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:
parent
2c4995c013
commit
7b05efb90d
|
@ -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 ]; }
|
||||
|
|
|
@ -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 ]; }
|
||||
|
|
|
@ -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)
|
|
@ -107,7 +107,7 @@ let
|
|||
makeQtWrapper =
|
||||
makeSetupHook
|
||||
{ deps = [ makeWrapper ]; }
|
||||
./make-qt-wrapper.sh;
|
||||
../make-qt-wrapper.sh;
|
||||
|
||||
qmakeHook =
|
||||
makeSetupHook
|
||||
|
|
|
@ -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)
|
Loading…
Reference in a new issue