From 749cc2bf1e1a25d4b53d1f50450da130a4bfaee5 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 7 Oct 2012 18:02:46 +0400 Subject: [PATCH] Adding Debian devscripts. Mostly for uscan. I plan to later use uscan for simplifying package updates in some NixPkgs packages. I have no code for that now. I added Perl packages File::DesktopEntry and File::BaseDir in a slightly hascky way because one part of the installation system replaced PREFIX= with --prefix= and the other complained that it doesn't know what to do with --prefix=. I checked that a script using File::DesktopEntry works, and I don't know enough Perl to rewrite buildPerlPackage and hope that my change is an improvement. I removed trnaslated manpages because it uses po4a which has some more Debian-specific dependencies of its own. --- pkgs/tools/misc/debian-devscripts/default.nix | 34 +++++++++++++++++++ .../tools/package-management/dpkg/default.nix | 17 +++++----- pkgs/top-level/all-packages.nix | 4 +++ pkgs/top-level/perl-packages.nix | 27 +++++++++++++++ 4 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 pkgs/tools/misc/debian-devscripts/default.nix diff --git a/pkgs/tools/misc/debian-devscripts/default.nix b/pkgs/tools/misc/debian-devscripts/default.nix new file mode 100644 index 000000000000..693cf7c78bfe --- /dev/null +++ b/pkgs/tools/misc/debian-devscripts/default.nix @@ -0,0 +1,34 @@ +{stdenv, fetchurl, perl, CryptSSLeay, LWP, unzip, xz, dpkg, TimeDate, DBFile + , FileDesktopEntry, libxslt, docbook_xsl, python, setuptools, makeWrapper +}: +stdenv.mkDerivation rec { + version = "2.12.4"; + name = "debian-devscripts-${version}"; + src = fetchurl { + url = "mirror://debian/pool/main/d/devscripts/devscripts_${version}.tar.gz"; + sha256 = "34bcbec78bd4fe34d9f1326b9d1477ff2410e20e2dca6b7bfbf2bf92dbb83904"; + }; + buildInputs = [ perl CryptSSLeay LWP unzip xz dpkg TimeDate DBFile + FileDesktopEntry libxslt python setuptools makeWrapper ]; + preConfigure = '' + export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}${dpkg}"; + sed -e "s@/usr/share/sgml/[^ ]*/manpages/docbook.xsl@${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl@" -i scripts/Makefile + sed -e 's/ translated_manpages//; s/--install-layout=deb//; s@--root="[^ ]*"@--prefix="'"$out"'"@' -i Makefile */Makefile + tgtpy="$out/lib/${python.libPrefix}/site-packages" + mkdir -p "$tgtpy" + export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$tgtpy" + sed -re "s@/usr( |$|/)@$out\\1@" -i Makefile* */Makefile* + sed -re "s@/etc( |$|/)@$out/etc\\1@" -i Makefile* */Makefile* + ''; + postInstall = '' + for i in "$out/bin"/*; do + wrapProgram "$i" \ + --prefix PERL5LIB : "$PERL5LIB" \ + --prefix PERL5LIB : "$out/share/devscripts" + done + ''; + meta = { + description = ''Debian package maintenance scripts''; + license = "GPL (variuous)"; # Mix of public domain, Artistic+GPL, GPL1+, GPL2+, GPL3+, and GPL2-only... + }; +} diff --git a/pkgs/tools/package-management/dpkg/default.nix b/pkgs/tools/package-management/dpkg/default.nix index 2ffacb084793..95682df5d39c 100644 --- a/pkgs/tools/package-management/dpkg/default.nix +++ b/pkgs/tools/package-management/dpkg/default.nix @@ -1,16 +1,16 @@ -{stdenv, fetchurl, perl, zlib, bzip2}: +{stdenv, fetchurl, perl, zlib, bzip2, xz}: -let version = "1.14.29"; in +let version = "1.16.8"; in stdenv.mkDerivation { name = "dpkg-${version}"; src = fetchurl { - url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.gz"; - sha256 = "0cynms4vziy957r4zskybbid87sz99vrfy8d999vlhxgc74c2zpa"; + url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.xz"; + sha256 = "4a1f4611390d93f1f198d910d3a4e4913b3cf81702b31f585a1872ca98df0eaa"; }; - configureFlags = "--without-dselect --with-admindir=/var/lib/dpkg"; + configureFlags = "--disable-dselect --with-admindir=/var/lib/dpkg "; preConfigure = '' # Can't use substitute pending resolution of NIXPKGS-89. @@ -24,11 +24,12 @@ stdenv.mkDerivation { chmod +x $TMPDIR/dpkg PATH=$TMPDIR:$PATH - substituteInPlace src/Makefile.in --replace "install-data-local:" "disabled:" - substituteInPlace dpkg-split/Makefile.in --replace "install-data-local:" "disabled:" + for i in $(find . -name Makefile.in); do + substituteInPlace $i --replace "install-data-local:" "disabled:" ; + done ''; - buildInputs = [ perl zlib bzip2 ]; + buildInputs = [ perl zlib bzip2 xz ]; meta = { description = "The Debian package manager"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 57078ac3750c..32fb0cb46753 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -587,6 +587,10 @@ let dcraw = callPackage ../tools/graphics/dcraw { }; + debian_devscripts = callPackage ../tools/misc/debian-devscripts { + inherit (perlPackages) CryptSSLeay LWP TimeDate DBFile FileDesktopEntry; + }; + debootstrap = callPackage ../tools/misc/debootstrap { }; detox = callPackage ../tools/misc/detox { }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index eeba996990dc..0e1f11d0b8ae 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -1578,6 +1578,19 @@ rec { }; }; + FileBaseDir = buildPerlPackage rec { + version = "0.03"; + name = "File-BaseDir-${version}"; + configurePhase = '' + preConfigure || true + perl Build.PL PREFIX="$out" prefix="$out" + ''; + src = fetchurl { + url = "mirror://cpan/modules/by-module/File/${name}.tar.gz"; + sha256 = "0029cba7a3b5d8aa5f7d03cb1b7ba2bcf2829382f7f26aa3bee06fce8611a886"; + }; + }; + FileCopyRecursive = buildPerlPackage rec { name = "File-Copy-Recursive-0.38"; src = fetchurl { @@ -1586,6 +1599,20 @@ rec { }; }; + FileDesktopEntry = buildPerlPackage rec { + version = "0.04"; + name = "File-DesktopEntry-${version}"; + configurePhase = '' + preConfigure || true + perl Build.PL PREFIX="$out" prefix="$out" + ''; + src = fetchurl { + url = "mirror://cpan/modules/by-module/File/${name}.tar.gz"; + sha256 = "d7f80d8bd303651a43dc1810c73740d38a0d2b158fb33cd3b6ca4d3a566da7cb"; + }; + propagatedBuildInputs = [ FileBaseDir ]; + }; + FileFindRule = buildPerlPackage rec { name = "File-Find-Rule-0.32"; src = fetchurl {