1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 05:00:16 +00:00

qt5: factor out common makeQtWrapper setup hook

This commit is contained in:
Thomas Tuegel 2016-12-03 09:57:17 -06:00
parent 2c4995c013
commit 7b05efb90d
No known key found for this signature in database
GPG key ID: 22CBF5249D4B4D59
6 changed files with 11 additions and 75 deletions

View file

@ -112,7 +112,11 @@ let
qtxmlpatterns
];
makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
makeQtWrapper =
makeSetupHook
{ deps = [ makeWrapper ]; }
../make-qt-wrapper.sh;
qmakeHook =
makeSetupHook
{ deps = [ self.qtbase.dev ]; }

View file

@ -109,7 +109,11 @@ let
qtwebchannel qtwebengine qtwebsockets qtx11extras qtxmlpatterns
];
makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
makeQtWrapper =
makeSetupHook
{ deps = [ makeWrapper ]; }
../make-qt-wrapper.sh;
qmakeHook =
makeSetupHook
{ deps = [ self.qtbase.dev ]; }

View file

@ -1,36 +0,0 @@
wrapQtProgram() {
local prog="$1"
shift
wrapProgram "$prog" \
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
"$@"
}
makeQtWrapper() {
local old="$1"
local new="$2"
shift
shift
makeWrapper "$old" "$new" \
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
"$@"
}
_makeQtWrapperSetup() {
# cannot use addToSearchPath because these directories may not exist yet
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/lib/qt5/plugins"
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}${!outputLib}/lib/qt5/imports"
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/lib/qt5/qml"
export RUNTIME_XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}${!outputBin}/share"
export RUNTIME_XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
}
prePhases+=(_makeQtWrapperSetup)

View file

@ -107,7 +107,7 @@ let
makeQtWrapper =
makeSetupHook
{ deps = [ makeWrapper ]; }
./make-qt-wrapper.sh;
../make-qt-wrapper.sh;
qmakeHook =
makeSetupHook

View file

@ -1,36 +0,0 @@
wrapQtProgram() {
local prog="$1"
shift
wrapProgram "$prog" \
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
"$@"
}
makeQtWrapper() {
local old="$1"
local new="$2"
shift
shift
makeWrapper "$old" "$new" \
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
--prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \
--prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \
"$@"
}
_makeQtWrapperSetup() {
# cannot use addToSearchPath because these directories may not exist yet
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/lib/qt5/plugins"
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}${!outputLib}/lib/qt5/imports"
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/lib/qt5/qml"
export RUNTIME_XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}${!outputBin}/share"
export RUNTIME_XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg"
}
prePhases+=(_makeQtWrapperSetup)