2023-02-07 09:46:13 +00:00
# cross compiling
# - for edge-casey things (e.g. `mesonEmulatorHook`, `depsBuildBuild`), see in nixpkgs:
# `git show da9a9a440415b236f22f57ba67a24ab3fb53f595`
2023-02-06 22:41:32 +00:00
{ config , lib , pkgs , . . . }:
2023-01-11 08:56:06 +00:00
2023-01-13 04:39:20 +00:00
let
2023-02-05 19:36:42 +00:00
# these are the overlays which we *also* pass through to the cross and emulated package sets.
# TODO: refactor to not specify same overlay in multiple places (here and flake.nix).
overlays = [
( import ./../../overlays/pkgs.nix )
( import ./../../overlays/pins.nix )
] ;
mkCrossFrom = localSystem : pkgs :
import pkgs . path {
inherit localSystem ; # localSystem is equivalent to buildPlatform
crossSystem = pkgs . stdenv . hostPlatform . system ;
inherit ( config . nixpkgs ) config ;
inherit overlays ;
} ;
mkEmulated = pkgs :
import pkgs . path {
localSystem = pkgs . stdenv . hostPlatform . system ;
inherit ( config . nixpkgs ) config ;
inherit overlays ;
} ;
2023-01-13 04:39:20 +00:00
in
2023-01-11 08:56:06 +00:00
{
2023-02-06 22:41:32 +00:00
# options = {
# perlPackageOverrides = lib.mkOption {
# };
# };
2023-02-05 19:36:42 +00:00
2023-02-06 22:41:32 +00:00
config = {
# the configuration of which specific package set `pkgs.cross` refers to happens elsewhere;
# here we just define them all.
nixpkgs . overlays = [
( next : prev : rec {
# 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.
crossFrom . " x 8 6 _ 6 4 - l i n u x " = mkCrossFrom " x 8 6 _ 6 4 - l i n u x " prev ;
crossFrom . " a a r c h 6 4 - l i n u x " = mkCrossFrom " a a r c h 6 4 - l i n u x " prev ;
emulated = mkEmulated prev ;
} )
( next : prev :
let
emulated = prev . emulated ;
in {
# packages which don't cross compile
inherit ( emulated )
# adwaita-qt # psqlodbc
2023-02-07 03:23:18 +00:00
apacheHttpd # TODO: not properly patched (we only need mod_dnssd?)
2023-02-06 22:41:32 +00:00
appstream
blueman
brltty
cantarell-fonts # python3.10-skia-pathops
2023-02-07 03:23:18 +00:00
cdrtools
2023-02-06 22:41:32 +00:00
colord
2023-02-07 09:46:13 +00:00
# duplicity # python3.10-s3transfer
2023-02-06 22:41:32 +00:00
evince
flakpak
fuzzel
fwupd-efi
fwupd
2023-02-07 09:46:13 +00:00
gcr_4 # meson ERROR: Program 'gpg2 gpg' not found or not executable
2023-02-06 22:41:32 +00:00
gmime
# gnome-keyring
# gnome-remote-desktop
2023-02-07 09:46:13 +00:00
# gnome-tour
gnustep # (gnustep.base is used by unar; can't override individual members)
2023-02-06 22:41:32 +00:00
gocryptfs # gocryptfs-2.3-go-modules
# grpc
gst_all_1 # gst_all_1.gst-editing-services
gupnp
gupnp_1_6
2023-02-07 09:46:13 +00:00
# gvfs # meson.build:312:2: ERROR: Assert failed: http required but libxml-2.0 not found
2023-02-06 22:41:32 +00:00
flatpak
2023-02-07 09:46:13 +00:00
hdf5 # configure: error: cannot run test program while cross compiling
2023-02-06 22:41:32 +00:00
http2
ibus
kitty
iio-sensor-proxy
libHX
libgweather
librest
librest_1_0
libsForQt5 # qtbase
2023-02-07 03:23:18 +00:00
libuv
2023-02-06 22:41:32 +00:00
mod_dnssd
ncftp
obex_data_server
openfortivpn
ostree
pam_mount
perl # perl5.36.0-Test-utf8
2023-02-07 09:46:13 +00:00
# pipewire
2023-02-06 22:41:32 +00:00
psqlodbc
2023-02-07 09:46:13 +00:00
# pulseaudio # python3.10-defcon
2023-02-06 22:41:32 +00:00
# qgnomeplatform
# qtbase
qt6 # psqlodbc
rmlint
sequoia
# splatmoji
squeekboard
sysprof
tracker-miners # it just can't run tests
2023-02-07 09:46:13 +00:00
# twitter-color-emoji # python3.10-defcon
unar # meson.build:52:2: ERROR: Program 'gpg2 gpg' not found or not executable
visidata # python3.10-psycopg2 python3.10-pandas python3.10-h5py
2023-02-06 22:41:32 +00:00
vpnc
webp-pixbuf-loader
xdg-utils # perl5.36.0-File-BaseDir
;
2023-02-07 09:46:13 +00:00
pipewire = prev . pipewire . overrideAttrs ( orig : {
# fix `spa/plugins/bluez5/meson.build:41:0: ERROR: Program 'gdbus-codegen' not found or not executable`
nativeBuildInputs = orig . nativeBuildInputs ++ [ prev . glib ] ;
} ) ;
pythonPackagesExtensions = prev . pythonPackagesExtensions ++ [
( py-next : py-prev : {
defcon = py-prev . defcon . overridePythonAttrs ( orig : {
# TODO: diagnose and upstream
nativeBuildInputs = orig . nativeBuildInputs ++ orig . nativeCheckInputs ;
} ) ;
executing = py-prev . executing . overridePythonAttrs ( orig : {
# TODO: confirm & upstream
# test has an assertion that < 1s of CPU time elapsed => flakey
disabledTestPaths = orig . disabledTestPaths or [ ] ++ [
# "tests/test_main.py::TestStuff::test_many_source_for_filename_calls"
" t e s t s / t e s t _ m a i n . p y "
] ;
} ) ;
# h5py = py-prev.h5py.overridePythonAttrs (orig: {
# # XXX: can't upstream until its dependency, hdf5, is fixed. that looks TRICKY.
# # - the `setup_configure.py` in h5py tries to dlopen (and call into) the hdf5 lib to query the version and detect features like MPI
# # - it could be patched with ~10 LoC in the HDF5LibWrapper class.
# #
# # expose numpy and hdf5 as available at build time
# nativeBuildInputs = orig.nativeBuildInputs ++ orig.propagatedBuildInputs ++ orig.buildInputs;
# buildInputs = [];
# # HDF5_DIR = "${hdf5}";
# });
mutatormath = py-prev . mutatormath . overridePythonAttrs ( orig : {
# TODO: diagnose and upstream
nativeBuildInputs = orig . nativeBuildInputs or [ ] ++ orig . nativeCheckInputs ;
} ) ;
pandas = py-prev . pandas . overridePythonAttrs ( orig : {
# TODO: upstream
# XXX: we only actually need numpy when building in ~/nixpkgs repo: not sure why we need all the propagatedBuildInputs here.
# nativeBuildInputs = orig.nativeBuildInputs ++ [ py-next.numpy ];
nativeBuildInputs = orig . nativeBuildInputs ++ orig . propagatedBuildInputs ;
} ) ;
psycopg2 = py-prev . psycopg2 . overridePythonAttrs ( orig : {
# TODO: upstream
# - see: <https://github.com/NixOS/nixpkgs/issues/210265>
# """
# i was able to just add `postgresql` to the `buildInputs` (so that it's in both `buildInputs` and `nativeBuildInputs`):
# it fixed the build for `pkgsCross.aarch64-multiplatform.python310Packages.psycopg2` but not for `armv7l-hf-multiplatform` that this issue description calls out.
#
# also i haven't deployed it yet to make sure this doesn't cause anything funky at runtime though.
# """
#
# psycopg2 *links* against libpg, so we need the host postgres available at build time!
# present-day nixpkgs only includes it in nativeBuildInputs
buildInputs = orig . buildInputs ++ [ next . postgresql ] ;
} ) ;
s3transfer = py-prev . s3transfer . overridePythonAttrs ( orig : {
# TODO: this doesn't actually stop the unit tests from running!
# some (or all?) tests fail if the test runner isn't on the same platform as the host (?)
# Bail out! ERROR:../plugins/core.c:221:qemu_plugin_vcpu_init_hook: assertion failed: (success)
# Bail out! ERROR:../accel/tcg/cpu-exec.c:954:cpu_exec: assertion failed: (cpu == current_cpu)
disabledTestPaths = orig . disabledTestPaths ++ [
# "tests/functional/test_processpool.py::TestProcessPoolDownloader::test_cleans_up_tempfile_on_failure"
" t e s t s / f u n c t i o n a l / t e s t _ p r o c e s s p o o l . p y "
# "tests/unit/test_compat.py::TestBaseManager::test_can_provide_signal_handler_initializers_to_start"
" t e s t s / u n i t / t e s t _ c o m p a t . p y "
] ;
} ) ;
# skia-pathops
# it tries to call `cc` during the build, but can't find it.
} )
] ;
2023-02-06 22:41:32 +00:00
gnome = prev . gnome . overrideScope' ( self : super : {
inherit ( emulated . gnome )
gnome-color-manager
gnome-keyring
2023-02-07 09:46:13 +00:00
# gnome-remote-desktop
gnome-settings-daemon # subprojects/gvc/meson.build:30:0: ERROR: Program 'glib-mkenums mkenums' not found or not executable
2023-02-06 22:41:32 +00:00
gnome-user-share
mutter
;
} ) ;
# gst_all_1.gst-editing-services = emulated.gst_all_1.gst-editing-services;
# gst_all_1 = prev.gst_all_1.overrideScope' (self: super: {
# inherit (emulated.gst_all_1)
# gst-editing-services
# ;
# });
# libsForQt5 = prev.libsForQt5.overrideScope' (self: super: {
# inherit (emulated.libsForQt5)
# qtbase
# ;
# });
# apacheHttpdPackagesFor = apacheHttpd: self:
# let
# prevHttpdPkgs = lib.fix (emulated.apacheHttpdPackagesFor apacheHttpd);
# in
# (prev.apacheHttpdPackagesFor apacheHttpd self) // {
# # inherit (prevHttpdPkgs) mod_dnssd;
# mod_dnssd = prevHttpdPkgs.mod_dnssd.override {
# inherit (self) apacheHttpd;
# };
# };
} )
] ;
# perlPackageOverrides = _perl: {
# inherit (pkgs.emulated.perl.pkgs)
# Testutf8
# ;
# };
} ;
2023-01-11 08:56:06 +00:00
}