networkmanager: fix cross

copy devdoc and man from native to cross
doc does not have to be copied
This commit is contained in:
Artturin 2022-07-07 21:32:13 +03:00
parent 28ca82a86b
commit bf15263d1c

View File

@ -34,6 +34,7 @@
, iputils , iputils
, kmod , kmod
, jansson , jansson
, elfutils
, gtk-doc , gtk-doc
, libxslt , libxslt
, docbook_xsl , docbook_xsl
@ -43,14 +44,16 @@
, openconnect , openconnect
, curl , curl
, meson , meson
, mesonEmulatorHook
, ninja , ninja
, libpsl , libpsl
, mobile-broadband-provider-info , mobile-broadband-provider-info
, runtimeShell , runtimeShell
, buildPackages
}: }:
let let
pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]); pythonForDocs = python3.pythonForBuild.withPackages (pkgs: with pkgs; [ pygobject3 ]);
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "networkmanager"; pname = "networkmanager";
@ -102,7 +105,9 @@ stdenv.mkDerivation rec {
"-Ddhcpcanon=no" "-Ddhcpcanon=no"
# Miscellaneous # Miscellaneous
"-Ddocs=true" # almost cross-compiles, however fails with
# ** (process:9234): WARNING **: Failed to load shared library '/nix/store/...-networkmanager-aarch64-unknown-linux-gnu-1.38.2/lib/libnm.so.0' referenced by the typelib: /nix/store/...-networkmanager-aarch64-unknown-linux-gnu-1.38.2/lib/libnm.so.0: cannot open shared object file: No such file or directory
"-Ddocs=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
# We don't use firewalld in NixOS # We don't use firewalld in NixOS
"-Dfirewalld_zone=false" "-Dfirewalld_zone=false"
"-Dtests=no" "-Dtests=no"
@ -150,12 +155,12 @@ stdenv.mkDerivation rec {
mobile-broadband-provider-info mobile-broadband-provider-info
bluez5 bluez5
dnsmasq dnsmasq
gobject-introspection
modemmanager modemmanager
readline readline
newt newt
libsoup libsoup
jansson jansson
dbus # used to get directory paths with pkg-config during configuration
]; ];
propagatedBuildInputs = [ gnutls libgcrypt ]; propagatedBuildInputs = [ gnutls libgcrypt ];
@ -167,7 +172,7 @@ stdenv.mkDerivation rec {
pkg-config pkg-config
vala vala
gobject-introspection gobject-introspection
dbus elfutils # used to find jansson soname
# Docs # Docs
gtk-doc gtk-doc
libxslt libxslt
@ -176,6 +181,8 @@ stdenv.mkDerivation rec {
docbook_xml_dtd_42 docbook_xml_dtd_42
docbook_xml_dtd_43 docbook_xml_dtd_43
pythonForDocs pythonForDocs
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
]; ];
doCheck = false; # requires /sys, the net doCheck = false; # requires /sys, the net
@ -183,6 +190,10 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
patchShebangs ./tools patchShebangs ./tools
patchShebangs libnm/generate-setting-docs.py patchShebangs libnm/generate-setting-docs.py
# TODO: submit upstream
substituteInPlace meson.build \
--replace "'vala', req" "'vala', native: false, req"
''; '';
preBuild = '' preBuild = ''
@ -194,6 +205,11 @@ stdenv.mkDerivation rec {
ln -s $PWD/src/libnm-client-impl/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0 ln -s $PWD/src/libnm-client-impl/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0
''; '';
postFixup = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
cp -r ${buildPackages.networkmanager.devdoc} $devdoc
cp -r ${buildPackages.networkmanager.man} $man
'';
passthru = { passthru = {
updateScript = gnome.updateScript { updateScript = gnome.updateScript {
packageName = "NetworkManager"; packageName = "NetworkManager";