2008-11-25 00:20:51 +00:00
|
|
|
# This function compiles a source tarball in a virtual machine image
|
|
|
|
# that contains a Debian-like (i.e. dpkg-based) OS. Currently this is
|
|
|
|
# just for portability testing: it doesn't produce any Debian
|
|
|
|
# packages.
|
|
|
|
|
2008-11-25 02:20:41 +00:00
|
|
|
{vmTools, fetchurl}: args: with args;
|
2008-11-25 00:20:51 +00:00
|
|
|
|
|
|
|
vmTools.runInLinuxImage (stdenv.mkDerivation (
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "debian-build";
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2008-11-25 02:20:41 +00:00
|
|
|
prefix = "/usr";
|
2008-11-25 00:20:51 +00:00
|
|
|
|
2008-11-25 02:20:41 +00:00
|
|
|
phases = "installExtraDebsPhase sysInfoPhase unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase distPhase";
|
2008-11-25 00:20:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// args //
|
|
|
|
|
|
|
|
{
|
|
|
|
src = src.path;
|
|
|
|
|
|
|
|
# !!! cut&paste from rpm-build.nix
|
|
|
|
postHook = ''
|
|
|
|
ensureDir $out/nix-support
|
|
|
|
cat "$diskImage"/nix-support/full-name > $out/nix-support/full-name
|
|
|
|
|
|
|
|
# If `src' is the result of a call to `makeSourceTarball', then it
|
|
|
|
# has a subdirectory containing the actual tarball(s). If there are
|
|
|
|
# multiple tarballs, just pick the first one.
|
|
|
|
echo $src
|
|
|
|
if test -d $src/tarballs; then
|
|
|
|
src=$(ls $src/tarballs/*.tar.bz2 $src/tarballs/*.tar.gz | sort | head -1)
|
|
|
|
fi
|
|
|
|
''; # */
|
|
|
|
|
2008-11-25 02:20:41 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2008-11-25 00:20:51 +00:00
|
|
|
sysInfoPhase = ''
|
|
|
|
echo "System/kernel: $(uname -a)"
|
|
|
|
if test -e /etc/debian_version; then echo "Debian release: $(cat /etc/debian_version)"; fi
|
|
|
|
header "installed Debian packages"
|
|
|
|
dpkg-query --list
|
|
|
|
stopNest
|
|
|
|
'';
|
|
|
|
|
2008-11-25 02:20:41 +00:00
|
|
|
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
|
|
|
|
''; # */
|
|
|
|
|
2008-11-25 00:20:51 +00:00
|
|
|
meta = {
|
|
|
|
description = "Test build on ${args.diskImage.fullName} (${args.diskImage.name})";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
))
|