1 {lib, stdenv, fetchurl, fetchpatch, xz, dpkg
2 , libxslt, docbook_xsl, makeWrapper, writeShellScript
4 , perlPackages, curl, gnupg, diffutils, nano, pkg-config, bash-completion, help2man
5 , sendmailPath ? "/run/wrappers/bin/sendmail"
9 inherit (python3Packages) python setuptools;
10 sensible-editor = writeShellScript "sensible-editor" ''
11 exec ''${EDITOR-${nano}/bin/nano} "$@"
13 in stdenv.mkDerivation rec {
15 pname = "debian-devscripts";
18 url = "mirror://debian/pool/main/d/devscripts/devscripts_${version}.tar.xz";
19 hash = "sha256-j0fUVTS/lPKFdgeMhksiJz2+E5koB07IK2uEj55EWG0=";
24 name = "hardening-check-obey-binutils-env-vars.patch";
25 url = "https://github.com/Debian/devscripts/pull/2/commits/c6a018e0ef50a1b0cb4962a2f96dae7c6f21f1d4.patch";
26 hash = "sha256-UpS239JiAM1IYxNuJLdILq2h0xlR5t0Tzhj47xiMHww=";
31 substituteInPlace scripts/Makefile --replace /usr/share/dpkg ${dpkg}/share/dpkg
32 substituteInPlace scripts/debrebuild.pl --replace /usr/bin/perl ${perlPackages.perl}/bin/perl
36 nativeBuildInputs = [ makeWrapper pkg-config ];
37 buildInputs = [ xz dpkg libxslt python setuptools curl gnupg diffutils bash-completion help2man ] ++
38 (with perlPackages; [ perl CryptSSLeay LWP TimeDate DBFile FileDesktopEntry ParseDebControl LWPProtocolHttps Moo FileHomeDir IPCRun FileDirList FileTouch ]);
41 export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}${dpkg}";
42 tgtpy="$out/${python.sitePackages}"
44 export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$tgtpy"
45 find lib po4a scripts -type f -exec sed -r \
46 -e "s@/usr/bin/gpg(2|)@${gnupg}/bin/gpg@g" \
47 -e "s@/usr/(s|)bin/sendmail@${sendmailPath}@g" \
48 -e "s@/usr/bin/diff@${diffutils}/bin/diff@g" \
49 -e "s@/usr/bin/gpgv(2|)@${gnupg}/bin/gpgv@g" \
50 -e "s@(command -v|/usr/bin/)curl@${curl.bin}/bin/curl@g" \
51 -e "s@sensible-editor@${sensible-editor}@g" \
52 -e "s@(^|\W)/bin/bash@\1${stdenv.shell}@g" \
54 sed -e "s@/usr/share/sgml/[^ ]*/manpages/docbook.xsl@${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl@" -i scripts/Makefile
56 -e "s@/usr( |$|/)@$out\\1@g" \
57 -e "s@/etc( |$|/)@$out/etc\\1@g" \
58 -e 's/ translated_manpages//; s/--install-layout=deb//; s@--root="[^ ]*"@--prefix="'"$out"'"@' \
59 -i Makefile* */Makefile*
65 "COMPL_DIR=/share/bash-completion/completions"
66 "PERLMOD_DIR=/share/devscripts"
70 sed -re 's@(^|[ !`"])/bin/bash@\1${stdenv.shell}@g' -i "$out/bin"/*
71 for i in "$out/bin"/*; do
73 --prefix PERL5LIB : "$PERL5LIB" \
74 --prefix PERL5LIB : "$out/share/devscripts" \
75 --prefix PYTHONPATH : "$out/${python.sitePackages}" \
76 --prefix PATH : "${dpkg}/bin"
78 ln -s cvs-debi $out/bin/cvs-debc
79 ln -s debchange $out/bin/dch
80 ln -s pts-subscribe $out/bin/pts-unsubscribe
84 description = "Debian package maintenance scripts";
85 license = licenses.free; # Mix of public domain, Artistic+GPL, GPL1+, GPL2+, GPL3+, and GPL2-only... TODO
86 maintainers = with maintainers; [raskin];
87 platforms = platforms.unix;