forked from mirrors/nixpkgs
separate makeQtWrapper from qtbase setup-hook
This commit is contained in:
parent
895100ef91
commit
d57e50d840
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, fetchurl, cmake
|
{ stdenv, fetchurl, cmake
|
||||||
, withQt4 ? false, qt4
|
, withQt4 ? false, qt4
|
||||||
, withQt5 ? true, qtbase, qtsvg, qttools
|
, withQt5 ? true, qtbase, qtsvg, qttools, makeQtWrapper
|
||||||
|
|
||||||
# I'm unable to make KDE work here, crashes at runtime so I simply
|
# I'm unable to make KDE work here, crashes at runtime so I simply
|
||||||
# make Qt4 the default until someone who wants KDE can figure it out.
|
# make Qt4 the default until someone who wants KDE can figure it out.
|
||||||
|
@ -68,6 +68,8 @@ stdenv.mkDerivation rec {
|
||||||
++ stdenv.lib.optional withMusicbrainz libmusicbrainz5
|
++ stdenv.lib.optional withMusicbrainz libmusicbrainz5
|
||||||
++ stdenv.lib.optional (withTaglib && !withKDE4 && withDevices) udisks2;
|
++ stdenv.lib.optional (withTaglib && !withKDE4 && withDevices) udisks2;
|
||||||
|
|
||||||
|
nativeBuildInputs = stdenv.lib.optional withQt5 makeQtWrapper;
|
||||||
|
|
||||||
unpackPhase = "tar -xvf $src";
|
unpackPhase = "tar -xvf $src";
|
||||||
sourceRoot = "${name}";
|
sourceRoot = "${name}";
|
||||||
|
|
||||||
|
@ -91,7 +93,7 @@ stdenv.mkDerivation rec {
|
||||||
"-DENABLE_UDISKS2=ON"
|
"-DENABLE_UDISKS2=ON"
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = stdenv.lib.optionalString withQt5 ''
|
||||||
wrapQtProgram "$out/bin/cantata"
|
wrapQtProgram "$out/bin/cantata"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchFromGitHub, fftw, libsndfile, qtbase, qtmultimedia }:
|
{ stdenv, fetchFromGitHub, fftw, libsndfile, qtbase, qtmultimedia, makeQtWrapper }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
buildInputs = [ fftw libsndfile qtbase qtmultimedia ];
|
buildInputs = [ fftw libsndfile qtbase qtmultimedia ];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeQtWrapper ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace dfasma.pro --replace '$$DFASMAVERSIONGITPRO' '${version}'
|
substituteInPlace dfasma.pro --replace '$$DFASMAVERSIONGITPRO' '${version}'
|
||||||
cp -Rv "${reaperFork.src}"/* external/REAPER
|
cp -Rv "${reaperFork.src}"/* external/REAPER
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
{ stdenv, fetchurl, alsaLib, bzip2, fftw, libjack2, libX11, liblo
|
{ stdenv, fetchurl, alsaLib, bzip2, fftw, libjack2, libX11, liblo
|
||||||
, libmad, libogg, librdf, librdf_raptor, librdf_rasqal, libsamplerate
|
, libmad, libogg, librdf, librdf_raptor, librdf_rasqal, libsamplerate
|
||||||
, libsndfile, pkgconfig, libpulseaudio, qtbase, redland
|
, libsndfile, pkgconfig, libpulseaudio, makeQtWrapper, qtbase, redland
|
||||||
, rubberband, serd, sord, vampSDK, fftwFloat
|
, rubberband, serd, sord, vampSDK, fftwFloat
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@ stdenv.mkDerivation rec {
|
||||||
libX11
|
libX11
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeQtWrapper ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
for i in sonic-visualiser svapp svcore svgui;
|
for i in sonic-visualiser svapp svcore svgui;
|
||||||
do cd $i && qmake -makefile PREFIX=$out && cd ..;
|
do cd $i && qmake -makefile PREFIX=$out && cd ..;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchpatch, makeWrapper, fetchFromGitHub, cmake, pkgconfig, libxcb, libpthreadstubs
|
{ stdenv, fetchpatch, makeQtWrapper, fetchFromGitHub, cmake, pkgconfig, libxcb, libpthreadstubs
|
||||||
, libXdmcp, libXau, qtbase, qtdeclarative, qttools, pam, systemd }:
|
, libXdmcp, libXau, qtbase, qtdeclarative, qttools, pam, systemd }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
patches = [ ./sddm-ignore-config-mtime.patch ];
|
patches = [ ./sddm-ignore-config-mtime.patch ];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkgconfig qttools ];
|
nativeBuildInputs = [ cmake makeQtWrapper pkgconfig qttools ];
|
||||||
|
|
||||||
buildInputs = [ libxcb libpthreadstubs libXdmcp libXau qtbase qtdeclarative pam systemd ];
|
buildInputs = [ libxcb libpthreadstubs libXdmcp libXau qtbase qtdeclarative pam systemd ];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchgit, makeWrapper, qtbase, qtquick1, qmltermwidget }:
|
{ stdenv, fetchgit, makeQtWrapper, qtbase, qtquick1, qmltermwidget }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
|
@ -15,7 +15,8 @@ stdenv.mkDerivation rec {
|
||||||
sed -i -e '/qmltermwidget/d' cool-retro-term.pro
|
sed -i -e '/qmltermwidget/d' cool-retro-term.pro
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ makeWrapper qtbase qtquick1 qmltermwidget ];
|
buildInputs = [ qtbase qtquick1 qmltermwidget ];
|
||||||
|
nativeBuildInputs = [ makeQtWrapper ];
|
||||||
|
|
||||||
configurePhase = "qmake PREFIX=$out";
|
configurePhase = "qmake PREFIX=$out";
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
, decryptSslTraffic ? false
|
, decryptSslTraffic ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let inherit (pkgs) stdenv; in
|
let inherit (pkgs) makeSetupHook makeWrapper stdenv; in
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
|
@ -101,6 +101,8 @@ let
|
||||||
qtx11extras = callPackage ./qtx11extras.nix {};
|
qtx11extras = callPackage ./qtx11extras.nix {};
|
||||||
qtxmlpatterns = callPackage ./qtxmlpatterns.nix {};
|
qtxmlpatterns = callPackage ./qtxmlpatterns.nix {};
|
||||||
|
|
||||||
|
makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in makeScope pkgs.newScope addPackages
|
in makeScope pkgs.newScope addPackages
|
||||||
|
|
52
pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh
Normal file
52
pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
addQtDependency() {
|
||||||
|
addToSearchPath QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
||||||
|
addToSearchPath QML_IMPORT_PATH "$1/lib/qt5/imports"
|
||||||
|
addToSearchPath QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
||||||
|
addToSearchPath XDG_DATA_DIRS "$1/share"
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapQtProgram() {
|
||||||
|
local prog="$1"
|
||||||
|
shift
|
||||||
|
if [[ -n "$QT_WRAPPER_IMPURE" ]]; then
|
||||||
|
wrapProgram "$prog" \
|
||||||
|
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
||||||
|
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
|
||||||
|
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
||||||
|
"$@"
|
||||||
|
else
|
||||||
|
wrapProgram "$prog" \
|
||||||
|
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
||||||
|
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
|
||||||
|
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
makeQtWrapper() {
|
||||||
|
local old="$1"
|
||||||
|
local new="$2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
if [[ -n "$QT_WRAPPER_IMPURE" ]]; then
|
||||||
|
makeWrapper "$old" "$new" \
|
||||||
|
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
|
||||||
|
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
|
||||||
|
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
|
||||||
|
"$@"
|
||||||
|
else
|
||||||
|
makeWrapper "$old" "$new" \
|
||||||
|
--set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \
|
||||||
|
--set QML_IMPORT_PATH "$QML_IMPORT_PATH" \
|
||||||
|
--set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \
|
||||||
|
"$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# cannot use addToSearchPath because these directories may not exist yet
|
||||||
|
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}$out/lib/qt5/plugins"
|
||||||
|
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}$out/lib/qt5/imports"
|
||||||
|
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}$out/lib/qt5/qml"
|
||||||
|
export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}$out/share"
|
||||||
|
|
||||||
|
envHooks+=(addQtDependency)
|
|
@ -18,11 +18,6 @@ addQtModule() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
addToSearchPath QT_PLUGIN_PATH "$1/lib/qt5/plugins"
|
|
||||||
addToSearchPath QML_IMPORT_PATH "$1/lib/qt5/imports"
|
|
||||||
addToSearchPath QML2_IMPORT_PATH "$1/lib/qt5/qml"
|
|
||||||
addToSearchPath XDG_DATA_DIRS "$1/share"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rmQtModules() {
|
rmQtModules() {
|
||||||
|
@ -49,28 +44,6 @@ setQMakePath() {
|
||||||
export PATH="$qtOut/bin${PATH:+:}$PATH"
|
export PATH="$qtOut/bin${PATH:+:}$PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
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" \
|
|
||||||
"$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
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" \
|
|
||||||
"$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
qtOut=""
|
qtOut=""
|
||||||
if [[ -z "$NIX_QT_SUBMODULE" ]]; then
|
if [[ -z "$NIX_QT_SUBMODULE" ]]; then
|
||||||
qtOut="$PWD/qmake-$name"
|
qtOut="$PWD/qmake-$name"
|
||||||
|
@ -91,11 +64,6 @@ Documentation = share/doc/qt5
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
export QMAKE="$qtOut/bin/qmake"
|
export QMAKE="$qtOut/bin/qmake"
|
||||||
# cannot use addToSearchPath because these directories may not exist yet
|
|
||||||
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}$out/lib/qt5/plugins"
|
|
||||||
export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}$out/lib/qt5/imports"
|
|
||||||
export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}$out/lib/qt5/qml"
|
|
||||||
export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}$out/share"
|
|
||||||
|
|
||||||
envHooks+=(addQtModule)
|
envHooks+=(addQtModule)
|
||||||
preConfigurePhases+=(setQMakePath)
|
preConfigurePhases+=(setQMakePath)
|
||||||
|
|
Loading…
Reference in a new issue