git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #39465 from matthewbauer/work

Various work on broken packages

commitd71d7c913ec3bb35135d1ddfbe74e561ba08e5c0 authorMatthew Justin Bauer <mjbauer95@gmail.com> dateWed 25 Apr 2018, 00:30 (9 years ago) parente4e85620a8c91a
12 files changed+254−109
pkgs/applications/graphics/inkscape/default.nix+15−13 pkgs/development/libraries/glibmm/default.nix+12−4 pkgs/development/libraries/gstreamer/bad/default.nix+1 pkgs/development/libraries/gstreamer/good/default.nix+5 pkgs/development/libraries/gstreamer/ugly/default.nix+6−3 pkgs/development/libraries/libdvdnav/default.nix+1−1 pkgs/development/libraries/libmtp/default.nix+3−2 pkgs/development/libraries/live555/default.nix+17−11 pkgs/development/libraries/qt-5/mkDerivation.nix+2−3 pkgs/development/libraries/qt-5/modules/qtwebengine.nix+80−15 pkgs/development/libraries/schroedinger/default.nix+12−4 pkgs/development/tools/build-managers/gn/default.nix+100−53
pkgs/applications/graphics/inkscape/default.nix+15−13
@@ -2,9 +2,15 @@
22, libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2
33, glibmm, libsigcxx, lcms, boost, gettext, makeWrapper
44, gsl, python2, poppler, imagemagick, libwpg, librevenge
5−, libvisio, libcdr, libexif, potrace, cmake
5+, libvisio, libcdr, libexif, potrace, autoreconfHook
6+, intltool
7+, lib
68}:
79
10+# Note that originally this Nix expression used CMake to build but
11+# this led to errors on MacOS of "Too many arguments". Inkscape
12+# supports autoconf and we will use this for now on.
13+
814let
915 python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]);
1016in
@@ -17,12 +23,6 @@ stdenv.mkDerivation rec {
1723 sha256 = "1chng2yw8dsjxc9gf92aqv7plj11cav8ax321wmakmv5bb09cch6";
1824 };
1925
20− unpackPhase = ''
21− cp $src ${name}.tar.bz2
22− tar xvjf ${name}.tar.bz2 > /dev/null
23− cd ${name}
24− '';
25−
2626 postPatch = ''
2727 patchShebangs share/extensions
2828 patchShebangs fix-roff-punct
@@ -33,25 +33,26 @@ stdenv.mkDerivation rec {
3333 --replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"'
3434 '';
3535
36− nativeBuildInputs = [ pkgconfig ];
36+ nativeBuildInputs = [ pkgconfig autoreconfHook intltool ];
3737 buildInputs = [
3838 perl perlXMLParser libXft libpng zlib popt boehmgc
3939 libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
4040 makeWrapper gsl poppler imagemagick libwpg librevenge
41− libvisio libcdr libexif potrace cmake python2Env
41+ libvisio libcdr libexif potrace python2Env
4242 ];
4343
4444 enableParallelBuilding = true;
4545
46+ preConfigure = ''
47+ intltoolize -f
48+ '';
49+
4650 postInstall = ''
4751 # Make sure PyXML modules can be found at run-time.
4852 rm "$out/share/icons/hicolor/icon-theme.cache"
49− '' + stdenv.lib.optionalString stdenv.isDarwin ''
50− install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkscape
51− install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview
5253 '';
5354
54− meta = with stdenv.lib; {
55+ meta = with lib; {
5556 license = "GPL";
5657 homepage = https://www.inkscape.org;
5758 description = "Vector graphics editor";
@@ -62,5 +63,6 @@ stdenv.mkDerivation rec {
6263
6364 If you want to import .eps files install ps2edit.
6465 '';
66+ maintainers = with maintainers; [ matthewbauer ];
6567 };
6668}
pkgs/development/libraries/glibmm/default.nix+12−4
@@ -1,19 +1,27 @@
1−{ stdenv, fetchurl, pkgconfig, gnum4, glib, libsigcxx }:
1+{ stdenv, fetchurl, fetchpatch, pkgconfig, gnum4, glib, libsigcxx }:
22
33let
4− ver_maj = "2.54";
5− ver_min = "1";
4+ ver_maj = "2.56";
5+ ver_min = "0";
66in
77stdenv.mkDerivation rec {
88 name = "glibmm-${ver_maj}.${ver_min}";
99
1010 src = fetchurl {
1111 url = "mirror://gnome/sources/glibmm/${ver_maj}/${name}.tar.xz";
12− sha256 = "0jkapw18icz59cmlmsl00nwwz0wh291kb4hc9z9hxmq45drqrhkw";
12+ sha256 = "1abrkqhca5p8n6ly3vp1232rny03s7lrd8f8iz2m2m141nxgqx3f";
1313 };
1414
1515 outputs = [ "out" "dev" ];
1616
17+ patchFlags = "-p0";
18+ patches = [
19+ (fetchpatch {
20+ url = "https://raw.githubusercontent.com/macports/macports-ports/e864b2340be9ef003d8ff4aef92e7151d06287dd/devel/glibmm/files/0001-ustring-Fix-wchar-conversion-on-macOS-with-libc.patch";
21+ sha256 = "02qvnailw1i59cjbj3cy7y02kfcivsvkdjrf4njkp4plarayyqp9";
22+ })
23+ ];
24+
1725 nativeBuildInputs = [ pkgconfig gnum4 ];
1826 propagatedBuildInputs = [ glib libsigcxx ];
1927
pkgs/development/libraries/gstreamer/bad/default.nix+1
@@ -35,6 +35,7 @@ stdenv.mkDerivation rec {
3535 '';
3636 license = licenses.lgpl2Plus;
3737 platforms = platforms.linux ++ platforms.darwin;
38+ maintainers = with maintainers; [ matthewbauer ];
3839 };
3940
4041 preConfigure = ''
pkgs/development/libraries/gstreamer/good/default.nix+5
@@ -6,6 +6,7 @@
66, libsoup, libpulseaudio, libintl
77, darwin, lame, mpg123, twolame
88, gtkSupport ? false, gtk3 ? null
9+, ncurses
910}:
1011
1112assert gtkSupport -> gtk3 != null;
@@ -26,6 +27,7 @@ stdenv.mkDerivation rec {
2627 '';
2728 license = licenses.lgpl2Plus;
2829 platforms = platforms.linux ++ platforms.darwin;
30+ maintainers = with maintainers; [ matthewbauer ];
2931 };
3032
3133 src = fetchurl {
@@ -39,11 +41,14 @@ stdenv.mkDerivation rec {
3941
4042 nativeBuildInputs = [ pkgconfig python meson ninja gettext ];
4143
44+ NIX_LDFLAGS = "-lncurses";
45+
4246 buildInputs = [
4347 gst-plugins-base orc bzip2
4448 libdv libvpx speex flac taglib
4549 cairo gdk_pixbuf aalib libcaca
4650 libsoup libshout lame mpg123 twolame libintl
51+ ncurses
4752 ]
4853 ++ optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
4954 ++ optionals stdenv.isLinux [ libv4l libpulseaudio libavc1394 libiec61883 ];
pkgs/development/libraries/gstreamer/ugly/default.nix+6−3
@@ -1,13 +1,14 @@
11{ stdenv, fetchurl, meson, ninja, pkgconfig, python
22, gst-plugins-base, orc, gettext
33, a52dec, libcdio, libdvdread
4−, libmad, libmpeg2, x264, libintl
4+, libmad, libmpeg2, x264, libintl, lib
5+, darwin
56}:
67
78stdenv.mkDerivation rec {
89 name = "gst-plugins-ugly-1.14.0";
910
10− meta = with stdenv.lib; {
11+ meta = with lib; {
1112 description = "Gstreamer Ugly Plugins";
1213 homepage = "https://gstreamer.freedesktop.org";
1314 longDescription = ''
@@ -18,6 +19,7 @@ stdenv.mkDerivation rec {
1819 '';
1920 license = licenses.lgpl2Plus;
2021 platforms = platforms.unix;
22+ maintainers = with maintainers; [ matthewbauer ];
2123 };
2224
2325 src = fetchurl {
@@ -34,5 +36,6 @@ stdenv.mkDerivation rec {
3436 a52dec libcdio libdvdread
3537 libmad libmpeg2 x264
3638 libintl
37− ];
39+ ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks;
40+ [ IOKit CoreFoundation DiskArbitration ]);
3841}
pkgs/development/libraries/libdvdnav/default.nix+1−1
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
1717 description = "A library that implements DVD navigation features such as DVD menus";
1818 license = stdenv.lib.licenses.gpl2;
1919 maintainers = [ stdenv.lib.maintainers.wmertens ];
20− platforms = stdenv.lib.platforms.linux;
20+ platforms = stdenv.lib.platforms.unix;
2121 };
2222
2323 passthru = { inherit libdvdread; };
pkgs/development/libraries/libmtp/default.nix+3−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, pkgconfig, libusb1 }:
1+{ stdenv, fetchurl, pkgconfig, libusb1, libiconv }:
22
33stdenv.mkDerivation rec {
44 name = "libmtp-1.1.15";
@@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
1010
1111 outputs = [ "bin" "dev" "out" ];
1212
13+ buildInputs = [ libiconv ];
1314 propagatedBuildInputs = [ libusb1 ];
1415 nativeBuildInputs = [ pkgconfig ];
1516
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
2425 in the form of a library suitable primarily for POSIX compliant operating
2526 systems. We implement MTP Basic, the stuff proposed for standardization.
2627 '';
27− platforms = stdenv.lib.platforms.linux;
28+ platforms = stdenv.lib.platforms.unix;
2829 maintainers = [ ];
2930 };
3031}
pkgs/development/libraries/live555/default.nix+17−11
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl }:
1+{ stdenv, fetchurl, lib, darwin }:
22
33# Based on https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD
44let
@@ -12,19 +12,23 @@ stdenv.mkDerivation {
1212 sha256 = "0zi47asv1qmb09g321m02q684i3c90vci0mgkdh1mlmx2rbg1d1d";
1313 };
1414
15− postPatch = "sed 's,/bin/rm,rm,g' -i genMakefiles"
16− + stdenv.lib.optionalString (stdenv ? glibc) ''
17−
15+ postPatch = ''
16+ sed 's,/bin/rm,rm,g' -i genMakefiles
17+ sed \
18+ -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \
19+ -i config.linux
20+ '' + stdenv.lib.optionalString (stdenv ? glibc) ''
1821 substituteInPlace liveMedia/include/Locale.hh \
1922 --replace '<xlocale.h>' '<locale.h>'
2023 '';
2124
2225 configurePhase = ''
23− sed \
24− -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \
25− -i config.linux
26−
27− ./genMakefiles linux
26+ ./genMakefiles ${{
27+ x86_64-darwin = "macosx";
28+ i686-linux = "linux";
29+ x86_64-linux = "linux-64bit";
30+ aarch64-linux = "linux-64bit";
31+ }.${stdenv.system}}
2832 '';
2933
3034 installPhase = ''
@@ -35,10 +39,12 @@ stdenv.mkDerivation {
3539 done
3640 '';
3741
38− meta = with stdenv.lib; {
42+ nativeBuildInputs = lib.optional stdenv.isDarwin darwin.cctools;
43+
44+ meta = with lib; {
3945 description = "Set of C++ libraries for multimedia streaming, using open standard protocols (RTP/RTCP, RTSP, SIP)";
4046 homepage = http://www.live555.com/liveMedia/;
4147 license = licenses.lgpl21Plus;
42− platforms = platforms.linux;
48+ platforms = platforms.unix;
4349 };
4450}
pkgs/development/libraries/qt-5/mkDerivation.nix+2−3
@@ -9,9 +9,8 @@ args:
99let
1010 args_ = {
1111
12− qmakeFlags =
13− (args.qmakeFlags or [])
14− ++ [ ("CONFIG+=" + (if debug then "debug" else "release")) ];
12+ qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
13+ ++ (args.qmakeFlags or []);
1514
1615 NIX_CFLAGS_COMPILE =
1716 optional (!debug) "-DQT_NO_DEBUG"
pkgs/development/libraries/qt-5/modules/qtwebengine.nix+80−15
@@ -11,9 +11,8 @@
1111, libcap
1212, pciutils
1313, systemd
14−
1514, enableProprietaryCodecs ? true
16−
15+, gn, darwin, openbsm
1716, lib, stdenv # lib.optional, needsPax
1817}:
1918
@@ -25,7 +24,7 @@ qtModule {
2524 name = "qtwebengine";
2625 qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
2726 nativeBuildInputs = [
28− bison coreutils flex git gperf ninja pkgconfig python2 which
27+ bison coreutils flex git gperf ninja pkgconfig python2 which gn
2928 ];
3029 doCheck = true;
3130 outputs = [ "bin" "dev" "out" ];
@@ -61,8 +60,50 @@ qtModule {
6160
6261 sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
6362 src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
63+ ''
64+ + optionalString stdenv.isDarwin ''
65+ # Remove annoying xcode check
66+ substituteInPlace mkspecs/features/platform.prf \
67+ --replace "lessThan(QMAKE_XCODE_VERSION, 7.3)" false
68+ substituteInPlace src/core/config/mac_osx.pri \
69+ --replace /usr ${stdenv.cc} \
70+ --replace "isEmpty(QMAKE_MAC_SDK_VERSION)" false
71+
72+ # FIXME Needed with old Apple SDKs
73+ # Abandon all hope ye who try to make sense of this.
74+ substituteInPlace src/3rdparty/chromium/base/mac/foundation_util.mm \
75+ --replace "NSArray<NSString*>*" "NSArray*"
76+ substituteInPlace src/3rdparty/chromium/base/mac/sdk_forward_declarations.h \
77+ --replace "NSDictionary<VNImageOption, id>*" "NSDictionary*" \
78+ --replace "NSArray<VNRequest*>*" "NSArray*" \
79+ --replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption"
80+
81+ cat <<EOF > src/3rdparty/chromium/build/mac/find_sdk.py
82+#!/usr/bin/env python
83+print("10.10.0")
84+print("")
85+EOF
86+
87+ cat <<EOF > src/3rdparty/chromium/build/config/mac/sdk_info.py
88+#!/usr/bin/env python
89+print('xcode_version="9.1"')
90+print('xcode_version_int=9')
91+print('xcode_build="9B55"')
92+print('machine_os_build="17E199"')
93+print('sdk_path=""')
94+print('sdk_version="10.10"')
95+print('sdk_platform_path=""')
96+print('sdk_build="17B41"')
97+EOF
98+
99+ # Apple has some secret stuff they don't share with OpenBSM
100+ substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \
101+ --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
102+ substituteInPlace src/3rdparty/chromium/sandbox/mac/bootstrap_sandbox.cc \
103+ --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
64104 '';
65105
106+ 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";
66107
67108 preConfigure = ''
68109 export NINJAFLAGS=-j$NIX_BUILD_CORES
@@ -70,13 +111,9 @@ qtModule {
70111 if [ -d "$PWD/tools/qmake" ]; then
71112 QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
72113 fi
73− '';
114+ '';
74115
75− qmakeFlags =
76− [
77− # Use system Ninja because bootstrapping it is fragile
78− "WEBENGINE_CONFIG+=use_system_ninja"
79− ] ++ optional enableProprietaryCodecs "WEBENGINE_CONFIG+=use_proprietary_codecs";
116+ qmakeFlags = optional enableProprietaryCodecs "-- -proprietary-codecs";
80117
81118 propagatedBuildInputs = [
82119 # Image formats
@@ -90,9 +127,10 @@ qtModule {
90127
91128 # Text rendering
92129 harfbuzz icu
93− ]
94− ++ optionals (!stdenv.isDarwin) [
95− dbus zlib minizip snappy nss protobuf jsoncpp libevent
130+
131+ libevent
132+ ] ++ optionals (!stdenv.isDarwin) [
133+ dbus zlib minizip snappy nss protobuf jsoncpp
96134
97135 # Audio formats
98136 alsaLib
@@ -106,17 +144,44 @@ qtModule {
106144 # X11 libs
107145 xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
108146 xorg.libXcomposite xorg.libXdamage libdrm
109− ];
147+ ]
148+
149+ # FIXME These dependencies shouldn't be needed but can't find a way
150+ # around it. Chromium pulls this in while bootstrapping GN.
151+ ++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [
152+ libobjc
153+ cctools
154+
155+ # frameworks
156+ ApplicationServices
157+ Foundation
158+ AppKit
159+ ImageCaptureCore
160+ CoreBluetooth
161+ IOBluetooth
162+ CoreWLAN
163+ Quartz
164+ Cocoa
165+
166+ openbsm
167+ libunwind
168+ ]);
110169
111170 dontUseNinjaBuild = true;
112171 dontUseNinjaInstall = true;
113172
114− postInstall = ''
173+ postInstall = lib.optionalString stdenv.isLinux ''
115174 cat > $out/libexec/qt.conf <<EOF
116175 [Paths]
117176 Prefix = ..
118177 EOF
119−
120178 paxmark m $out/libexec/QtWebEngineProcess
121179 '';
180+
181+ meta = with lib; {
182+ description = "A web engine based on the Chromium web browser";
183+ maintainers = with maintainers; [ matthewbauer ];
184+ platforms = platforms.unix;
185+ };
186+
122187}
pkgs/development/libraries/schroedinger/default.nix+12−4
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, orc, pkgconfig }:
1+{ stdenv, fetchurl, orc, pkgconfig, fetchpatch, autoreconfHook }:
22
33stdenv.mkDerivation {
44 name = "schroedinger-1.0.11";
@@ -13,15 +13,23 @@ stdenv.mkDerivation {
1313
1414 outputs = [ "out" "dev" "devdoc" ];
1515
16− nativeBuildInputs = [ pkgconfig ];
16+ nativeBuildInputs = [ pkgconfig autoreconfHook ];
1717 buildInputs = [ orc ];
1818
19− doCheck = true;
19+ doCheck = (!stdenv.isDarwin);
20+
21+ patchFlags = "-p0";
22+ patches = [
23+ (fetchpatch {
24+ url = "https://raw.githubusercontent.com/macports/macports-ports/master/multimedia/schroedinger/files/patch-testsuite-Makefile.am.diff";
25+ sha256 = "0cc8ymvgjgwy7ghca2dd8m8pxpinf27s2i8krf2m3fzv2ckq09v3";
26+ })
27+ ];
2028
2129 meta = with stdenv.lib; {
2230 homepage = http://diracvideo.org/;
2331 maintainers = [ maintainers.spwhitt ];
2432 license = [ licenses.mpl11 licenses.lgpl2 licenses.mit ];
25− platforms = platforms.linux;
33+ platforms = platforms.unix;
2634 };
2735}
pkgs/development/tools/build-managers/gn/default.nix+100−53
@@ -1,77 +1,124 @@
1−{ stdenv, lib, fetchgit, fetchurl, libevent, ninja, python }:
1+{ stdenv, lib, fetchgit, fetchurl, fetchpatch
2+, libevent, ninja, python, darwin }:
23
34let
45 depsGit = {
56 "tools/gn" = fetchgit {
67 url = "https://chromium.googlesource.com/chromium/src/tools/gn";
7− rev = "d0c518db129975ce88ff1de26c857873b0619c4b";
8− sha256 = "0l15vzmjyx6bwlz1qhn3fy7yx3qzzxr3drnkj3l0p0fmyxza52vx";
8+ rev = "0fa417a0d2d8484e9a5a636e3301da322f586601";
9+ sha256 = "0pigcl14yc4aak6q1ghfjxdz2ah4fg4m2r5y3asw2rz6mpr5y9z0";
910 };
1011 "base" = fetchgit {
1112 url = "https://chromium.googlesource.com/chromium/src/base";
12− rev = "bc6e3ce8ca01b894751e1f7b22b561e3ae2e7f17";
13− sha256 = "1yl49v6nxbrfms52xf7fiwh7d4301m2aj744pa3hzzh989c5j6g5";
13+ rev = "ab1d7c3b92ce9c9bc756bdefb8338360d1a33a1e";
14+ sha256 = "15wis6qg9ka62k6v1vamg0bp3v5vkpapg485jsn4bbfcaqp6di0f";
1415 };
1516 "build" = fetchgit {
1617 url = "https://chromium.googlesource.com/chromium/src/build";
17− rev = "e934a19ae908081fba13769924e4ea45a7a451ce";
18− sha256 = "0jhy418vaiin7djg9zvk83f8zhasigki4442x5j7gkmgmgmyc4am";
18+ rev = "8d44c08a4c9997695db8098198bdd5026bc7a6f9";
19+ sha256 = "19sajgf55xfmvnwvy2ss7g6pyljp751cfsws30w415m6m00lmpxl";
1920 };
2021 "config" = fetchgit {
2122 url = "https://chromium.googlesource.com/chromium/src/build/config";
22− rev = "df16c6a2c070704b0a25efe46ee9af16de1e65b3";
23− sha256 = "1x18syzz1scwhd8lf448hy5lnfpq118l403x9qmwm0np318w09wg";
23+ rev = "14116c0cdcb9e28995ca8bb384a12e5c9dbd1dbb";
24+ sha256 = "04nif0lm4wcy05b7xhal023874s4r0iq067q57cgwdm72i2gml40";
2425 };
2526 "testing/gtest" = fetchgit {
2627 url = "https://chromium.googlesource.com/chromium/testing/gtest";
2728 rev = "585ec31ea716f08233a815e680fc0d4699843938";
2829 sha256 = "0csn1cza66851nmxxiw42smsm3422mx67vcyykwn0a71lcjng6rc";
2930 };
31+ "third_party/apple_apsl" = fetchurl {
32+ url = "https://chromium.googlesource.com/chromium/src/third_party/+archive/8e6ccb8c74db6dfa15dd21401ace3ac96c054cf7/apple_apsl.tar.gz";
33+ sha256 = "0sc7b7zdw7f9piyyijl7xq3v1fzflqlck1apwm8kvgdhkyz3l63k";
34+ };
3035 };
3136
32−in
33− stdenv.mkDerivation rec {
34− name = "gn";
35− version = "0.0.0.20170629";
36− sourceRoot = ".";
37+in stdenv.mkDerivation {
38+ name = "gn";
39+ version = "20180423";
40+ sourceRoot = ".";
3741
38− unpackPhase = ''
39− ${lib.concatStringsSep "\n" (
40− lib.mapAttrsToList (n: v: ''
41− mkdir -p $sourceRoot/${n}
42+ unpackPhase = ''
43+ ${lib.concatStringsSep "\n" (
44+ lib.mapAttrsToList (n: v: ''
45+ mkdir -p $sourceRoot/${n}
46+ if [ -d ${v} ]; then
4247 cp -r ${v}/* $sourceRoot/${n}
43− '') depsGit)}
44− '';
45−
46− postPatch = ''
47− # Patch shebands (for sandbox build)
48− chmod u+w -R build
49− patchShebangs build
50−
51− # Patch out Chromium-bundled libevent
52− chmod u+w tools/gn/bootstrap tools/gn/bootstrap/bootstrap.py
53− sed -i -e '/static_libraries.*libevent/,/^ *\]\?[})]$/d' \
54− tools/gn/bootstrap/bootstrap.py
55− '';
56−
57− NIX_LDFLAGS = "-levent";
58−
59− nativeBuildInputs = [ ninja python ];
60− buildInputs = [ libevent ];
61−
62− buildPhase = ''
63− python tools/gn/bootstrap/bootstrap.py -s
64− '';
65−
66− installPhase = ''
67− install -vD out/Release/gn "$out/bin/gn"
68− '';
69−
70− meta = with stdenv.lib; {
71− description = "A meta-build system that generates NinjaBuild files";
72− homepage = https://chromium.googlesource.com/chromium/src/tools/gn;
73− license = licenses.bsd3;
74− platforms = platforms.linux;
75− maintainers = [ maintainers.stesie ];
76− };
77− }
48+ else
49+ mkdir -p $sourceRoot/${n}
50+ pushd $sourceRoot/${n}
51+ unpackFile ${v}
52+ popd
53+ fi
54+ '') depsGit)}
55+
56+ chmod u+w -R $sourceRoot
57+ '';
58+
59+ patches = [
60+ (fetchpatch {
61+ url = "https://raw.githubusercontent.com/Eloston/ungoogled-chromium/master/resources/patches/ungoogled-chromium/macos/fix-gn-bootstrap.patch";
62+ sha256 = "1h8jgxznm7zrxlzb4wcfx4zx4lyvfrmpd0r7cd7h0s23wn8ibb3a";
63+ })
64+ ];
65+
66+ postPatch = ''
67+ # Disable libevent bootstrapping (we will provide it).
68+ sed -i -e '/static_libraries.*libevent/,/^ *\]\?[})]$/d' \
69+ tools/gn/bootstrap/bootstrap.py
70+
71+ # FIXME Needed with old Apple SDKs
72+ substituteInPlace base/mac/foundation_util.mm \
73+ --replace "NSArray<NSString*>*" "NSArray*"
74+ substituteInPlace base/mac/sdk_forward_declarations.h \
75+ --replace "NSDictionary<VNImageOption, id>*" "NSDictionary*" \
76+ --replace "NSArray<VNRequest*>*" "NSArray*" \
77+ --replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption"
78+
79+ # Patch shebangs (for sandbox build)
80+ patchShebangs build
81+ '';
82+
83+ # FIXME again this shouldn't be necessary but I can't figure out a better way
84+ 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";
85+
86+ NIX_LDFLAGS = "-levent";
87+
88+ nativeBuildInputs = [ ninja python ];
89+ buildInputs = [ libevent ]
90+
91+ # FIXME These dependencies shouldn't be needed but can't find a way
92+ # around it. Chromium pulls this in while bootstrapping GN.
93+ ++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [
94+ libobjc
95+ cctools
96+
97+ # frameworks
98+ ApplicationServices
99+ Foundation
100+ AppKit
101+ ImageCaptureCore
102+ CoreBluetooth
103+ IOBluetooth
104+ CoreWLAN
105+ Quartz
106+ Cocoa
107+ ]);
108+
109+ buildPhase = ''
110+ python tools/gn/bootstrap/bootstrap.py -s
111+ '';
112+
113+ installPhase = ''
114+ install -vD out/Release/gn "$out/bin/gn"
115+ '';
116+
117+ meta = with lib; {
118+ description = "A meta-build system that generates NinjaBuild files";
119+ homepage = https://chromium.googlesource.com/chromium/src/tools/gn;
120+ license = licenses.bsd3;
121+ platforms = platforms.unix;
122+ maintainers = with maintainers; [ stesie matthewbauer ];
123+ };
124+}