From 763fda70f081707bda58676123b702caae0d9db9 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Wed, 29 Jul 2015 11:14:50 +0000 Subject: [PATCH] wrapGAppsHook: build hook for wrapping GTK/GNOME apps --- .../setup-hooks/wrap-gapps-hook.sh | 33 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/build-support/setup-hooks/wrap-gapps-hook.sh diff --git a/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh b/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh new file mode 100644 index 000000000000..4b1a9527b110 --- /dev/null +++ b/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh @@ -0,0 +1,33 @@ +gappsWrapperArgs=() + +wrapGAppsHook() { + if [ -n "$GDK_PIXBUF_MODULE_FILE" ]; then + gappsWrapperArgs+=(--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE") + fi + + if [ -n "$XDG_ICON_DIRS" ]; then + gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS") + fi + + if [ -n "$GSETTINGS_SCHEMAS_PATH" ]; then + gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH") + fi + + if [ -d "$prefix/share" ]; then + gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$out/share") + fi + + for v in $wrapPrefixVariables GST_PLUGIN_SYSTEM_PATH_1_0 GI_TYPELIB_PATH GRL_PLUGIN_PATH; do + eval local dummy="\$$v" + gappsWrapperArgs+=(--prefix $v : "$dummy") + done + + if [ -z "$dontWrapGApps" ]; then + for i in $prefix/bin/* $prefix/libexec/*; do + echo "Wrapping app $i" + wrapProgram "$i" "${gappsWrapperArgs[@]}" + done + fi +} + +fixupOutputHooks+=(wrapGAppsHook) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3cf462adeb39..c77fbf47c540 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -512,6 +512,10 @@ let findXMLCatalogs = makeSetupHook { } ../build-support/setup-hooks/find-xml-catalogs.sh; + wrapGAppsHook = makeSetupHook { + deps = [ makeWrapper ]; + } ../build-support/setup-hooks/wrap-gapps-hook.sh; + ### TOOLS