Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt, dpkg: fix cross build #372955

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions pkgs/by-name/ap/apt/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
[
Expand All @@ -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")
Expand Down
6 changes: 5 additions & 1 deletion pkgs/by-name/dp/dpkg/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down