From 86293377d7f190bf241ad5c18496a00998e47309 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 10 Feb 2023 00:46:04 +0000 Subject: [PATCH] cross packages: cross compile more stuff --- hosts/common/cross.nix | 265 ++++++++++++++++++++++++++++++++--------- 1 file changed, 208 insertions(+), 57 deletions(-) diff --git a/hosts/common/cross.nix b/hosts/common/cross.nix index d6c1f4f1..18c3fe8b 100644 --- a/hosts/common/cross.nix +++ b/hosts/common/cross.nix @@ -65,7 +65,7 @@ in # the configuration of which specific package set `pkgs.cross` refers to happens elsewhere; # here we just define them all. nixpkgs.overlays = [ - (next: prev: rec { + (next: prev: { # non-emulated packages build *from* local *for* target. # for large packages like the linux kernel which are expensive to build under emulation, # the config can explicitly pull such packages from `pkgs.cross` to do more efficient cross-compilation. @@ -81,81 +81,68 @@ in # packages which don't cross compile inherit (emulated) # adwaita-qt # psqlodbc - apacheHttpd # TODO: not properly patched (we only need mod_dnssd?) + apacheHttpd_2_4 # `configure: error: Size of "void *" is less than size of "long"` appstream # meson.build:139:0: ERROR: Program 'gperf' not found or not executable cantarell-fonts # python3.10-skia-pathops colord # (meson) ERROR: An exe_wrapper is needed but was not found. Please define one in cross file and check the command and/or add it to PATH. + dante # "configure: error: error: getaddrinfo() error value count too low" # duplicity # python3.10-s3transfer - evince # "Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)" + emacs # "configure: error: cannot run test program while cross compiling" flatpak # No package 'libxml-2.0' found fwupd-efi # efi/meson.build:162:0: ERROR: Program or command 'gcc' not found or not executable fwupd # "Run-time dependency libgcab-1.0 found: NO (tried pkgconfig and cmake)" gcr_4 # meson ERROR: Program 'gpg2 gpg' not found or not executable + gmime3 # "checking preferred charset formats for system iconv... cannot run test program while cross compiling" # gnome-keyring # gnome-remote-desktop # gnome-tour gnustep # gnustep.base: "configure: error: Your compiler does not appear to implement the -fconstant-string-class option needed for support of strings." gocryptfs # gocryptfs-2.3-go-modules # grpc - gst_all_1 # gst_all_1.gst-editing-services + gst_all_1 # (gst_all_1.gst-editing-services) `Run-time dependency gst-validate-1.0 found: NO (tried pkgconfig and cmake)` # gupnp_1_6 # subprojects/gi-docgen/meson.build:10:0: ERROR: python3 not found gvfs # meson.build:312:2: ERROR: Assert failed: http required but libxml-2.0 not found # flatpak hdf5 # configure: error: cannot run test program while cross compiling # http2 ibus # configure.ac:152: error: possibly undefined macro: AM_PATH_GLIB_2_0 - kitty - iio-sensor-proxy - libgweather - libHX + kitty # "FileNotFoundError: [Errno 2] No such file or directory: 'pkg-config'" + iio-sensor-proxy # "./autogen.sh: line 26: gtkdocize: not found" + libgccjit # "../../gcc-9.5.0/gcc/jit/jit-result.c:52:3: error: 'dlclose' was not declared in this scope" + libgweather # "Run-time dependency vapigen found: NO (tried pkgconfig)" libjcat # data/tests/meson.build:10:0: ERROR: Program 'gnutls-certtool certtool' not found or not executable - # TODO: librest*: disable doc building with --disable-gtk-doc - librest # You must have gtk-doc >= 1.13 installed to build documentation - librest_1_0 # (meson) Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) libsForQt5 # qtbase # make: g++: No such file or directory - # libuv - mod_dnssd - ncftp - networkmanager-fortisslvpn # /nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 2: gdbus-codegen: command not found + mod_dnssd # "configure: error: *** Sorry, could not find apxs ***" networkmanager-iodine # configure.ac:58: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT - networkmanager-l2tp # /nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 2: gdbus-codegen: command not found - networkmanager-openconnect # /nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 1: properties/gresource.xml: Permission denied - networkmanager-openvpn # /nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 1: properties/gresource.xml: Permission denied - networkmanager-sstp # /nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 2: gdbus-codegen: command not found - networkmanager-vpnc # /nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 1: properties/gresource.xml: Permission denied - obex_data_server - openfortivpn - ostree - pam_mount + notmuch # "Error: The dependencies of notmuch could not be satisfied" (xapian, gmime, glib, talloc) + obex_data_server # "/nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 2: --prefix=ods_manager: command not found" + openfortivpn # "checking for /proc/net/route... configure: error: cannot check for file existence when cross compiling" + ostree # "configure: error: Need GPGME_PTHREAD version 1.1.8 or later" perlInterpreters # perl5.36.0-Module-Build perl5.36.0-Test-utf8 (see tracking issues ^) phoc # Program wayland-scanner found: NO phosh # libadwaita-1 not found phosh-mobile-settings # meson.build:26:0: ERROR: Dependency "phosh-plugins" not found, tried pkgconfig - # pipewire - # psqlodbc - pulseaudio # FAILED: meson-internal__test + psqlodbc # "configure: error: odbc_config not found (required for unixODBC build)" # qgnomeplatform # qtbase - qt6 # psqlodbc + qt6 # error in psqlodbc, not fixed by emulating only psqlodbc above for some reason + rapidfuzz-cpp # error: could not find git for clone of catch2-populate re2 # FAILED: CMakeFiles/test.util - rmlint - sequoia + rmlint # "Checking whether the C compiler works... no" + sequoia # "/nix/store/q8hg17w47f9xr014g36rdc2gi8fv02qc-clang-aarch64-unknown-linux-gnu-12.0.1-lib/lib/libclang.so.12: cannot open shared object file: No such file or directory"', /build/sequoia-0.27.0-vendor.tar.gz/bindgen/src/lib.rs:1975:31" # splatmoji squeekboard # meson.build:1:0: ERROR: 'rust' compiler binary not defined in cross or native file - sysprof - tpm2-abrmd # configure: error: *** gdbus-codegen is required to build tpm2-abrmd; No package 'gio-unix-2.0' found - tracker-miners # it just can't run tests + tracker-miners # "meson.build:183:0: ERROR: Can not run test applications in this cross environment." twitter-color-emoji # /nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 1: pkg-config: command not found # unar has multiple failures: # - "configure: error: Your compiler does not appear to implement the -fconstant-string-class option needed for support of strings. Please check for a more recent version or consider using --enable-nxconstantstring" # - "/nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 1: ar: command not found" unar visidata # python3.10-psycopg2 python3.10-pandas python3.10-h5py - vpnc - webp-pixbuf-loader + # vpnc # "/nix/store/0wk6nr1mryvylf5g5frckjam7g7p9gpi-bash-5.2-p15/bin/bash: line 1: perl: command not found" + webp-pixbuf-loader # install phase: "Builder called die: Cannot wrap '/nix/store/kpp8qhzdjqgvw73llka5gpnsj0l4jlg8-gdk-pixbuf-aarch64-unknown-linux-gnu-2.42.10/bin/gdk-pixbuf-thumbnailer' because it is not an executable file" # webkitgtk_4_1 # requires nativeBuildInputs = perl.pkgs.FileCopyRecursive => perl5.36.0-Test-utf8 - xdg-desktop-portal-gtk # No package 'xdg-desktop-portal' found - xdg-desktop-portal-gnome # data/meson.build:33:5: ERROR: Program 'msgfmt' not found or not executable + # xdg-desktop-portal-gnome # data/meson.build:33:5: ERROR: Program 'msgfmt' not found or not executable # xdg-utils # perl5.36.0-File-BaseDir / perl5.36.0-Module-Build ; @@ -173,8 +160,13 @@ in # # doesn't fix: "ld: error adding symbols: file in wrong format" # inherit (emulated) stdenv; # }; + # appstream = prev.appstream.overrideAttrs (orig: { + # # fixes "Program 'gperf' not found or not executable" + # # does not fix "ERROR: An exe_wrapper is needed but was not found. Please define one in cross file and check the command and/or add it to PATH." + # nativeBuildInputs = orig.nativeBuildInputs ++ [ next.gperf ]; + # }); - blueman = prev.blueman.overrideAttrs(orig: { + blueman = prev.blueman.overrideAttrs (orig: { # configure: error: ifconfig or ip not found, install net-tools or iproute2 nativeBuildInputs = orig.nativeBuildInputs ++ [ next.iproute2 ]; }); @@ -217,6 +209,11 @@ in # "checking preferred charset formats for system iconv... cannot run test program while cross compiling" configureFlags = orig.configureFlags ++ [ "ac_cv_have_iconv_detect_h=no" ]; }); + # gmime3 = prev.gmime3.overrideAttrs (orig: { + # # "checking preferred charset formats for system iconv... cannot run test program while cross compiling" + # # unsolved: "ImportError: /nix/store/c190src4bjkfp7bdgc5sadnmvgzv7kxb-gobject-introspection-aarch64-unknown-linux-gnu-1.74.0/lib/gobject-introspection/giscanner/_giscanner.cpython-310-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory" + # configureFlags = orig.configureFlags ++ [ "ac_cv_have_iconv_detect_h=no" ]; + # }); gupnp_1_6 = prev.gupnp_1_6.overrideAttrs (orig: { # "subprojects/gi-docgen/meson.build:10:0: ERROR: python3 not found" # this patch is copied from the default gupnp. @@ -231,24 +228,83 @@ in gnome = prev.gnome.overrideScope' (self: super: { inherit (emulated.gnome) - evolution-data-server # 'nix log /nix/store/ghlsq1jl5js5jiy24b4p1k67k4sgrnv7-libuv-1.44.2.drv' - gnome-color-manager # src/meson.build:3:0: ERROR: Program 'glib-compile-resources' not found or not executable - gnome-control-center # subprojects/gvc/meson.build:30:0: ERROR: Program 'glib-mkenums mkenums' not found or not executable + evolution-data-server # "The 'perl' not found, not installing csv2vcard" gnome-keyring # configure.ac:374: error: possibly undefined macro: AM_PATH_LIBGCRYPT gnome-shell # "meson.build:128:0: ERROR: Program 'gjs' not found or not executable" gnome-settings-daemon # subprojects/gvc/meson.build:30:0: ERROR: Program 'glib-mkenums mkenums' not found or not executable - gnome-user-share # meson.build:111:6: ERROR: Program 'glib-compile-schemas' not found or not executable mutter # meson.build:237:2: ERROR: Dependency "gbm" not found, tried pkgconfig (it's provided by mesa) ; - gnome-remote-desktop = emulated.gnome.gnome-remote-desktop.overrideAttrs(orig: { + evince = super.evince.overrideAttrs (orig: { + # fixes (meson) "Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)" + # inspired by gupnp + outputs = [ "out" "dev" ] + ++ lib.optionals (prev.stdenv.buildPlatform == prev.stdenv.hostPlatform) [ "devdoc" ]; + mesonFlags = orig.mesonFlags ++ [ + "-Dgtk_doc=${lib.boolToString (prev.stdenv.buildPlatform == prev.stdenv.hostPlatform)}" + ]; + }); + # evolution-data-server = super.evolution-data-server.override { + # inherit (next) stdenv; + # }; + # evolution-data-server = super.evolution-data-server.overrideAttrs (orig: { + # # fixes "The 'perl' not found, not installing csv2vcard" + # # doesn't fix "CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately" + # nativeBuildInputs = orig.nativeBuildInputs ++ [ next.perl ]; + # }); + gnome-color-manager = super.gnome-color-manager.overrideAttrs (orig: { + # fixes: "src/meson.build:3:0: ERROR: Program 'glib-compile-resources' not found or not executable" + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; + }); + gnome-control-center = super.gnome-control-center.overrideAttrs (orig: { + # fixes "subprojects/gvc/meson.build:30:0: ERROR: Program 'glib-mkenums mkenums' not found or not executable" + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; + }); + # gnome-control-center = super.gnome-control-center.override { + # inherit (next) stdenv; + # }; + gnome-remote-desktop = super.gnome-remote-desktop.overrideAttrs (orig: { # TODO: remove gnome-remote-desktop (wanted by gnome-control-center) - # "Program gdbus-codegen found: NO" + # fixes: "Program gdbus-codegen found: NO" nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; }); - gnome-session = emulated.gnome.gnome-session.overrideAttrs(orig: { - # "gdbus-codegen not found or executable" + # gnome-shell = super.gnome-shell.overrideAttrs (orig: { + # # fixes "meson.build:128:0: ERROR: Program 'gjs' not found or not executable" + # # does not fix "_giscanner.cpython-310-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory" (python import failure) + # nativeBuildInputs = orig.nativeBuildInputs ++ [ next.gjs next.gobject-introspection ]; + # # try to reduce gobject-introspection/shew dependencies + # mesonFlags = [ + # "-Dextensions_app=false" + # "-Dextensions_tool=false" + # "-Dman=false" + # ]; + # # fixes "gvc| Build-time dependency gobject-introspection-1.0 found: NO" + # # inspired by gupnp_1_6 + # # outputs = [ "out" "dev" ] + # # ++ lib.optionals (prev.stdenv.buildPlatform == prev.stdenv.hostPlatform) [ "devdoc" ]; + # # mesonFlags = [ + # # "-Dgtk_doc=${lib.boolToString (prev.stdenv.buildPlatform == prev.stdenv.hostPlatform)}" + # # ]; + # }); + # gnome-shell = super.gnome-shell.override { + # inherit (next) stdenv; + # }; + # gnome-settings-daemon = super.gnome-settings-daemon.overrideAttrs (orig: { + # # fixes "subprojects/gvc/meson.build:30:0: ERROR: Program 'glib-mkenums mkenums' not found or not executable" + # # new error: "plugins/power/meson.build:22:0: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Pkg-config binary for machine 0 not found. Giving up." + # nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; + # }); + gnome-session = super.gnome-session.overrideAttrs (orig: { + # fixes: "gdbus-codegen not found or executable" nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; }); + gnome-user-share = super.gnome-user-share.overrideAttrs (orig: { + # fixes: meson.build:111:6: ERROR: Program 'glib-compile-schemas' not found or not executable + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; + }); + # mutter = super.mutter.override { + # # DOES NOT FIX: "meson.build:237:2: ERROR: Dependency "gbm" not found, tried pkgconfig (it's provided by mesa)" + # inherit (next) stdenv; + # }; }); # gst_all_1.gst-editing-services = emulated.gst_all_1.gst-editing-services; @@ -282,14 +338,25 @@ in # inherit (emulated) stdenv; # }; - # librest = prev.librest.overrideAttrs (orig: { - # # You must have gtk-doc >= 1.13 installed to build documentation (TODO: add '--disable-gtk-doc') - # inherit (emulated) stdenv; - # }); - # librest_1_0 = prev.librest_1_0.overrideAttrs (orig: { - # # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake) - # inherit (emulated) stdenv; - # }); + libHX = prev.libHX.overrideAttrs (orig: { + # "Can't exec "libtoolize": No such file or directory at /nix/store/r4fvx9hazsm0rdm7s393zd5v665dsh1c-autoconf-2.71/share/autoconf/Autom4te/FileUtils.pm line 294." + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.libtool ]; + }); + + librest = prev.librest.overrideAttrs (orig: { + # fixes "You must have gtk-doc >= 1.13 installed to build documentation" + # by removing the "--enable-gtk-doc" flag + configureFlags = [ "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt" ]; + }); + librest_1_0 = prev.librest_1_0.overrideAttrs (orig: { + # fixes (meson) "Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)" + # inspired by gupnp + outputs = [ "out" "dev" ] + ++ lib.optionals (prev.stdenv.buildPlatform == prev.stdenv.hostPlatform) [ "devdoc" ]; + mesonFlags = orig.mesonFlags ++ [ + "-Dgtk_doc=${lib.boolToString (prev.stdenv.buildPlatform == prev.stdenv.hostPlatform)}" + ]; + }); # libsForQt5 = prev.libsForQt5.overrideScope' (self: super: { # inherit (emulated.libsForQt5) # qtbase @@ -303,6 +370,52 @@ in doCheck = false; }); + ncftp = prev.ncftp.override { + # fixes: "ar: No such file or directory" + inherit (emulated) stdenv; + }; + networkmanager-fortisslvpn = prev.networkmanager-fortisslvpn.overrideAttrs (orig: { + # fixes "gdbus-codegen: command not found" + nativeBuildInputs = orig.nativeBuildInputs ++ [ prev.glib ]; + }); + # networkmanager-iodine = prev.networkmanager-iodine.overrideAttrs (orig: { + # # fails to fix "configure.ac:58: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT" + # nativeBuildInputs = orig.nativeBuildInputs ++ [ prev.gettext ]; + # }); + networkmanager-l2tp = prev.networkmanager-l2tp.overrideAttrs (orig: { + # fixes "gdbus-codegen: command not found" + # fixes "gtk4-builder-tool: command not found" + nativeBuildInputs = orig.nativeBuildInputs ++ [ prev.glib prev.gtk4 ]; + }); + networkmanager-openconnect = prev.networkmanager-openconnect.overrideAttrs (orig: { + # fixes "properties/gresource.xml: Permission denied" + # - by providing glib-compile-resources + nativeBuildInputs = orig.nativeBuildInputs ++ [ prev.glib ]; + }); + networkmanager-openvpn = prev.networkmanager-openvpn.overrideAttrs (orig: { + # fixes "properties/gresource.xml: Permission denied" + # - by providing glib-compile-resources + nativeBuildInputs = orig.nativeBuildInputs ++ [ prev.glib ]; + }); + networkmanager-sstp = prev.networkmanager-sstp.overrideAttrs (orig: { + # fixes "gdbus-codegen: command not found" + nativeBuildInputs = orig.nativeBuildInputs ++ [ prev.glib ]; + }); + networkmanager-vpnc = prev.networkmanager-vpnc.overrideAttrs (orig: { + # fixes "properties/gresource.xml: Permission denied" + # - by providing glib-compile-resources + nativeBuildInputs = orig.nativeBuildInputs ++ [ prev.glib ]; + }); + nheko = prev.nheko.overrideAttrs (orig: { + # fixes "fatal error: lmdb++.h: No such file or directory + buildInputs = orig.buildInputs ++ [ next.lmdbxx ]; + }); + + pam_mount = prev.pam_mount.overrideAttrs (orig: { + # fixes: "perl: command not found" + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.perl ]; + }); + # perlPackageOverrides = _perl: { # inherit (pkgs.emulated.perl.pkgs) # Testutf8 @@ -370,13 +483,51 @@ in # it tries to call `cc` during the build, but can't find it. }) ]; + # squeekboard = prev.squeekboard.overrideAttrs (orig: { + # # fixes: "meson.build:1:0: ERROR: 'rust' compiler binary not defined in cross or native file" + # # new error: "meson.build:1:0: ERROR: Rust compiler rustc --target aarch64-unknown-linux-gnu -C linker=aarch64-unknown-linux-gnu-gcc can not compile programs." + # mesonFlags = + # let + # # ERROR: 'rust' compiler binary not defined in cross or native file + # crossFile = next.writeText "cross-file.conf" '' + # [binaries] + # rust = [ 'rustc', '--target', '${next.rust.toRustTargetSpec next.stdenv.hostPlatform}' ] + # ''; + # in + # orig.mesonFlags or [] ++ lib.optionals (next.stdenv.hostPlatform != next.stdenv.buildPlatform) [ "--cross-file=${crossFile}" ]; + # }); + strp = prev.srtp.overrideAttrs (orig: { + # roc_driver test times out after 30s + doCheck = false; + }); + sysprof = prev.sysprof.overrideAttrs (orig: { + # fixes: "src/meson.build:12:2: ERROR: Program 'gdbus-codegen' not found or not executable" + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; + }); + tpm2-abrmd = prev.tpm2-abrmd.overrideAttrs (orig: { + # fixes "configure: error: *** gdbus-codegen is required to build tpm2-abrmd; No package 'gio-unix-2.0' found" + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.glib ]; + }); # unar = (prev.unar.override { - # # "meson.build:52:2: ERROR: Program 'gpg2 gpg' not found or not executable" + # # fixes "ar: command not found" + # # new error: "gcc: error: unrecognized command line option '-fobjc-runtime=gnustep-2.0'" # inherit (emulated) stdenv; - # }).overrideAttrs (orig: { - # nativeBuildInputs = orig.nativeBuildInputs ++ [ next.coreutils-full ]; # }); + + vpnc = prev.vpnc.overrideAttrs (orig: { + # fixes "perl: command not found" + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.perl ]; + }); + xdg-desktop-portal-gtk = prev.xdg-desktop-portal-gtk.overrideAttrs (orig: { + # fixes "No package 'xdg-desktop-portal' found" + buildInputs = orig.buildInputs ++ [ next.xdg-desktop-portal ]; + }); + xdg-desktop-portal-gnome = prev.xdg-desktop-portal-gnome.overrideAttrs (orig: { + # fixes: "data/meson.build:33:5: ERROR: Program 'msgfmt' not found or not executable" + # fixes: "src/meson.build:25:0: ERROR: Program 'gdbus-codegen' not found or not executable" + nativeBuildInputs = orig.nativeBuildInputs ++ [ next.gettext next.glib ]; + }); }) ]; };