Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

gobject-introspection: wrapper: add .libs to LD_LIBRARY_PATH for emulator

fixes issues like
libdbusmenu-gtk3-aarch64-unknown-linux-gnu> /build/libdbusmenu-16.04.0/libdbusmenu-gtk/tmp-introspect2jhtiwwn/.libs/DbusmenuGtk3-0.4:
error while loading shared libraries: libdbusmenu-glib.so.4: cannot open shared object file: No such file or directory
in non-meson builds

i think the reason we need this in all non-meson builds is because of ./pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch

see: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gobject-introspection/files/g-ir-scanner-qemuwrapper
https://github.com/openembedded/openembedded-core/blob/c5a14f39a6717a99b510cb97aa2fb403d4b98d99/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.72.0.bb#L74

Artturin 267ef1f2 118b5d13

+28 -5
+3 -3
pkgs/development/libraries/gobject-introspection/wrapper.nix
··· 25 25 ( 26 26 export bash="${buildPackages.bash}" 27 27 export emulator=${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)} 28 + export emulatorwrapper="$dev/bin/g-ir-scanner-qemuwrapper" 28 29 export buildobjdump="${buildPackages.stdenv.cc.bintools}/bin/objdump" 29 30 30 31 export targetgir="${lib.getDev (targetPackages.gobject-introspection-unwrapped.override argsForTarget)}" ··· 32 33 substituteAll "${./wrappers/g-ir-compiler.sh}" "$dev/bin/g-ir-compiler" 33 34 substituteAll "${./wrappers/g-ir-scanner.sh}" "$dev/bin/g-ir-scanner" 34 35 substituteAll "${./wrappers/g-ir-scanner-lddwrapper.sh}" "$dev/bin/g-ir-scanner-lddwrapper" 35 - chmod +x "$dev/bin/g-ir-compiler" 36 - chmod +x "$dev/bin/g-ir-scanner" 37 - chmod +x "$dev/bin/g-ir-scanner-lddwrapper" 36 + substituteAll "${./wrappers/g-ir-scanner-qemuwrapper.sh}" "$dev/bin/g-ir-scanner-qemuwrapper" 37 + chmod +x $dev/bin/g-ir-* 38 38 ) 39 39 '' 40 40 # when cross-compiling and using the wrapper then when a package looks up the g_ir_X
+1 -1
pkgs/development/libraries/gobject-introspection/wrappers/g-ir-compiler.sh
··· 1 1 #! @bash@/bin/bash 2 2 # shellcheck shell=bash 3 3 4 - exec @emulator@ @targetgir@/bin/g-ir-compiler "$@" 4 + exec @emulatorwrapper@ @targetgir@/bin/g-ir-compiler "$@"
+23
pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner-qemuwrapper.sh
··· 1 + #! @bash@/bin/bash 2 + # shellcheck shell=bash 3 + 4 + # fixes issues like 5 + # libdbusmenu-gtk3-aarch64-unknown-linux-gnu> /build/libdbusmenu-16.04.0/libdbusmenu-gtk/tmp-introspect2jhtiwwn/.libs/DbusmenuGtk3-0.4: 6 + # error while loading shared libraries: libdbusmenu-glib.so.4: cannot open shared object file: No such file or directory 7 + # in non-meson builds 8 + 9 + # see: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gobject-introspection/files/g-ir-scanner-qemuwrapper 10 + # https://github.com/openembedded/openembedded-core/blob/c5a14f39a6717a99b510cb97aa2fb403d4b98d99/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.72.0.bb#L74 11 + while read -r d; do \ 12 + # some meson projects may have subprojects which use makefiles for docs(e.g. gi-docgen), ignore those as they will never be needed 13 + if [[ -f "$d/Makefile" && "$d" != *"subproject"* ]]; then 14 + GIR_EXTRA_LIBS_PATH="$(readlink -f "$d/.libs"):$GIR_EXTRA_LIBS_PATH" 15 + export GIR_EXTRA_LIBS_PATH 16 + fi 17 + done < <(find "$NIX_BUILD_TOP" -type d) 18 + 19 + # quoting broke the build of atk 20 + # shellcheck disable=2086 21 + exec @emulator@ ${GIR_EXTRA_OPTIONS:-} \ 22 + ${GIR_EXTRA_LIBS_PATH:+-E LD_LIBRARY_PATH="${GIR_EXTRA_LIBS_PATH}"} \ 23 + "$@"
+1 -1
pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner.sh
··· 2 2 # shellcheck shell=bash 3 3 4 4 exec @dev@/bin/.g-ir-scanner-wrapped \ 5 - --use-binary-wrapper=@emulator@ \ 5 + --use-binary-wrapper=@emulatorwrapper@ \ 6 6 --use-ldd-wrapper=@dev@/bin/g-ir-scanner-lddwrapper \ 7 7 "$@"