From 1d1cebde0fc0cdf57e8032cb39762d8c69567c71 Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Wed, 8 Jan 2025 12:32:19 +0100 Subject: [PATCH 1/2] dpkg: fix cross build --- pkgs/by-name/dp/dpkg/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/dp/dpkg/package.nix b/pkgs/by-name/dp/dpkg/package.nix index dc12b465987b0..0516effef9557 100644 --- a/pkgs/by-name/dp/dpkg/package.nix +++ b/pkgs/by-name/dp/dpkg/package.nix @@ -49,10 +49,14 @@ stdenv.mkDerivation rec { for i in $(find . -name Makefile.in); do substituteInPlace $i --replace "install-data-local:" "disabled:" ; done + + # Skip check broken when cross-compiling. + substituteInPlace configure \ + --replace-fail 'as_fn_error $? "cannot find a GNU tar program"' "#" ''; postPatch = '' - patchShebangs . + patchShebangs --host . # Dpkg commands sometimes calls out to shell commands substituteInPlace lib/dpkg/dpkg.h \ From e289913bf53d3012d79cca3cbb300944dc65d61b Mon Sep 17 00:00:00 2001 From: FliegendeWurst Date: Wed, 8 Jan 2025 12:32:19 +0100 Subject: [PATCH 2/2] apt: fix cross build --- pkgs/by-name/ap/apt/package.nix | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/ap/apt/package.nix b/pkgs/by-name/ap/apt/package.nix index 2e0e68c13ea75..e28dde96197e4 100644 --- a/pkgs/by-name/ap/apt/package.nix +++ b/pkgs/by-name/ap/apt/package.nix @@ -49,13 +49,23 @@ stdenv.mkDerivation (finalAttrs: { "man" ]; - nativeBuildInputs = [ - cmake - gtest - (lib.getBin libxslt) - pkg-config - triehash - ]; + nativeBuildInputs = + [ + cmake + dpkg # dpkg-architecture + gettext # msgfmt + gtest + (lib.getBin libxslt) + pkg-config + triehash + perlPackages.perl + ] + ++ lib.optionals withDocs [ + docbook_xml_dtd_45 + doxygen + perlPackages.Po4a + w3m + ]; buildInputs = [ @@ -64,30 +74,25 @@ stdenv.mkDerivation (finalAttrs: { db dpkg gnutls + gtest libgcrypt libgpg-error libseccomp libtasn1 lz4 p11-kit - perlPackages.perl udev xxHash xz zstd ] - ++ lib.optionals withDocs [ - docbook_xml_dtd_45 - doxygen - perlPackages.Po4a - w3m - ] ++ lib.optionals withNLS [ gettext ]; cmakeFlags = [ (lib.cmakeOptionType "filepath" "BERKELEY_INCLUDE_DIRS" "${lib.getDev db}/include") + (lib.cmakeOptionType "filepath" "DPKG_DATADIR" "${dpkg}/share/dpkg") (lib.cmakeOptionType "filepath" "DOCBOOK_XSL" "${docbook_xsl}/share/xml/docbook-xsl") (lib.cmakeOptionType "filepath" "GNUTLS_INCLUDE_DIR" "${lib.getDev gnutls}/include") (lib.cmakeFeature "DROOT_GROUP" "root")