2023-12-20 22:32:07 +00:00
# outstanding cross-compilation PRs/issues:
# - all: <https://github.com/NixOS/nixpkgs/labels/6.topic%3A%20cross-compilation>
# - qtsvg mixed deps: <https://github.com/NixOS/nixpkgs/issues/269756>
# - big Qt fix: <https://github.com/NixOS/nixpkgs/pull/267311>
#
2023-10-11 09:58:44 +00:00
# outstanding issues:
# - 2023/10/10: build python3 is pulled in by many things
# - nix why-depends --all /nix/store/8g3kd2jxifq10726p6317kh8srkdalf5-nixos-system-moby-23.11.20231011.dirty /nix/store/pzf6dnxg8gf04xazzjdwarm7s03cbrgz-python3-3.10.12/bin/python3.10
# - gstreamer-vaapi -> gstreamer-dev -> glib-dev
# - portfolio -> {glib,cairo,pygobject}-dev
# - komikku -> python3.10-brotlicffi -> python3.10-cffi
# - many others. python3.10-cffi seems to be the offender which infects 70% of consumers though
2023-10-11 19:41:49 +00:00
# - 2023/10/11: build ruby is pulled in by `neovim`:
# - nix why-depends --all /nix/store/rhli8vhscv93ikb43639c2ysy3a6dmzp-nixos-system-moby-23.11.20231011.30c7fd8 /nix/store/5xbwwbyjmc1xvjzhghk6r89rn4ylidv8-ruby-3.1.4
2023-12-20 08:00:40 +00:00
# - 2023/12/19: rustPlatform.cargoSetupHook outside of `buildRustPackage` or python packages is a mess
# - it doesn't populate `.cargo/config` with valid cross-compilation config
# - something to do with the way it's spliced: `nativeBuildInputs = [ rustPlatform.cargoSetupHook.__spliced.hostHost ]` (or hostTarget) WORKS
# - see <https://github.com/NixOS/nixpkgs/pull/260068> -- it's probably wrong.
# - WIP fix in `pr-cross-cargo`/`pr-cross-cargo2` nixpkgs branch.
# - sanity check by building `pkgsCross.aarch64-multiplatform.rav1e`, and the `fd` program mentioned in PR 260068
# - `pkgsCross.musl64.fd`
# - `pkgsStatic.fd`
# - this is way too tricky to enable cross compilation without breaking the musl stuff.
# - i lost a whole day trying to get it to work: don't do it!
2023-10-12 00:00:54 +00:00
#
# partially fixed:
# - 2023/10/11: build coreutils pulled in by rpm 4.18.1, but NOT by 4.19.0
2023-10-11 22:06:59 +00:00
# - nix why-depends --all /nix/store/gjwd2x507x7gjycl5q0nydd39d3nkwc5-dtrx-8.5.3-aarch64-unknown-linux-gnu /nix/store/y9gr7abwxvzcpg5g73vhnx1fpssr5frr-coreutils-9.3
2023-10-11 09:58:44 +00:00
#
2023-08-12 08:17:08 +00:00
# outstanding issues for software i don't have deployed:
2023-07-31 08:07:15 +00:00
# - gdk-pixbuf doesn't generate `gdk-pixbuf-thumbnailer` on cross
# - been this way since 2018: <https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/20>
# - as authored upstream, thumbnailer depends on loader.cache, and neither are built during cross compilation.
# - nixos manually builds loader.cache in postInstall (via emulator).
# - even though we have loader.cache, ordering means that thumbnailer still can't be built.
# - solution is probably to integrate meson's cross_file stuff, and pushing all this emulation upstream.
2023-07-30 01:48:29 +00:00
2023-05-24 03:57:35 +00:00
final : prev :
let
inherit ( prev ) lib ;
## package override helpers
addInputs = { buildInputs ? [ ] , nativeBuildInputs ? [ ] , depsBuildBuild ? [ ] }: pkg : pkg . overrideAttrs ( upstream : {
buildInputs = upstream . buildInputs or [ ] ++ buildInputs ;
nativeBuildInputs = upstream . nativeBuildInputs or [ ] ++ nativeBuildInputs ;
depsBuildBuild = upstream . depsBuildBuild or [ ] ++ depsBuildBuild ;
} ) ;
addNativeInputs = nativeBuildInputs : addInputs { inherit nativeBuildInputs ; } ;
addBuildInputs = buildInputs : addInputs { inherit buildInputs ; } ;
addDepsBuildBuild = depsBuildBuild : addInputs { inherit depsBuildBuild ; } ;
mvToNativeInputs = nativeBuildInputs : mvInputs { inherit nativeBuildInputs ; } ;
mvToBuildInputs = buildInputs : mvInputs { inherit buildInputs ; } ;
rmInputs = { buildInputs ? [ ] , nativeBuildInputs ? [ ] }: pkg : pkg . overrideAttrs ( upstream : {
buildInputs = lib . subtractLists buildInputs ( upstream . buildInputs or [ ] ) ;
nativeBuildInputs = lib . subtractLists nativeBuildInputs ( upstream . nativeBuildInputs or [ ] ) ;
} ) ;
2023-07-09 10:50:01 +00:00
rmNativeInputs = nativeBuildInputs : rmInputs { inherit nativeBuildInputs ; } ;
2023-05-24 03:57:35 +00:00
# move items from buildInputs into nativeBuildInputs, or vice-versa.
# arguments represent the final location of specific inputs.
mvInputs = { buildInputs ? [ ] , nativeBuildInputs ? [ ] }: pkg :
addInputs { buildInputs = buildInputs ; nativeBuildInputs = nativeBuildInputs ; }
(
rmInputs { buildInputs = nativeBuildInputs ; nativeBuildInputs = buildInputs ; }
pkg
) ;
2024-05-19 22:33:00 +00:00
# build a GI_TYPELIB_PATH out of some packages, useful for build-time tools which otherwise
# try to load gobject-introspection files for the wrong platform (e.g. `blueprint` compiler).
2024-05-08 08:45:41 +00:00
typelibPath = pkgs : lib . concatStringsSep " : " ( builtins . map ( p : " ${ lib . getLib p } / l i b / g i r e p o s i t o r y - 1 . 0 " ) pkgs ) ;
2024-05-19 22:33:00 +00:00
# `cargo` which adds the correct env vars and `--target` flag when invoked from meson build scripts
crossCargo = let
inherit ( final . pkgsBuildHost ) cargo ;
inherit ( final . rust . envVars ) setEnv rustHostPlatformSpec ;
in ( final . pkgsBuildBuild . writeShellScriptBin " c a r g o " ''
exec $ { setEnv } " ${ lib . getExe cargo } " " $ @ " - - target " ${ rustHostPlatformSpec } "
'' ) . o v e r r i d e A t t r s {
inherit ( cargo ) meta ;
} ;
2023-12-04 07:42:11 +00:00
in with final ; {
2023-07-09 10:50:01 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked (but this solution no longer works)
2024-02-27 14:53:26 +00:00
# apacheHttpd_2_4 = prev.apacheHttpd_2_4.overrideAttrs (upstream: {
# configureFlags = upstream.configureFlags or [] ++ [
# "ap_cv_void_ptr_lt_long=no" # configure can't AC_TRY_RUN, and can't validate that sizeof (void*) == sizeof long
# ];
# # let nix figure out the perl shebangs.
# # some of these perl scripts are shipped on the host, others in the .dev output for the build machine.
# # postPatch methods create cycles
# # postPatch = ''
# # substituteInPlace configure --replace \
# # '/replace/with/path/to/perl/interpreter' \
# # '/usr/bin/perl'
# # '';
# # postPatch = ''
# # substituteInPlace support/apxs.in --replace \
# # '@perlbin@' \
# # '/usr/bin/perl'
# # '';
# postFixup = upstream.postFixup or "" + ''
# sed -i 's:/replace/with/path/to/perl/interpreter:${buildPackages.perl}/bin/perl:' $dev/bin/apxs
# '';
# });
2023-05-24 03:57:35 +00:00
# apacheHttpdPackagesFor = apacheHttpd: self:
# let
2023-08-04 05:20:20 +00:00
# prevHttpdPkgs = prev.apacheHttpdPackagesFor apacheHttpd self;
# in prevHttpdPkgs // {
# # fixes "configure: error: *** Sorry, could not find apxs ***"
# # N.B.: the below apxs doesn't have a valid shebang (#!/replace/with/...).
# # we can't replace it at the origin?
# mod_dnssd = prevHttpdPkgs.mod_dnssd.overrideAttrs (upstream: {
# configureFlags = upstream.configureFlags ++ [
# "--with-apxs=${self.apacheHttpd.dev}/bin"
# ];
# });
# };
2023-05-24 03:57:35 +00:00
2024-05-13 16:47:16 +00:00
# 2024/05/13: upstreaming is unblocked; out for review: <https://github.com/NixOS/nixpkgs/pull/305241>
2024-01-12 02:17:28 +00:00
appstream = prev . appstream . overrideAttrs ( upstream : {
# fixes: "Message: Native appstream required for cross-building"
# error introduced in:
# - <https://github.com/ximion/appstream/pull/510>
# - <https://github.com/NixOS/nixpkgs/pull/273297>
postPatch = ( upstream . postPatch or " " ) + ''
substituteInPlace data/meson.build \
2024-05-19 23:24:07 +00:00
- - replace-fail ' meson . is_cross_build ( ) ' ' false'
2024-01-12 02:17:28 +00:00
'' ;
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
# prev.appstream
# ];
} ) ;
2024-06-14 03:28:34 +00:00
# bamf: required via pantheon.switchboard -> wingpanel -> gala
# bamf = prev.bamf.overrideAttrs (upstream: {
# # "You must have gtk-doc >= 1.0 installed to build documentation"
# depsBuildBuild = (upstream.depsBuildBuild or []) ++ [
# pkg-config #< to find gtk-doc
# (buildPackages.python3.withPackages (ps: with ps; [ lxml ])) # Tests
# ];
# # nativeBuildInputs = [
# # # (python3.withPackages (ps: with ps; [ lxml ])) # Tests
# # autoreconfHook
# # dbus
# # docbook_xsl
# # gnome.gnome-common
# # gobject-introspection
# # gtk-doc
# # pkg-config
# # vala
# # which
# # wrapGAppsHook3
# # xorg.xorgserver
# # ] ++ [
# # nativeBuildInputs = lib.tail upstream.nativeBuildInputs ++ [
# nativeBuildInputs = (
# lib.filter (p:
# !lib.hasPrefix python3.pname (p.name or p.pname or "") &&
# # ... i can't figure out where it's getting libX11 from :|
# (p.pname or "") != xorg.xorgserver.pname &&
# (p.pname or "") != gnome.gnome-common.pname
# )
# upstream.nativeBuildInputs
# ) ++ [
# buildPackages.gettext #< for msgfmt
# ];
# buildInputs = upstream.buildInputs ++ [
# xorg.xorgserver #< upstream incorrectly places this in `nativeBuildInputs`
# ];
# # nativeBuildInputs = upstream.nativeBuildInputs ++ [
# # (python3.pythonOnBuildForHost.withPackages (ps: with ps; [ lxml ])) # Tests
# # ];
# configureFlags = [
# "--enable-gtk-doc"
# # "--enable-headless-tests" #< can't test when cross compiling
# ];
# });
2023-10-11 22:06:59 +00:00
# binutils = prev.binutils.override {
# # fix that resulting binary files would specify build #!sh as their interpreter.
# # dtrx is the primary beneficiary of this.
# # this doesn't actually cause mass rebuilding.
# # note that this isn't enough to remove all build references:
# # - expand-response-params still references build stuff.
2023-12-04 07:42:11 +00:00
# shell = runtimeShell;
2023-10-11 22:06:59 +00:00
# };
2024-05-31 06:59:32 +00:00
# 2024/05/31: upstreaming blocked by appstream, qtsvg
# fixes: "Exec format error: './calls-scan'"
2023-12-04 04:24:53 +00:00
calls = prev . calls . overrideAttrs ( upstream : {
# TODO: try building with mesonEmulatorHook when i upstream this
# nativeBuildInputs = upstream.nativeBuildInputs ++ lib.optionals (!prev.stdenv.buildPlatform.canExecute prev.stdenv.hostPlatform) [
2023-12-04 07:42:11 +00:00
# mesonEmulatorHook
2023-12-04 04:24:53 +00:00
# ];
outputs = lib . remove " d e v d o c " upstream . outputs ;
mesonFlags = lib . remove " - D g t k _ d o c = t r u e " upstream . mesonFlags ;
} ) ;
2023-08-31 00:52:28 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2023-08-01 08:07:27 +00:00
# clapper = prev.clapper.overrideAttrs (upstream: {
# # use the host gjs (meson's find_program expects it to be executable)
# postPatch = (upstream.postPatch or "") + ''
# substituteInPlace bin/meson.build \
2023-12-04 07:42:11 +00:00
# --replace "find_program('gjs').path()" "'${gjs}/bin/gjs'"
2023-08-01 08:07:27 +00:00
# '';
# });
2023-07-26 08:51:51 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2024-05-19 22:33:00 +00:00
delfin = prev . delfin . overrideAttrs ( upstream : {
2023-12-15 08:43:10 +00:00
nativeBuildInputs = upstream . nativeBuildInputs ++ [
# fixes: loaders/meson.build:72:7: ERROR: Program 'msgfmt' not found or not executable
buildPackages . gettext
] ;
postPatch = ''
substituteInPlace delfin/meson.build \
2024-05-19 23:24:07 +00:00
- - replace-fail " c a r g o , ' b u i l d ' , " " ' ${ lib . getExe crossCargo } ' , ' b u i l d ' , " \
- - replace-fail " ' d e l f i n ' / r u s t _ t a r g e t " " ' d e l f i n ' / ' ${ rust . envVars . rustHostPlatformSpec } ' / r u s t _ t a r g e t "
2023-12-15 08:43:10 +00:00
'' ;
} ) ;
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2023-11-10 23:05:12 +00:00
dialect = prev . dialect . overrideAttrs ( upstream : {
2023-12-06 13:56:39 +00:00
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = ( upstream . postPatch or " " ) + ''
2024-05-19 23:24:07 +00:00
substituteInPlace data/resources/meson.build - - replace-fail \
2023-12-06 13:56:39 +00:00
" f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) " \
2024-05-08 08:45:41 +00:00
" ' e n v ' , ' G I _ T Y P E L I B _ P A T H = ${ typelibPath [
buildPackages . gdk-pixbuf
buildPackages . glib
buildPackages . graphene
buildPackages . gtk4
buildPackages . harfbuzz
buildPackages . libadwaita
buildPackages . pango
] } ' , find_program ( ' blueprint-compiler' ) "
2023-12-06 13:56:39 +00:00
'' ;
2023-11-27 09:48:37 +00:00
# error: "<dialect> is not allowed to refer to the following paths: <build python>"
2023-11-10 23:05:12 +00:00
# dialect's meson build script sets host binaries to use build PYTHON
# disallowedReferences = [];
postFixup = ( upstream . postFixup or " " ) + ''
patchShebangs - - update - - host $ out/share/dialect/search_provider
'' ;
2023-12-06 13:56:39 +00:00
# upstream sets strictDeps=false which makes gAppsWrapperHook wrap with the build dependencies
strictDeps = true ;
2023-11-10 23:05:12 +00:00
} ) ;
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on rpm
2024-04-19 20:35:18 +00:00
# dtrx = prev.dtrx.override {
# # `binutils` is the nix wrapper, which reads nix-related env vars
# # before passing on to e.g. `ld`.
# # dtrx probably only needs `ar` at runtime, not even `ld`.
# binutils = binutils-unwrapped;
# };
2023-10-11 22:06:59 +00:00
2023-08-04 05:20:20 +00:00
# emacs = prev.emacs.override {
# nativeComp = false; # will be renamed to `withNativeCompilation` in future
# # future: we can specify 'action-if-cross-compiling' to actually invoke the test programs:
# # <https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Runtime.html>
# };
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked
2024-05-25 10:21:17 +00:00
# firejail = prev.firejail.overrideAttrs (upstream: {
# # firejail executes its build outputs to produce the default filter list.
# # i think we *could* copy the default filters from pkgsBuildBuild, but that doesn't seem future proof
# # for any (future) arch-specific filtering
# postPatch = (upstream.postPatch or "") + (let
# emulator = stdenv.hostPlatform.emulator buildPackages;
# in lib.optionalString (!prev.stdenv.buildPlatform.canExecute prev.stdenv.hostPlatform) ''
# substituteInPlace Makefile \
# --replace-fail ' src/fseccomp/fseccomp' ' ${emulator} src/fseccomp/fseccomp' \
# --replace-fail ' src/fsec-optimize/fsec-optimize' ' ${emulator} src/fsec-optimize/fsec-optimize'
# '');
# });
2024-01-19 22:05:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2023-12-06 14:08:46 +00:00
flare-signal = prev . flare-signal . overrideAttrs ( upstream : {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = ( upstream . postPatch or " " ) + ''
2024-05-19 23:24:07 +00:00
substituteInPlace data/resources/meson.build - - replace-fail \
2023-12-06 14:08:46 +00:00
" f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) " \
" ' e n v ' , ' G I _ T Y P E L I B _ P A T H = ${ buildPackages . gdk-pixbuf . out } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . harfbuzz . out } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . gtk4 . out } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . graphene } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . libadwaita } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . pango . out } / l i b / g i r e p o s i t o r y - 1 . 0 ' , f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) "
'' ;
env = let
inherit buildPackages stdenv rust ;
ccForBuild = " ${ buildPackages . stdenv . cc } / b i n / ${ buildPackages . stdenv . cc . targetPrefix } c c " ;
cxxForBuild = " ${ buildPackages . stdenv . cc } / b i n / ${ buildPackages . stdenv . cc . targetPrefix } c + + " ;
ccForHost = " ${ stdenv . cc } / b i n / ${ stdenv . cc . targetPrefix } c c " ;
cxxForHost = " ${ stdenv . cc } / b i n / ${ stdenv . cc . targetPrefix } c + + " ;
rustBuildPlatform = rust . toRustTarget stdenv . buildPlatform ;
rustTargetPlatform = rust . toRustTarget stdenv . hostPlatform ;
rustTargetPlatformSpec = rust . toRustTargetSpec stdenv . hostPlatform ;
in {
# taken from <pkgs/build-support/rust/hooks/default.nix>
# fixes "cargo:warning=aarch64-unknown-linux-gnu-gcc: error: unrecognized command-line option ‘ -m64’ "
# XXX: these aren't necessarily valid environment variables: the referenced nix file is more clever to get them to work.
" C C _ ${ rustBuildPlatform } " = " ${ ccForBuild } " ;
" C X X _ ${ rustBuildPlatform } " = " ${ cxxForBuild } " ;
" C C _ ${ rustTargetPlatform } " = " ${ ccForHost } " ;
" C X X _ ${ rustTargetPlatform } " = " ${ cxxForHost } " ;
} ;
} ) ;
2023-10-31 01:33:42 +00:00
2024-02-27 16:20:55 +00:00
flare-signal-nixified = prev . flare-signal-nixified . overrideAttrs ( upstream : {
2023-12-06 19:25:09 +00:00
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = ( upstream . postPatch or " " ) + ''
2024-05-19 23:24:07 +00:00
substituteInPlace data/resources/meson.build - - replace-fail \
2023-12-06 19:25:09 +00:00
" f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) " \
" ' e n v ' , ' G I _ T Y P E L I B _ P A T H = ${ buildPackages . gdk-pixbuf . out } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . harfbuzz . out } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . gtk4 . out } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . graphene } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . libadwaita } / l i b / g i r e p o s i t o r y - 1 . 0 : ${ buildPackages . pango . out } / l i b / g i r e p o s i t o r y - 1 . 0 ' , f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) "
'' ;
2024-02-27 16:20:55 +00:00
} ) ;
2023-10-30 11:02:01 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on appstream
2023-12-04 05:05:26 +00:00
flatpak = prev . flatpak . overrideAttrs ( upstream : {
2023-09-03 08:46:50 +00:00
# fixes "No package 'libxml-2.0' found"
2023-12-04 07:42:11 +00:00
buildInputs = upstream . buildInputs ++ [ libxml2 ] ;
2023-09-03 08:46:50 +00:00
configureFlags = upstream . configureFlags ++ [
" - - e n a b l e - s e l i n u x - m o d u l e = n o " # fixes "checking for /usr/share/selinux/devel/Makefile... configure: error: cannot check for file existence when cross compiling"
" - - d i s a b l e - g t k - d o c " # fixes "You must have gtk-doc >= 1.20 installed to build documentation for Flatpak"
] ;
2023-12-04 05:05:26 +00:00
postPatch = let
# copied from nixpkgs flatpak and modified to use buildPackages python
2023-12-04 07:42:11 +00:00
vsc-py = buildPackages . python3 . withPackages ( pp : [
2023-12-04 05:05:26 +00:00
pp . pyparsing
] ) ;
in ''
patchShebangs buildutil
patchShebangs tests
PATH = $ { lib . makeBinPath [ vsc-py ] }: $ PATH patchShebangs - - build subprojects/variant-schema-compiler/variant-schema-compiler
'' + ''
2023-12-04 07:42:11 +00:00
sed - i s:' \ $ BWRAP - - version:$ { stdenv . hostPlatform . emulator buildPackages } \ $ BWRAP - - version:' configure . ac
sed - i s:' \ $ DBUS_PROXY - - version:$ { stdenv . hostPlatform . emulator buildPackages } \ $ DBUS_PROXY - - version:' configure . ac
2023-12-04 05:05:26 +00:00
'' ;
} ) ;
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2024-05-19 23:16:29 +00:00
fractal = prev . fractal . overrideAttrs ( upstream : {
postPatch = ( upstream . postPatch or " " ) + ''
substituteInPlace src/meson.build \
- - replace-fail " c a r g o , ' b u i l d ' , " " ' ${ lib . getExe crossCargo } ' , ' b u i l d ' , " \
- - replace-fail " ' s r c ' / r u s t _ t a r g e t " " ' s r c ' / ' ${ rust . envVars . rustHostPlatformSpec } ' / r u s t _ t a r g e t "
'' ;
} ) ;
2023-08-02 08:31:48 +00:00
2023-05-24 03:57:35 +00:00
# solves (meson) "Run-time dependency libgcab-1.0 found: NO (tried pkgconfig and cmake)", and others.
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked
2023-12-21 00:20:42 +00:00
# fwupd = (addBuildInputs
# [ gcab ]
# (mvToBuildInputs [ gnutls ] prev.fwupd)
# ).overrideAttrs (upstream: {
# # XXX: gcab is apparently needed as both build and native input
# # can't build docs w/o adding `gi-docgen` to ldpath, but that adds a new glibc to the ldpath
# # which causes host binaries to be linked against the build libc & fail
# mesonFlags = (lib.remove "-Ddocs=enabled" upstream.mesonFlags) ++ [ "-Ddocs=disabled" ];
# outputs = lib.remove "devdoc" upstream.outputs;
# });
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on qtsvg (via pipewire)
2024-02-27 16:44:47 +00:00
# required by epiphany, gnome-settings-daemon
2023-10-11 09:58:44 +00:00
# N.B.: should be able to remove gnupg/ssh from {native}buildInputs when upstreaming
gcr_4 = prev . gcr_4 . overrideAttrs ( upstream : {
# fixes (meson): "ERROR: Program 'gpg2 gpg' not found or not executable"
mesonFlags = ( upstream . mesonFlags or [ ] ) ++ [
2023-12-04 07:42:11 +00:00
" - D g p g _ p a t h = ${ gnupg } / b i n / g p g "
2023-10-11 09:58:44 +00:00
] ;
} ) ;
2023-12-12 08:51:44 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked
2024-05-19 22:33:00 +00:00
glycin-loaders = prev . glycin-loaders . overrideAttrs ( upstream : {
2023-12-13 01:40:36 +00:00
nativeBuildInputs = upstream . nativeBuildInputs ++ [
# fixes: loaders/meson.build:72:7: ERROR: Program 'msgfmt' not found or not executable
buildPackages . gettext
] ;
postPatch = ''
substituteInPlace loaders/meson.build \
2024-05-19 23:24:07 +00:00
- - replace-fail " c a r g o _ b i n , ' b u i l d ' , " " ' ${ lib . getExe crossCargo } ' , ' b u i l d ' , " \
- - replace-fail " ' l o a d e r s ' / r u s t _ t a r g e t " " ' l o a d e r s ' / ' ${ rust . envVars . rustHostPlatformSpec } ' / r u s t _ t a r g e t "
2023-12-13 01:40:36 +00:00
'' ;
2023-12-12 08:51:44 +00:00
} ) ;
2024-02-01 15:44:46 +00:00
# gnustep = prev.gnustep.overrideScope (self: super: {
2023-07-31 03:04:26 +00:00
# # gnustep is going to need a *lot* of work/domain-specific knowledge to truly cross-compile,
2024-05-31 06:59:32 +00:00
# base = super.base.overrideAttrs (upstream: {
2023-07-31 03:04:26 +00:00
# # fixes: "checking FFI library usage... ./configure: line 11028: pkg-config: command not found"
# # nixpkgs has this in nativeBuildInputs... but that's failing when we partially emulate things.
# buildInputs = (upstream.buildInputs or []) ++ [ prev.pkg-config ];
# });
# });
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on appstream, qtx11extras (via zbar)
2023-12-11 03:27:46 +00:00
gnome-frog = prev . gnome-frog . overrideAttrs ( upstream : {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = ( upstream . postPatch or " " ) + ''
2024-05-19 23:24:07 +00:00
substituteInPlace data/meson.build - - replace-fail \
2023-12-11 03:27:46 +00:00
" f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) " \
2024-05-08 08:45:41 +00:00
" ' e n v ' , ' G I _ T Y P E L I B _ P A T H = ${ typelibPath [
buildPackages . gdk-pixbuf
buildPackages . glib
buildPackages . graphene
buildPackages . gtk4
buildPackages . harfbuzz
buildPackages . libadwaita
buildPackages . pango
] } ' , find_program ( ' blueprint-compiler' ) "
2023-12-11 03:27:46 +00:00
'' ;
} ) ;
2024-05-08 08:45:41 +00:00
# 2024/05/08: fix: "meson.build:85:11: ERROR: Dependency "dbus-1" not found, tried pkgconfig".
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2024-05-08 08:45:41 +00:00
gnome-online-accounts = mvToBuildInputs [ dbus ] prev . gnome-online-accounts ;
2024-02-01 15:44:46 +00:00
gnome = prev . gnome . overrideScope ( self : super : {
2023-12-04 13:12:22 +00:00
evolution-data-server = super . evolution-data-server . overrideAttrs ( upstream : {
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by appstream (out for PR), libgweather (out for PR)
2023-05-24 03:57:35 +00:00
cmakeFlags = upstream . cmakeFlags ++ [
2023-12-04 07:42:11 +00:00
" - D C M A K E _ C R O S S C O M P I L I N G _ E M U L A T O R = ${ stdenv . hostPlatform . emulator buildPackages } "
2023-12-04 13:12:22 +00:00
" - D E N A B L E _ T E S T S = n o "
" - D G E T T E X T _ M S G F M T _ E X E C U T A B L E = ${ lib . getBin buildPackages . gettext } / b i n / m s g f m t "
" - D G E T T E X T _ M S G M E R G E _ E X E C U T A B L E = ${ lib . getBin buildPackages . gettext } / b i n / m s g m e r g e "
" - D G E T T E X T _ X G E T T E X T _ E X E C U T A B L E = ${ lib . getBin buildPackages . gettext } / b i n / x g e t t e x t "
" - D G L I B _ C O M P I L E _ R E S O U R C E S = ${ lib . getDev buildPackages . glib } / b i n / g l i b - c o m p i l e - r e s o u r c e s "
" - D G L I B _ C O M P I L E _ S C H E M A S = ${ lib . getDev buildPackages . glib } / b i n / g l i b - c o m p i l e - s c h e m a s "
2023-05-24 03:57:35 +00:00
] ;
2023-12-04 13:12:22 +00:00
postPatch = ( upstream . postPatch or " " ) + ''
2024-05-19 23:24:07 +00:00
substituteInPlace src/addressbook/libebook-contacts/CMakeLists.txt - - replace-fail \
2023-12-04 13:12:22 +00:00
' COMMAND '' ${ CMAKE_CURRENT_BINARY_DIR } / g e n - w e s t e r n - t a b l e ' \
' COMMAND $ { stdenv . hostPlatform . emulator buildPackages } '' ${ CMAKE_CURRENT_BINARY_DIR } / g e n - w e s t e r n - t a b l e '
2024-05-19 23:24:07 +00:00
substituteInPlace src/camel/CMakeLists.txt - - replace-fail \
2023-12-04 13:12:22 +00:00
' COMMAND '' ${ CMAKE_CURRENT_BINARY_DIR } / c a m e l - g e n - t a b l e s ' \
' COMMAND $ { stdenv . hostPlatform . emulator buildPackages } '' ${ CMAKE_CURRENT_BINARY_DIR } / c a m e l - g e n - t a b l e s '
'' ;
2023-05-24 03:57:35 +00:00
# N.B.: the deps are funky even without cross compiling.
# upstream probably wants to replace pcre with pcre2, and maybe provide perl
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
2023-12-04 07:42:11 +00:00
# perl # fixes "The 'perl' not found, not installing csv2vcard"
# # glib
# # libiconv
# # iconv
2023-05-24 03:57:35 +00:00
# ];
# buildInputs = upstream.buildInputs ++ [
2023-12-04 07:42:11 +00:00
# pcre2 # fixes: "Package 'libpcre2-8', required by 'glib-2.0', not found"
# mount # fails to fix: "Package 'mount', required by 'gio-2.0', not found"
2023-05-24 03:57:35 +00:00
# ];
2023-12-04 13:12:22 +00:00
} ) ;
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on appstream (out for review), gnome-user-share (apache-httpd, webp-pixbuf-loader), qtsvg
2023-05-24 03:57:35 +00:00
# fixes: "src/meson.build:106:0: ERROR: Program 'glib-compile-resources' not found or not executable"
2024-05-31 08:21:23 +00:00
# file-roller = mvToNativeInputs [ glib ] super.file-roller;
2023-08-25 12:03:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream (out for review), libgweather (out for review)
2023-10-24 09:47:10 +00:00
geary = super . geary . overrideAttrs ( upstream : {
buildInputs = upstream . buildInputs ++ [
2023-12-04 07:42:11 +00:00
# glib
appstream-glib
libxml2
2023-10-24 09:47:10 +00:00
] ;
} ) ;
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by a LOT: qtbase, qtsvg, webp-pixbuf-loader, libgweather, gnome-color-manager, appstream, apache-httpd, ibus
2023-05-24 03:57:35 +00:00
# fixes "subprojects/gvc/meson.build:30:0: ERROR: Program 'glib-mkenums mkenums' not found or not executable"
2023-12-04 07:42:11 +00:00
# gnome-control-center = mvToNativeInputs [ glib ] super.gnome-control-center;
2024-02-27 14:53:26 +00:00
2023-10-02 04:06:34 +00:00
gnome-maps = super . gnome-maps . overrideAttrs ( upstream : {
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by libgweather, appstream, qtsvg (via pipewire/ffado)
2023-10-02 04:06:34 +00:00
postPatch = ( upstream . postPatch or " " ) + ''
2023-10-02 05:30:09 +00:00
# fixes: "ERROR: Program 'gjs' not found or not executable"
2023-10-02 04:06:34 +00:00
substituteInPlace meson . build \
2024-05-19 23:24:07 +00:00
- - replace-fail " f i n d _ p r o g r a m ( ' g j s ' ) " " f i n d _ p r o g r a m ( ' ${ gjs } / b i n / g j s ' ) "
2023-10-02 05:30:09 +00:00
# fixes missing `gapplication` binary when not on PATH (needed for non-cross build too)
substituteInPlace data/org.gnome.Maps.desktop.in.in \
2024-05-19 23:24:07 +00:00
- - replace-fail " g a p p l i c a t i o n " " ${ glib . bin } / b i n / g a p p l i c a t i o n "
2023-10-02 04:06:34 +00:00
'' ;
} ) ;
2023-05-24 03:57:35 +00:00
# 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)
2023-12-04 07:42:11 +00:00
# nativeBuildInputs = orig.nativeBuildInputs ++ [ gjs gobject-introspection ];
2023-05-24 03:57:35 +00:00
# # 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)}"
# # ];
# });
2024-02-27 16:44:47 +00:00
# gnome-shell = super.gnome-shell.overrideAttrs (upstream: {
2024-05-31 08:02:25 +00:00
# # 2024/05/31: upstreaming is blocked on qtsvg, appstream, webp-pixbuf-loader, libgweather, ibus
2024-02-27 16:44:47 +00:00
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
# gjs # fixes "meson.build:128:0: ERROR: Program 'gjs' not found or not executable"
# ];
# });
2023-05-24 03:57:35 +00:00
gnome-settings-daemon = super . gnome-settings-daemon . overrideAttrs ( orig : {
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on qtsvg (ffado), libgweather
2024-02-27 16:44:47 +00:00
# gsd is required by xdg-desktop-portal-gtk
2024-05-31 08:21:23 +00:00
# pkg-config solves: "plugins/power/meson.build:22:0: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Pkg-config binary for machine build machine not found."
2023-05-24 03:57:35 +00:00
# stdenv.cc fixes: "plugins/power/meson.build:60:0: ERROR: No build machine compiler for 'plugins/power/gsd-power-enums-update.c'"
# but then it fails with a link-time error.
2023-12-04 07:42:11 +00:00
# depsBuildBuild = orig.depsBuildBuild or [] ++ [ glib pkg-config buildPackages.stdenv.cc ];
2023-05-24 03:57:35 +00:00
# hack to just not build the power plugin (panel?), to avoid cross compilation errors
postPatch = orig . postPatch + ''
2024-05-31 08:21:23 +00:00
substituteInPlace plugins/meson.build \
- - replace-fail " d i s a b l e d _ p l u g i n s = [ ] " " d i s a b l e d _ p l u g i n s = [ ' p o w e r ' ] "
2023-05-24 03:57:35 +00:00
'' ;
} ) ;
2024-06-14 03:28:34 +00:00
# gnome-settings-daemon43 = super.gnome-settings-daemon43.overrideAttrs (orig: {
# postPatch = orig.postPatch + ''
# substituteInPlace plugins/meson.build \
# --replace-fail "disabled_plugins = []" "disabled_plugins = ['power']"
# '';
# });
2023-12-04 12:08:58 +00:00
2023-08-01 21:48:25 +00:00
# 2023/08/01: upstreaming is blocked on argyllcms, gnome-keyring, gnome-clocks, ibus, libavif, webp-pixbuf-loader (gnome-shell)
2023-05-24 03:57:35 +00:00
# fixes: "gdbus-codegen not found or executable"
2023-12-04 07:42:11 +00:00
# gnome-session = mvToNativeInputs [ glib ] super.gnome-session;
2023-08-04 05:20:20 +00:00
# gnome-terminal = super.gnome-terminal.overrideAttrs (orig: {
# # 2023/07/31: upstreaming is blocked on argyllcms, apache-httpd, gnome-keyring, libavif, gnome-clocks, ibus, webp-pixbuf-loader
# # fixes "meson.build:343:0: ERROR: Dependency "libpcre2-8" not found, tried pkgconfig"
2023-12-04 07:42:11 +00:00
# buildInputs = orig.buildInputs ++ [ pcre2 ];
2023-08-04 05:20:20 +00:00
# });
2023-08-01 21:48:25 +00:00
# 2023/07/31: upstreaming is blocked on apache-httpd
2023-05-24 03:57:35 +00:00
# fixes: meson.build:111:6: ERROR: Program 'glib-compile-schemas' not found or not executable
2023-12-04 07:42:11 +00:00
# gnome-user-share = addNativeInputs [ glib ] super.gnome-user-share;
2023-12-04 12:08:58 +00:00
2024-02-27 16:44:47 +00:00
# mutter = super.mutter.overrideAttrs (orig: {
# # 2024/02/27: upstreaming is blocked on appstream, possibly others
# # N.B.: not all of this suitable to upstreaming, as-is.
# # mesa and xorgserver are removed here because they *themselves* don't build for `buildPackages` (temporarily: 2023/10/26)
# nativeBuildInputs = lib.subtractLists [ mesa xorg.xorgserver ] orig.nativeBuildInputs;
# buildInputs = orig.buildInputs ++ [
# mesa # fixes "meson.build:237:2: ERROR: Dependency "gbm" not found, tried pkgconfig"
# libGL # fixes "meson.build:184:11: ERROR: Dependency "gl" not found, tried pkgconfig and system"
# ];
# # Run-time dependency gi-docgen found: NO (tried pkgconfig and cmake)
# mesonFlags = lib.remove "-Ddocs=true" orig.mesonFlags;
# outputs = lib.remove "devdoc" orig.outputs;
# postInstall = lib.replaceStrings [ "${glib.dev}" ] [ "${buildPackages.glib.dev}" ] orig.postInstall;
# });
2023-11-22 05:01:34 +00:00
# nautilus = (
2023-11-22 08:32:14 +00:00
# # 2023/11/21: upstreaming is blocked on apache-httpd, webp-pixbuf-loader, qtsvg
2023-11-22 05:01:34 +00:00
# addInputs {
# # fixes: "meson.build:123:0: ERROR: Dependency "libxml-2.0" not found, tried pkgconfig"
2023-12-04 07:42:11 +00:00
# buildInputs = [ libxml2 ];
2023-11-22 05:01:34 +00:00
# # fixes: "meson.build:226:6: ERROR: Program 'gtk-update-icon-cache' not found or not executable"
2023-12-04 07:42:11 +00:00
# nativeBuildInputs = [ gtk4 ];
2023-11-22 05:01:34 +00:00
# }
# );
2023-05-24 03:57:35 +00:00
} ) ;
2024-02-01 15:44:46 +00:00
# gnome2 = prev.gnome2.overrideScope (self: super: {
2024-05-31 09:04:16 +00:00
# # 2024/05/31: upstreaming is blocked on gconf (ORBit2)
2023-07-31 03:04:26 +00:00
# # gnome_vfs = (
# # # fixes: "configure: error: gconftool-2 executable not found in your path - should be installed with GConf"
# # # new error: "configure: error: cannot run test program while cross compiling"
# # mvToNativeInputs [ self.GConf ] super.gnome_vfs
# # );
# });
2023-05-24 03:57:35 +00:00
2023-10-24 16:53:24 +00:00
# out for PR: <https://github.com/NixOS/nixpkgs/pull/263182>
# hspell = prev.hspell.overrideAttrs (upstream: {
# # build perl is needed by the Makefile,
# # but $out/bin/multispell (which is simply copied from src) should use host perl
2023-12-04 07:42:11 +00:00
# buildInputs = (upstream.buildInputs or []) ++ [ perl ];
2023-10-24 16:53:24 +00:00
# postInstall = ''
# patchShebangs --update $out/bin/multispell
# '';
# });
2023-10-11 20:58:09 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked
2024-05-13 16:03:46 +00:00
# hyprland = mvToNativeInputs [ hwdata ] prev.hyprland;
2024-03-13 15:02:21 +00:00
# hyprland = prev.hyprland.overrideAttrs (_: {
# depsBuildBuild = [ pkg-config ];
# });
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on gconf
2023-05-24 03:57:35 +00:00
# "setup: line 1595: ant: command not found"
2023-12-04 07:42:11 +00:00
# i2p = mvToNativeInputs [ ant gettext ] prev.i2p;
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked (see `pkgs/patched/ibus`)
2024-05-31 06:59:32 +00:00
# ibus = prev.ibus.overrideAttrs (upstream: {
2023-05-24 03:57:35 +00:00
# nativeBuildInputs = upstream.nativeBuildInputs or [] ++ [
2023-12-04 07:42:11 +00:00
# glib # fixes: ImportError: /nix/store/fi1rsalr11xg00dqwgzbf91jpl3zwygi-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
# buildPackages.gobject-introspection # fixes "_giscanner.cpython-310-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory"
2023-05-24 03:57:35 +00:00
# ];
2023-12-04 07:42:11 +00:00
# buildInputs = lib.remove gobject-introspection upstream.buildInputs ++ [
# vala # fixes: "Package `ibus-1.0' not found in specified Vala API directories or GObject-Introspection GIR directories"
2023-05-24 03:57:35 +00:00
# ];
# });
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on appstream, qtsvg, lua, unicode-collation, etc
2023-11-27 09:48:37 +00:00
iotas = prev . iotas . overrideAttrs ( _ : {
# error: "<iotas> is not allowed to refer to the following paths: <build python>"
# disallowedReferences = [];
postPatch = ''
# @PYTHON@ becomes the build python, but this file isn't executable anyway so shouldn't have a shebang
substituteInPlace iotas/const.py.in \
2024-05-19 23:24:07 +00:00
- - replace-fail ' #!@PYTHON@' ""
2023-11-27 09:48:37 +00:00
'' ;
} ) ;
2023-11-22 05:01:34 +00:00
# jellyfin-media-player = mvToBuildInputs
2023-12-04 07:42:11 +00:00
# [ libsForQt5.wrapQtAppsHook ] # this shouldn't be: but otherwise we get mixed qtbase deps
2023-11-22 05:01:34 +00:00
# (prev.jellyfin-media-player.overrideAttrs (upstream: {
# meta = upstream.meta // {
# platforms = upstream.meta.platforms ++ [
# "aarch64-linux"
# ];
# };
# }));
# jellyfin-media-player-qt6 = prev.jellyfin-media-player-qt6.overrideAttrs (upstream: {
# # nativeBuildInputs => result targets x86.
# # buildInputs => result targets correct platform, but doesn't wrap the runtime deps
# # TODO: fix the hook in qt6 itself?
2023-12-04 07:42:11 +00:00
# depsHostHost = upstream.depsHostHost or [] ++ [ qt6.wrapQtAppsHook ];
# nativeBuildInputs = lib.remove [ qt6.wrapQtAppsHook ] upstream.nativeBuildInputs;
2023-11-22 05:01:34 +00:00
# });
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2023-12-05 05:16:40 +00:00
komikku = prev . komikku . overrideAttrs ( upstream : {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
postPatch = ( upstream . postPatch or " " ) + ''
2024-05-19 23:24:07 +00:00
substituteInPlace data/meson.build - - replace-fail \
2023-12-05 05:16:40 +00:00
" f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) " \
2024-05-08 08:45:41 +00:00
" ' e n v ' , ' G I _ T Y P E L I B _ P A T H = ${ typelibPath [
buildPackages . gdk-pixbuf
buildPackages . glib
buildPackages . graphene
buildPackages . gtk4
buildPackages . harfbuzz
buildPackages . libadwaita
buildPackages . pango
] } ' , find_program ( ' blueprint-compiler' ) "
2023-12-05 05:16:40 +00:00
'' ;
2023-11-30 13:40:51 +00:00
} ) ;
2024-05-31 06:59:32 +00:00
# koreader = prev.koreader.overrideAttrs (upstream: {
2023-11-22 05:01:34 +00:00
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
2023-12-04 07:42:11 +00:00
# autoPatchelfHook
2023-11-22 05:01:34 +00:00
# ];
# });
2023-11-24 08:57:20 +00:00
2023-12-19 19:39:11 +00:00
lemoa = prev . lemoa . overrideAttrs ( upstream :
let
rustTargetPlatform = rust . toRustTarget stdenv . hostPlatform ;
in {
# nixpkgs sets CARGO_BUILD_TARGET to the build platform target, so correct that.
buildPhase = ''
runHook preBuild
mkdir - p target/release
ln - s . . / $ { rustTargetPlatform } /release/lemoa target/release/lemoa
$ { rust . envVars . setEnv } " C A R G O _ B U I L D _ T A R G E T = ${ rustTargetPlatform } " ninja - j $ NIX_BUILD_CORES
runHook postBuild
'' ;
}
) ;
2023-05-24 03:57:35 +00:00
# libgweather = prev.libgweather.overrideAttrs (upstream: {
2023-12-04 07:42:11 +00:00
# nativeBuildInputs = (lib.remove gobject-introspection upstream.nativeBuildInputs) ++ [
# buildPackages.gobject-introspection # fails to fix "gi._error.GError: g-invoke-error-quark: Could not locate g_option_error_quark: /nix/store/dsx6kqmyg7f3dz9hwhz7m3jrac4vn3pc-glib-aarch64-unknown-linux-gnu-2.74.3/lib/libglib-2.0.so.0"
2023-05-24 03:57:35 +00:00
# ];
# # fixes "Run-time dependency vapigen found: NO (tried pkgconfig)"
2023-12-04 07:42:11 +00:00
# buildInputs = upstream.buildInputs ++ [ vala ];
2023-05-24 03:57:35 +00:00
# });
2023-08-28 11:14:51 +00:00
2023-10-24 10:28:01 +00:00
# 2023/08/27: out for PR: <https://github.com/NixOS/nixpkgs/pull/251956>
2023-08-28 11:14:51 +00:00
# libgweather = (prev.libgweather.override {
# # we need introspection for bindings, used by e.g.
# # - gnome.gnome-weather (javascript)
# # - sane-weather (python)
# #
# # enabling introspection on cross is tricky because `gen_locations_variant.py`
# # outputs binary files (Locations.bin) which use the endianness of the build machine
# # OTOH, aarch64 and x86_64 have same endianness: why not just ignore the issue, then?
# # upstream issue (loosely related): <https://gitlab.gnome.org/GNOME/libgweather/-/issues/154>
# withIntrospection = true;
# }).overrideAttrs (upstream: {
# # TODO: the `is_cross_build` change to meson.build is in nixpkgs, but specifies the wrong filepath
# # (libgweather/meson.build instead of meson.build)
# postPatch = (upstream.postPatch or "") + ''
# sed -i '2i import os; os.environ["GI_TYPELIB_PATH"] = ""' build-aux/meson/gen_locations_variant.py
# substituteInPlace meson.build \
# --replace "g_ir_scanner.found() and not meson.is_cross_build()" "g_ir_scanner.found()"
# substituteInPlace libgweather/meson.build \
# --replace "dependency('vapigen'," "dependency('vapigen', native:true,"
# '';
# });
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on appstream
2024-02-27 16:44:47 +00:00
# libpanel = prev.libpanel.overrideAttrs (upstream: {
# doCheck = false;
# # depsBuildBuild = (upstream.depsBuildBuild or []) ++ [
# # # fixes "Build-time dependency gi-docgen found: NO (tried pkgconfig and cmake)"
# # pkg-config
# # ];
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
# buildPackages.gtk4 # fixes "ERROR: Program 'gtk-update-icon-cache' not found or not executable"
# ];
# # it can't figure out where gi-docgen lives
# mesonFlags = (upstream.mesonFlags or []) ++ [
# "-Ddocs=disabled"
# ];
# outputs = lib.remove "devdoc" upstream.outputs;
# });
2023-11-22 03:36:36 +00:00
2024-02-01 15:44:46 +00:00
# libsForQt5 = prev.libsForQt5.overrideScope (self: super: {
2023-06-08 08:26:45 +00:00
# phonon = super.phonon.overrideAttrs (orig: {
# # fixes "ECM (required version >= 5.60), Extra CMake Modules"
2023-12-04 07:42:11 +00:00
# buildInputs = orig.buildInputs ++ [ extra-cmake-modules ];
2023-06-08 08:26:45 +00:00
# });
# });
2024-02-01 15:44:46 +00:00
# libsForQt5 = prev.libsForQt5.overrideScope (self: super: {
2023-06-08 20:01:21 +00:00
# # emulate all the qt5 packages, but rework `libsForQt5.callPackage` and `mkDerivation`
# # to use non-emulated stdenv by default.
2023-12-04 07:42:11 +00:00
# mkDerivation = self.mkDerivationWith stdenv.mkDerivation;
# callPackage = self.newScope { inherit (self) qtCompatVersion qtModule srcs; inherit stdenv; };
2023-06-08 20:01:21 +00:00
# });
2023-05-24 03:57:35 +00:00
2024-05-31 06:27:10 +00:00
# 2024/05/31: better fix is to use CMAKE_CROSSCOMPILING_EMULATOR
# - <https://github.com/uninsane/nixpkgs/pull/new/pr-libphonenumber-cross>
# libphonenumber = prev.libphonenumber.overrideAttrs (upstream: {
# # fix that phone number geolocation binary doesn't cross compile.
# # it's CMAKE, and a google project, so the fix to cross compile is unlikely to *ever* make it upstream.
# # see: <https://github.com/google/libphonenumber/pull/2604>
# #
# # the main (only?) user of this library is evolution-data-server,
# # which is consumed by gnome-calender, calls, planify.
# # maybe i can purge EDS from my system somehow.
# # - geary: package doesn't even have EDS as an input; it speaks to it over dbus.
# # - calls: package has EDS as input (unused?); speaks to it over dbus.
# # - it actually needs EDS though, for its `libebook-contacts` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libebook-contacts/>
# # - gnome-calendar: package has EDS as input (unused?); speaks to it over dbus.
# # - it actually needs EDS though, for its `libedataserverui4` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libedataserverui4/>
# # - planify: package has EDS as input (unused?); speaks to it over dbus.
# # - it actually needs EDS though, for its `libecal` library: <https://gnome.pages.gitlab.gnome.org/evolution-data-server/libecal/>
# # - it could be using evolution-data-server-gtk4 instead of EDS gtk3 though
# #
# # or build EDS with `-DWITH_PHONENUMBER=OFF`
# cmakeFlags = (upstream.cmakeFlags or []) ++ [
# "-DPROTOC_BIN=${lib.getExe buildPackages.protobuf}"
# "-DBUILD_GEOCODER=OFF"
# ];
# });
2024-05-30 21:40:11 +00:00
2024-06-07 07:31:27 +00:00
# upstreaming: <https://github.com/NixOS/nixpkgs/pull/317477>
libvpx = prev . libvpx . overrideAttrs ( upstream : {
# fails building neon extensions for armv7l; see <https://github.com/NixOS/nixpkgs/issues/208746>
configureFlags = builtins . map ( lib . replaceStrings [ " a r m v 7 l - l i n u x - g c c " ] [ " a r m v 7 - l i n u x - g c c " ] ) upstream . configureFlags ;
} ) ;
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming blocked on qtsvg, libgweather, appstream, glycin-loaders
2024-05-19 22:33:00 +00:00
loupe = prev . loupe . overrideAttrs ( upstream : {
2023-12-13 02:00:43 +00:00
postPatch = ( upstream . postPatch or " " ) + ''
substituteInPlace src/meson.build \
2024-05-19 23:24:07 +00:00
- - replace-fail " c a r g o , ' b u i l d ' , " " ' ${ lib . getExe crossCargo } ' , ' b u i l d ' , " \
- - replace-fail " ' s r c ' / r u s t _ t a r g e t " " ' s r c ' / ' ${ rust . envVars . rustHostPlatformSpec } ' / r u s t _ t a r g e t "
2023-12-13 02:00:43 +00:00
'' ;
} ) ;
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming blocked on qtsvg, appstream, maybe others
2023-08-11 05:02:42 +00:00
mepo = ( prev . mepo . override {
2024-06-07 09:08:24 +00:00
# nixpkgs mepo correctly puts `zig_0_12.hook` in nativeBuildInputs,
2023-08-11 05:02:42 +00:00
# but for some reason that tries to use the host zig instead of the build zig.
2024-06-07 09:08:24 +00:00
zig_0_12 = buildPackages . zig_0_12 ;
2023-08-11 05:02:42 +00:00
} ) . overrideAttrs ( upstream : {
2023-08-08 00:14:40 +00:00
dontUseZigCheck = true ;
2023-08-06 08:09:13 +00:00
nativeBuildInputs = upstream . nativeBuildInputs ++ [
2023-08-12 02:44:14 +00:00
# zig hardcodes the /lib/ld-linux.so interpreter which breaks nix dynamic linking & dep tracking.
# this shouldn't have to be buildPackages.autoPatchelfHook...
# but without specifying `buildPackages` the host coreutils ends up on the builder's path and breaks things
2023-12-04 07:42:11 +00:00
buildPackages . autoPatchelfHook
2023-08-15 05:38:11 +00:00
# zig hard-codes `pkg-config` inside lib/std/build.zig
2023-12-04 07:42:11 +00:00
( buildPackages . writeShellScriptBin " p k g - c o n f i g " ''
2023-08-06 08:09:13 +00:00
exec $ PKG_CONFIG $ @
'' )
] ;
postPatch = ( upstream . postPatch or " " ) + ''
substituteInPlace src/sdlshim.zig \
2024-05-19 23:24:07 +00:00
- - replace-fail ' cInclude ( " S D L 2 / S D L 2 _ g f x P r i m i t i v e s . h " ) ' ' cInclude ( " S D L 2 _ g f x P r i m i t i v e s . h " ) ' \
- - replace-fail ' cInclude ( " S D L 2 / S D L _ i m a g e . h " ) ' ' cInclude ( " S D L _ i m a g e . h " ) ' \
- - replace-fail ' cInclude ( " S D L 2 / S D L _ t t f . h " ) ' ' cInclude ( " S D L _ t t f . h " ) '
2023-08-06 08:09:13 +00:00
substituteInPlace build . zig \
2024-05-19 23:24:07 +00:00
- - replace-fail ' step . linkSystemLibrary ( " c u r l " ) ' ' step . linkSystemLibrary ( " l i b c u r l " ) '
2023-08-06 08:09:13 +00:00
'' ;
2023-08-08 00:14:40 +00:00
# skip the mepo -docman self-documenting invocation
postInstall = ''
install - d $ out/share/man/man1
'' ;
2023-08-06 08:09:13 +00:00
# optional `zig build` debugging flags:
# - --verbose
# - --verbose-cimport
# - --help
2023-08-08 00:14:40 +00:00
zigBuildFlags = [ " - D t a r g e t = a a r c h 6 4 - l i n u x - g n u " ] ;
2023-08-06 08:09:13 +00:00
} ) ;
2023-05-24 03:57:35 +00:00
# fixes: "ar: command not found"
# `ar` is provided by bintools
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked by deps; but turns out to not be this simple
2024-05-31 08:21:23 +00:00
# ncftp = addNativeInputs [ bintools ] prev.ncftp;
2023-05-24 03:57:35 +00:00
# fixes "gdbus-codegen: command not found"
2023-10-24 16:53:55 +00:00
# 2023/07/31: upstreaming is blocked on p11-kit, openfortivpn, qttranslations (qtbase) cross compilation
2023-12-04 07:42:11 +00:00
# networkmanager-fortisslvpn = mvToNativeInputs [ glib ] prev.networkmanager-fortisslvpn;
2023-05-24 03:57:35 +00:00
# networkmanager-iodine = prev.networkmanager-iodine.overrideAttrs (orig: {
# # fails to fix "configure.ac:58: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT"
2023-12-04 07:42:11 +00:00
# nativeBuildInputs = orig.nativeBuildInputs ++ [ gettext ];
2023-05-24 03:57:35 +00:00
# });
2023-12-04 07:42:11 +00:00
# networkmanager-iodine = addNativeInputs [ gettext ] prev.networkmanager-iodine;
2023-05-24 03:57:35 +00:00
# networkmanager-iodine = prev.networkmanager-iodine.overrideAttrs (upstream: {
2023-12-04 07:42:11 +00:00
# # buildInputs = upstream.buildInputs ++ [ intltool gettext ];
# # nativeBuildInputs = lib.remove intltool upstream.nativeBuildInputs;
# # nativeBuildInputs = upstream.nativeBuildInputs ++ [ gettext ];
2023-05-24 03:57:35 +00:00
# postPatch = upstream.postPatch or "" + ''
# sed -i s/AM_GLIB_GNU_GETTEXT/AM_GNU_GETTEXT/ configure.ac
# '';
# });
# fixes "gdbus-codegen: command not found"
# fixes "gtk4-builder-tool: command not found"
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on qtsvg
2023-12-04 07:42:11 +00:00
# networkmanager-l2tp = addNativeInputs [ gtk4 ]
# (mvToNativeInputs [ glib ] prev.networkmanager-l2tp);
2023-05-24 03:57:35 +00:00
# fixes "properties/gresource.xml: Permission denied"
# - by providing glib-compile-resources
2023-08-01 21:48:25 +00:00
# 2023/07/31: upstreaming is blocked on libavif cross compilation
2023-12-04 07:42:11 +00:00
# networkmanager-openconnect = mvToNativeInputs [ glib ] prev.networkmanager-openconnect;
2023-05-24 03:57:35 +00:00
# fixes "properties/gresource.xml: Permission denied"
# - by providing glib-compile-resources
2023-08-01 21:48:25 +00:00
# 2023/07/31: upstreaming is unblocked,implemented
2023-12-04 07:42:11 +00:00
# networkmanager-openvpn = mvToNativeInputs [ glib ] prev.networkmanager-openvpn;
2023-08-01 21:48:25 +00:00
# 2023/07/31: upstreaming is unblocked,implemented
# networkmanager-sstp = (
# # fixes "gdbus-codegen: command not found"
2023-12-04 07:42:11 +00:00
# mvToNativeInputs [ glib ] (
2023-08-01 21:48:25 +00:00
# # fixes gtk4-builder-tool wrong format
2023-12-04 07:42:11 +00:00
# addNativeInputs [ gtk4.dev ] prev.networkmanager-sstp
2023-08-01 21:48:25 +00:00
# )
# );
# 2023/07/31: upstreaming is blocked on vpnc cross compilation
2023-12-04 07:42:11 +00:00
# networkmanager-vpnc = mvToNativeInputs [ glib ] prev.networkmanager-vpnc;
2023-05-24 03:57:35 +00:00
# fixes "properties/gresource.xml: Permission denied"
# - by providing glib-compile-resources
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on qtsvg, qtimageformats, qtx11extras
2024-02-27 16:20:55 +00:00
# nheko = (prev.nheko.override {
# gst_all_1 = gst_all_1 // {
# # don't build gst-plugins-good with "qt5 support"
# # alternative build fix is to remove `qtbase` from nativeBuildInputs:
# # - that avoids the mixd qt5 deps, but forces a rebuild of gst-plugins-good and +20MB to closure
# gst-plugins-good.override = attrs: gst_all_1.gst-plugins-good.override (builtins.removeAttrs attrs [ "qt5Support" ]);
# };
# }).overrideAttrs (orig: {
# # fixes "fatal error: lmdb++.h: No such file or directory
# buildInputs = orig.buildInputs ++ [ lmdbxx ];
# });
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming blocked on emacs (and maybe ruby, libgccjit?)
# - previous upstreaming attemt: <https://github.com/NixOS/nixpkgs/pull/225111/files>
2023-08-04 05:20:20 +00:00
# notmuch = prev.notmuch.overrideAttrs (upstream: {
# # fixes "Error: The dependencies of notmuch could not be satisfied" (xapian, gmime, glib, talloc)
# # when cross-compiling, we only have a triple-prefixed pkg-config which notmuch's configure script doesn't know how to find.
# # so just replace these with the nix-supplied env-var which resolves to the relevant pkg-config.
# postPatch = upstream.postPatch or "" + ''
# sed -i 's/pkg-config/\$PKG_CONFIG/g' configure
# '';
2023-12-04 07:42:11 +00:00
# XAPIAN_CONFIG = buildPackages.writeShellScript "xapian-config" ''
# exec ${lib.getBin xapian}/bin/xapian-config $@
2023-08-04 05:20:20 +00:00
# '';
2023-12-04 07:42:11 +00:00
# # depsBuildBuild = [ gnupg ];
2023-08-04 05:20:20 +00:00
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
2023-12-04 07:42:11 +00:00
# gnupg # nixpkgs specifies gpg as a buildInput instead of a nativeBuildInput
# perl # used to build manpages
# # pythonPackages.python
# # shared-mime-info
2023-08-04 05:20:20 +00:00
# ];
2023-12-04 07:42:11 +00:00
# buildInputs = [
2023-08-04 05:20:20 +00:00
# xapian gmime3 talloc zlib # dependencies described in INSTALL
# # perl
# # pythonPackages.python
# ruby # notmuch links against ruby.so
# ];
# # buildInputs =
# # (lib.remove
2023-12-04 07:42:11 +00:00
# # perl
2023-08-04 05:20:20 +00:00
# # (lib.remove
2023-12-04 07:42:11 +00:00
# # gmime
# # (lib.remove gnupg upstream.buildInputs)
2023-08-04 05:20:20 +00:00
# # )
2023-12-04 07:42:11 +00:00
# # ) ++ [ gmime ];
2023-08-04 05:20:20 +00:00
# });
2023-05-24 03:57:35 +00:00
# notmuch = prev.notmuch.overrideAttrs (upstream: {
# # fixes "Error: The dependencies of notmuch could not be satisfied" (xapian, gmime, glib, talloc)
# # when cross-compiling, we only have a triple-prefixed pkg-config which notmuch's configure script doesn't know how to find.
# # so just replace these with the nix-supplied env-var which resolves to the relevant pkg-config.
# postPatch = upstream.postPatch or "" + ''
# sed -i 's/pkg-config/\$PKG_CONFIG/g' configure
2023-12-04 07:42:11 +00:00
# sed -i 's: gpg : ${buildPackages.gnupg}/bin/gpg :' configure
2023-05-24 03:57:35 +00:00
# '';
2023-12-04 07:42:11 +00:00
# XAPIAN_CONFIG = buildPackages.writeShellScript "xapian-config" ''
# exec ${lib.getBin xapian}/bin/xapian-config $@
2023-05-24 03:57:35 +00:00
# '';
# # depsBuildBuild = upstream.depsBuildBuild or [] ++ [
2023-12-04 07:42:11 +00:00
# # buildPackages.stdenv.cc
2023-05-24 03:57:35 +00:00
# # ];
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
2023-12-04 07:42:11 +00:00
# # gnupg
# perl
2023-05-24 03:57:35 +00:00
# ];
2023-12-04 07:42:11 +00:00
# # buildInputs = lib.remove gnupg upstream.buildInputs;
2023-05-24 03:57:35 +00:00
# });
2024-06-14 03:28:34 +00:00
pantheon = prev . pantheon . overrideScope ( self : super : {
# 2024/06/13: upstreaming is blocked by qtsvg/ffado
switchboard-plug-network = super . switchboard-plug-network . overrideAttrs ( upstream : {
nativeBuildInputs = upstream . nativeBuildInputs ++ [
buildPackages . gettext # <for msgfmt
] ;
} ) ;
# 2024/06/13: upstreaming is unblocked; implemented on `pr-cross-switchboard-plugs-sound` branch
switchboard-plug-sound = super . switchboard-plug-sound . overrideAttrs ( upstream : {
# depsBuildBuild = (upstream.depsBuildBuild or []) ++ [
# pkg-config #< so that it can find the right gettext/msgfmt
# ];
# everything requires an extra `buildPackages` than if i patched this inside nixpkgs itself: not sure why!
nativeBuildInputs = upstream . nativeBuildInputs ++ [
buildPackages . gettext #< for msgfmt
# gettext #< for msgfmt
buildPackages . glib
] ;
env . PKG_CONFIG_GIO_2_0_GLIB_COMPILE_RESOURCES = " ${ lib . getDev buildPackages . buildPackages . glib } / b i n / g l i b - c o m p i l e - r e s o u r c e s " ;
strictDeps = true ;
} ) ;
} ) ;
2023-05-24 03:57:35 +00:00
# fixes (meson) "Program 'glib-mkenums mkenums' not found or not executable"
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on appstream, libgweather, qtsvg
2024-02-27 16:20:55 +00:00
# phoc = mvToNativeInputs [ wayland-scanner glib ] prev.phoc;
# phosh = prev.phosh.overrideAttrs (upstream: {
# buildInputs = upstream.buildInputs ++ [
# libadwaita # "plugins/meson.build:41:2: ERROR: Dependency "libadwaita-1" not found, tried pkgconfig"
# ];
# mesonFlags = upstream.mesonFlags ++ [
# "-Dphoc_tests=disabled" # "tests/meson.build:20:0: ERROR: Program 'phoc' not found or not executable"
# ];
# # postPatch = upstream.postPatch or "" + ''
# # sed -i 's:gio_querymodules = :gio_querymodules = "${buildPackages.glib.dev}/bin/gio-querymodules" if True else :' build-aux/post_install.py
# # '';
# });
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on qtsvg, libgweather, webp-pixbuf-loader, appstream, gnome-color-manager, apache-httpd, ibus, freerdp (mostly gnome-shell i think)
2024-02-27 16:20:55 +00:00
# phosh-mobile-settings = mvInputs {
# # fixes "meson.build:26:0: ERROR: Dependency "phosh-plugins" not found, tried pkgconfig"
# # phosh is used only for its plugins; these are specified as a runtime dep in src.
# # it's correct for them to be runtime dep: src/ms-lockscreen-panel.c loads stuff from
# buildInputs = [ phosh ];
# nativeBuildInputs = [
# gettext # fixes "data/meson.build:1:0: ERROR: Program 'msgfmt' not found or not executable"
# wayland-scanner # fixes "protocols/meson.build:7:0: ERROR: Program 'wayland-scanner' not found or not executable"
# glib # fixes "src/meson.build:1:0: ERROR: Program 'glib-mkenums mkenums' not found or not executable"
# desktop-file-utils # fixes "meson.build:116:8: ERROR: Program 'update-desktop-database' not found or not executable"
# ];
# } prev.phosh-mobile-settings;
2023-08-16 10:20:31 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on qtsvg, appstream
2023-12-13 20:02:48 +00:00
pwvucontrol = prev . pwvucontrol . overrideAttrs ( upstream :
let
rustTargetPlatform = rust . toRustTarget stdenv . hostPlatform ;
in {
postPatch = ( upstream . postPatch or " " ) + ''
2024-05-19 23:24:07 +00:00
substituteInPlace src/meson.build - - replace-fail \
2023-12-13 20:02:48 +00:00
" ' s r c ' / r u s t _ t a r g e t " \
" ' s r c ' / ' ${ rustTargetPlatform } ' / r u s t _ t a r g e t "
'' ;
# nixpkgs sets CARGO_BUILD_TARGET to the build platform target, so correct that.
buildPhase = ''
runHook preBuild
$ { rust . envVars . setEnv } " C A R G O _ B U I L D _ T A R G E T = ${ rustTargetPlatform } " ninja - j $ NIX_BUILD_CORES
runHook postBuild
'' ;
} ) ;
2023-08-06 08:15:47 +00:00
# libsForQt5 = prev.libsForQt5.overrideScope (self: super: {
2023-12-04 07:42:11 +00:00
# inherit stdenv;
2023-08-06 08:15:47 +00:00
# inherit (self.stdenv) mkderivation;
# });
2024-02-01 15:44:46 +00:00
# qt6 = prev.qt6.overrideScope (self: super: {
2023-08-01 22:44:53 +00:00
# # qtbase = super.qtbase.overrideAttrs (upstream: {
2023-12-04 07:42:11 +00:00
# # # cmakeFlags = upstream.cmakeFlags ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
# # cmakeFlags = upstream.cmakeFlags ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
2023-08-01 22:44:53 +00:00
# # # "-DCMAKE_CROSSCOMPILING=True" # fails to solve QT_HOST_PATH error
2023-12-04 07:42:11 +00:00
# # "-DQT_HOST_PATH=${buildPackages.qt6.full}"
2023-08-01 22:44:53 +00:00
# # ];
# # });
# # qtModule = args: (super.qtModule args).overrideAttrs (upstream: {
# # # the nixpkgs comment about libexec seems to be outdated:
# # # it's just that cross-compiled syncqt.pl doesn't get its #!/usr/bin/env shebang replaced.
# # preConfigure = lib.replaceStrings
# # ["${lib.getDev self.qtbase}/libexec/syncqt.pl"]
# # ["perl ${lib.getDev self.qtbase}/libexec/syncqt.pl"]
# # upstream.preConfigure;
# # });
# # # qtwayland = super.qtwayland.overrideAttrs (upstream: {
# # # preConfigure = "fixQtBuiltinPaths . '*.pr?'";
# # # });
# # # qtwayland = super.qtwayland.override {
# # # inherit (self) qtbase;
# # # };
2023-06-08 05:11:06 +00:00
2023-08-01 22:44:53 +00:00
# qtwebengine = super.qtwebengine.overrideAttrs (upstream: {
2023-12-04 07:42:11 +00:00
# # depsBuildBuild = upstream.depsBuildBuild or [] ++ [ pkg-config ];
2023-08-01 22:44:53 +00:00
# # XXX: qt seems to use its own terminology for "host" and "target":
# # - <https://www.qt.io/blog/qt6-development-hosts-and-targets>
# # - "host" = machine invoking the compiler
# # - "target" = machine on which the resulting qtwebengine.so binaries will run
# # XXX: NIX_CFLAGS_COMPILE_<machine> is how we get the `-isystem <dir>` flags.
# # probably we shouldn't blindly copy these from host machine to build machine,
# # as the headers could reasonably make different assumptions.
# preConfigure = upstream.preConfigure + ''
# # export PKG_CONFIG_HOST="$PKG_CONFIG"
# export PKG_CONFIG_HOST="$PKG_CONFIG_FOR_BUILD"
# # expose -isystem <zlib> to x86 builds
# export NIX_CFLAGS_COMPILE_x86_64_unknown_linux_gnu="$NIX_CFLAGS_COMPILE"
2023-12-04 07:42:11 +00:00
# export NIX_LDFLAGS_x86_64_unknown_linux_gnu="-L${buildPackages.zlib}/lib"
2023-08-01 22:44:53 +00:00
# '';
# patches = upstream.patches or [] ++ [
# # ./qtwebengine-host-pkg-config.patch
# # alternatively, look at dlopenBuildInputs
# ./qtwebengine-host-cc.patch
# ];
# # patch the qt pkg-config script to show us more debug info
# postPatch = upstream.postPatch or "" + ''
# sed -i s/options.debug/True/g src/3rdparty/chromium/build/config/linux/pkg-config.py
# '';
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
2023-12-04 07:42:11 +00:00
# bintools-unwrapped # for readelf
# buildPackages.cups # for cups-config
# buildPackages.fontconfig
# buildPackages.glib
# buildPackages.harfbuzz
# buildPackages.icu
# buildPackages.libjpeg
# buildPackages.libpng
# buildPackages.libwebp
# buildPackages.nss
# # gcc-unwrapped.libgcc # for libgcc_s.so
# buildPackages.zlib
2023-08-01 22:44:53 +00:00
# ];
2023-12-04 07:42:11 +00:00
# depsBuildBuild = upstream.depsBuildBuild or [] ++ [ pkg-config ];
2023-08-01 22:44:53 +00:00
# # buildInputs = upstream.buildInputs ++ [
2023-12-04 07:42:11 +00:00
# # gcc-unwrapped.libgcc # for libgcc_s.so. this gets loaded during build, suggesting i surely messed something up
2023-08-01 22:44:53 +00:00
# # ];
# # buildInputs = upstream.buildInputs ++ [
2023-12-04 07:42:11 +00:00
# # gcc-unwrapped.libgcc
2023-08-01 22:44:53 +00:00
# # ];
# # nativeBuildInputs = upstream.nativeBuildInputs ++ [
2023-12-04 07:42:11 +00:00
# # icu
2023-08-01 22:44:53 +00:00
# # ];
# # buildInputs = upstream.buildInputs ++ [
2023-12-04 07:42:11 +00:00
# # icu
2023-08-01 22:44:53 +00:00
# # ];
# # env.NIX_DEBUG="1";
# # env.NIX_DEBUG="7";
# # cmakeFlags = lib.remove "-DQT_FEATURE_webengine_system_icu=ON" upstream.cmakeFlags;
2023-12-04 07:42:11 +00:00
# cmakeFlags = upstream.cmakeFlags ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# # "--host-cc=${buildPackages.stdenv.cc}/bin/cc"
# # "--host-cxx=${buildPackages.stdenv.cc}/bin/c++"
2023-08-01 22:44:53 +00:00
# # these are my own vars, used by my own patch
2023-12-04 07:42:11 +00:00
# "-DCMAKE_HOST_C_COMPILER=${buildPackages.stdenv.cc}/bin/gcc"
# "-DCMAKE_HOST_CXX_COMPILER=${buildPackages.stdenv.cc}/bin/g++"
# "-DCMAKE_HOST_AR=${buildPackages.stdenv.cc}/bin/ar"
# "-DCMAKE_HOST_NM=${buildPackages.stdenv.cc}/bin/nm"
2023-08-01 22:44:53 +00:00
# ];
# });
# });
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked; requires some changes, as configure tries to invoke our `python`
2023-08-01 08:07:27 +00:00
# implemented (broken) on servo cross-staging-2023-07-30 branch
2024-04-19 20:35:18 +00:00
# rpm = prev.rpm.overrideAttrs (upstream: {
# # fixes "python too old". might also be specifiable as a configure flag?
# env = upstream.env // lib.optionalAttrs (upstream.version == "4.18.1") {
# # 4.19.0 upgrade should fix cross compilation.
# # see: <https://github.com/NixOS/nixpkgs/pull/260558>
# PYTHON = python3.interpreter;
# };
# });
2023-07-31 01:13:15 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2024-05-19 22:33:00 +00:00
snapshot = prev . snapshot . overrideAttrs ( upstream : {
2024-05-19 10:32:05 +00:00
# fixes "error: linker `cc` not found"
postPatch = ( upstream . postPatch or " " ) + ''
substituteInPlace src/meson.build \
2024-05-19 23:24:07 +00:00
- - replace-fail " c a r g o , ' b u i l d ' , " " ' ${ lib . getExe crossCargo } ' , ' b u i l d ' , " \
- - replace-fail " ' s r c ' / r u s t _ t a r g e t " " ' s r c ' / ' ${ rust . envVars . rustHostPlatformSpec } ' / r u s t _ t a r g e t "
2024-05-19 10:32:05 +00:00
'' ;
} ) ;
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2023-11-10 22:12:00 +00:00
spot = prev . spot . overrideAttrs ( upstream :
let
2023-12-04 07:42:11 +00:00
rustTargetPlatform = rust . toRustTarget stdenv . hostPlatform ;
2023-11-10 22:12:00 +00:00
in {
2024-04-26 21:07:35 +00:00
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
2023-11-10 22:12:00 +00:00
postPatch = ( upstream . postPatch or " " ) + ''
2024-04-26 21:07:35 +00:00
substituteInPlace src/meson.build \
- - replace-fail \
" f i n d _ p r o g r a m ( ' b l u e p r i n t - c o m p i l e r ' ) " \
2024-05-08 08:45:41 +00:00
" ' e n v ' , ' G I _ T Y P E L I B _ P A T H = ${ typelibPath [
buildPackages . gdk-pixbuf
buildPackages . glib
buildPackages . graphene
buildPackages . gtk4
buildPackages . harfbuzz
buildPackages . libadwaita
buildPackages . pango
] } ' , find_program ( ' blueprint-compiler' ) " \
2024-04-26 21:07:35 +00:00
- - replace-fail \
" m e s o n . p r o j e c t _ b u i l d _ r o o t ( ) / c a r g o _ o u t p u t " \
" m e s o n . p r o j e c t _ b u i l d _ r o o t ( ) / ' s r c ' / ' ${ rust . envVars . rustHostPlatformSpec } ' / r u s t _ t a r g e t / m e s o n . p r o j e c t _ n a m e ( ) "
2023-11-10 22:12:00 +00:00
'' ;
# nixpkgs sets CARGO_BUILD_TARGET to the build platform target, so correct that.
buildPhase = ''
runHook preBuild
2023-12-04 07:42:11 +00:00
$ { rust . envVars . setEnv } " C A R G O _ B U I L D _ T A R G E T = ${ rustTargetPlatform } " ninja - j $ NIX_BUILD_CORES
2023-11-10 22:12:00 +00:00
runHook postBuild
'' ;
}
) ;
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked
2024-02-27 14:53:26 +00:00
# squeekboard = prev.squeekboard.overrideAttrs (upstream: {
# # 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."
# # NB(2023/03/04): upstream nixpkgs has a new squeekboard that's closer to cross-compiling; use that
# # NB(2023/08/24): this emulates the entire rust build process
# mesonFlags =
# let
# # ERROR: 'rust' compiler binary not defined in cross or native file
# crossFile = writeText "cross-file.conf" ''
# [binaries]
# rust = [ 'rustc', '--target', '${rust.toRustTargetSpec stdenv.hostPlatform}' ]
# '';
# in
# # upstream.mesonFlags or [] ++
# [
# "-Dtests=false"
# "-Dnewer=true"
# "-Donline=false"
# ]
# ++ lib.optional
# (stdenv.hostPlatform != stdenv.buildPlatform)
# "--cross-file=${crossFile}"
# ;
# # cargoDeps = null;
# # cargoVendorDir = "vendor";
# # depsBuildBuild = (upstream.depsBuildBuild or []) ++ [
# # pkg-config
# # ];
# # this is identical to upstream, but somehow build fails if i remove it??
# nativeBuildInputs = [
# meson
# ninja
# pkg-config
# glib
# wayland
# rustPlatform.cargoSetupHook
2023-07-31 03:04:26 +00:00
# cargo
2024-02-27 14:53:26 +00:00
# rustc
# ];
# });
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2023-12-05 06:02:38 +00:00
tangram = prev . tangram . overrideAttrs ( upstream : {
# blueprint-compiler runs on the build machine, but tries to load gobject-introspection types meant for the host.
# additionally, gsjpack has a shebang for the host gjs. patchShebangs --build doesn't fix that: just manually specify the build gjs
2023-07-28 10:14:53 +00:00
postPatch = ( upstream . postPatch or " " ) + ''
substituteInPlace src/meson.build \
2024-05-19 23:24:07 +00:00
- - replace-fail " f i n d _ p r o g r a m ( ' g j s ' ) . f u l l _ p a t h ( ) " " ' ${ gjs } / b i n / g j s ' " \
- - replace-fail " g j s p a c k , " " ' e n v ' , ' G I _ T Y P E L I B _ P A T H = ${ typelibPath [
2024-05-08 08:45:41 +00:00
buildPackages . gdk-pixbuf
buildPackages . glib
buildPackages . graphene
buildPackages . gtk4
buildPackages . harfbuzz
buildPackages . libadwaita
buildPackages . pango
] } ' , ' $ { buildPackages . gjs } /bin/gjs ' , ' - m' , gjspack , "
2023-07-28 10:14:53 +00:00
'' ;
2023-12-05 06:02:38 +00:00
} ) ;
2023-08-03 00:39:18 +00:00
2023-05-24 03:57:35 +00:00
# fixes: "ar: command not found"
# `ar` is provided by bintools
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on gnustep-base cross compilation
2024-05-31 08:21:23 +00:00
# unar = addNativeInputs [ bintools ] prev.unar;
2023-08-04 05:20:20 +00:00
# unixODBCDrivers = prev.unixODBCDrivers // {
# # TODO: should this package be deduped with toplevel psqlodbc in upstream nixpkgs?
# psql = prev.unixODBCDrivers.psql.overrideAttrs (_upstream: {
# # XXX: these are both available as configureFlags, if we prefer that (we probably do, so as to make them available only during specific parts of the build).
2023-12-04 07:42:11 +00:00
# ODBC_CONFIG = buildPackages.writeShellScript "odbc_config" ''
# exec ${stdenv.hostPlatform.emulator buildPackages} ${unixODBC}/bin/odbc_config $@
2023-08-04 05:20:20 +00:00
# '';
2023-12-04 07:42:11 +00:00
# PG_CONFIG = buildPackages.writeShellScript "pg_config" ''
# exec ${stdenv.hostPlatform.emulator buildPackages} ${postgresql}/bin/pg_config $@
2023-08-04 05:20:20 +00:00
# '';
# });
# };
2023-05-24 03:57:35 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on hdf5, thrift, others
2023-08-04 05:20:20 +00:00
# visidata = prev.visidata.override {
# # hdf5 / h5py don't cross-compile, but i don't use that file format anyway.
# # setting this to null means visidata will work as normal but not be able to load hdf files.
# h5py = null;
# };
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on qtsvg, qtx11extras
2024-02-27 14:53:26 +00:00
# vlc = prev.vlc.overrideAttrs (orig: {
# # fixes: "configure: error: could not find the LUA byte compiler"
# # fixes: "configure: error: protoc compiler needed for chromecast was not found"
# nativeBuildInputs = orig.nativeBuildInputs ++ [ lua5 protobuf ];
# # fix that it can't find the c compiler
# # makeFlags = orig.makeFlags or [] ++ [ "CC=${prev.stdenv.cc.targetPrefix}cc" ];
# env = orig.env // {
# BUILDCC = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
# };
# });
2023-05-24 03:57:35 +00:00
# fixes "perl: command not found"
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked, but requires alternative fix
2023-08-01 08:07:27 +00:00
# - i think the build script tries to run the generated binary?
2024-02-27 16:20:55 +00:00
# vpnc = mvToNativeInputs [ perl ] prev.vpnc;
2023-12-03 13:29:34 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked on appstream
2023-11-22 03:36:50 +00:00
xdg-desktop-portal = prev . xdg-desktop-portal . overrideAttrs ( upstream : {
nativeBuildInputs = upstream . nativeBuildInputs ++ [
# fixes "meson.build:117:8: ERROR: Program 'bwrap' not found or not executable"
2023-12-04 07:42:11 +00:00
bubblewrap
2023-11-22 03:36:50 +00:00
] ; # ++ upstream.nativeCheckInputs;
mesonFlags = ( upstream . mesonFlags or [ ] ) ++ [
# fixes "tests/meson.build:268:9: ERROR: Program 'pytest-3 pytest' not found or not executable"
# nixpkgs should add this whenever doCheck == false, i think
" - D p y t e s t = d i s a b l e d "
] ;
} ) ;
2023-05-24 03:57:35 +00:00
# fixes "No package 'xdg-desktop-portal' found"
2023-12-08 20:08:17 +00:00
# 2023/12/08: upstreaming is blocked on argyllcms, flatpak, qtsvg (via pipewire/ffado)
2023-12-04 07:42:11 +00:00
xdg-desktop-portal-gtk = mvToBuildInputs [ xdg-desktop-portal ] prev . xdg-desktop-portal-gtk ;
2024-05-31 08:21:23 +00:00
2023-05-24 03:57:35 +00:00
# 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"
2023-07-29 10:57:55 +00:00
# 2023/07/27: upstreaming is blocked on p11-kit cross compilation
2024-05-31 08:21:23 +00:00
# xdg-desktop-portal-gnome = (
# addNativeInputs [ wayland-scanner ] (
# mvToNativeInputs [ gettext glib ] prev.xdg-desktop-portal-gnome
# )
# );
2023-08-01 08:07:27 +00:00
2024-05-31 08:02:25 +00:00
# 2024/02/27: upstreaming is blocked on hyprland
2024-02-29 21:35:02 +00:00
# waybar = (prev.waybar.override {
# runTests = false; #< upstream expects `catch2_3` as a runtime requirement
# hyprlandSupport = false; # doesn't cross compile
# # fixes: "/nix/store/sc1pz0zaqwpai24zh7xx0brjinflmc6v-aarch64-unknown-linux-gnu-binutils-2.40/bin/aarch64-unknown-linux-gnu-ld: /nix/store/ghxl1zrfnvh69dmv7xa1swcbyx06va4y-wayland-1.22.0/lib/libwayland-client.so: error adding symbols: file in wrong format"
# wrapGAppsHook = wrapGAppsNoGuiHook;
# }).overrideAttrs (upstream: {
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
# buildPackages.wayland-scanner
# (makeShellWrapper.overrideAttrs (_: {
# # else it tries to invoke the host CC compiler (??)
# shell = runtimeShell;
# }))
# ];
# # buildInputs = upstream.buildInputs ++ [ catch2_3 ]; #< either this or override `runTests = false`
# mesonFlags = upstream.mesonFlags ++ [
# # fixes "Dependency lookup for scdoc with method 'pkgconfig' failed: Pkg-config binary for machine 0 not found. Giving up."
# "-Dman-pages=disabled"
# ];
# });
2024-03-13 15:02:21 +00:00
# waybar = (prev.waybar.override { runTests = false; }).overrideAttrs (upstream: {
# nativeBuildInputs = upstream.nativeBuildInputs ++ [
# wayland-scanner
# ];
# strictDeps = true;
# });
2023-08-15 10:56:07 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked
2024-06-07 07:31:27 +00:00
# implemented: <https://github.com/NixOS/nixpkgs/pull/315119>
2023-05-24 03:57:35 +00:00
webp-pixbuf-loader = prev . webp-pixbuf-loader . overrideAttrs ( upstream : {
# fixes: "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"
# gdk-pixbuf doesn't create a `bin/` directory when cross-compiling, breaks some thumbnailing stuff.
# - gnome's gdk-pixbuf *explicitly* doesn't build thumbnailer on cross builds
# see `librsvg` for a more bullet-proof cross-compilation approach
postInstall = " " ;
} ) ;
# XXX: aarch64 webp-pixbuf-loader wanted by gdk-pixbuf-loaders.cache.drv, wanted by aarch64 gnome-control-center
2023-05-24 05:54:03 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is blocked by qtsvg, appstream
2023-11-10 23:05:12 +00:00
wike = prev . wike . overrideAttrs ( upstream : {
2023-11-27 09:48:37 +00:00
# error: "<wike> is not allowed to refer to the following paths: <build python>"
2023-11-10 23:05:12 +00:00
# wike's meson build script sets host binaries to use build PYTHON
# disallowedReferences = [];
postFixup = ( upstream . postFixup or " " ) + ''
patchShebangs - - update $ out/share/wike/wike-sp
'' ;
} ) ;
2023-12-07 06:38:15 +00:00
# wrapFirefox = prev.wrapFirefox.override {
# buildPackages = buildPackages // {
# # fixes "extract-binary-wrapper-cmd: line 2: strings: command not found"
# # ^- in the `nix log` output of cross-compiled `firefox` (it's non-fatal)
# makeBinaryWrapper = bpkgs.makeBinaryWrapper.overrideAttrs (upstream: {
# passthru.extractCmd = bpkgs.writeShellScript "extract-binary-wrapper-cmd" ''
# ${stdenv.cc.targetPrefix}strings -dw "$1" | sed -n '/^makeCWrapper/,/^$/ p'
# '';
# });
# };
# };
2023-05-25 06:07:05 +00:00
2024-05-31 08:02:25 +00:00
# 2024/05/31: upstreaming is unblocked
2024-05-13 16:47:16 +00:00
# fixes `hostPrograms.moby.neovim` (but breaks eval of `hostPkgs.moby.neovim` :o)
2024-05-13 17:05:14 +00:00
# wrapNeovimUnstable = neovim: config: (prev.wrapNeovimUnstable neovim config).overrideAttrs (upstream: {
# # nvim wrapper has a sanity check that the plugins will load correctly.
# # this is effectively a check phase and should be rewritten as such
# postBuild = lib.replaceStrings
# [ "! $out/bin/nvim-wrapper" ]
# # [ "${stdenv.hostPlatform.emulator buildPackages} $out/bin/nvim-wrapper" ]
# [ "false && $out/bin/nvim-wrapper" ]
# upstream.postBuild;
# });
2023-11-25 05:03:19 +00:00
2024-05-31 08:21:23 +00:00
# 2024/05/31: upstreaming is blocked on unar (gnustep), unless i also make that optional
2023-12-04 07:42:11 +00:00
xarchiver = mvToNativeInputs [ libxslt ] prev . xarchiver ;
2023-05-24 03:57:35 +00:00
}