diff --git a/pkgs/build-support/release/debian-build.nix b/pkgs/build-support/release/debian-build.nix index 96efd1913cc6..3bae38e1d06d 100644 --- a/pkgs/build-support/release/debian-build.nix +++ b/pkgs/build-support/release/debian-build.nix @@ -3,7 +3,7 @@ # just for portability testing: it doesn't produce any Debian # packages. -vmTools: args: with args; +{vmTools, fetchurl}: args: with args; vmTools.runInLinuxImage (stdenv.mkDerivation ( @@ -12,10 +12,9 @@ vmTools.runInLinuxImage (stdenv.mkDerivation ( doCheck = true; - # Don't install the result in the Nix store. - useTempPrefix = true; + prefix = "/usr"; - phases = "sysInfoPhase unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase distPhase"; + phases = "installExtraDebsPhase sysInfoPhase unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase distPhase"; } // args // @@ -37,6 +36,19 @@ vmTools.runInLinuxImage (stdenv.mkDerivation ( fi ''; # */ + extraDebs = [ + (fetchurl { + url = http://checkinstall.izto.org/files/deb/checkinstall_1.6.1-1_i386.deb; + sha256 = "0c9wwk1m0w677gr37zd4lhvkskkcrwa0bk7csh7b3qy94pnab618"; + }) + ]; + + installExtraDebsPhase = '' + for i in $extraDebs; do + dpkg --install $i + done + ''; + sysInfoPhase = '' echo "System/kernel: $(uname -a)" if test -e /etc/debian_version; then echo "Debian release: $(cat /etc/debian_version)"; fi @@ -45,6 +57,21 @@ vmTools.runInLinuxImage (stdenv.mkDerivation ( stopNest ''; + installCommand = '' + /usr/local/sbin/checkinstall -y -D make install + + ensureDir $out/debs + find . -name "*.deb" -exec cp {} $out/debs \; + + shopt -s nullglob + for i in $out/debs/*.deb; do + header "Generated DEB package: $i" + dpkg-deb --info $i + echo "file deb $i" >> $out/nix-support/hydra-build-products + stopNest + done + ''; # */ + meta = { description = "Test build on ${args.diskImage.fullName} (${args.diskImage.name})"; }; diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix index dd46164d9f29..f90c56fbc8e5 100644 --- a/pkgs/build-support/release/default.nix +++ b/pkgs/build-support/release/default.nix @@ -19,7 +19,7 @@ rec { rpmBuild = args: import ./rpm-build.nix vmTools args; - debBuild = args: import ./debian-build.nix vmTools ( + debBuild = args: import ./debian-build.nix {inherit vmTools fetchurl;} ( { inherit stdenv; } // args); diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 427e7dc58ff1..756aa14c0955 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -863,6 +863,10 @@ rec { "patch" "diff" "locales" + # Needed by checkinstall: + "util-linux" + "file" + "dpkg-dev" ]; diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix new file mode 100644 index 000000000000..80f774e8e5d9 --- /dev/null +++ b/pkgs/tools/package-management/checkinstall/default.nix @@ -0,0 +1,24 @@ +{stdenv, fetchurl, gettext}: + +stdenv.mkDerivation { + name = "checkinstall-1.6.1"; + + src = fetchurl { + url = http://checkinstall.izto.org/files/source/checkinstall-1.6.1.tgz; + sha256 = "0p6gbbnk4hjwkmv8dr7c4v5wpdnanczavi7yiiivvf45zyfl8lil"; + }; + + buildInputs = [gettext]; + + preBuild = '' + makeFlagsArray=(PREFIX=$out) + + substituteInPlace checkinstall --replace /usr/local/lib/checkinstall $out/lib/checkinstall + substituteInPlace checkinstallrc-dist --replace /usr/local $out + ''; + + meta = { + homepage = http://checkinstall.izto.org/; + description = "A tool for automatically generating Slackware, RPM or Debian packages when doing `make install'"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 50819014d099..e8394aea3413 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -572,6 +572,10 @@ let inherit fetchurl stdenv cmake libcap zlib bzip2; }; + checkinstall = import ../tools/package-management/checkinstall { + inherit fetchurl stdenv gettext; + }; + cheetahTemplate = builderDefsPackage (selectVersion ../tools/text/cheetah-template "2.0.1") { inherit makeWrapper python; };