autojump: rework

- fetchurl -> fetchFromGitHub
- Update URLs: joelthelion -> wting
- mkdir + cp -> install
- Use -z flag to set zshshare_dir
- Add me as a maintainer
- Use recursive version instead of let
- meta: with stdenv.lib; ...
This commit is contained in:
Eric Bailey 2018-05-18 09:11:12 -05:00
parent 364f922cbf
commit 47aceb0a7b
No known key found for this signature in database
GPG Key ID: 55BF5D49549F04AD

View File

@ -1,40 +1,29 @@
{ fetchurl, stdenv, python, bash }:
{ stdenv, fetchFromGitHub, python, bash }:
let
version = "22.5.1";
in
stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "autojump-${version}";
version = "22.5.1";
src = fetchurl {
url = "http://github.com/joelthelion/autojump/archive/release-v${version}.tar.gz";
name = "autojump-${version}.tar.gz";
sha256 = "17z9j9936x0nizwrzf664bngh60x5qbvrrf1s5qdzd0f2gdanpvn";
src = fetchFromGitHub {
owner = "wting";
repo = "autojump";
rev = "release-v${version}";
sha256 = "1l1278g3k1qfrz41pkpjdhsabassb9si2d1bfbcmvbv5h3wmlqk9";
};
buildInputs = [ python bash ];
dontBuild = true;
installPhase = ''
python ./install.py -d $out -p ""
chmod +x $out/etc/profile.d/*
python ./install.py -d "$out" -p "" -z "$out/share/zsh/site-functions/"
mkdir -p "$out/etc/bash_completion.d"
cp -v $out/share/autojump/autojump.bash "$out/etc/bash_completion.d"
mkdir -p $out/share/fish/vendor_completions.d/
cp -v $out/share/autojump/autojump.fish "$out/share/fish/vendor_completions.d/autojump.fish"
cat <<SCRIPT > $out/bin/autojump-share
#!/bin/sh
# Run this script to find the autojump shared folder where all the shell
# integration scripts are living.
echo $out/share/autojump
SCRIPT
chmod +x $out/bin/autojump-share
chmod +x "$out/etc/profile.d/autojump.sh"
install -Dt "$out/share/bash-completion/completions/" -m444 "$out/share/autojump/autojump.bash"
install -Dt "$out/share/fish/vendor_conf.d/" -m444 "$out/share/autojump/autojump.fish"
install -Dt "$out/share/zsh/site-functions/" -m444 "$out/share/autojump/autojump.zsh"
'';
meta = {
meta = with stdenv.lib; {
description = "A `cd' command that learns";
longDescription = ''
One of the most used shell commands is cd. A quick survey
@ -56,9 +45,9 @@ in
Autojump supports tab-completion.
'';
homepage = http://wiki.github.com/joelthelion/autojump;
license = stdenv.lib.licenses.gpl3;
platforms = stdenv.lib.platforms.all;
maintainers = [ stdenv.lib.maintainers.domenkozar ];
homepage = http://wiki.github.com/wting/autojump;
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ domenkozar yurrriq ];
};
}
}