···
glibc ? !stdenv.hostPlatform.isDarwin,
+
stdenv.mkDerivation (finalAttrs: {
url = "https://git.launchpad.net/ubuntu/+source/dpkg";
+
tag = "applied/${finalAttrs.version}";
+
# Fix filename conflict on case-insensitive filesystems
+
git checkout HEAD -- scripts/t/Dpkg_BuildTree.t
+
mv scripts/t/Dpkg_BuildTree.t scripts/t/Dpkg_BuildTreeC.t
+
substituteInPlace scripts/Makefile.am --replace-fail t/Dpkg_BuildTree.t t/Dpkg_BuildTreeC.t
+
substituteInPlace scripts/Makefile.in --replace-fail t/Dpkg_BuildTree.t t/Dpkg_BuildTreeC.t
+
git checkout HEAD -- scripts/t/dpkg_buildtree.t
+
hash = "sha256-LK6nOPewjRyKyHdwJgmLILoZ6sEfJzRtC7pIeWz01lA=";
···
for i in $(find . -name Makefile.in); do
+
substituteInPlace $i --replace-quiet "install-data-local:" "disabled:" ;
# Skip check broken when cross-compiling.
···
# Dpkg commands sometimes calls out to shell commands
substituteInPlace lib/dpkg/dpkg.h \
+
--replace-fail '"dpkg-deb"' \"$out/bin/dpkg-deb\" \
+
--replace-fail '"dpkg-split"' \"$out/bin/dpkg-split\" \
+
--replace-fail '"dpkg-query"' \"$out/bin/dpkg-query\" \
+
--replace-fail '"dpkg-divert"' \"$out/bin/dpkg-divert\" \
+
--replace-fail '"dpkg-statoverride"' \"$out/bin/dpkg-statoverride\" \
+
--replace-fail '"dpkg-trigger"' \"$out/bin/dpkg-trigger\" \
+
--replace-fail '"dpkg"' \"$out/bin/dpkg\" \
+
--replace-fail '"debsig-verify"' \"$out/bin/debsig-verify\" \
+
--replace-fail '"rm"' \"${coreutils}/bin/rm\" \
+
--replace-fail '"cat"' \"${coreutils}/bin/cat\" \
+
--replace-fail '"diff"' \"${diffutils}/bin/diff\"
+
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
+
# realpath("/var/lib/dpkg", NULL) gives EPERM on sandboxed darwin instead of the expected ENOENT,
+
# which makes some tests fail.
+
sed -i '/opts normalize/a AT_SKIP_IF([true])' src/at/chdir.at
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace src/main/help.c \
+
--replace-fail '"ldconfig"' \"${glibc.bin}/bin/ldconfig\"
···
if head -n 1 $i | grep -q perl; then
+
substituteInPlace $i --replace-fail \
"${perl}/bin/perl" "${perl}/bin/perl -I $out/${perl.libPrefix}"
···
cp -r scripts/t/origins $out/etc/dpkg
+
nativeInstallCheckInputs = [ versionCheckHook ];
+
versionCheckProgramArg = "--version";
setupHook = ./setup-hook.sh;
···
homepage = "https://wiki.debian.org/Teams/Dpkg";
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ siriobalmelli ];