at 22.05-pre 2.4 kB view raw
1{lib, stdenv, fetchurl, xz, dpkg 2, libxslt, docbook_xsl, makeWrapper 3, python3Packages 4, perlPackages, curl, gnupg, diffutils 5, sendmailPath ? "/run/wrappers/bin/sendmail" 6}: 7 8let 9 inherit (python3Packages) python setuptools; 10in stdenv.mkDerivation rec { 11 version = "2.16.8"; 12 pname = "debian-devscripts"; 13 14 src = fetchurl { 15 url = "mirror://debian/pool/main/d/devscripts/devscripts_${version}.tar.xz"; 16 sha256 = "0xy1nvqrnifx46g8ch69pk31by0va6hn10wpi1fkrsrgncanjjh1"; 17 }; 18 19 nativeBuildInputs = [ makeWrapper ]; 20 buildInputs = [ xz dpkg libxslt python setuptools curl gnupg diffutils ] ++ 21 (with perlPackages; [ perl CryptSSLeay LWP TimeDate DBFile FileDesktopEntry ParseDebControl LWPProtocolHttps ]); 22 23 preConfigure = '' 24 export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}${dpkg}"; 25 tgtpy="$out/lib/${python.libPrefix}/site-packages" 26 mkdir -p "$tgtpy" 27 export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$tgtpy" 28 find po4a scripts -type f -exec sed -r \ 29 -e "s@/usr/bin/gpg(2|)@${gnupg}/bin/gpg@g" \ 30 -e "s@/usr/(s|)bin/sendmail@${sendmailPath}@g" \ 31 -e "s@/usr/bin/diff@${diffutils}/bin/diff@g" \ 32 -e "s@/usr/bin/gpgv(2|)@${gnupg}/bin/gpgv@g" \ 33 -e "s@(command -v|/usr/bin/)curl@${curl.bin}/bin/curl@g" \ 34 -i {} + 35 sed -e "s@/usr/share/sgml/[^ ]*/manpages/docbook.xsl@${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl@" -i scripts/Makefile 36 sed -r \ 37 -e "s@/usr( |$|/)@$out\\1@g" \ 38 -e "s@/etc( |$|/)@$out/etc\\1@g" \ 39 -e 's/ translated_manpages//; s/--install-layout=deb//; s@--root="[^ ]*"@--prefix="'"$out"'"@' \ 40 -i Makefile* */Makefile* 41 ''; 42 43 makeFlags = [ 44 "DESTDIR=$(out)" 45 "PREFIX=" 46 "COMPL_DIR=/share/bash-completion/completions" 47 "PERLMOD_DIR=/share/devscripts" 48 ]; 49 50 postInstall = '' 51 sed -re 's@(^|[ !`"])/bin/bash@\1${stdenv.shell}@g' -i "$out/bin"/* 52 for i in "$out/bin"/*; do 53 wrapProgram "$i" \ 54 --prefix PERL5LIB : "$PERL5LIB" \ 55 --prefix PERL5LIB : "$out/share/devscripts" \ 56 --prefix PYTHONPATH : "$out/lib/python3.4/site-packages" \ 57 --prefix PATH : "${dpkg}/bin" 58 done 59 ''; 60 61 meta = with lib; { 62 description = "Debian package maintenance scripts"; 63 license = licenses.free; # Mix of public domain, Artistic+GPL, GPL1+, GPL2+, GPL3+, and GPL2-only... TODO 64 maintainers = with maintainers; [raskin]; 65 platforms = with platforms; linux; 66 }; 67}