nixpkgs-suyu/pkgs/tools/misc/keychain/default.nix
Patrick Mahoney 02e46cacc6 keychain: fixup shebang, use upstream builder, install manpage
fixup shebang - build was not running fixupPhase, and shebang was pointing to
/bin/sh. On a system where /bin/sh links to dash, this results in errors:

    /nix/store/v40yk16fl1rhvr6zz91ij753ziyphwwp-keychain-2.8.0/bin/.keychain-wrapped: 59: /nix/store/v40yk16fl1rhvr6zz91ij753ziyphwwp-keychain-2.8.0/bin/.keychain-wrapped: shopt: not found
    /nix/store/v40yk16fl1rhvr6zz91ij753ziyphwwp-keychain-2.8.0/bin/.keychain-wrapped: 686: /nix/store/v40yk16fl1rhvr6zz91ij753ziyphwwp-keychain-2.8.0/bin/.keychain-wrapped: Syntax error: "(" unexpected (expecting ")")

use upstream builder - the include Makefile uses perl to generate a manpage and
insert the same text into the keychain script for '--help' output, which was
otherwise missing:

    $ keychain --help

     * keychain 2.8.0 ~ http://www.funtoo.org

    [snip]

    INSERT_POD_OUTPUT_HERE

install manpage - self explanatory
2015-05-18 15:26:06 -05:00

37 lines
1.1 KiB
Nix

{ stdenv, fetchFromGitHub, makeWrapper, coreutils, openssh, gnupg
, perl, procps, gnugrep, gawk, findutils, gnused }:
stdenv.mkDerivation rec {
name = "keychain-${version}";
version = "2.8.0";
src = fetchFromGitHub {
owner = "funtoo";
repo = "keychain";
rev = "1c8eaba53a7788d12d086b66ac3929810510f73a";
sha256 = "0ajas58cv8mp5wb6hn1zhsqiwfxvx69p4f91a5j2as299rxgrxlp";
};
buildInputs = [ makeWrapper perl ];
installPhase = ''
mkdir -p $out/{bin,share/man/man1}
cp keychain $out/bin/keychain
cp keychain.1 $out/share/man/man1
wrapProgram $out/bin/keychain \
--prefix PATH ":" "${coreutils}/bin" \
--prefix PATH ":" "${openssh}/bin" \
--prefix PATH ":" "${gnupg}/bin" \
--prefix PATH ":" "${gnugrep}/bin" \
--prefix PATH ":" "${gnused}/bin" \
--prefix PATH ":" "${findutils}/bin" \
--prefix PATH ":" "${gawk}/bin" \
--prefix PATH ":" "${procps}/bin"
'';
meta = {
description = "Keychain management tool";
homepage = "http://www.funtoo.org/Keychain";
license = stdenv.lib.licenses.gpl2;
};
}