mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 11:45:45 +03:00
blueprint-compiler: wrap with required dependencies
without this, `blueprint-compiler` fails when trying to import GIR files required by the compiler itself -- even for basic commands like `blueprint-compiler --help` or `blueprint-compiler --version`. `passthru.tests.version` passes because blueprint-compiler propagates `gobject-introspection`, which has a setup hook that configures `GI_TYPELIB_PATH` to have the required GIR files. but setup hooks are only run within nix builds, and conditional on the hook being in `nativeBuildInputs`. the result is that the following previously _didn't_ work: ``` $ nix-build -A blueprint-compiler $ ./result/bin/blueprint-compiler --help ``` an additional consequence of this patch is that several consumers of blueprint-compiler now cross compile correctly: - blanket - komikku - ... previously, blueprint-compiler did not work in a cross compiling environment, because the gobject-introspection setup-hook configures GI_TYPELIB_PATH for the _host_, which is generally not the same host on which blueprint-compiler is being run (i.e. the build machine). a consumer of blueprint-compiler has (in effect) build inputs like: ``` nativeBuildInputs | buildInputs ----------------------------------- blueprint-compiler | gobject-introspection | | glib | gtk | adwaita ... | ... ``` gobject-introspection's setup-hook populates GI_TYPELIB_PATH from the buildInputs; this is correct when blueprint-compiler is querying typelibs to generate code against, however before it gets to that point it needs to import its _own_ typelib dependencies (glib and gobject-introspection). this is made possible by wrapGAppsNoGuiHook, which wraps blueprint-compiler with a copy of those typelibs built for the same platform as it.
This commit is contained in:
parent
f378b788da
commit
5ee4899006
1 changed files with 14 additions and 2 deletions
|
@ -7,8 +7,10 @@
|
||||||
meson,
|
meson,
|
||||||
ninja,
|
ninja,
|
||||||
python3,
|
python3,
|
||||||
|
runCommand,
|
||||||
stdenv,
|
stdenv,
|
||||||
testers,
|
testers,
|
||||||
|
wrapGAppsNoGuiHook,
|
||||||
xvfb-run,
|
xvfb-run,
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
@ -30,6 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
|
wrapGAppsNoGuiHook
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
|
@ -64,9 +67,18 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
runHook postCheck
|
runHook postCheck
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests.version = testers.testVersion {
|
passthru.tests = {
|
||||||
|
version = testers.testVersion {
|
||||||
package = finalAttrs.finalPackage;
|
package = finalAttrs.finalPackage;
|
||||||
};
|
};
|
||||||
|
# regression test that `blueprint-compiler` can be used in a standalone
|
||||||
|
# context outside of nix builds, and doesn't rely on the setup hooks of
|
||||||
|
# its propagated inputs for basic functionality.
|
||||||
|
# see https://github.com/NixOS/nixpkgs/pull/400415
|
||||||
|
standalone = runCommand "blueprint-compiler-test-standalone" { } ''
|
||||||
|
${lib.getExe finalAttrs.finalPackage} --help && touch $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Markup language for GTK user interface files";
|
description = "Markup language for GTK user interface files";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue