diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix index 47452eb43e88..9a8ef6bd7744 100644 --- a/pkgs/applications/graphics/inkscape/default.nix +++ b/pkgs/applications/graphics/inkscape/default.nix @@ -2,9 +2,15 @@ , libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2 , glibmm, libsigcxx, lcms, boost, gettext, makeWrapper , gsl, python2, poppler, imagemagick, libwpg, librevenge -, libvisio, libcdr, libexif, potrace, cmake +, libvisio, libcdr, libexif, potrace, autoreconfHook +, intltool +, lib }: +# Note that originally this Nix expression used CMake to build but +# this led to errors on MacOS of "Too many arguments". Inkscape +# supports autoconf and we will use this for now on. + let python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]); in @@ -17,12 +23,6 @@ stdenv.mkDerivation rec { sha256 = "1chng2yw8dsjxc9gf92aqv7plj11cav8ax321wmakmv5bb09cch6"; }; - unpackPhase = '' - cp $src ${name}.tar.bz2 - tar xvjf ${name}.tar.bz2 > /dev/null - cd ${name} - ''; - postPatch = '' patchShebangs share/extensions patchShebangs fix-roff-punct @@ -33,25 +33,26 @@ stdenv.mkDerivation rec { --replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"' ''; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig autoreconfHook intltool ]; buildInputs = [ perl perlXMLParser libXft libpng zlib popt boehmgc libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext makeWrapper gsl poppler imagemagick libwpg librevenge - libvisio libcdr libexif potrace cmake python2Env + libvisio libcdr libexif potrace python2Env ]; enableParallelBuilding = true; + preConfigure = '' + intltoolize -f + ''; + postInstall = '' # Make sure PyXML modules can be found at run-time. rm "$out/share/icons/hicolor/icon-theme.cache" - '' + stdenv.lib.optionalString stdenv.isDarwin '' - install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkscape - install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview ''; - meta = with stdenv.lib; { + meta = with lib; { license = "GPL"; homepage = https://www.inkscape.org; description = "Vector graphics editor"; @@ -62,5 +63,6 @@ stdenv.mkDerivation rec { If you want to import .eps files install ps2edit. ''; + maintainers = with maintainers; [ matthewbauer ]; }; } diff --git a/pkgs/development/libraries/glibmm/default.nix b/pkgs/development/libraries/glibmm/default.nix index a3af96d51edc..3c3b49e66161 100644 --- a/pkgs/development/libraries/glibmm/default.nix +++ b/pkgs/development/libraries/glibmm/default.nix @@ -1,19 +1,27 @@ -{ stdenv, fetchurl, pkgconfig, gnum4, glib, libsigcxx }: +{ stdenv, fetchurl, fetchpatch, pkgconfig, gnum4, glib, libsigcxx }: let - ver_maj = "2.54"; - ver_min = "1"; + ver_maj = "2.56"; + ver_min = "0"; in stdenv.mkDerivation rec { name = "glibmm-${ver_maj}.${ver_min}"; src = fetchurl { url = "mirror://gnome/sources/glibmm/${ver_maj}/${name}.tar.xz"; - sha256 = "0jkapw18icz59cmlmsl00nwwz0wh291kb4hc9z9hxmq45drqrhkw"; + sha256 = "1abrkqhca5p8n6ly3vp1232rny03s7lrd8f8iz2m2m141nxgqx3f"; }; outputs = [ "out" "dev" ]; + patchFlags = "-p0"; + patches = [ + (fetchpatch { + url = "https://raw.githubusercontent.com/macports/macports-ports/e864b2340be9ef003d8ff4aef92e7151d06287dd/devel/glibmm/files/0001-ustring-Fix-wchar-conversion-on-macOS-with-libc.patch"; + sha256 = "02qvnailw1i59cjbj3cy7y02kfcivsvkdjrf4njkp4plarayyqp9"; + }) + ]; + nativeBuildInputs = [ pkgconfig gnum4 ]; propagatedBuildInputs = [ glib libsigcxx ]; diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index 73cbaa0f8070..8ebd70921135 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -35,6 +35,7 @@ stdenv.mkDerivation rec { ''; license = licenses.lgpl2Plus; platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ matthewbauer ]; }; preConfigure = '' diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix index 5c10221b27d7..21376ce79c1c 100644 --- a/pkgs/development/libraries/gstreamer/good/default.nix +++ b/pkgs/development/libraries/gstreamer/good/default.nix @@ -6,6 +6,7 @@ , libsoup, libpulseaudio, libintl , darwin, lame, mpg123, twolame , gtkSupport ? false, gtk3 ? null +, ncurses }: assert gtkSupport -> gtk3 != null; @@ -26,6 +27,7 @@ stdenv.mkDerivation rec { ''; license = licenses.lgpl2Plus; platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ matthewbauer ]; }; src = fetchurl { @@ -39,11 +41,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig python meson ninja gettext ]; + NIX_LDFLAGS = "-lncurses"; + buildInputs = [ gst-plugins-base orc bzip2 libdv libvpx speex flac taglib cairo gdk_pixbuf aalib libcaca libsoup libshout lame mpg123 twolame libintl + ncurses ] ++ optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ] ++ optionals stdenv.isLinux [ libv4l libpulseaudio libavc1394 libiec61883 ]; diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix index a5449abb9f7d..004bb0715f26 100644 --- a/pkgs/development/libraries/gstreamer/ugly/default.nix +++ b/pkgs/development/libraries/gstreamer/ugly/default.nix @@ -1,13 +1,14 @@ { stdenv, fetchurl, meson, ninja, pkgconfig, python , gst-plugins-base, orc, gettext , a52dec, libcdio, libdvdread -, libmad, libmpeg2, x264, libintl +, libmad, libmpeg2, x264, libintl, lib +, darwin }: stdenv.mkDerivation rec { name = "gst-plugins-ugly-1.14.0"; - meta = with stdenv.lib; { + meta = with lib; { description = "Gstreamer Ugly Plugins"; homepage = "https://gstreamer.freedesktop.org"; longDescription = '' @@ -18,6 +19,7 @@ stdenv.mkDerivation rec { ''; license = licenses.lgpl2Plus; platforms = platforms.unix; + maintainers = with maintainers; [ matthewbauer ]; }; src = fetchurl { @@ -34,5 +36,6 @@ stdenv.mkDerivation rec { a52dec libcdio libdvdread libmad libmpeg2 x264 libintl - ]; + ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; + [ IOKit CoreFoundation DiskArbitration ]); } diff --git a/pkgs/development/libraries/libdvdnav/default.nix b/pkgs/development/libraries/libdvdnav/default.nix index 42321b2f866a..b0dfd1e8fc12 100644 --- a/pkgs/development/libraries/libdvdnav/default.nix +++ b/pkgs/development/libraries/libdvdnav/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { description = "A library that implements DVD navigation features such as DVD menus"; license = stdenv.lib.licenses.gpl2; maintainers = [ stdenv.lib.maintainers.wmertens ]; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; }; passthru = { inherit libdvdread; }; diff --git a/pkgs/development/libraries/libmtp/default.nix b/pkgs/development/libraries/libmtp/default.nix index 88ef55715a7c..c3061626a6ae 100644 --- a/pkgs/development/libraries/libmtp/default.nix +++ b/pkgs/development/libraries/libmtp/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, libusb1 }: +{ stdenv, fetchurl, pkgconfig, libusb1, libiconv }: stdenv.mkDerivation rec { name = "libmtp-1.1.15"; @@ -10,6 +10,7 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" ]; + buildInputs = [ libiconv ]; propagatedBuildInputs = [ libusb1 ]; nativeBuildInputs = [ pkgconfig ]; @@ -24,7 +25,7 @@ stdenv.mkDerivation rec { in the form of a library suitable primarily for POSIX compliant operating systems. We implement MTP Basic, the stuff proposed for standardization. ''; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; maintainers = [ ]; }; } diff --git a/pkgs/development/libraries/live555/default.nix b/pkgs/development/libraries/live555/default.nix index 1479f7b6153b..e0cf3328bac2 100644 --- a/pkgs/development/libraries/live555/default.nix +++ b/pkgs/development/libraries/live555/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, lib, darwin }: # Based on https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD let @@ -12,19 +12,23 @@ stdenv.mkDerivation { sha256 = "0zi47asv1qmb09g321m02q684i3c90vci0mgkdh1mlmx2rbg1d1d"; }; - postPatch = "sed 's,/bin/rm,rm,g' -i genMakefiles" - + stdenv.lib.optionalString (stdenv ? glibc) '' - + postPatch = '' + sed 's,/bin/rm,rm,g' -i genMakefiles + sed \ + -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ + -i config.linux + '' + stdenv.lib.optionalString (stdenv ? glibc) '' substituteInPlace liveMedia/include/Locale.hh \ --replace '' '' ''; configurePhase = '' - sed \ - -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ - -i config.linux - - ./genMakefiles linux + ./genMakefiles ${{ + x86_64-darwin = "macosx"; + i686-linux = "linux"; + x86_64-linux = "linux-64bit"; + aarch64-linux = "linux-64bit"; + }.${stdenv.system}} ''; installPhase = '' @@ -35,10 +39,12 @@ stdenv.mkDerivation { done ''; - meta = with stdenv.lib; { + nativeBuildInputs = lib.optional stdenv.isDarwin darwin.cctools; + + meta = with lib; { description = "Set of C++ libraries for multimedia streaming, using open standard protocols (RTP/RTCP, RTSP, SIP)"; homepage = http://www.live555.com/liveMedia/; license = licenses.lgpl21Plus; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix index 739c9b4a1608..96014cfbc779 100644 --- a/pkgs/development/libraries/qt-5/mkDerivation.nix +++ b/pkgs/development/libraries/qt-5/mkDerivation.nix @@ -9,9 +9,8 @@ args: let args_ = { - qmakeFlags = - (args.qmakeFlags or []) - ++ [ ("CONFIG+=" + (if debug then "debug" else "release")) ]; + qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ] + ++ (args.qmakeFlags or []); NIX_CFLAGS_COMPILE = optional (!debug) "-DQT_NO_DEBUG" diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 08345510d787..e798d529ce1b 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -11,9 +11,8 @@ , libcap , pciutils , systemd - , enableProprietaryCodecs ? true - +, gn, darwin, openbsm , lib, stdenv # lib.optional, needsPax }: @@ -25,7 +24,7 @@ qtModule { name = "qtwebengine"; qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ]; nativeBuildInputs = [ - bison coreutils flex git gperf ninja pkgconfig python2 which + bison coreutils flex git gperf ninja pkgconfig python2 which gn ]; doCheck = true; outputs = [ "bin" "dev" "out" ]; @@ -61,8 +60,50 @@ qtModule { sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc + '' + + optionalString stdenv.isDarwin '' + # Remove annoying xcode check + substituteInPlace mkspecs/features/platform.prf \ + --replace "lessThan(QMAKE_XCODE_VERSION, 7.3)" false + substituteInPlace src/core/config/mac_osx.pri \ + --replace /usr ${stdenv.cc} \ + --replace "isEmpty(QMAKE_MAC_SDK_VERSION)" false + + # FIXME Needed with old Apple SDKs + # Abandon all hope ye who try to make sense of this. + substituteInPlace src/3rdparty/chromium/base/mac/foundation_util.mm \ + --replace "NSArray*" "NSArray*" + substituteInPlace src/3rdparty/chromium/base/mac/sdk_forward_declarations.h \ + --replace "NSDictionary*" "NSDictionary*" \ + --replace "NSArray*" "NSArray*" \ + --replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption" + + cat < src/3rdparty/chromium/build/mac/find_sdk.py +#!/usr/bin/env python +print("10.10.0") +print("") +EOF + + cat < src/3rdparty/chromium/build/config/mac/sdk_info.py +#!/usr/bin/env python +print('xcode_version="9.1"') +print('xcode_version_int=9') +print('xcode_build="9B55"') +print('machine_os_build="17E199"') +print('sdk_path=""') +print('sdk_version="10.10"') +print('sdk_platform_path=""') +print('sdk_build="17B41"') +EOF + + # Apple has some secret stuff they don't share with OpenBSM + substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ + --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" + substituteInPlace src/3rdparty/chromium/sandbox/mac/bootstrap_sandbox.cc \ + --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" ''; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10"; preConfigure = '' export NINJAFLAGS=-j$NIX_BUILD_CORES @@ -70,13 +111,9 @@ qtModule { if [ -d "$PWD/tools/qmake" ]; then QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH" fi - ''; + ''; - qmakeFlags = - [ - # Use system Ninja because bootstrapping it is fragile - "WEBENGINE_CONFIG+=use_system_ninja" - ] ++ optional enableProprietaryCodecs "WEBENGINE_CONFIG+=use_proprietary_codecs"; + qmakeFlags = optional enableProprietaryCodecs "-- -proprietary-codecs"; propagatedBuildInputs = [ # Image formats @@ -90,9 +127,10 @@ qtModule { # Text rendering harfbuzz icu - ] - ++ optionals (!stdenv.isDarwin) [ - dbus zlib minizip snappy nss protobuf jsoncpp libevent + + libevent + ] ++ optionals (!stdenv.isDarwin) [ + dbus zlib minizip snappy nss protobuf jsoncpp # Audio formats alsaLib @@ -106,17 +144,44 @@ qtModule { # X11 libs xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst xorg.libXcomposite xorg.libXdamage libdrm - ]; + ] + + # FIXME These dependencies shouldn't be needed but can't find a way + # around it. Chromium pulls this in while bootstrapping GN. + ++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [ + libobjc + cctools + + # frameworks + ApplicationServices + Foundation + AppKit + ImageCaptureCore + CoreBluetooth + IOBluetooth + CoreWLAN + Quartz + Cocoa + + openbsm + libunwind + ]); dontUseNinjaBuild = true; dontUseNinjaInstall = true; - postInstall = '' + postInstall = lib.optionalString stdenv.isLinux '' cat > $out/libexec/qt.conf <*" "NSArray*" + substituteInPlace base/mac/sdk_forward_declarations.h \ + --replace "NSDictionary*" "NSDictionary*" \ + --replace "NSArray*" "NSArray*" \ + --replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption" - buildPhase = '' - python tools/gn/bootstrap/bootstrap.py -s - ''; + # Patch shebangs (for sandbox build) + patchShebangs build + ''; - installPhase = '' - install -vD out/Release/gn "$out/bin/gn" - ''; + # FIXME again this shouldn't be necessary but I can't figure out a better way + NIX_CFLAGS_COMPILE = "-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10"; - meta = with stdenv.lib; { - description = "A meta-build system that generates NinjaBuild files"; - homepage = https://chromium.googlesource.com/chromium/src/tools/gn; - license = licenses.bsd3; - platforms = platforms.linux; - maintainers = [ maintainers.stesie ]; - }; - } + NIX_LDFLAGS = "-levent"; + + nativeBuildInputs = [ ninja python ]; + buildInputs = [ libevent ] + + # FIXME These dependencies shouldn't be needed but can't find a way + # around it. Chromium pulls this in while bootstrapping GN. + ++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [ + libobjc + cctools + + # frameworks + ApplicationServices + Foundation + AppKit + ImageCaptureCore + CoreBluetooth + IOBluetooth + CoreWLAN + Quartz + Cocoa + ]); + + buildPhase = '' + python tools/gn/bootstrap/bootstrap.py -s + ''; + + installPhase = '' + install -vD out/Release/gn "$out/bin/gn" + ''; + + meta = with lib; { + description = "A meta-build system that generates NinjaBuild files"; + homepage = https://chromium.googlesource.com/chromium/src/tools/gn; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = with maintainers; [ stesie matthewbauer ]; + }; +}