Skip to content

Commit

Permalink
qt5: separate plugins from libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
ttuegel committed Jun 18, 2017
1 parent 5a8295e commit 6fa4178
Show file tree
Hide file tree
Showing 17 changed files with 167 additions and 134 deletions.
12 changes: 7 additions & 5 deletions pkgs/development/libraries/qt-5/5.6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ let

outputs = args.outputs or [ "out" "dev" ];

propagatedUserEnvPkgs =
(args.propagatedUserEnvPkgs or [])
++ map getBin (args.propagatedBuildInputs or []);

qmakeFlags =
(args.qmakeFlags or [])
++ optional (debug != null)
Expand Down Expand Up @@ -90,7 +86,13 @@ let

setupHook = ../qtsubmodule-setup-hook.sh;

meta = self.qtbase.meta // (args.meta or {});
meta = {
homepage = http://www.qt.io;
description = "A cross-platform application framework for C++";
license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
maintainers = with maintainers; [ qknight ttuegel periklis ];
platforms = platforms.unix;
} // (args.meta or {});
});

addPackages = self: with self;
Expand Down
12 changes: 7 additions & 5 deletions pkgs/development/libraries/qt-5/5.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ let

outputs = args.outputs or [ "out" "dev" ];

propagatedUserEnvPkgs =
(args.propagatedUserEnvPkgs or [])
++ map getBin (args.propagatedBuildInputs or []);

qmakeFlags =
(args.qmakeFlags or [])
++ optional (debug != null)
Expand Down Expand Up @@ -81,7 +77,13 @@ let

setupHook = ../qtsubmodule-setup-hook.sh;

meta = self.qtbase.meta // (args.meta or {});
meta = {
homepage = http://www.qt.io;
description = "A cross-platform application framework for C++";
license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
maintainers = with maintainers; [ qknight ttuegel periklis ];
platforms = platforms.unix;
} // (args.meta or {});
});

addPackages = self: with self;
Expand Down
41 changes: 22 additions & 19 deletions pkgs/development/libraries/qt-5/5.8/qtbase/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ stdenv.mkDerivation {
[ bison flex gperf lndir perl pkgconfig python2 ]
++ lib.optional (!stdenv.isDarwin) patchelf;

outputs = [ "out" "dev" ];
outputs = [ "out" "dev" "bin" ];

patches =
copyPathsToStore (lib.readPathsFromFile ./. ./series);
Expand Down Expand Up @@ -264,29 +264,32 @@ stdenv.mkDerivation {

enableParallelBuilding = true;

postInstall = ''
find "$out" -name "*.cmake" | while read file; do
substituteInPlace "$file" \
--subst-var-by NIX_OUT "$out" \
--subst-var-by NIX_DEV "$dev"
done
'';
postInstall =
# Hardcode some CMake module paths.
''
find "$out" -name "*.cmake" | while read file; do
substituteInPlace "$file" \
--subst-var-by NIX_OUT "$out" \
--subst-var-by NIX_DEV "$dev"
done
'';

preFixup = ''
# We cannot simply set these paths in configureFlags because libQtCore retains
# references to the paths it was built with.
moveToOutput "bin" "$dev"
moveToOutput "include" "$dev"
moveToOutput "mkspecs" "$dev"
preFixup =
# Move selected outputs.
''
moveToOutput "bin" "$dev"
moveToOutput "include" "$dev"
moveToOutput "mkspecs" "$dev"
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "$dev/share"
moveToOutput "share/doc" "$dev"
'';
mkdir -p "$dev/share"
moveToOutput "share/doc" "$dev"
moveToOutput "$qtPluginPrefix" "$bin"
'';

postFixup =
# Don't retain build-time dependencies like gdb.
''
# Don't retain build-time dependencies like gdb.
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
''

Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtconnectivity.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
qtSubmodule {
name = "qtconnectivity";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
6 changes: 6 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtdeclarative/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ qtSubmodule {
patches = copyPathsToStore (readPathsFromFile ./. ./series);
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
nativeBuildInputs = [ python2 ];
outputs = [ "out" "dev" "bin" ];

preConfigure = ''
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""
'';

postInstall = ''
moveToOutput "$qtPluginPrefix" "$bin"
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
1 change: 1 addition & 0 deletions pkgs/development/libraries/qt-5/5.8/qtdoc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
qtSubmodule {
name = "qtdoc";
qtInputs = [ qtdeclarative ];
outputs = [ "out" ];
}
5 changes: 5 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtlocation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
qtSubmodule {
name = "qtlocation";
qtInputs = [ qtbase qtmultimedia ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtPluginPrefix" "$bin"
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
5 changes: 5 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtmultimedia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ qtSubmodule {
qtInputs = [ qtbase qtdeclarative ];
buildInputs = [ pkgconfig gstreamer gst-plugins-base libpulseaudio]
++ optional (stdenv.isLinux) alsaLib;
outputs = [ "out" "dev" "bin" ];
qmakeFlags = [ "GST_VERSION=1.0" ];
NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc";
postInstall = ''
moveToOutput "$qtPluginPrefix" "$bin"
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtquickcontrols2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
qtSubmodule {
name = "qtquickcontrols2";
qtInputs = [ qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
5 changes: 5 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtsensors.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ with stdenv.lib;
qtSubmodule {
name = "qtsensors";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtPluginPrefix" "$bin"
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtsvg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
qtSubmodule {
name = "qtsvg";
qtInputs = [ qtbase ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtPluginPrefix" "$bin"
'';
}
8 changes: 4 additions & 4 deletions pkgs/development/libraries/qt-5/5.8/qttools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ with stdenv.lib;
qtSubmodule {
name = "qttools";
qtInputs = [ qtbase ];

outputs = [ "out" "dev" "bin" ];
patches = copyPathsToStore (readPathsFromFile ./. ./series);
postFixup = ''
moveToOutput "bin/qdbus" "$out"
moveToOutput "bin/qtpaths" "$out"
postInstall = ''
moveToOutput "bin/qdbus" "$bin"
moveToOutput "bin/qtpaths" "$bin"
'';
}
5 changes: 5 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtwayland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ qtSubmodule {
qtInputs = [ qtbase qtquickcontrols ];
buildInputs = [ wayland ];
nativeBuildInputs = [ pkgconfig ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtPluginPrefix" "$bin"
moveToOutput "$qtQmlPrefix "$bin"
'';
}
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtwebchannel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
qtSubmodule {
name = "qtwebchannel";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtQmlPrefix" "$bin"
'';
}

3 changes: 3 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtwebengine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ qtSubmodule {
buildInputs = [ bison flex git which gperf ];
nativeBuildInputs = [ pkgconfig python2 coreutils ];
doCheck = true;
outputs = [ "out" "dev" "bin" ];

enableParallelBuilding = true;

Expand Down Expand Up @@ -90,5 +91,7 @@ qtSubmodule {
EOF
paxmark m $out/libexec/QtWebEngineProcess
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/5.8/qtwebsockets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
qtSubmodule {
name = "qtwebsockets";
qtInputs = [ qtbase qtdeclarative ];
outputs = [ "out" "dev" "bin" ];
postInstall = ''
moveToOutput "$qtQmlPrefix" "$bin"
'';
}
Loading

0 comments on commit 6fa4178

Please sign in to comment.