Merge #12740: multiple outputs for Qt 5 and KDE 5

This commit is contained in:
Vladimír Čunát 2016-02-03 17:09:09 +01:00
commit d3a3aa8674
78 changed files with 733 additions and 417 deletions

View File

@ -55,12 +55,12 @@ in
services.xserver.desktopManager.session = singleton {
name = "kde5";
bgSupport = true;
start = ''exec ${kde5.plasma-workspace}/bin/startkde;'';
start = ''exec startkde;'';
};
security.setuidOwners = singleton {
program = "kcheckpass";
source = "${kde5.plasma-workspace}/lib/libexec/kcheckpass";
source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass";
owner = "root";
group = "root";
setuid = true;
@ -168,12 +168,12 @@ in
# Enable GTK applications to load SVG icons
environment.variables = mkIf (lib.hasAttr "breeze-icons" kde5) {
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
};
fonts.fonts = [ (kde5.oxygen-fonts or pkgs.noto-fonts) ];
programs.ssh.askPassword = "${kde5.ksshaskpass}/bin/ksshaskpass";
programs.ssh.askPassword = "${kde5.ksshaskpass.out}/bin/ksshaskpass";
# Enable helpful DBus services.
services.udisks2.enable = true;

View File

@ -1,6 +1,6 @@
{ fetchurl, stdenv, dpkg, xorg, alsaLib, makeWrapper, openssl_1_0_1, freetype
, glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf
, libgcrypt, udev, fontconfig, dbus, expat, ffmpeg_0_10, curl, zlib, gnome }:
, libgcrypt, libudev, fontconfig, dbus, expat, ffmpeg_0_10, curl, zlib, gnome }:
assert stdenv.system == "x86_64-linux";
@ -27,7 +27,7 @@ let
nss
pango
stdenv.cc.cc
udev
libudev
xorg.libX11
xorg.libXcomposite
xorg.libXcursor

View File

@ -72,7 +72,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ lndir makeQtWrapper ];
buildInputs = [ unwrapped ] ++ themes;
inherit themes;
themes = map (pkg: pkg.out or pkg) themes;
inherit unwrapped;
installPhase = ''
@ -81,7 +81,7 @@ stdenv.mkDerivation {
mkdir -p "$out/share/sddm"
for pkg in $unwrapped $themes; do
local sddmDir="$pkg/share/sddm"
if [[ -d "$sddmDir" ]]; then
if [ -d "$sddmDir" ]; then
lndir -silent "$sddmDir" "$out/share/sddm"
fi
done

View File

@ -11,6 +11,8 @@ stdenv.mkDerivation (args // {
name = "${name}-${version}";
inherit src;
outputs = args.outputs or [ "dev" "out" ];
cmakeFlags =
(args.cmakeFlags or [])
++ [ "-DBUILD_TESTING=OFF" ]

View File

@ -6,6 +6,8 @@ kdeApp (args // {
sname = "kde-l10n-${name}";
name = "kde-l10n-${name}-qt4";
outputs = [ "out" ];
nativeBuildInputs =
[ automoc4 cmake gettext perl ]
++ (args.nativeBuildInputs or []);
@ -17,4 +19,9 @@ kdeApp (args // {
sed -e 's/add_subdirectory(5)//' -i CMakeLists.txt
${args.preConfigure or ""}
'';
preFixup = ''
propagatedBuildInputs=
propagatedNativeBuildInputs=
'';
})

View File

@ -6,6 +6,8 @@ kdeApp (args // {
sname = "kde-l10n-${name}";
name = "kde-l10n-${name}-qt5";
outputs = [ "out" ];
nativeBuildInputs =
[ cmake extra-cmake-modules gettext kdoctools ]
++ (args.nativeBuildInputs or []);
@ -14,4 +16,9 @@ kdeApp (args // {
sed -e 's/add_subdirectory(4)//' -i CMakeLists.txt
${args.preConfigure or ""}
'';
preFixup = ''
propagatedBuildInputs=
propagatedNativeBuildInputs=
'';
})

View File

@ -9,6 +9,8 @@
kdeApp {
name = "kdelibs";
outputs = [ "out" ];
buildInputs = [
attica attr avahi giflib libdbusmenu_qt libjpeg libxml2
polkit_qt4 qca2 shared_desktop_ontologies udev xz pcre

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, rpm, cpio, mesa, xorg, cairo
, libpng, gtk, glib, gdk_pixbuf, fontconfig, freetype, curl
, dbus_glib, alsaLib, libpulseaudio, udev, pango
, dbus_glib, alsaLib, libpulseaudio, libudev, pango
}:
with stdenv.lib;
@ -36,7 +36,7 @@ let
alsaLib
libpulseaudio
dbus_glib
udev
libudev
curl
pango
cairo

View File

@ -26,7 +26,7 @@ let
name = "${name}-${version}";
inherit src;
setupHook = args.setupHook or ./setup-hook.sh;
outputs = args.outputs or [ "dev" "out" ];
cmakeFlags =
(args.cmakeFlags or [])
@ -48,8 +48,11 @@ let
breeze-qt4 = callPackage ./breeze-qt4.nix {};
breeze-qt5 = callPackage ./breeze-qt5.nix {};
breeze =
let version = (builtins.parseDrvName breeze-qt5.name).version;
in symlinkJoin "breeze-${version}" [ breeze-gtk breeze-qt4 breeze-qt5 ];
let
version = (builtins.parseDrvName breeze-qt5.name).version;
in
symlinkJoin "breeze-${version}"
(map (pkg: pkg.out or pkg) [ breeze-gtk breeze-qt4 breeze-qt5 ]);
kde-cli-tools = callPackage ./kde-cli-tools.nix {};
kde-gtk-config = callPackage ./kde-gtk-config {};
kdecoration = callPackage ./kdecoration.nix {};

View File

@ -22,7 +22,7 @@ plasmaPackage {
];
propagatedBuildInputs = [ ki18n kio ];
cmakeFlags = [
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib}/lib/glib-2.0/include"
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2}/lib/gtk-2.0/include"
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
];
}

View File

@ -23,11 +23,6 @@ plasmaPackage {
qtdeclarative
qtgraphicaleffects
];
propagatedUserEnvPkgs = [
libkscreen # D-Bus service
qtdeclarative # QML import
qtgraphicaleffects # QML import
];
postInstall = ''
wrapQtProgram "$out/bin/kscreen-console"
'';

View File

@ -60,9 +60,6 @@ plasmaPackage rec {
qtquickcontrols
qtx11extras
];
# All propagatedBuildInputs should be present in the profile because
# wrappers cannot be used here.
propagatedUserEnvPkgs = propagatedBuildInputs;
patches = [
./0001-qt-5.5-QML-import-paths.patch
(substituteAll {

View File

@ -17,7 +17,4 @@ plasmaPackage rec {
baloo kactivities kdeclarative kfilemetadata ki18n kio
plasma-framework
];
# All propagatedBuildInputs should be present in the profile because
# wrappers cannot be used here.
propagatedUserEnvPkgs = propagatedBuildInputs;
}

View File

@ -11,7 +11,7 @@
, xprop, xrdb, xset, xsetroot, solid, qtquickcontrols
}:
plasmaPackage rec {
plasmaPackage {
name = "plasma-workspace";
nativeBuildInputs = [
@ -20,10 +20,11 @@ plasmaPackage rec {
makeQtWrapper
];
buildInputs = [
kcmutils kcrash kdbusaddons kdesu kdewebkit kjsembed knewstuff
knotifyconfig kpackage ktextwidgets kwallet kwayland kxmlrpcclient
libdbusmenu libSM libXcursor networkmanager-qt pam phonon
qtscript wayland
dbus_tools kcmutils kconfig kcrash kdbusaddons kdesu kdewebkit
kinit kjsembed knewstuff knotifyconfig kpackage kservice
ktextwidgets kwallet kwayland kxmlrpcclient libdbusmenu libSM
libXcursor mkfontdir networkmanager-qt pam phonon qtscript qttools
socat wayland xmessage xprop xset xsetroot
];
propagatedBuildInputs = [
baloo kactivities kdeclarative kdelibs4support kglobalaccel
@ -32,13 +33,31 @@ plasmaPackage rec {
];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
inherit bash coreutils gnused gnugrep socat;
inherit kconfig kinit kservice qttools;
inherit dbus_tools mkfontdir xmessage xprop xrdb xset xsetroot;
postPatch = ''
substituteAllInPlace startkde/startkde.cmake
substituteInPlace startkde/startkde.cmake \
--subst-var-by bash $(type -P bash) \
--subst-var-by sed $(type -P sed) \
--subst-var-by grep $(type -P grep) \
--subst-var-by socat $(type -P socat) \
--subst-var-by kcheckrunning $(type -P kcheckrunning) \
--subst-var-by xmessage $(type -P xmessage) \
--subst-var-by tr $(type -P tr) \
--subst-var-by qtpaths $(type -P qtpaths) \
--subst-var-by qdbus $(type -P qdbus) \
--subst-var-by dbus-launch $(type -P dbus-launch) \
--subst-var-by mkfontdir $(type -P mkfontdir) \
--subst-var-by xset $(type -P xset) \
--subst-var-by xsetroot $(type -P xsetroot) \
--subst-var-by xprop $(type -P xprop) \
--subst-var-by start_kdeinit_wrapper "${kinit.out}/lib/libexec/kf5/start_kdeinit_wrapper" \
--subst-var-by kwrapper5 $(type -P kwrapper5) \
--subst-var-by kdeinit5_shutdown $(type -P kdeinit5_shutdown) \
--subst-var-by kbuildsycoca5 $(type -P kbuildsycoca5) \
--subst-var-by kreadconfig5 $(type -P kreadconfig5) \
--subst-var out
substituteInPlace startkde/kstartupconfig/kstartupconfig.cpp \
--replace kdostartupconfig5 $out/bin/kdostartupconfig5
--replace kdostartupconfig5 $out/bin/kdostartupconfig5
'';
postInstall = ''

View File

@ -4,7 +4,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
+++ plasma-workspace-5.5.1/startkde/startkde.cmake
@@ -1,8 +1,31 @@
-#!/bin/sh
+#!@bash@/bin/bash
+#!@bash@
#
# DEFAULT KDE STARTUP SCRIPT ( @PROJECT_VERSION@ )
#
@ -29,7 +29,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
+# in Trolltech.conf. A better solution would be to stop
+# Qt from doing this wackiness in the first place.
+if [ -e $HOME/.config/Trolltech.conf ]; then
+ @gnused@/bin/sed -e '/nix\\store\|nix\/store/ d' -i $HOME/.config/Trolltech.conf
+ @sed@ -e '/nix\\store\|nix\/store/ d' -i $HOME/.config/Trolltech.conf
+fi
+
if test "x$1" = x--failsafe; then
@ -54,13 +54,13 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
-
# Check if a KDE session already is running and whether it's possible to connect to X
-kcheckrunning
+@out@/bin/kcheckrunning
+@kcheckrunning@
kcheckrunning_result=$?
if test $kcheckrunning_result -eq 0 ; then
- echo "KDE seems to be already running on this display."
- xmessage -geometry 500x100 "KDE seems to be already running on this display." > /dev/null 2>/dev/null
+ echo "KDE seems to be already running on this display."
+ @xmessage@/bin/xmessage -geometry 500x100 "KDE seems to be already running on this display."
+ @xmessage@ -geometry 500x100 "KDE seems to be already running on this display."
exit 1
elif test $kcheckrunning_result -eq 2 ; then
echo "\$DISPLAY is not set or cannot connect to the X server."
@ -80,7 +80,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
-fi
-
-mkdir -p $configDir
+configDir=$(@qttools@/bin/qtpaths --writable-path GenericConfigLocation)
+configDir=$(@qtpaths@ --writable-path GenericConfigLocation)
+mkdir -p "$configDir"
#This is basically setting defaults so we can use them with kstartupconfig5
@ -126,7 +126,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
returncode=$?
if test $returncode -ne 0; then
- xmessage -geometry 500x100 "kstartupconfig5 does not exist or fails. The error code is $returncode. Check your installation."
+ @xmessage@/bin/xmessage -geometry 500x100 "kstartupconfig5 does not exist or fails. The error code is $returncode. Check your installation."
+ @xmessage@ -geometry 500x100 "kstartupconfig5 does not exist or fails. The error code is $returncode. Check your installation."
exit 1
fi
[ -r $configDir/startupconfig ] && . $configDir/startupconfig
@ -134,7 +134,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
export QT_DEVICE_PIXEL_RATIO=$kdeglobals_kscreen_scalefactor
fi
+XCURSOR_PATH=~/.icons:$(echo "$XDG_DATA_DIRS" | @coreutils@/bin/tr ":" "\n" | @gnused@/bin/sed 's,$,/icons,g' | @coreutils@/bin/tr "\n" ":")
+XCURSOR_PATH=~/.icons:$(echo "$XDG_DATA_DIRS" | @tr@ ":" "\n" | @sed@ 's,$,/icons,g' | @tr@ "\n" ":")
+export XCURSOR_PATH
+
# XCursor mouse theme needs to be applied here to work even for kded or ksmserver
@ -160,7 +160,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
+# If the user has overwritten fonts, the cursor font may be different now
+# so don't move this up.
+#
+@xsetroot@/bin/xsetroot -cursor_name left_ptr
+@xsetroot@ -cursor_name left_ptr
dl=$DESKTOP_LOCKED
unset DESKTOP_LOCKED # Don't want it in the environment
@ -168,14 +168,14 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
+# Make sure that D-Bus is running
+# D-Bus autolaunch is broken
+if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
+ eval `@dbus_tools@/bin/dbus-launch --sh-syntax --exit-with-session`
+ eval `@dbus-launch@ --sh-syntax --exit-with-session`
+fi
+if @qttools@/bin/qdbus >/dev/null 2>/dev/null; then
+if @qdbus@ >/dev/null 2>/dev/null; then
+ : # ok
+else
+ echo 'startkde: Could not start D-Bus. Can you call qdbus?' 1>&2
+ test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
+ @xmessage@/bin/xmessage -geometry 500x100 "Could not start D-Bus. Can you call qdbus?"
+ @xmessage@ -geometry 500x100 "Could not start D-Bus. Can you call qdbus?"
+ exit 1
+fi
+
@ -195,7 +195,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
-# TODO: Use GenericConfigLocation once we depend on Qt 5.4
-scriptpath=`qtpaths --paths ConfigLocation | tr ':' '\n' | sed 's,$,/plasma-workspace,g'`
+scriptpath=$(@qttools@/bin/qtpaths --paths GenericConfigLocation | tr ':' '\n' | @gnused@/bin/sed 's,$,/plasma-workspace,g')
+scriptpath=$(@qtpaths@ --paths GenericConfigLocation | tr ':' '\n' | @sed@ 's,$,/plasma-workspace,g')
# Add /env/ to the directory to locate the scripts to be sourced
for prefix in `echo $scriptpath`; do
@ -204,7 +204,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
if test -n "$KDEDIRS"; then
- kdedirs_first=`echo "$KDEDIRS"|sed -e 's/:.*//'`
+ kdedirs_first=`echo "$KDEDIRS" | @gnused@/bin/sed -e 's/:.*//'`
+ kdedirs_first=`echo "$KDEDIRS" | @sed@ -e 's/:.*//'`
sys_odir=$kdedirs_first/share/fonts/override
sys_fdir=$kdedirs_first/share/fonts
else
@ -216,10 +216,10 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
-test -d "$usr_odir" && (mkfontdir "$usr_odir" ; xset +fp "$usr_odir")
-test -d "$usr_fdir" && (mkfontdir "$usr_fdir" ; xset fp+ "$usr_fdir")
-test -d "$sys_fdir" && xset fp+ "$sys_fdir"
+test -d "$sys_odir" && @xset@/bin/xset +fp "$sys_odir"
+test -d "$usr_odir" && ( @mkfontdir@/bin/mkfontdir "$usr_odir" ; @xset@/bin/xset +fp "$usr_odir" )
+test -d "$usr_fdir" && ( @mkfontdir@/bin/mkfontdir "$usr_fdir" ; @xset@/bin/xset fp+ "$usr_fdir" )
+test -d "$sys_fdir" && @xset@/bin/xset fp+ "$sys_fdir"
+test -d "$sys_odir" && @xset@ +fp "$sys_odir"
+test -d "$usr_odir" && ( @mkfontdir@ "$usr_odir" ; @xset@ +fp "$usr_odir" )
+test -d "$usr_fdir" && ( @mkfontdir@ "$usr_fdir" ; @xset@ fp+ "$usr_fdir" )
+test -d "$sys_fdir" && @xset@ fp+ "$sys_fdir"
# Ask X11 to rebuild its font list.
-xset fp rehash
@ -233,7 +233,7 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
-# so don't move this up.
-#
-xsetroot -cursor_name left_ptr
+@xset@/bin/xset fp rehash
+@xset@ fp rehash
# Get Ghostscript to look into user's KDE fonts dir for additional Fontmap
if test -n "$GS_LIB" ; then
@ -269,12 +269,12 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
KDE_FULL_SESSION=true
export KDE_FULL_SESSION
-xprop -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true
+@xprop@/bin/xprop -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true
+@xprop@ -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true
KDE_SESSION_VERSION=5
export KDE_SESSION_VERSION
-xprop -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5
+@xprop@/bin/xprop -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5
+@xprop@ -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5
KDE_SESSION_UID=`id -ru`
export KDE_SESSION_UID
@ -283,12 +283,12 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
# At this point all the environment is ready, let's send it to kwalletd if running
if test -n "$PAM_KWALLET_LOGIN" ; then
- env | socat STDIN UNIX-CONNECT:$PAM_KWALLET_LOGIN
+ env | @socat@/bin/socat STDIN UNIX-CONNECT:$PAM_KWALLET_LOGIN
+ env | @socat@ STDIN UNIX-CONNECT:$PAM_KWALLET_LOGIN
fi
# ...and also to kwalletd5
if test -n "$PAM_KWALLET5_LOGIN" ; then
- env | socat STDIN UNIX-CONNECT:$PAM_KWALLET5_LOGIN
+ env | @socat@/bin/socat STDIN UNIX-CONNECT:$PAM_KWALLET5_LOGIN
+ env | @socat@ STDIN UNIX-CONNECT:$PAM_KWALLET5_LOGIN
fi
# At this point all environment variables are set, let's send it to the DBus session server to update the activation environment
@ -297,27 +297,27 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
echo 'startkde: Could not sync environment to dbus.' 1>&2
test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
- xmessage -geometry 500x100 "Could not sync environment to dbus."
+ @xmessage@/bin/xmessage -geometry 500x100 "Could not sync environment to dbus."
+ @xmessage@ -geometry 500x100 "Could not sync environment to dbus."
exit 1
fi
# We set LD_BIND_NOW to increase the efficiency of kdeinit.
# kdeinit unsets this variable before loading applications.
-LD_BIND_NOW=true @CMAKE_INSTALL_FULL_LIBEXECDIR_KF5@/start_kdeinit_wrapper --kded +kcminit_startup
+LD_BIND_NOW=true @kinit@/lib/libexec/kf5/start_kdeinit_wrapper --kded +kcminit_startup
+LD_BIND_NOW=true @start_kdeinit_wrapper@ --kded +kcminit_startup
if test $? -ne 0; then
# Startup error
echo 'startkde: Could not start kdeinit5. Check your installation.' 1>&2
test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
- xmessage -geometry 500x100 "Could not start kdeinit5. Check your installation."
+ @xmessage@/bin/xmessage -geometry 500x100 "Could not start kdeinit5. Check your installation."
+ @xmessage@ -geometry 500x100 "Could not start kdeinit5. Check your installation."
exit 1
fi
+# (NixOS) We run kbuildsycoca5 before starting the user session because things
+# may be missing or moved if they have run nixos-rebuild and it may not be
+# possible for them to start Konsole to run it manually!
+@kservice@/bin/kbuildsycoca5
+@kbuildsycoca5@
+
# finally, give the session control to the session manager
# see kdebase/ksmserver for the description of the rest of the startup sequence
@ -327,33 +327,33 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
KSMSERVEROPTIONS=""
test -n "$dl" && KSMSERVEROPTIONS=" --lockscreen"
-kwrapper5 @CMAKE_INSTALL_FULL_BINDIR@/ksmserver $KDEWM $KSMSERVEROPTIONS
+@kinit@/bin/kwrapper5 @CMAKE_INSTALL_FULL_BINDIR@/ksmserver $KDEWM $KSMSERVEROPTIONS
+@kwrapper5@ @CMAKE_INSTALL_FULL_BINDIR@/ksmserver $KDEWM $KSMSERVEROPTIONS
if test $? -eq 255; then
# Startup error
echo 'startkde: Could not start ksmserver. Check your installation.' 1>&2
test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
- xmessage -geometry 500x100 "Could not start ksmserver. Check your installation."
+ @xmessage@/bin/xmessage -geometry 500x100 "Could not start ksmserver. Check your installation."
+ @xmessage@ -geometry 500x100 "Could not start ksmserver. Check your installation."
fi
-wait_drkonqi=`kreadconfig5 --file startkderc --group WaitForDrKonqi --key Enabled --default true`
+wait_drkonqi=`@kconfig@/bin/kreadconfig5 --file startkderc --group WaitForDrKonqi --key Enabled --default true`
+wait_drkonqi=`@kreadconfig5@ --file startkderc --group WaitForDrKonqi --key Enabled --default true`
if test x"$wait_drkonqi"x = x"true"x ; then
# wait for remaining drkonqi instances with timeout (in seconds)
- wait_drkonqi_timeout=`kreadconfig5 --file startkderc --group WaitForDrKonqi --key Timeout --default 900`
+ wait_drkonqi_timeout=`@kconfig@/bin/kreadconfig5 --file startkderc --group WaitForDrKonqi --key Timeout --default 900`
+ wait_drkonqi_timeout=`@kreadconfig5@ --file startkderc --group WaitForDrKonqi --key Timeout --default 900`
wait_drkonqi_counter=0
- while $qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do
+ while @qttools@/bin/qdbus | @gnugrep@/bin/grep "^[^w]*org.kde.drkonqi" > /dev/null ; do
+ while @qdbus@ | @grep@ "^[^w]*org.kde.drkonqi" > /dev/null ; do
sleep 5
wait_drkonqi_counter=$((wait_drkonqi_counter+5))
if test "$wait_drkonqi_counter" -ge "$wait_drkonqi_timeout" ; then
# ask remaining drkonqis to die in a graceful way
- $qdbus | grep 'org.kde.drkonqi-' | while read address ; do
- $qdbus "$address" "/MainApplication" "quit"
+ @qttools@/bin/qdbus | @gnugrep@/bin/grep 'org.kde.drkonqi-' | while read address ; do
+ @qttools@/bin/qdbus "$address" "/MainApplication" "quit"
+ @qdbus@ | @grep@ 'org.kde.drkonqi-' | while read address ; do
+ @qdbus@ "$address" "/MainApplication" "quit"
done
break
fi
@ -362,14 +362,14 @@ Index: plasma-workspace-5.5.1/startkde/startkde.cmake
# Clean up
-kdeinit5_shutdown
+@kinit@/bin/kdeinit5_shutdown
+@kdeinit5_shutdown@
unset KDE_FULL_SESSION
-xprop -root -remove KDE_FULL_SESSION
+@xprop@/bin/xprop -root -remove KDE_FULL_SESSION
+@xprop@ -root -remove KDE_FULL_SESSION
unset KDE_SESSION_VERSION
-xprop -root -remove KDE_SESSION_VERSION
+@xprop@/bin/xprop -root -remove KDE_SESSION_VERSION
+@xprop@ -root -remove KDE_SESSION_VERSION
unset KDE_SESSION_UID
echo 'startkde: Done.' 1>&2

View File

@ -1 +0,0 @@
addToSearchPath XDG_DATA_DIRS @out@/share

View File

@ -6,5 +6,5 @@
kdeFramework {
name = "breeze-icons";
nativeBuildInputs = [ extra-cmake-modules ];
propagatedUserEnvPkgs = [ qtsvg ];
buildInputs = [ qtsvg ];
}

View File

@ -23,6 +23,8 @@ let
name = "${name}-${version}";
inherit src;
outputs = args.outputs or [ "dev" "out" ];
cmakeFlags =
(args.cmakeFlags or [])
++ [ "-DBUILD_TESTING=OFF" ]
@ -58,14 +60,14 @@ let
kdbusaddons = callPackage ./kdbusaddons.nix {};
kdeclarative = callPackage ./kdeclarative.nix {};
kded = callPackage ./kded.nix {};
kdelibs4support = callPackage ./kdelibs4support.nix {};
kdelibs4support = callPackage ./kdelibs4support {};
kdesignerplugin = callPackage ./kdesignerplugin.nix {};
kdewebkit = callPackage ./kdewebkit.nix {};
kdesu = callPackage ./kdesu.nix {};
kdnssd = callPackage ./kdnssd.nix {};
kdoctools = callPackage ./kdoctools {};
kemoticons = callPackage ./kemoticons.nix {};
kfilemetadata = callPackage ./kfilemetadata.nix {};
kfilemetadata = callPackage ./kfilemetadata {};
kglobalaccel = callPackage ./kglobalaccel.nix {};
kguiaddons = callPackage ./kguiaddons.nix {};
khtml = callPackage ./khtml.nix {};

View File

@ -1,74 +0,0 @@
From 3cc148e878b69fc3e0228f3e3bf1bbe689dad87c Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Fri, 20 Feb 2015 23:17:39 -0600
Subject: [PATCH] extra-cmake-modules paths
---
kde-modules/KDEInstallDirs.cmake | 37 ++++---------------------------------
1 file changed, 4 insertions(+), 33 deletions(-)
diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake
index b7cd34d..2f868ac 100644
--- a/kde-modules/KDEInstallDirs.cmake
+++ b/kde-modules/KDEInstallDirs.cmake
@@ -193,37 +193,8 @@
# (To distribute this file outside of extra-cmake-modules, substitute the full
# License text for the above reference.)
-# Figure out what the default install directory for libraries should be.
-# This is based on the logic in GNUInstallDirs, but simplified (the
-# GNUInstallDirs code deals with re-configuring, but that is dealt with
-# by the _define_* macros in this module).
+# The default library directory on NixOS is *always* /lib.
set(_LIBDIR_DEFAULT "lib")
-# Override this default 'lib' with 'lib64' iff:
-# - we are on a Linux, kFreeBSD or Hurd system but NOT cross-compiling
-# - we are NOT on debian
-# - we are on a 64 bits system
-# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
-# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
-# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
-# See http://wiki.debian.org/Multiarch
-if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
- AND NOT CMAKE_CROSSCOMPILING)
- if (EXISTS "/etc/debian_version") # is this a debian system ?
- if(CMAKE_LIBRARY_ARCHITECTURE)
- set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
- endif()
- else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
- if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
- message(AUTHOR_WARNING
- "Unable to determine default LIB_INSTALL_LIBDIR directory because no target architecture is known. "
- "Please enable at least one language before including KDEInstallDirs.")
- else()
- if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
- set(_LIBDIR_DEFAULT "lib64")
- endif()
- endif()
- endif()
-endif()
set(_gnu_install_dirs_vars
BINDIR
@@ -445,15 +416,15 @@ if(KDE_INSTALL_USE_QT_SYS_PATHS)
"QtQuick2 imports"
QML_INSTALL_DIR)
else()
- _define_relative(QTPLUGINDIR LIBDIR "plugins"
+ _define_relative(QTPLUGINDIR LIBDIR "qt5/plugins"
"Qt plugins"
QT_PLUGIN_INSTALL_DIR)
- _define_relative(QTQUICKIMPORTSDIR QTPLUGINDIR "imports"
+ _define_relative(QTQUICKIMPORTSDIR QTPLUGINDIR "qt5/imports"
"QtQuick1 imports"
IMPORTS_INSTALL_DIR)
- _define_relative(QMLDIR LIBDIR "qml"
+ _define_relative(QMLDIR LIBDIR "qt5/qml"
"QtQuick2 imports"
QML_INSTALL_DIR)
endif()
--
2.3.0

View File

@ -1,9 +1,11 @@
{ kdeFramework, lib, stdenv, cmake, pkgconfig, qttools }:
{ kdeFramework, lib, copyPathsToStore, cmake, pkgconfig, qttools }:
kdeFramework {
name = "extra-cmake-modules";
patches = [ ./0001-extra-cmake-modules-paths.patch ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
outputs = [ "out" ]; # this package has no runtime components
setupHook = ./setup-hook.sh;
# It is OK to propagate these inputs as long as
@ -11,8 +13,8 @@ kdeFramework {
# of some other derivation.
propagatedNativeBuildInputs = [ cmake pkgconfig qttools ];
meta = {
license = stdenv.lib.licenses.bsd2;
maintainers = [ lib.maintainers.ttuegel ];
meta = with lib; {
license = licenses.bsd2;
maintainers = [ maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,37 @@
Index: extra-cmake-modules-5.18.0/kde-modules/KDEInstallDirs.cmake
===================================================================
--- extra-cmake-modules-5.18.0.orig/kde-modules/KDEInstallDirs.cmake
+++ extra-cmake-modules-5.18.0/kde-modules/KDEInstallDirs.cmake
@@ -200,32 +200,6 @@
# GNUInstallDirs code deals with re-configuring, but that is dealt with
# by the _define_* macros in this module).
set(_LIBDIR_DEFAULT "lib")
-# Override this default 'lib' with 'lib64' iff:
-# - we are on a Linux, kFreeBSD or Hurd system but NOT cross-compiling
-# - we are NOT on debian
-# - we are on a 64 bits system
-# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
-# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
-# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
-# See http://wiki.debian.org/Multiarch
-if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
- AND NOT CMAKE_CROSSCOMPILING)
- if (EXISTS "/etc/debian_version") # is this a debian system ?
- if(CMAKE_LIBRARY_ARCHITECTURE)
- set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
- endif()
- else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
- if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
- message(AUTHOR_WARNING
- "Unable to determine default LIB_INSTALL_LIBDIR directory because no target architecture is known. "
- "Please enable at least one language before including KDEInstallDirs.")
- else()
- if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
- set(_LIBDIR_DEFAULT "lib64")
- endif()
- endif()
- endif()
-endif()
set(_gnu_install_dirs_vars
BINDIR

View File

@ -0,0 +1 @@
nix-lib-path.patch

View File

@ -1,27 +1,81 @@
addMimePkg() {
local propagated
if [[ -d "$1/share/mime" ]]; then
propagated=
for pkg in $propagatedBuildInputs; do
if [[ "z$pkg" == "z$1" ]]; then
propagated=1
fi
done
if [[ -z $propagated ]]; then
propagatedBuildInputs="$propagatedBuildInputs $1"
fi
propagated=
for pkg in $propagatedUserEnvPkgs; do
if [[ "z$pkg" == "z$1" ]]; then
propagated=1
fi
done
if [[ -z $propagated ]]; then
propagatedUserEnvPkgs="$propagatedUserEnvPkgs $1"
fi
fi
_ecmSetXdgDirs() {
addToSearchPathOnce XDG_DATA_DIRS "$1/share"
addToSearchPathOnce XDG_CONFIG_DIRS "$1/etc/xdg"
addToSearchPathOnce NIX_WRAP_XDG_CONFIG_DIRS "$1/etc/xdg"
}
envHooks+=(addMimePkg)
_ecmPropagateSharedData() {
local sharedPaths=( \
"config.cfg" \
"doc" \
"kconf_update" \
"kservices5" \
"kservicetypes5" \
"kxmlgui5" \
"knotifications5" \
"icons" \
"sounds" \
"templates" \
"wallpapers" \
"applications" \
"desktop-directories" \
"mime" \
"info" \
"dbus-1" \
"interfaces" \
"services" \
"system-services" )
for dir in ${sharedPaths[@]}; do
if [ -d "$1/share/$dir" ]; then
addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share"
propagateOnce propagatedUserEnvPkgs "$1"
break
fi
done
}
_ecmConfig() {
# Because we need to use absolute paths here, we must set *all* the paths.
cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
cmakeFlags+=" -DKDE_INSTALL_BINDIR=${!outputBin}/bin"
cmakeFlags+=" -DKDE_INSTALL_SBINDIR=${!outputBin}/sbin"
cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputLib}/lib/libexec"
cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputLib}/lib/qt5/plugins"
cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputLib}/lib/qt5/plugins"
cmakeFlags+=" -DKDE_INSTALL_QTQUICKIMPORTSDIR=${!outputLib}/lib/qt5/imports"
cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputLib}/lib/qt5/qml"
cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var"
cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputLib}/share"
cmakeFlags+=" -DKDE_INSTALL_DATADIR=${!outputLib}/share"
cmakeFlags+=" -DKDE_INSTALL_DOCBUNDLEDIR=${!outputLib}/share/doc/HTML"
cmakeFlags+=" -DKDE_INSTALL_KCFGDIR=${!outputLib}/share/config.kcfg"
cmakeFlags+=" -DKDE_INSTALL_KCONFUPDATEDIR=${!outputLib}/share/kconf_update"
cmakeFlags+=" -DKDE_INSTALL_KSERVICES5DIR=${!outputLib}/share/kservices5"
cmakeFlags+=" -DKDE_INSTALL_KSERVICETYPES5DIR=${!outputLib}/share/kservicetypes5"
cmakeFlags+=" -DKDE_INSTALL_KXMLGUI5DIR=${!outputLib}/share/kxmlgui5"
cmakeFlags+=" -DKDE_INSTALL_KNOTIFY5RCDIR=${!outputLib}/share/knotifications5"
cmakeFlags+=" -DKDE_INSTALL_ICONDIR=${!outputLib}/share/icons"
cmakeFlags+=" -DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
cmakeFlags+=" -DKDE_INSTALL_SOUNDDIR=${!outputLib}/share/sounds"
cmakeFlags+=" -DKDE_INSTALL_TEMPLATEDIR=${!outputLib}/share/templates"
cmakeFlags+=" -DKDE_INSTALL_WALLPAPERDIR=${!outputLib}/share/wallpapers"
cmakeFlags+=" -DKDE_INSTALL_APPDIR=${!outputLib}/share/applications"
cmakeFlags+=" -DKDE_INSTALL_DESKTOPDIR=${!outputLib}/share/desktop-directories"
cmakeFlags+=" -DKDE_INSTALL_MIMEDIR=${!outputLib}/share/mime/packages"
cmakeFlags+=" -DKDE_INSTALL_METAINFODIR=${!outputLib}/share/appdata"
cmakeFlags+=" -DKDE_INSTALL_MANDIR=${!outputLib}/share/man"
cmakeFlags+=" -DKDE_INSTALL_INFODIR=${!outputLib}/share/info"
cmakeFlags+=" -DKDE_INSTALL_DBUSDIR=${!outputLib}/share/dbus-1"
cmakeFlags+=" -DKDE_INSTALL_DBUSINTERFACEDIR=${!outputLib}/share/dbus-1/interfaces"
cmakeFlags+=" -DKDE_INSTALL_DBUSSERVICEDIR=${!outputLib}/share/dbus-1/services"
cmakeFlags+=" -DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputLib}/share/dbus-1/system-services"
cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputLib}/etc"
cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputLib}/etc/xdg"
cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputLib}/etc/xdg/autostart"
}
envHooks+=(_ecmSetXdgDirs _ecmPropagateSharedData)
preConfigureHooks+=(_ecmConfig)

View File

@ -0,0 +1,17 @@
Index: kauth-5.18.0/KF5AuthConfig.cmake.in
===================================================================
--- kauth-5.18.0.orig/KF5AuthConfig.cmake.in
+++ kauth-5.18.0/KF5AuthConfig.cmake.in
@@ -4,9 +4,9 @@ set(KAUTH_STUB_FILES_DIR "@PACKAGE_KDE_I
set(KAUTH_BACKEND_NAME "@KAUTH_BACKEND_NAME@")
set(KAUTH_HELPER_BACKEND_NAME "@KAUTH_HELPER_BACKEND_NAME@")
-set(KAUTH_POLICY_FILES_INSTALL_DIR "@KAUTH_POLICY_FILES_INSTALL_DIR@")
-set(KAUTH_HELPER_INSTALL_DIR "@KAUTH_HELPER_INSTALL_DIR@")
-set(KAUTH_HELPER_INSTALL_ABSOLUTE_DIR "@KAUTH_HELPER_INSTALL_ABSOLUTE_DIR@")
+set(KAUTH_POLICY_FILES_INSTALL_DIR "${KDE_INSTALL_DATADIR}/polkit-1/actions")
+set(KAUTH_HELPER_INSTALL_DIR "${KDE_INSTALL_LIBEXECDIR}")
+set(KAUTH_HELPER_INSTALL_ABSOLUTE_DIR "${KDE_INSTALL_LIBEXECDIR}")
find_dependency(KF5CoreAddons "@KF5_DEP_VERSION@")

View File

@ -1,4 +1,4 @@
{ kdeFramework, lib
{ kdeFramework, lib, copyPathsToStore
, extra-cmake-modules
, kcoreaddons
, polkit-qt
@ -9,7 +9,7 @@ kdeFramework {
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ polkit-qt ];
propagatedBuildInputs = [ kcoreaddons ];
patches = [ ./kauth-policy-install.patch ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
meta = {
maintainers = [ lib.maintainers.ttuegel ];
};

View File

@ -1,13 +0,0 @@
diff --git a/KF5AuthConfig.cmake.in b/KF5AuthConfig.cmake.in
index e859ec7..9a8ab18 100644
--- a/KF5AuthConfig.cmake.in
+++ b/KF5AuthConfig.cmake.in
@@ -4,7 +4,7 @@ set(KAUTH_STUB_FILES_DIR "${PACKAGE_PREFIX_DIR}/@KF5_DATA_INSTALL_DIR@/kauth/")
set(KAUTH_BACKEND_NAME "@KAUTH_BACKEND_NAME@")
set(KAUTH_HELPER_BACKEND_NAME "@KAUTH_HELPER_BACKEND_NAME@")
-set(KAUTH_POLICY_FILES_INSTALL_DIR "@KAUTH_POLICY_FILES_INSTALL_DIR@")
+set(KAUTH_POLICY_FILES_INSTALL_DIR "\${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions")
set(KAUTH_HELPER_INSTALL_DIR "@KAUTH_HELPER_INSTALL_DIR@")
find_dependency(KF5CoreAddons "@KF5_DEP_VERSION@")

View File

@ -0,0 +1 @@
cmake-install-paths.patch

View File

@ -1,4 +1,5 @@
{ kdeFramework, lib, extra-cmake-modules, docbook_xml_dtd_45, kauth
{ kdeFramework, lib, copyPathsToStore
, extra-cmake-modules, docbook_xml_dtd_45, kauth
, karchive, kcompletion, kconfig, kconfigwidgets, kcoreaddons
, kcrash, kdbusaddons, kded, kdesignerplugin, kdoctools, kemoticons
, kglobalaccel, kguiaddons, ki18n, kiconthemes, kio, kitemmodels
@ -11,6 +12,9 @@
kdeFramework {
name = "kdelibs4support";
outputs = [ "dev" "out" ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
setupHook = ./setup-hook.sh;
nativeBuildInputs = [ extra-cmake-modules kdoctools ];
buildInputs = [
kcompletion kconfig kded kservice kwidgetsaddons

View File

@ -0,0 +1,13 @@
Index: kdelibs4support-5.18.0/src/kdecore/kstandarddirs.cpp
===================================================================
--- kdelibs4support-5.18.0.orig/src/kdecore/kstandarddirs.cpp
+++ kdelibs4support-5.18.0/src/kdecore/kstandarddirs.cpp
@@ -292,7 +292,7 @@ static QString relativeInstallPath(const
return QFile::decodeName(ICON_INSTALL_DIR "/");
}
if (strcmp("include", type) == 0) {
- return QFile::decodeName(INCLUDE_INSTALL_DIR "/");
+ return QFile::decodeName(qgetenv("NIX_KDE_INCLUDE_DIR"));
}
break;
case 'l':

View File

@ -0,0 +1 @@
nix-kde-include-dir.patch

View File

@ -0,0 +1 @@
export NIX_KDE_INCLUDE_DIR="@dev@/include/" # trailing slash is required!

View File

@ -4,7 +4,6 @@
kdeFramework {
name = "kdoctools";
setupHook = ./setup-hook.sh;
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ karchive ];
propagatedBuildInputs = [ ki18n ];

View File

@ -1,5 +0,0 @@
addXdgData() {
addToSearchPath XDG_DATA_DIRS "$1/share"
}
envHooks+=(addXdgData)

View File

@ -0,0 +1,13 @@
Index: kfilemetadata-5.18.0/src/CMakeLists.txt
===================================================================
--- kfilemetadata-5.18.0.orig/src/CMakeLists.txt
+++ kfilemetadata-5.18.0/src/CMakeLists.txt
@@ -49,7 +49,7 @@ install(TARGETS KF5FileMetaData EXPORT K
install(EXPORT KF5FileMetaDataTargets
NAMESPACE KF5::
- DESTINATION ${LIB_INSTALL_DIR}/cmake/KF5FileMetaData
+ DESTINATION ${KDE_INSTALL_FULL_CMAKEPACKAGEDIR}/KF5FileMetaData
FILE KF5FileMetaDataTargets.cmake)
install(FILES

View File

@ -1,9 +1,10 @@
{ kdeFramework, lib, extra-cmake-modules, attr, ebook_tools, exiv2
, ffmpeg, karchive, ki18n, poppler, qtbase, taglib
{ kdeFramework, lib, copyPathsToStore, extra-cmake-modules
, attr, ebook_tools, exiv2, ffmpeg, karchive, ki18n, poppler, qtbase, taglib
}:
kdeFramework {
name = "kfilemetadata";
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ attr ebook_tools exiv2 ffmpeg karchive poppler taglib ];
propagatedBuildInputs = [ qtbase ki18n ];

View File

@ -0,0 +1 @@
cmake-install-paths.patch

View File

@ -4,11 +4,10 @@
kdeFramework {
name = "kservice";
setupHook = ./setup-hook.sh;
nativeBuildInputs = [ extra-cmake-modules kdoctools ];
propagatedNativeBuildInputs = [ extra-cmake-modules ];
nativeBuildInputs = [ kdoctools ];
buildInputs = [ kcrash kdbusaddons ];
propagatedBuildInputs = [ kconfig kcoreaddons ki18n kwindowsystem ];
propagatedUserEnvPkgs = [ kcoreaddons ];
patches = [
./0001-qdiriterator-follow-symlinks.patch
./0002-no-canonicalize-path.patch

View File

@ -1,43 +0,0 @@
addServicePkg() {
local propagated
for dir in "share/kservices5" "share/kservicetypes5"; do
if [[ -d "$1/$dir" ]]; then
propagated=
for pkg in $propagatedBuildInputs; do
if [[ "z$pkg" == "z$1" ]]; then
propagated=1
break
fi
done
if [[ -z $propagated ]]; then
propagatedBuildInputs="$propagatedBuildInputs $1"
fi
propagated=
for pkg in $propagatedUserEnvPkgs; do
if [[ "z$pkg" == "z$1" ]]; then
propagated=1
break
fi
done
if [[ -z $propagated ]]; then
propagatedUserEnvPkgs="$propagatedUserEnvPkgs $1"
fi
break
fi
done
}
envHooks+=(addServicePkg)
local propagated
for pkg in $propagatedBuildInputs; do
if [[ "z$pkg" == "z@out@" ]]; then
propagated=1
break
fi
done
if [[ -z $propagated ]]; then
propagatedBuildInputs="$propagatedBuildInputs @out@"
fi

View File

@ -37,21 +37,19 @@ let
inherit src;
propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ self.fixQtModuleCMakeConfig ];
NIX_QT_SUBMODULE = args.NIX_QT_SUBMODULE or true;
dontAddPrefix = args.dontAddPrefix or true;
dontFixLibtool = args.dontFixLibtool or true;
configureScript = args.configureScript or "qmake";
outputs = args.outputs or [ "dev" "out" ];
setOutputFlags = false;
enableParallelBuilding = args.enableParallelBuilding or true;
meta = {
homepage = http://qt-project.org;
description = "A cross-platform application framework for C++";
license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
maintainers = with maintainers; [ bbenoist qknight ttuegel ];
platforms = platforms.linux;
} // (args.meta or {});
meta = self.qtbase.meta // (args.meta or {});
});
addPackages = self: with self;
@ -110,7 +108,10 @@ let
];
makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
fixQtModuleCMakeConfig = makeSetupHook { } ./fix-qt-module-cmake-config.sh;
};
in makeScope pkgs.newScope addPackages
self = makeScope pkgs.newScope addPackages;
in self

View File

@ -0,0 +1,5 @@
fixQtModuleCMakeConfig() {
local module="$1"
sed -e "/set(imported_location/ s@\\\${_qt5${module}_install_prefix}@${!outputLib}@" \
-i "${!outputDev}/lib/cmake/Qt5${module}/Qt5${module}Config.cmake"
}

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, copyPathsToStore, makeWrapper
{ stdenv, lib, fetchurl, copyPathsToStore, fixQtModuleCMakeConfig
, srcs
, xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi
@ -14,8 +14,7 @@
, mysql ? null, postgresql ? null
# options
, mesaSupported, mesa, mesa_glu
, buildDocs ? false
, mesaSupported, mesa
, buildExamples ? false
, buildTests ? false
, developerBuild ? false
@ -37,6 +36,8 @@ stdenv.mkDerivation {
sourceRoot = "qt-everywhere-opensource-src-${version}";
outputs = [ "dev" "out" ];
postUnpack = ''
mv qtbase-opensource-src-${version} ./qt-everywhere-opensource-src-${version}/qtbase
'';
@ -94,12 +95,34 @@ stdenv.mkDerivation {
--replace "@mesa_inc@" "${mesa.dev}"
'';
setOutputFlags = false;
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/qtbase/lib:$PWD/qtbase/plugins/platforms:$LD_LIBRARY_PATH"
export MAKEFLAGS=-j$NIX_BUILD_CORES
export configureFlags+="-plugindir $out/lib/qt5/plugins -importdir $out/lib/qt5/imports -qmldir $out/lib/qt5/qml"
export configureFlags+=" -docdir $out/share/doc/qt5"
_multioutQtDevs() {
# 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"
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "$dev/share"
moveToOutput "share/doc" "$dev"
mkdir -p "$dev/lib"
lndir -silent "$out/lib" "$dev/lib"
if [[ -h "$dev/lib/cmake" ]]; then rm "$dev/lib/cmake"; fi
if [[ -h "$dev/lib/pkgconfig" ]]; then rm "$dev/lib/pkgconfig"; fi
}
preFixupHooks+=(_multioutQtDevs)
configureFlags+="\
-plugindir $out/lib/qt5/plugins \
-importdir $out/lib/qt5/imports \
-qmldir $out/lib/qt5/qml \
-docdir $out/share/doc/qt5"
'';
prefixKey = "-prefix ";
@ -182,32 +205,38 @@ stdenv.mkDerivation {
zlib libjpeg libpng libtiff sqlite icu
xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
]
# Qt doesn't directly need GLU (just GL), but many apps use, it's small and
# doesn't remain a runtime-dep if not used
++ lib.optionals mesaSupported [ mesa mesa_glu ]
++ lib.optional (cups != null) cups
++ lib.optional (mysql != null) mysql.lib
++ lib.optional (postgresql != null) postgresql
++ lib.optionals gtkStyle [gnome_vfs libgnomeui gtk GConf];
++ lib.optional mesaSupported mesa;
buildInputs =
[ bison flex gperf ruby ]
++ lib.optional developerBuild gdb;
++ lib.optional developerBuild gdb
++ lib.optional (cups != null) cups
++ lib.optional (mysql != null) mysql.lib
++ lib.optional (postgresql != null) postgresql
++ lib.optionals gtkStyle [gnome_vfs libgnomeui gtk GConf];
nativeBuildInputs = [ python perl pkgconfig ];
propagatedNativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ fixQtModuleCMakeConfig lndir python perl pkgconfig ];
# freetype-2.5.4 changed signedness of some struct fields
NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare";
postInstall =
postFixup =
''
# Don't retain build-time dependencies like gdb and ruby.
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $out/mkspecs/qconfig.pri
''
+ lib.optionalString buildDocs ''
make docs && make install_docs
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i "$dev/mkspecs/qconfig.pri"
fixQtModuleCMakeConfig "Concurrent"
fixQtModuleCMakeConfig "Core"
fixQtModuleCMakeConfig "DBus"
fixQtModuleCMakeConfig "Gui"
fixQtModuleCMakeConfig "Network"
fixQtModuleCMakeConfig "OpenGL"
fixQtModuleCMakeConfig "OpenGLExtensions"
fixQtModuleCMakeConfig "PrintSupport"
fixQtModuleCMakeConfig "Sql"
fixQtModuleCMakeConfig "Test"
fixQtModuleCMakeConfig "Widgets"
fixQtModuleCMakeConfig "Xml"
'';
inherit lndir;
@ -216,9 +245,9 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
meta = with lib; {
homepage = http://qt-project.org;
homepage = http://www.qt.io;
description = "A cross-platform application framework for C++";
license = "GPL/LGPL";
license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
maintainers = with maintainers; [ bbenoist qknight ttuegel ];
platforms = platforms.linux;
};

View File

@ -1,45 +1,26 @@
if [[ -z "$QMAKE" ]]; then
linkDependencyDir() {
_qtLinkDependencyDir() {
@lndir@/bin/lndir -silent "$1/$2" "$qtOut/$2"
if [[ -n "$NIX_QT_SUBMODULE" ]]; then
find "$1/$2" -printf "$2/%P\n" >> "$out/nix-support/qt-inputs"
fi
}
addQtModule() {
if [[ -d "$1/mkspecs" ]]; then
_qtLinkModule() {
if [ -d "$1/mkspecs" ]; then
# $1 is a Qt module
linkDependencyDir "$1" mkspecs
_qtLinkDependencyDir "$1" mkspecs
for dir in bin include lib share; do
if [[ -d "$1/$dir" ]]; then
linkDependencyDir "$1" "$dir"
if [ -d "$1/$dir" ]; then
_qtLinkDependencyDir "$1" "$dir"
fi
done
fi
}
propagateRuntimeDeps() {
local propagated
for dir in "etc/xdg" "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports" "share"; do
if [[ -d "$1/$dir" ]]; then
propagated=
for pkg in $propagatedBuildInputs; do
if [[ "z$pkg" == "z$1" ]]; then
propagated=1
break
fi
done
if [[ -z $propagated ]]; then
propagatedBuildInputs="$propagatedBuildInputs $1"
fi
break
fi
done
}
rmQtModules() {
_qtRmModules() {
cat "$out/nix-support/qt-inputs" | while read file; do
if [[ -h "$out/$file" ]]; then
rm "$out/$file"
@ -55,14 +36,65 @@ rmQtModules() {
rm "$out/nix-support/qt-inputs"
}
rmQMake() {
addToSearchPathOnceWithCustomDelimiter() {
local delim="$1"
local search="$2"
local target="$3"
local dirs
local exported
IFS="$delim" read -a dirs <<< "${!search}"
for dir in ${dirs[@]}; do
if [ "z$dir" == "z$target" ]; then exported=1; fi
done
if [ -z $exported ]; then
eval "export ${search}=\"${!search}${!search:+$delim}$target\""
fi
}
addToSearchPathOnce() {
addToSearchPathOnceWithCustomDelimiter ':' "$@"
}
propagateOnce() {
addToSearchPathOnceWithCustomDelimiter ' ' "$@"
}
_qtPropagateRuntimeDependencies() {
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
if [ -d "$1/$dir" ]; then
propagateOnce propagatedBuildInputs "$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() {
rm "$qtOut/bin/qmake" "$qtOut/bin/qt.conf"
}
setQMakePath() {
_qtSetQmakePath() {
export PATH="$qtOut/bin${PATH:+:}$PATH"
}
_qtMultioutModuleDevs() {
# We cannot simply set these paths in configureFlags because libQtCore retains
# references to the paths it was built with.
moveToOutput "bin" "${!outputDev}"
moveToOutput "include" "${!outputDev}"
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "${!outputDev}/share"
moveToOutput "share/doc" "${!outputDev}"
}
_qtMultioutDevs() {
# This is necessary whether the package is a Qt module or not
moveToOutput "mkspecs" "${!outputDev}"
}
qtOut=""
if [[ -z "$NIX_QT_SUBMODULE" ]]; then
qtOut=`mktemp -d`
@ -72,7 +104,7 @@ fi
mkdir -p "$qtOut/bin" "$qtOut/mkspecs" "$qtOut/include" "$qtOut/nix-support" "$qtOut/lib" "$qtOut/share"
cp "@out@/bin/qmake" "$qtOut/bin"
cp "@dev@/bin/qmake" "$qtOut/bin"
cat >"$qtOut/bin/qt.conf" <<EOF
[Paths]
Prefix = $qtOut
@ -84,17 +116,20 @@ EOF
export QMAKE="$qtOut/bin/qmake"
envHooks+=(addQtModule propagateRuntimeDeps)
preConfigurePhases+=(setQMakePath)
envHooks+=(_qtLinkModule _qtPropagateRuntimeDependencies)
# Set PATH to find qmake first in a preConfigure hook
# It must run after all the envHooks!
preConfigureHooks+=(_qtSetQmakePath)
preFixupHooks+=(_qtMultioutDevs)
if [[ -n "$NIX_QT_SUBMODULE" ]]; then
preFixupPhases+=(rmQtModules)
postPhases+=(rmQMake)
postInstallHooks+=(_qtRmQmake _qtRmModules)
preFixupHooks+=(_qtMultioutModuleDevs)
fi
fi
if [[ -z "$NIX_QT_PIC" ]]; then
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
export NIX_QT_PIC=1
fi

View File

@ -3,4 +3,8 @@
qtSubmodule {
name = "qtconnectivity";
qtInputs = [ qtbase qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "Bluetooth"
fixQtModuleCMakeConfig "Nfc"
'';
}

View File

@ -5,4 +5,10 @@ qtSubmodule {
patches = [ ./0001-nix-profiles-import-paths.patch ];
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
nativeBuildInputs = [ python ];
postFixup = ''
fixQtModuleCMakeConfig "Qml"
fixQtModuleCMakeConfig "Quick"
fixQtModuleCMakeConfig "QuickTest"
fixQtModuleCMakeConfig "QuickWidgets"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtenginio";
qtInputs = [ qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "Enginio"
'';
}

View File

@ -3,4 +3,8 @@
qtSubmodule {
name = "qtlocation";
qtInputs = [ qtbase qtmultimedia ];
postFixup = ''
fixQtModuleCMakeConfig "Location"
fixQtModuleCMakeConfig "Positioning"
'';
}

View File

@ -9,4 +9,8 @@ qtSubmodule {
pkgconfig alsaLib gstreamer gst-plugins-base libpulseaudio
];
configureFlags = "GST_VERSION=1.0";
postFixup = ''
fixQtModuleCMakeConfig "Multimedia"
fixQtModuleCMakeConfig "MultimediaWidgets"
'';
}

View File

@ -4,4 +4,7 @@ qtSubmodule {
name = "qtquick1";
patches = [ ./0001-nix-profiles-import-paths.patch ];
qtInputs = [ qtscript qtsvg qtwebkit qtxmlpatterns ];
postFixup = ''
fixQtModuleCMakeConfig "Declarative"
'';
}

View File

@ -4,4 +4,7 @@ qtSubmodule {
name = "qtscript";
qtInputs = [ qtbase qttools ];
patches = [ ./0001-glib-2.32.patch ];
postFixup = ''
fixQtModuleCMakeConfig "Script"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtsensors";
qtInputs = [ qtbase qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "Sensors"
'';
}

View File

@ -10,4 +10,7 @@ qtSubmodule {
libudev = libudev.out;
})
];
postFixup = ''
fixQtModuleCMakeConfig "SerialPort"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtsvg";
qtInputs = [ qtbase ];
postFixup = ''
fixQtModuleCMakeConfig "Svg"
'';
}

View File

@ -3,4 +3,14 @@
qtSubmodule {
name = "qttools";
qtInputs = [ qtbase ];
postFixup = ''
moveToOutput "bin/qdbus" "$out"
moveToOutput "bin/qtpaths" "$out"
fixQtModuleCMakeConfig "Designer"
fixQtModuleCMakeConfig "Help"
fixQtModuleCMakeConfig "LinguistTools"
fixQtModuleCMakeConfig "UiPlugin"
fixQtModuleCMakeConfig "UiTools"
'';
}

View File

@ -31,4 +31,8 @@ qtSubmodule {
};
in optionals flashplayerFix [ dlopen-webkit-nsplugin dlopen-webkit-gtk ]
++ [ dlopen-webkit-udev ];
postFixup = ''
fixQtModuleCMakeConfig "WebKit"
fixQtModuleCMakeConfig "WebKitWidgets"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtwebsockets";
qtInputs = [ qtbase qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "WebSockets"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtx11extras";
qtInputs = [ qtbase ];
postFixup = ''
fixQtModuleCMakeConfig "X11Extras"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtxmlpatterns";
qtInputs = [ qtbase ];
postFixup = ''
fixQtModuleCMakeConfig "XmlPatterns"
'';
}

View File

@ -1,15 +1,20 @@
# Maintainer's Notes:
#
# Minor updates:
# 1. Edit ./fetchsrcs.sh to point to the updated URL.
# 2. Run ./fetchsrcs.sh.
# 3. Build and enjoy.
#
# Major updates:
# We prefer not to immediately overwrite older versions with major updates, so
# make a copy of this directory first. After copying, be sure to delete ./tmp
# if it exists. Then follow the minor update instructions. Be sure to check if
# any new components have been added and package them as necessary.
/*
# Minor Updates
1. Edit ./fetchsrcs.sh to point to the updated URL.
2. Run ./fetchsrcs.sh.
3. Build and enjoy.
# Major Updates
1. Make a copy of this directory. (We like to keep the old version around
for a short time after major updates.)
2. Delete the tmp/ subdirectory of the copy.
3. Follow the minor update instructions above.
4. Package any new Qt modules, if necessary.
*/
{ pkgs
@ -37,21 +42,19 @@ let
inherit src;
propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ self.fixQtModuleCMakeConfig ];
NIX_QT_SUBMODULE = args.NIX_QT_SUBMODULE or true;
dontAddPrefix = args.dontAddPrefix or true;
dontFixLibtool = args.dontFixLibtool or true;
configureScript = args.configureScript or "qmake";
outputs = args.outputs or [ "dev" "out" ];
setOutputFlags = args.setOutputFlags or false;
enableParallelBuilding = args.enableParallelBuilding or true;
meta = {
homepage = http://qt-project.org;
description = "A cross-platform application framework for C++";
license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
maintainers = with maintainers; [ bbenoist qknight ttuegel ];
platforms = platforms.linux;
} // (args.meta or {});
meta = self.qtbase.meta // (args.meta or {});
});
addPackages = self: with self;
@ -61,6 +64,7 @@ let
qtbase = callPackage ./qtbase {
mesa = pkgs.mesa_noglu;
harfbuzz = pkgs.harfbuzz-icu;
cups = if stdenv.isLinux then pkgs.cups else null;
# GNOME dependencies are not used unless gtkStyle == true
inherit (pkgs.gnome) libgnomeui GConf gnome_vfs;
@ -110,7 +114,10 @@ let
];
makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
fixQtModuleCMakeConfig = makeSetupHook { } ./fix-qt-module-cmake-config.sh;
};
in makeScope pkgs.newScope addPackages
self = makeScope pkgs.newScope addPackages;
in self

View File

@ -0,0 +1,5 @@
fixQtModuleCMakeConfig() {
local module="$1"
sed -e "/set(imported_location/ s@\\\${_qt5${module}_install_prefix}@${!outputLib}@" \
-i "${!outputDev}/lib/cmake/Qt5${module}/Qt5${module}Config.cmake"
}

View File

@ -1,11 +1,3 @@
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_CONFIG_DIRS "$1/etc/xdg"
addToSearchPath XDG_DATA_DIRS "$1/share"
}
wrapQtProgram() {
local prog="$1"
shift
@ -13,8 +5,8 @@ wrapQtProgram() {
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
--prefix XDG_CONFIG_DIRS : "$XDG_CONFIG_DIRS" \
--prefix XDG_DATA_DIRS : "$XDG_DATA_DIRS" \
--prefix XDG_CONFIG_DIRS : "$NIX_WRAP_XDG_CONFIG_DIRS" \
--prefix XDG_DATA_DIRS : "$NIX_WRAP_XDG_DATA_DIRS" \
"$@"
}
@ -27,16 +19,16 @@ makeQtWrapper() {
--prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
--prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
--prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
--prefix XDG_CONFIG_DIRS : "$XDG_CONFIG_DIRS" \
--prefix XDG_DATA_DIRS : "$XDG_DATA_DIRS" \
--prefix XDG_CONFIG_DIRS : "$NIX_WRAP_XDG_CONFIG_DIRS" \
--prefix XDG_DATA_DIRS : "$NIX_WRAP_XDG_DATA_DIRS" \
"$@"
}
# 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_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}$out/etc/xdg"
export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}$out/share"
envHooks+=(addQtDependency)
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 XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}${!outputLib}/etc/xdg"
export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}${!outputLib}/share"
export NIX_WRAP_XDG_CONFIG_DIRS="$NIX_WRAP_XDG_CONFIG_DIRS${NIX_WRAP_XDG_CONFIG_DIRS:+:}${!outputLib}/etc/xdg"
export NIX_WRAP_XDG_DATA_DIRS="$NIX_WRAP_XDG_DATA_DIRS${NIX_WRAP_XDG_DATA_DIRS:+:}${!outputLib}/share"

View File

@ -1,9 +1,10 @@
{ stdenv, lib, fetchurl, copyPathsToStore, makeWrapper
{ stdenv, lib, fetchurl, copyPathsToStore, fixQtModuleCMakeConfig
, srcs
, xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi
, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon
, fontconfig, freetype, openssl, dbus, glib, udev, libxml2, libxslt, pcre
, fontconfig, freetype, harfbuzz
, openssl, dbus, glib, udev, libxml2, libxslt, pcre
, zlib, libjpeg, libpng, libtiff, sqlite, icu
, coreutils, bison, flex, gdb, gperf, lndir, ruby
@ -14,8 +15,7 @@
, mysql ? null, postgresql ? null
# options
, mesaSupported, mesa, mesa_glu
, buildDocs ? false
, mesaSupported, mesa
, buildExamples ? false
, buildTests ? false
, developerBuild ? false
@ -26,6 +26,12 @@
let
inherit (srcs.qt5) version;
system-x86_64 = lib.elem stdenv.system lib.platforms.x86_64;
dontInvalidateBacking = fetchurl {
url = "https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=patch;h=0f68f8920573cdce1729a285a92ac8582df32841;hp=24c50f8dcf7fa61ac3c3d4d6295c259a104a2b8c";
name = "qtbug-48321-dont-invalidate-backing-store.patch";
sha256 = "07vnndmvri73psz0nrs2hg0zw2i4b1k1igy2al6kwjbp7d5xpglr";
};
in
stdenv.mkDerivation {
@ -37,6 +43,8 @@ stdenv.mkDerivation {
sourceRoot = "qt-everywhere-opensource-src-${version}";
outputs = [ "dev" "out" ];
postUnpack = ''
mv qtbase-opensource-src-${version} ./qt-everywhere-opensource-src-${version}/qtbase
'';
@ -49,6 +57,10 @@ stdenv.mkDerivation {
postPatch =
''
cd qtbase
patch -p1 <${dontInvalidateBacking}
cd ..
substituteInPlace configure --replace /bin/pwd pwd
substituteInPlace qtbase/configure --replace /bin/pwd pwd
substituteInPlace qtbase/src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
@ -83,7 +95,7 @@ stdenv.mkDerivation {
--replace "@gtk@" "${gtk.out}" \
--replace "@gnome_vfs@" "${gnome_vfs.out}" \
--replace "@libgnomeui@" "${libgnomeui.out}" \
--replace "@gconf@" "${GConf}"
--replace "@gconf@" "${GConf.out}"
''
+ lib.optionalString mesaSupported ''
substituteInPlace \
@ -94,12 +106,34 @@ stdenv.mkDerivation {
--replace "@mesa_inc@" "${mesa.dev}"
'';
setOutputFlags = false;
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/qtbase/lib:$PWD/qtbase/plugins/platforms:$LD_LIBRARY_PATH"
export MAKEFLAGS=-j$NIX_BUILD_CORES
export configureFlags+="-plugindir $out/lib/qt5/plugins -importdir $out/lib/qt5/imports -qmldir $out/lib/qt5/qml"
export configureFlags+=" -docdir $out/share/doc/qt5"
_multioutQtDevs() {
# 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"
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "$dev/share"
moveToOutput "share/doc" "$dev"
mkdir -p "$dev/lib"
lndir -silent "$out/lib" "$dev/lib"
if [[ -h "$dev/lib/cmake" ]]; then rm "$dev/lib/cmake"; fi
if [[ -h "$dev/lib/pkgconfig" ]]; then rm "$dev/lib/pkgconfig"; fi
}
preFixupHooks+=(_multioutQtDevs)
configureFlags+="\
-plugindir $out/lib/qt5/plugins \
-importdir $out/lib/qt5/imports \
-qmldir $out/lib/qt5/qml \
-docdir $out/share/doc/qt5"
'';
prefixKey = "-prefix ";
@ -154,6 +188,7 @@ stdenv.mkDerivation {
-no-mips_dspr2
-system-zlib
-system-harfbuzz
-system-libpng
-system-libjpeg
-system-xcb
@ -177,37 +212,50 @@ stdenv.mkDerivation {
PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq";
propagatedBuildInputs = [
dbus glib libxml2 libxslt openssl pcre sqlite udev zlib
# Image formats
libjpeg libpng libtiff
# Text rendering
fontconfig freetype harfbuzz icu
# X11 libs
xlibs.libXcomposite libX11 libxcb libXext libXrender libXi
fontconfig freetype openssl dbus glib udev libxml2 libxslt pcre
zlib libjpeg libpng libtiff sqlite icu
xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
]
# Qt doesn't directly need GLU (just GL), but many apps use, it's small and
# doesn't remain a runtime-dep if not used
++ lib.optionals mesaSupported [ mesa mesa_glu ]
++ lib.optional (cups != null) cups
++ lib.optional (mysql != null) mysql.lib
++ lib.optional (postgresql != null) postgresql
++ lib.optionals gtkStyle [gnome_vfs.out libgnomeui.out gtk GConf];
++ lib.optional mesaSupported mesa;
buildInputs =
[ bison flex gperf ruby ]
++ lib.optional developerBuild gdb;
++ lib.optional developerBuild gdb
++ lib.optional (cups != null) cups
++ lib.optional (mysql != null) mysql.lib
++ lib.optional (postgresql != null) postgresql
++ lib.optionals gtkStyle [gnome_vfs.out libgnomeui.out gtk GConf];
nativeBuildInputs = [ python perl pkgconfig ];
propagatedNativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ fixQtModuleCMakeConfig lndir python perl pkgconfig ];
# freetype-2.5.4 changed signedness of some struct fields
NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare";
postInstall =
postFixup =
''
# Don't retain build-time dependencies like gdb and ruby.
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $out/mkspecs/qconfig.pri
''
+ lib.optionalString buildDocs ''
make docs && make install_docs
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
fixQtModuleCMakeConfig "Concurrent"
fixQtModuleCMakeConfig "Core"
fixQtModuleCMakeConfig "DBus"
fixQtModuleCMakeConfig "Gui"
fixQtModuleCMakeConfig "Network"
fixQtModuleCMakeConfig "OpenGL"
fixQtModuleCMakeConfig "OpenGLExtensions"
fixQtModuleCMakeConfig "PrintSupport"
fixQtModuleCMakeConfig "Sql"
fixQtModuleCMakeConfig "Test"
fixQtModuleCMakeConfig "Widgets"
fixQtModuleCMakeConfig "Xml"
'';
inherit lndir;
@ -216,9 +264,9 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
meta = with lib; {
homepage = http://qt-project.org;
homepage = http://www.qt.io;
description = "A cross-platform application framework for C++";
license = "GPL/LGPL";
license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
maintainers = with maintainers; [ bbenoist qknight ttuegel ];
platforms = platforms.linux;
};

View File

@ -1,45 +1,26 @@
if [[ -z "$QMAKE" ]]; then
linkDependencyDir() {
_qtLinkDependencyDir() {
@lndir@/bin/lndir -silent "$1/$2" "$qtOut/$2"
if [[ -n "$NIX_QT_SUBMODULE" ]]; then
find "$1/$2" -printf "$2/%P\n" >> "$out/nix-support/qt-inputs"
fi
}
addQtModule() {
if [[ -d "$1/mkspecs" ]]; then
_qtLinkModule() {
if [ -d "$1/mkspecs" ]; then
# $1 is a Qt module
linkDependencyDir "$1" mkspecs
_qtLinkDependencyDir "$1" mkspecs
for dir in bin include lib share; do
if [[ -d "$1/$dir" ]]; then
linkDependencyDir "$1" "$dir"
if [ -d "$1/$dir" ]; then
_qtLinkDependencyDir "$1" "$dir"
fi
done
fi
}
propagateRuntimeDeps() {
local propagated
for dir in "etc/xdg" "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports" "share"; do
if [[ -d "$1/$dir" ]]; then
propagated=
for pkg in $propagatedBuildInputs; do
if [[ "z$pkg" == "z$1" ]]; then
propagated=1
break
fi
done
if [[ -z $propagated ]]; then
propagatedBuildInputs="$propagatedBuildInputs $1"
fi
break
fi
done
}
rmQtModules() {
_qtRmModules() {
cat "$out/nix-support/qt-inputs" | while read file; do
if [[ -h "$out/$file" ]]; then
rm "$out/$file"
@ -55,14 +36,66 @@ rmQtModules() {
rm "$out/nix-support/qt-inputs"
}
rmQMake() {
addToSearchPathOnceWithCustomDelimiter() {
local delim="$1"
local search="$2"
local target="$3"
local dirs
local exported
IFS="$delim" read -a dirs <<< "${!search}"
for dir in ${dirs[@]}; do
if [ "z$dir" == "z$target" ]; then exported=1; fi
done
if [ -z $exported ]; then
eval "export ${search}=\"${!search}${!search:+$delim}$target\""
fi
}
addToSearchPathOnce() {
addToSearchPathOnceWithCustomDelimiter ':' "$@"
}
propagateOnce() {
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"
}
_qtRmQmake() {
rm "$qtOut/bin/qmake" "$qtOut/bin/qt.conf"
}
setQMakePath() {
_qtSetQmakePath() {
export PATH="$qtOut/bin${PATH:+:}$PATH"
}
_qtMultioutModuleDevs() {
# We cannot simply set these paths in configureFlags because libQtCore retains
# references to the paths it was built with.
moveToOutput "bin" "${!outputDev}"
moveToOutput "include" "${!outputDev}"
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "${!outputDev}/share"
moveToOutput "share/doc" "${!outputDev}"
}
_qtMultioutDevs() {
# This is necessary whether the package is a Qt module or not
moveToOutput "mkspecs" "${!outputDev}"
}
qtOut=""
if [[ -z "$NIX_QT_SUBMODULE" ]]; then
qtOut=`mktemp -d`
@ -72,7 +105,7 @@ fi
mkdir -p "$qtOut/bin" "$qtOut/mkspecs" "$qtOut/include" "$qtOut/nix-support" "$qtOut/lib" "$qtOut/share"
cp "@out@/bin/qmake" "$qtOut/bin"
cp "@dev@/bin/qmake" "$qtOut/bin"
cat >"$qtOut/bin/qt.conf" <<EOF
[Paths]
Prefix = $qtOut
@ -84,17 +117,20 @@ EOF
export QMAKE="$qtOut/bin/qmake"
envHooks+=(addQtModule propagateRuntimeDeps)
preConfigurePhases+=(setQMakePath)
envHooks+=(_qtLinkModule _qtPropagateRuntimeDependencies)
# Set PATH to find qmake first in a preConfigure hook
# It must run after all the envHooks!
preConfigureHooks+=(_qtSetQmakePath)
preFixupHooks+=(_qtMultioutDevs)
if [[ -n "$NIX_QT_SUBMODULE" ]]; then
preFixupPhases+=(rmQtModules)
postPhases+=(rmQMake)
postInstallHooks+=(_qtRmQmake _qtRmModules)
preFixupHooks+=(_qtMultioutModuleDevs)
fi
fi
if [[ -z "$NIX_QT_PIC" ]]; then
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
export NIX_QT_PIC=1
fi

View File

@ -3,4 +3,8 @@
qtSubmodule {
name = "qtconnectivity";
qtInputs = [ qtbase qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "Bluetooth"
fixQtModuleCMakeConfig "Nfc"
'';
}

View File

@ -5,4 +5,10 @@ qtSubmodule {
patches = [ ./0001-nix-profiles-import-paths.patch ];
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
nativeBuildInputs = [ python ];
postFixup = ''
fixQtModuleCMakeConfig "Qml"
fixQtModuleCMakeConfig "Quick"
fixQtModuleCMakeConfig "QuickTest"
fixQtModuleCMakeConfig "QuickWidgets"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtenginio";
qtInputs = [ qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "Enginio"
'';
}

View File

@ -3,4 +3,8 @@
qtSubmodule {
name = "qtlocation";
qtInputs = [ qtbase qtmultimedia ];
postFixup = ''
fixQtModuleCMakeConfig "Location"
fixQtModuleCMakeConfig "Positioning"
'';
}

View File

@ -9,4 +9,8 @@ qtSubmodule {
pkgconfig alsaLib gstreamer gst-plugins-base libpulseaudio
];
configureFlags = "GST_VERSION=1.0";
postFixup = ''
fixQtModuleCMakeConfig "Multimedia"
fixQtModuleCMakeConfig "MultimediaWidgets"
'';
}

View File

@ -4,4 +4,7 @@ qtSubmodule {
name = "qtquick1";
patches = [ ./0001-nix-profiles-import-paths.patch ];
qtInputs = [ qtscript qtsvg qtwebkit qtxmlpatterns ];
postFixup = ''
fixQtModuleCMakeConfig "Declarative"
'';
}

View File

@ -4,4 +4,7 @@ qtSubmodule {
name = "qtscript";
qtInputs = [ qtbase qttools ];
patches = [ ./0001-glib-2.32.patch ];
postFixup = ''
fixQtModuleCMakeConfig "Script"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtsensors";
qtInputs = [ qtbase qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "Sensors"
'';
}

View File

@ -9,4 +9,7 @@ qtSubmodule {
libudev = libudev.out;
})
];
postFixup = ''
fixQtModuleCMakeConfig "SerialPort"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtsvg";
qtInputs = [ qtbase ];
postFixup = ''
fixQtModuleCMakeConfig "Svg"
'';
}

View File

@ -3,4 +3,14 @@
qtSubmodule {
name = "qttools";
qtInputs = [ qtbase ];
postFixup = ''
moveToOutput "bin/qdbus" "$out"
moveToOutput "bin/qtpaths" "$out"
fixQtModuleCMakeConfig "Designer"
fixQtModuleCMakeConfig "Help"
fixQtModuleCMakeConfig "LinguistTools"
fixQtModuleCMakeConfig "UiPlugin"
fixQtModuleCMakeConfig "UiTools"
'';
}

View File

@ -31,4 +31,8 @@ qtSubmodule {
};
in optionals flashplayerFix [ dlopen-webkit-nsplugin dlopen-webkit-gtk ]
++ [ dlopen-webkit-udev ];
postFixup = ''
fixQtModuleCMakeConfig "WebKit"
fixQtModuleCMakeConfig "WebKitWidgets"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtwebsockets";
qtInputs = [ qtbase qtdeclarative ];
postFixup = ''
fixQtModuleCMakeConfig "WebSockets"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtx11extras";
qtInputs = [ qtbase ];
postFixup = ''
fixQtModuleCMakeConfig "X11Extras"
'';
}

View File

@ -3,4 +3,7 @@
qtSubmodule {
name = "qtxmlpatterns";
qtInputs = [ qtbase ];
postFixup = ''
fixQtModuleCMakeConfig "XmlPatterns"
'';
}

View File

@ -13,7 +13,7 @@ fixCmakeFiles() {
}
cmakeConfigurePhase() {
eval "$preConfigure"
runHook preConfigure
if [ -z "$dontFixCmake" ]; then
fixCmakeFiles .
@ -53,10 +53,11 @@ cmakeConfigurePhase() {
cmake ${cmakeDir:-.} $cmakeFlags "${cmakeFlagsArray[@]}"
eval "$postConfigure"
runHook postConfigure
}
if [ -z "$dontUseCmakeConfigure" -a -z "$configurePhase" ]; then
setOutputFlags=
configurePhase=cmakeConfigurePhase
fi