1 # This function compiles a source tarball in a virtual machine image
2 # that contains a Debian-like (i.e. dpkg-based) OS.
12 fsTranslation ? false,
13 # Features provided by this package.
15 # Features required by this package.
20 vmTools.runInLinuxImage (
29 "installExtraDebsPhase"
41 name = name + "-" + diskImage.name + (lib.optionalString (src ? version) "-${src.version}");
43 # !!! cut&paste from rpm-build.nix
47 src=$(findTarball $src)
50 installExtraDebsPhase = ''
51 for i in $extraDebs; do
52 dpkg --install $(ls $i/debs/*.deb | sort | head -1)
57 [ ! -f /etc/lsb-release ] || (source /etc/lsb-release; echo "OS release: $DISTRIB_DESCRIPTION")
58 echo "System/kernel: $(uname -a)"
59 if test -e /etc/debian_version; then echo "Debian release: $(cat /etc/debian_version)"; fi
60 echo "installed Debian packages"
68 # otherwise build hangs when it wants to display
71 ${checkinstall}/sbin/checkinstall --nodoc -y -D \
72 --fstrans=${if fsTranslation then "yes" else "no"} \
73 --requires="${lib.concatStringsSep "," debRequires}" \
74 --provides="${lib.concatStringsSep "," debProvides}" \
76 if (src ? version) then "--pkgversion=$(echo ${src.version} | tr _ -)" else "--pkgversion=0.0.0"
78 ''${debMaintainer:+--maintainer="'$debMaintainer'"} \
79 ''${debName:+--pkgname="'$debName'"} \
82 $SHELL -c "''${installCommand:-make install}"
85 find . -name "*.deb" -exec cp {} $out/debs \;
87 [ "$(echo $out/debs/*.deb)" != "" ]
89 for i in $out/debs/*.deb; do
90 echo "Generated DEB package: $i"
92 pkgName=$(dpkg-deb -W "$i" | awk '{print $1}')
93 echo "file deb $i" >> $out/nix-support/hydra-build-products
95 dpkg -i $out/debs/*.deb
97 for i in $extraDebs; do
98 echo "file deb-extra $(ls $i/debs/*.deb | sort | head -1)" >> $out/nix-support/hydra-build-products
104 meta = (lib.optionalAttrs (args ? meta) args.meta) // {
105 description = "Deb package for ${diskImage.fullName}";