mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
qt5: handle dev output even without qmake
This commit is contained in:
parent
b845596f66
commit
9ea3e371df
@ -36,19 +36,6 @@ _qtRmModules() {
|
|||||||
rm "$out/nix-support/qt-inputs"
|
rm "$out/nix-support/qt-inputs"
|
||||||
}
|
}
|
||||||
|
|
||||||
_qtPropagateRuntimeDependencies() {
|
|
||||||
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
|
||||||
if [ -d "$1/$dir" ]; then
|
|
||||||
propagateOnce propagatedBuildInputs "$1"
|
|
||||||
propagateOnce propagatedUserEnvPkgs "$1"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
|
||||||
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
|
||||||
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
|
||||||
}
|
|
||||||
|
|
||||||
_qtRmQmake() {
|
_qtRmQmake() {
|
||||||
rm "$qtOut/bin/qmake" "$qtOut/bin/qt.conf"
|
rm "$qtOut/bin/qmake" "$qtOut/bin/qt.conf"
|
||||||
}
|
}
|
||||||
@ -68,11 +55,6 @@ _qtMultioutModuleDevs() {
|
|||||||
moveToOutput "share/doc" "${!outputDev}"
|
moveToOutput "share/doc" "${!outputDev}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_qtMultioutDevs() {
|
|
||||||
# This is necessary whether the package is a Qt module or not
|
|
||||||
moveToOutput "mkspecs" "${!outputDev}"
|
|
||||||
}
|
|
||||||
|
|
||||||
qmakeConfigurePhase() {
|
qmakeConfigurePhase() {
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
@ -102,7 +84,7 @@ EOF
|
|||||||
|
|
||||||
export QMAKE="$qtOut/bin/qmake"
|
export QMAKE="$qtOut/bin/qmake"
|
||||||
|
|
||||||
envHooks+=(_qtLinkModule _qtPropagateRuntimeDependencies)
|
envHooks+=(_qtLinkModule)
|
||||||
# Set PATH to find qmake first in a preConfigure hook
|
# Set PATH to find qmake first in a preConfigure hook
|
||||||
# It must run after all the envHooks!
|
# It must run after all the envHooks!
|
||||||
postHooks+=(_qtSetQmakePath)
|
postHooks+=(_qtSetQmakePath)
|
||||||
@ -111,7 +93,6 @@ if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then
|
|||||||
configurePhase=qmakeConfigurePhase
|
configurePhase=qmakeConfigurePhase
|
||||||
fi
|
fi
|
||||||
|
|
||||||
preFixupHooks+=(_qtMultioutDevs)
|
|
||||||
if [ -n "$NIX_QT_SUBMODULE" ]; then
|
if [ -n "$NIX_QT_SUBMODULE" ]; then
|
||||||
postInstallHooks+=(_qtRmQmake _qtRmModules)
|
postInstallHooks+=(_qtRmQmake _qtRmModules)
|
||||||
preFixupHooks+=(_qtMultioutModuleDevs)
|
preFixupHooks+=(_qtMultioutModuleDevs)
|
||||||
|
@ -24,6 +24,28 @@ propagateOnce() {
|
|||||||
addToSearchPathOnceWithCustomDelimiter ' ' "$@"
|
addToSearchPathOnceWithCustomDelimiter ' ' "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_qtPropagateRuntimeDependencies() {
|
||||||
|
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
||||||
|
if [ -d "$1/$dir" ]; then
|
||||||
|
propagateOnce propagatedBuildInputs "$1"
|
||||||
|
propagateOnce propagatedUserEnvPkgs "$1"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
||||||
|
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
||||||
|
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
||||||
|
}
|
||||||
|
|
||||||
|
envHooks+=(_qtPropagateRuntimeDependencies)
|
||||||
|
|
||||||
|
_qtMultioutDevs() {
|
||||||
|
# This is necessary whether the package is a Qt module or not
|
||||||
|
moveToOutput "mkspecs" "${!outputDev}"
|
||||||
|
}
|
||||||
|
|
||||||
|
preFixupHooks+=(_qtMultioutDevs)
|
||||||
|
|
||||||
if [[ -z "$NIX_QT_PIC" ]]; then
|
if [[ -z "$NIX_QT_PIC" ]]; then
|
||||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
|
||||||
export NIX_QT_PIC=1
|
export NIX_QT_PIC=1
|
||||||
|
@ -36,19 +36,6 @@ _qtRmModules() {
|
|||||||
rm "$out/nix-support/qt-inputs"
|
rm "$out/nix-support/qt-inputs"
|
||||||
}
|
}
|
||||||
|
|
||||||
_qtPropagateRuntimeDependencies() {
|
|
||||||
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
|
||||||
if [ -d "$1/$dir" ]; then
|
|
||||||
propagateOnce propagatedBuildInputs "$1"
|
|
||||||
propagateOnce propagatedUserEnvPkgs "$1"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
|
||||||
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
|
||||||
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
|
||||||
}
|
|
||||||
|
|
||||||
_qtRmQmake() {
|
_qtRmQmake() {
|
||||||
rm "$qtOut/bin/qmake" "$qtOut/bin/qt.conf"
|
rm "$qtOut/bin/qmake" "$qtOut/bin/qt.conf"
|
||||||
}
|
}
|
||||||
@ -68,11 +55,6 @@ _qtMultioutModuleDevs() {
|
|||||||
moveToOutput "share/doc" "${!outputDev}"
|
moveToOutput "share/doc" "${!outputDev}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_qtMultioutDevs() {
|
|
||||||
# This is necessary whether the package is a Qt module or not
|
|
||||||
moveToOutput "mkspecs" "${!outputDev}"
|
|
||||||
}
|
|
||||||
|
|
||||||
qmakeConfigurePhase() {
|
qmakeConfigurePhase() {
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
|
|
||||||
@ -102,7 +84,7 @@ EOF
|
|||||||
|
|
||||||
export QMAKE="$qtOut/bin/qmake"
|
export QMAKE="$qtOut/bin/qmake"
|
||||||
|
|
||||||
envHooks+=(_qtLinkModule _qtPropagateRuntimeDependencies)
|
envHooks+=(_qtLinkModule)
|
||||||
# Set PATH to find qmake first in a preConfigure hook
|
# Set PATH to find qmake first in a preConfigure hook
|
||||||
# It must run after all the envHooks!
|
# It must run after all the envHooks!
|
||||||
postHooks+=(_qtSetQmakePath)
|
postHooks+=(_qtSetQmakePath)
|
||||||
@ -111,7 +93,6 @@ if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then
|
|||||||
configurePhase=qmakeConfigurePhase
|
configurePhase=qmakeConfigurePhase
|
||||||
fi
|
fi
|
||||||
|
|
||||||
preFixupHooks+=(_qtMultioutDevs)
|
|
||||||
if [ -n "$NIX_QT_SUBMODULE" ]; then
|
if [ -n "$NIX_QT_SUBMODULE" ]; then
|
||||||
postInstallHooks+=(_qtRmQmake _qtRmModules)
|
postInstallHooks+=(_qtRmQmake _qtRmModules)
|
||||||
preFixupHooks+=(_qtMultioutModuleDevs)
|
preFixupHooks+=(_qtMultioutModuleDevs)
|
||||||
|
@ -24,6 +24,28 @@ propagateOnce() {
|
|||||||
addToSearchPathOnceWithCustomDelimiter ' ' "$@"
|
addToSearchPathOnceWithCustomDelimiter ' ' "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_qtPropagateRuntimeDependencies() {
|
||||||
|
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
|
||||||
|
if [ -d "$1/$dir" ]; then
|
||||||
|
propagateOnce propagatedBuildInputs "$1"
|
||||||
|
propagateOnce propagatedUserEnvPkgs "$1"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
||||||
|
addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports"
|
||||||
|
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
||||||
|
}
|
||||||
|
|
||||||
|
envHooks+=(_qtPropagateRuntimeDependencies)
|
||||||
|
|
||||||
|
_qtMultioutDevs() {
|
||||||
|
# This is necessary whether the package is a Qt module or not
|
||||||
|
moveToOutput "mkspecs" "${!outputDev}"
|
||||||
|
}
|
||||||
|
|
||||||
|
preFixupHooks+=(_qtMultioutDevs)
|
||||||
|
|
||||||
if [[ -z "$NIX_QT_PIC" ]]; then
|
if [[ -z "$NIX_QT_PIC" ]]; then
|
||||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
|
||||||
export NIX_QT_PIC=1
|
export NIX_QT_PIC=1
|
||||||
|
Loading…
Reference in New Issue
Block a user