diff --git a/pkgs/build-support/release/debian-build.nix b/pkgs/build-support/release/debian-build.nix index fad216fb1c24..fad88a98f177 100644 --- a/pkgs/build-support/release/debian-build.nix +++ b/pkgs/build-support/release/debian-build.nix @@ -34,13 +34,6 @@ 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 @@ -56,7 +49,9 @@ vmTools.runInLinuxImage (stdenv.mkDerivation ( ''; installCommand = '' - /usr/local/sbin/checkinstall -y -D make install + export LOGNAME=root + + ${checkinstall}/sbin/checkinstall -y -D make install ensureDir $out/debs find . -name "*.deb" -exec cp {} $out/debs \; diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix index e3ea97876f46..58368bddf6be 100644 --- a/pkgs/build-support/release/default.nix +++ b/pkgs/build-support/release/default.nix @@ -21,7 +21,7 @@ rec { rpmBuild = args: import ./rpm-build.nix vmTools args; debBuild = args: import ./debian-build.nix {inherit vmTools fetchurl;} ( - { inherit stdenv; + { inherit stdenv checkinstall; } // args); } diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix index 80f774e8e5d9..f7a8321fe317 100644 --- a/pkgs/tools/package-management/checkinstall/default.nix +++ b/pkgs/tools/package-management/checkinstall/default.nix @@ -17,6 +17,22 @@ stdenv.mkDerivation { substituteInPlace checkinstallrc-dist --replace /usr/local $out ''; + postInstall = + if stdenv.isLinux then + # Clear the RPATH, otherwise installwatch.so won't work properly + # as an LD_PRELOADed library on applications that load against a + # different Glibc. + '' + patchelf --set-rpath "" $out/lib/installwatch.so + '' + else ""; + + patches = [ + # Necessary for building on x86_64, see + # http://checkinstall.izto.org/cklist/msg00256.html + ./readlink.patch + ]; + 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/tools/package-management/checkinstall/readlink.patch b/pkgs/tools/package-management/checkinstall/readlink.patch new file mode 100644 index 000000000000..f276c057d8f9 --- /dev/null +++ b/pkgs/tools/package-management/checkinstall/readlink.patch @@ -0,0 +1,40 @@ +--- a/installwatch-0.7.0beta5/installwatch.c 2007-04-07 14:27:23.000000000 -0400 ++++ b/installwatch-0.7.0beta5/installwatch.c 2007-04-07 14:25:06.000000000 -0400 +@@ -84,7 +84,7 @@ + static int (*true_open)(const char *, int, ...); + static DIR *(*true_opendir)(const char *); + static struct dirent *(*true_readdir)(DIR *dir); +-static int (*true_readlink)(const char*,char *,size_t); ++static ssize_t (*true_readlink)(const char*,char *,size_t); + static char *(*true_realpath)(const char *,char *); + static int (*true_rename)(const char *, const char *); + static int (*true_rmdir)(const char *); +@@ -546,7 +546,7 @@ + struct utimbuf timbuf; + size_t truesz; + char linkpath[PATH_MAX+1]; +- size_t linksz; ++ ssize_t linksz; + + #if DEBUG + debug(2,"copy_path(%s,%s)\n",truepath,translroot); +@@ -1582,7 +1582,7 @@ + struct stat reslvinfo; + instw_t iw; + char wpath[PATH_MAX+1]; +- size_t wsz=0; ++ ssize_t wsz=0; + char linkpath[PATH_MAX+1]; + + +@@ -2698,8 +2698,8 @@ + return result; + } + +-int readlink(const char *path,char *buf,size_t bufsiz) { +- int result; ++ssize_t readlink(const char *path,char *buf,size_t bufsiz) { ++ ssize_t result; + instw_t instw; + int status; +