Merge pull request #24340 from periklis/topic_qt58_modules

qt58: extend darwin compatibility

Changed files
+106 -30
pkgs
development
+5 -3
pkgs/development/libraries/qt-5/5.8/default.nix
···
qtgraphicaleffects = callPackage ./qtgraphicaleffects.nix {};
qtimageformats = callPackage ./qtimageformats.nix {};
qtlocation = callPackage ./qtlocation.nix {};
+
qtmacextras = callPackage ./qtmacextras.nix {};
qtmultimedia = callPackage ./qtmultimedia.nix {
inherit gstreamer gst-plugins-base;
};
···
qtxmlpatterns = callPackage ./qtxmlpatterns.nix {};
env = callPackage ../qt-env.nix {};
-
full = env "qt-${qtbase.version}" [
+
full = env "qt-${qtbase.version}" ([
qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript
-
qtsensors qtserialport qtsvg qttools qttranslations qtwayland
+
qtsensors qtserialport qtsvg qttools qttranslations
qtwebsockets qtx11extras qtxmlpatterns
-
];
+
] ++ optional (!stdenv.isDarwin) qtwayland
+
++ optional (stdenv.isDarwin) qtmacextras);
makeQtWrapper =
makeSetupHook
+4 -2
pkgs/development/libraries/qt-5/5.8/qtbase/default.nix
···
libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
-
ApplicationServices Foundation CoreServices AppKit Carbon OpenGL AGL Cocoa
-
DiskArbitration darwin.cf-private libiconv
+
AGL AppKit ApplicationServices Carbon Cocoa
+
CoreAudio CoreBluetooth CoreLocation CoreServices
+
DiskArbitration Foundation OpenGL
+
darwin.cf-private darwin.apple_sdk.sdk darwin.libobjc libiconv
]);
buildInputs = [ ]
+13 -3
pkgs/development/libraries/qt-5/5.8/qtdeclarative/default.nix
···
-
{ qtSubmodule, lib, copyPathsToStore, python2, qtbase, qtsvg, qtxmlpatterns }:
+
{ stdenv, qtSubmodule, makeQtWrapper, copyPathsToStore, python2, qtbase, qtsvg, qtxmlpatterns }:
+
+
with stdenv.lib;
qtSubmodule {
name = "qtdeclarative";
-
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
+
patches = copyPathsToStore (readPathsFromFile ./. ./series);
qtInputs = [ qtbase qtsvg qtxmlpatterns ];
-
nativeBuildInputs = [ python2 ];
+
nativeBuildInputs = [ python2 makeQtWrapper ];
+
+
postInstall = ''
+
wrapQtProgram $out/bin/qmleasing
+
wrapQtProgram $out/bin/qmlscene
+
wrapQtProgram $out/bin/qmltestrunner
+
'' + optionalString (stdenv.isDarwin) ''
+
wrapQtProgram $out/bin/qml.app/Contents/MacOS/qml
+
'';
}
+10
pkgs/development/libraries/qt-5/5.8/qtmacextras.nix
···
+
{ qtSubmodule, qtbase, lib }:
+
+
qtSubmodule {
+
name = "qtmacextras";
+
qtInputs = [ qtbase ];
+
meta = with lib; {
+
maintainers = with maintainers; [ periklis ];
+
platforms = platforms.darwin;
+
};
+
}
+7 -4
pkgs/development/libraries/qt-5/5.8/qtmultimedia.nix
···
-
{ qtSubmodule, qtbase, qtdeclarative, pkgconfig
+
{ stdenv, qtSubmodule, qtbase, qtdeclarative, pkgconfig
, alsaLib, gstreamer, gst-plugins-base, libpulseaudio
+
, darwin
}:
+
with stdenv.lib;
+
qtSubmodule {
name = "qtmultimedia";
qtInputs = [ qtbase qtdeclarative ];
-
buildInputs = [
-
pkgconfig alsaLib gstreamer gst-plugins-base libpulseaudio
-
];
+
buildInputs = [ pkgconfig gstreamer gst-plugins-base libpulseaudio]
+
++ optional (stdenv.isLinux) alsaLib;
qmakeFlags = [ "GST_VERSION=1.0" ];
+
NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc";
}
+3 -1
pkgs/development/libraries/qt-5/5.8/qtsensors.nix
···
-
{ qtSubmodule, qtbase, qtdeclarative }:
+
{ stdenv, qtSubmodule, qtbase, qtdeclarative }:
+
+
with stdenv.lib;
qtSubmodule {
name = "qtsensors";
+4 -2
pkgs/development/libraries/qt-5/5.8/qtserialport/default.nix
···
-
{ qtSubmodule, qtbase, substituteAll, systemd }:
+
{ stdenv, qtSubmodule, qtbase, substituteAll, systemd }:
+
+
with stdenv.lib;
qtSubmodule {
name = "qtserialport";
qtInputs = [ qtbase ];
-
patches = [
+
patches = optionals (stdenv.isLinux) [
(substituteAll {
src = ./0001-dlopen-serialport-udev.patch;
libudev = systemd.lib;
+19 -2
pkgs/development/libraries/qt-5/5.8/qttools/default.nix
···
-
{ qtSubmodule, lib, copyPathsToStore, qtbase }:
+
{ stdenv, qtSubmodule, makeQtWrapper, copyPathsToStore, qtbase }:
+
+
with stdenv.lib;
qtSubmodule {
name = "qttools";
qtInputs = [ qtbase ];
-
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
+
nativeBuildInputs = [ makeQtWrapper ];
+
+
patches = copyPathsToStore (readPathsFromFile ./. ./series);
postFixup = ''
moveToOutput "bin/qdbus" "$out"
moveToOutput "bin/qtpaths" "$out"
+
'';
+
+
postInstall = ''
+
wrapQtProgram $out/bin/qcollectiongenerator
+
wrapQtProgram $out/bin/qhelpconverter
+
wrapQtProgram $out/bin/qhelpgenerator
+
wrapQtProgram $out/bin/qtdiag
+
'' + optionalString (stdenv.isDarwin) ''
+
wrapQtProgram $out/bin/Assistant.app/Contents/MacOS/Assistant
+
wrapQtProgram $out/bin/Designer.app/Contents/MacOS/Designer
+
wrapQtProgram $out/bin/Linguist.app/Contents/MacOS/Linguist
+
wrapQtProgram $out/bin/pixeltool.app/Contents/MacOS/pixeltool
+
wrapQtProgram $out/bin/qdbusviewer.app/Contents/MacOS/qdbusviewer
'';
}
+19 -10
pkgs/development/libraries/qt-5/5.8/qtwebengine/default.nix
···
, lib, stdenv # lib.optional, needsPax
}:
+
with stdenv.lib;
+
qtSubmodule {
name = "qtwebengine";
qtInputs = [ qtquickcontrols qtlocation qtwebchannel ];
···
-e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \
-e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \
src/core/web_engine_library_info.cpp
-
+
'' + optionalString (!stdenv.isDarwin) ''
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${systemd.lib}/lib/\1!' \
src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
···
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
'';
-
qmakeFlags = lib.optional enableProprietaryCodecs "WEBENGINE_CONFIG+=use_proprietary_codecs";
+
qmakeFlags = optional enableProprietaryCodecs "WEBENGINE_CONFIG+=use_proprietary_codecs";
propagatedBuildInputs = [
-
dbus zlib minizip alsaLib snappy nss protobuf jsoncpp libevent
-
# Image formats
libjpeg libpng libtiff libwebp
···
srtp libvpx
# Audio formats
-
alsaLib libopus
+
libopus
+
+
# Text rendering
+
harfbuzz icu
+
]
+
++ optionals (!stdenv.isDarwin) [
+
dbus zlib minizip snappy nss protobuf jsoncpp libevent
+
+
# Audio formats
+
alsaLib
# Text rendering
-
fontconfig freetype harfbuzz icu
+
fontconfig freetype
+
+
libcap
+
pciutils
# X11 libs
xlibs.xrandr libXScrnSaver libXcursor libXrandr xlibs.libpciaccess libXtst
xlibs.libXcomposite
-
-
libcap
-
pciutils
];
-
patches = lib.optional stdenv.needsPax ./qtwebengine-paxmark-mksnapshot.patch;
+
patches = optional stdenv.needsPax ./qtwebengine-paxmark-mksnapshot.patch;
postInstall = ''
cat > $out/libexec/qt.conf <<EOF
[Paths]
+11
pkgs/development/libraries/qt-5/5.8/qtwebkit/0004-icucore-darwin.patch
···
+
--- qtwebkit-opensource-src-5.8.0.orig/Source/WTF/WTF.pri
+
+++ qtwebkit-opensource-src-5.8.0/Source/WTF/WTF.pri
+
@@ -12,7 +12,7 @@
+
# Mac OS does ship libicu but not the associated header files.
+
# Therefore WebKit provides adequate header files.
+
INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH
+
- LIBS += -licucore
+
+ LIBS += /usr/lib/libicucore.dylib
+
} else:!use?(wchar_unicode): {
+
win32 {
+
CONFIG(static, static|shared) {
+11 -3
pkgs/development/libraries/qt-5/5.8/qtwebkit/default.nix
···
, fontconfig, gdk_pixbuf, gtk2, libwebp, libxml2, libxslt
, sqlite, systemd, glib, gst_all_1
, bison2, flex, gdb, gperf, perl, pkgconfig, python2, ruby
+
, darwin
, substituteAll
, flashplayerFix ? false
}:
···
qtSubmodule {
name = "qtwebkit";
qtInputs = [ qtdeclarative qtlocation qtsensors ];
-
buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ];
+
buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
+
++ optionals (stdenv.isDarwin) (with darwin.apple_sdk.frameworks; [ OpenGL ]);
nativeBuildInputs = [
bison2 flex gdb gperf perl pkgconfig python2 ruby
];
+
+
__impureHostDeps = optionals (stdenv.isDarwin) [
+
"/usr/lib/libicucore.dylib"
+
];
+
patches =
let dlopen-webkit-nsplugin = substituteAll {
src = ./0001-dlopen-webkit-nsplugin.patch;
···
libudev = systemd.lib;
};
in optionals flashplayerFix [ dlopen-webkit-nsplugin dlopen-webkit-gtk ]
-
++ [ dlopen-webkit-udev ];
-
meta.maintainers = with stdenv.lib.maintainers; [ abbradar ];
+
++ optionals (!stdenv.isDarwin) [ dlopen-webkit-udev ]
+
++ optionals (stdenv.isDarwin) [ ./0004-icucore-darwin.patch ];
+
meta.maintainers = with stdenv.lib.maintainers; [ abbradar periklis ];
}