cross: tidy up the blueprint-compiler patches
deployed and *seems* to be working; i ought to be able to turn these into proper patches over the next few days
This commit is contained in:
@@ -49,18 +49,34 @@ let
|
||||
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 []);
|
||||
mvToDepsBuildBuild = depsBuildBuild: mvInputs { inherit depsBuildBuild; };
|
||||
rmInputs = { buildInputs ? [], depsBuildBuild ? [], nativeBuildInputs ? [] }: pkg: pkg.overrideAttrs (upstream: {
|
||||
buildInputs = lib.filter
|
||||
(p: !lib.any (rm: p == rm || (p ? name && rm ? name && p.name == rm.name)) buildInputs)
|
||||
(upstream.buildInputs or [])
|
||||
;
|
||||
depsBuildBuild = lib.filter
|
||||
(p: !lib.any (rm: p == rm || (p ? name && rm ? name && p.name == rm.name)) depsBuildBuild)
|
||||
(upstream.depsBuildBuild or [])
|
||||
;
|
||||
nativeBuildInputs = lib.filter
|
||||
(p: !lib.any (rm: p == rm || (p ? name && rm ? name && p.name == rm.name)) nativeBuildInputs)
|
||||
(upstream.nativeBuildInputs or [])
|
||||
;
|
||||
});
|
||||
rmBuildInputs = buildInputs: rmInputs { inherit buildInputs; };
|
||||
rmNativeInputs = nativeBuildInputs: rmInputs { inherit nativeBuildInputs; };
|
||||
# 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; }
|
||||
mvInputs = { buildInputs ? [], depsBuildBuild ? [], nativeBuildInputs ? [] }: pkg:
|
||||
addInputs { inherit buildInputs depsBuildBuild nativeBuildInputs; }
|
||||
(
|
||||
rmInputs { buildInputs = nativeBuildInputs; nativeBuildInputs = buildInputs; }
|
||||
rmInputs
|
||||
{
|
||||
buildInputs = depsBuildBuild ++ nativeBuildInputs;
|
||||
depsBuildBuild = buildInputs ++ nativeBuildInputs;
|
||||
nativeBuildInputs = buildInputs ++ depsBuildBuild;
|
||||
}
|
||||
pkg
|
||||
);
|
||||
|
||||
@@ -83,6 +99,32 @@ let
|
||||
exec ${lib.getExe final.buildPackages.blueprint-compiler} "$@"
|
||||
'';
|
||||
|
||||
# use like: `p.override { blueprint-compiler = crossBlueprint; }`
|
||||
crossBlueprint = final.pkgsBuildBuild.blueprint-compiler.overrideAttrs (upstream: {
|
||||
# blueprint-compiler isn't invokable in a standalone environment.
|
||||
# i.e. `blueprint-compiler --help` fails.
|
||||
# fix by adding glib typelib.
|
||||
# TODO: upstream! (see `wip-blueprint-compiler` nixpkgs branch)
|
||||
nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
|
||||
final.pkgsBuildBuild.makeWrapper
|
||||
];
|
||||
postFixup = (upstream.postFixup or "") + ''
|
||||
wrapProgram $out/bin/blueprint-compiler \
|
||||
--prefix GI_TYPELIB_PATH : "${lib.getLib final.pkgsBuildBuild.glib}/lib/girepository-1.0:${lib.getLib final.pkgsBuildBuild.gobject-introspection}/lib/girepository-1.0"
|
||||
'';
|
||||
|
||||
# propagate gobject-introspection such that it appears in the same host offset as us,
|
||||
# and populates GI_TYPELIB_PATH with the correct offset.
|
||||
propagatedBuildInputs = [];
|
||||
depsTargetTargetPropagated = [ final.gobject-introspection ];
|
||||
});
|
||||
|
||||
# build a blueprint-based package in a way that is cross-compatible
|
||||
# fixBlueprint = p: mvToDepsBuildBuild [ crossBlueprint ] p;
|
||||
fixBlueprint = p: p.override {
|
||||
blueprint-compiler = crossBlueprint;
|
||||
};
|
||||
|
||||
# `cargo` which adds the correct env vars and `--target` flag when invoked from meson build scripts
|
||||
crossCargo = let
|
||||
inherit (final.pkgsBuildHost) cargo;
|
||||
@@ -179,30 +221,32 @@ in with final; {
|
||||
# shell = runtimeShell;
|
||||
# };
|
||||
|
||||
blanket = prev.blanket.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
};
|
||||
blanket = fixBlueprint prev.blanket;
|
||||
# blanket = prev.blanket.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# };
|
||||
|
||||
# 2025/02/04: upstreaming is unblocked, but a cleaner solution than this doesn't seem to exist yet
|
||||
confy = (prev.confy.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
}).overrideAttrs (upstream: {
|
||||
# confy = (prev.confy.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# }).overrideAttrs (upstream: {
|
||||
confy = (fixBlueprint prev.confy).overrideAttrs (upstream: {
|
||||
# meson's `python.find_installation` method somehow just doesn't support cross compilation.
|
||||
# - <https://mesonbuild.com/Python-module.html#find_installation>
|
||||
# so, build it to target build python, then patch in the host python
|
||||
@@ -230,17 +274,18 @@ in with final; {
|
||||
});
|
||||
|
||||
# 2024/11/19: upstreaming is unblocked
|
||||
dialect = (prev.dialect.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
}).overrideAttrs (upstream: {
|
||||
# dialect = (prev.dialect.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# }).overrideAttrs (upstream: {
|
||||
dialect = (fixBlueprint prev.dialect).overrideAttrs (upstream: {
|
||||
# error: "<dialect> is not allowed to refer to the following paths: <build python>"
|
||||
# dialect's meson build script sets host binaries to use build PYTHON
|
||||
# disallowedReferences = [];
|
||||
@@ -332,17 +377,18 @@ in with final; {
|
||||
# };
|
||||
# });
|
||||
|
||||
flare-signal-nixified = prev.flare-signal-nixified.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
};
|
||||
flare-signal-nixified = fixBlueprint prev.flare-signal-nixified;
|
||||
# flare-signal-nixified = prev.flare-signal-nixified.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# };
|
||||
|
||||
# 2025/01/13: upstreaming is blocked by glycin-loaders
|
||||
fractal = prev.fractal.override {
|
||||
@@ -364,17 +410,18 @@ in with final; {
|
||||
# });
|
||||
|
||||
# 2024/11/19: upstreaming is blocked on qtx11extras (via zbar)
|
||||
gnome-frog = prev.gnome-frog.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
};
|
||||
# gnome-frog = prev.gnome-frog.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# };
|
||||
gnome-frog = fixBlueprint prev.gnome-frog;
|
||||
|
||||
# 2025/01/13: upstreaming is blocked on gnome-shell
|
||||
# fixes: "gdbus-codegen not found or executable"
|
||||
@@ -443,17 +490,18 @@ in with final; {
|
||||
# });
|
||||
|
||||
# 2024/11/19: upstreaming is unblocked
|
||||
komikku = prev.komikku.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
};
|
||||
komikku = fixBlueprint prev.komikku;
|
||||
# komikku = prev.komikku.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# };
|
||||
|
||||
# 2024/08/12: upstreaming is unblocked -- but is this necessary?
|
||||
# koreader = prev.koreader.overrideAttrs (upstream: {
|
||||
@@ -524,20 +572,24 @@ in with final; {
|
||||
# ncftp = addNativeInputs [ bintools ] prev.ncftp;
|
||||
|
||||
# 2025/04/04: upstreaming is unblocked
|
||||
# newsflash = (prev.newsflash.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.clapper
|
||||
# buildPackages.glib
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.gst_all_1.gstreamer
|
||||
# buildPackages.gst_all_1.gst-plugins-base
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.pango
|
||||
# buildPackages.graphene
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# ];
|
||||
# cargo = crossCargo; #< fixes openssl not being able to find its library
|
||||
# }).overrideAttrs (upstream: {
|
||||
newsflash = (prev.newsflash.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.clapper
|
||||
buildPackages.glib
|
||||
buildPackages.gtk4
|
||||
buildPackages.gst_all_1.gstreamer
|
||||
buildPackages.gst_all_1.gst-plugins-base
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.pango
|
||||
buildPackages.graphene
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
];
|
||||
cargo = crossCargo; #< fixes openssl not being able to find its library
|
||||
blueprint-compiler = crossBlueprint;
|
||||
cargo = crossCargo;
|
||||
}).overrideAttrs (upstream: {
|
||||
postPatch = (upstream.postPatch or "") + ''
|
||||
rm build.rs
|
||||
@@ -803,16 +855,20 @@ in with final; {
|
||||
};
|
||||
|
||||
# 2025/04/04: upstreaming is unblocked
|
||||
# spot = prev.spot.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# cargo = crossCargo;
|
||||
# };
|
||||
spot = prev.spot.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
blueprint-compiler = crossBlueprint;
|
||||
cargo = crossCargo;
|
||||
};
|
||||
|
||||
@@ -861,25 +917,36 @@ in with final; {
|
||||
# });
|
||||
|
||||
# 2024/11/19: upstreaming is unblocked
|
||||
tangram = (prev.tangram.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
}).overrideAttrs (upstream: {
|
||||
# tangram = (prev.tangram.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# }).overrideAttrs (upstream: {
|
||||
tangram = (fixBlueprint prev.tangram).overrideAttrs (upstream: {
|
||||
# gsjpack has a shebang for the host gjs. patchShebangs --build doesn't fix that: just manually specify the build gjs
|
||||
postPatch = (upstream.postPatch or "") + ''
|
||||
postPatch = let
|
||||
gjspack' = buildPackages.writeShellScriptBin "gjspack" ''
|
||||
export GI_TYPELIB_PATH=${typelibPath [ buildPackages.glib ]}:$GI_TYPELIB_PATH
|
||||
exec ${buildPackages.gjs}/bin/gjs $@
|
||||
'';
|
||||
in (upstream.postPatch or "") + ''
|
||||
substituteInPlace src/meson.build \
|
||||
--replace-fail "find_program('gjs').full_path()" "'${gjs}/bin/gjs'" \
|
||||
--replace-fail "gjspack," "'env', 'GI_TYPELIB_PATH=${typelibPath [
|
||||
buildPackages.glib
|
||||
]}', '${buildPackages.gjs}/bin/gjs', '-m', gjspack,"
|
||||
--replace-fail "gjspack," "'${gjspack'}/bin/gjspack', '-m', gjspack,"
|
||||
'';
|
||||
# postPatch = (upstream.postPatch or "") + ''
|
||||
# substituteInPlace src/meson.build \
|
||||
# --replace-fail "find_program('gjs').full_path()" "'${gjs}/bin/gjs'" \
|
||||
# --replace-fail "gjspack," "'env', 'GI_TYPELIB_PATH=${typelibPath [
|
||||
# buildPackages.glib
|
||||
# ]}', '${buildPackages.gjs}/bin/gjs', '-m', gjspack,"
|
||||
# '';
|
||||
});
|
||||
|
||||
# fixes: "ar: command not found"
|
||||
@@ -904,17 +971,21 @@ in with final; {
|
||||
# };
|
||||
|
||||
# 2025/01/13: upstreaming is unblocked
|
||||
# video-trimmer = prev.video-trimmer.override {
|
||||
# blueprint-compiler = wrapBlueprint [
|
||||
# buildPackages.gdk-pixbuf
|
||||
# buildPackages.glib
|
||||
# buildPackages.graphene
|
||||
# buildPackages.gtk4
|
||||
# buildPackages.harfbuzz
|
||||
# buildPackages.libadwaita
|
||||
# buildPackages.pango
|
||||
# ];
|
||||
# cargo = crossCargo;
|
||||
# };
|
||||
video-trimmer = prev.video-trimmer.override {
|
||||
blueprint-compiler = wrapBlueprint [
|
||||
buildPackages.gdk-pixbuf
|
||||
buildPackages.glib
|
||||
buildPackages.graphene
|
||||
buildPackages.gtk4
|
||||
buildPackages.harfbuzz
|
||||
buildPackages.libadwaita
|
||||
buildPackages.pango
|
||||
];
|
||||
cargo = crossCargo;
|
||||
blueprint-compiler = crossBlueprint;
|
||||
};
|
||||
|
||||
# 2025/01/13: upstreaming is blocked on arrow-cpp, python-pyarrow, python-contourpy, python-matplotlib, python-h5py, python-pandas, google-cloud-cpp
|
||||
|
Reference in New Issue
Block a user