about summary refs log tree commit diff
path: root/pkgs/development/libraries/gobject-introspection/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/gobject-introspection/wrapper.nix')
-rw-r--r--pkgs/development/libraries/gobject-introspection/wrapper.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/development/libraries/gobject-introspection/wrapper.nix b/pkgs/development/libraries/gobject-introspection/wrapper.nix
new file mode 100644
index 0000000000000..44d31540e6456
--- /dev/null
+++ b/pkgs/development/libraries/gobject-introspection/wrapper.nix
@@ -0,0 +1,29 @@
+{ lib
+, stdenv
+, buildPackages
+, gobject-introspection-unwrapped
+, targetPackages
+}:
+
+# to build, run
+# `nix build ".#pkgsCross.aarch64-multiplatform.buildPackages.gobject-introspection"`
+gobject-introspection-unwrapped.overrideAttrs (_previousAttrs: {
+  pname = "gobject-introspection-wrapped";
+  postFixup = ''
+    mv $dev/bin/g-ir-compiler $dev/bin/.g-ir-compiler-wrapped
+    mv $dev/bin/g-ir-scanner $dev/bin/.g-ir-scanner-wrapped
+
+    (
+      export bash="${buildPackages.bash}/bin/bash"
+      export emulator=${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)}
+      export buildprelink="${buildPackages.prelink}/bin/prelink-rtld"
+
+      export targetgir="${lib.getDev targetPackages.gobject-introspection-unwrapped}"
+
+      substituteAll "${./wrappers/g-ir-compiler.sh}" "$dev/bin/g-ir-compiler"
+      substituteAll "${./wrappers/g-ir-scanner.sh}" "$dev/bin/g-ir-scanner"
+      chmod +x "$dev/bin/g-ir-compiler"
+      chmod +x "$dev/bin/g-ir-scanner"
+    )
+  '';
+})