Merge pull request #39465 from matthewbauer/work

Various work on broken packages
This commit is contained in:
Matthew Justin Bauer 2018-04-25 00:30:32 -05:00 committed by GitHub
commit d71d7c913e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 247 additions and 102 deletions

View File

@ -2,9 +2,15 @@
, libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2 , libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2
, glibmm, libsigcxx, lcms, boost, gettext, makeWrapper , glibmm, libsigcxx, lcms, boost, gettext, makeWrapper
, gsl, python2, poppler, imagemagick, libwpg, librevenge , 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 let
python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]); python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]);
in in
@ -17,12 +23,6 @@ stdenv.mkDerivation rec {
sha256 = "1chng2yw8dsjxc9gf92aqv7plj11cav8ax321wmakmv5bb09cch6"; sha256 = "1chng2yw8dsjxc9gf92aqv7plj11cav8ax321wmakmv5bb09cch6";
}; };
unpackPhase = ''
cp $src ${name}.tar.bz2
tar xvjf ${name}.tar.bz2 > /dev/null
cd ${name}
'';
postPatch = '' postPatch = ''
patchShebangs share/extensions patchShebangs share/extensions
patchShebangs fix-roff-punct patchShebangs fix-roff-punct
@ -33,25 +33,26 @@ stdenv.mkDerivation rec {
--replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"' --replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"'
''; '';
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig autoreconfHook intltool ];
buildInputs = [ buildInputs = [
perl perlXMLParser libXft libpng zlib popt boehmgc perl perlXMLParser libXft libpng zlib popt boehmgc
libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
makeWrapper gsl poppler imagemagick libwpg librevenge makeWrapper gsl poppler imagemagick libwpg librevenge
libvisio libcdr libexif potrace cmake python2Env libvisio libcdr libexif potrace python2Env
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;
preConfigure = ''
intltoolize -f
'';
postInstall = '' postInstall = ''
# Make sure PyXML modules can be found at run-time. # Make sure PyXML modules can be found at run-time.
rm "$out/share/icons/hicolor/icon-theme.cache" 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"; license = "GPL";
homepage = https://www.inkscape.org; homepage = https://www.inkscape.org;
description = "Vector graphics editor"; description = "Vector graphics editor";
@ -62,5 +63,6 @@ stdenv.mkDerivation rec {
If you want to import .eps files install ps2edit. If you want to import .eps files install ps2edit.
''; '';
maintainers = with maintainers; [ matthewbauer ];
}; };
} }

View File

@ -1,19 +1,27 @@
{ stdenv, fetchurl, pkgconfig, gnum4, glib, libsigcxx }: { stdenv, fetchurl, fetchpatch, pkgconfig, gnum4, glib, libsigcxx }:
let let
ver_maj = "2.54"; ver_maj = "2.56";
ver_min = "1"; ver_min = "0";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "glibmm-${ver_maj}.${ver_min}"; name = "glibmm-${ver_maj}.${ver_min}";
src = fetchurl { src = fetchurl {
url = "mirror://gnome/sources/glibmm/${ver_maj}/${name}.tar.xz"; url = "mirror://gnome/sources/glibmm/${ver_maj}/${name}.tar.xz";
sha256 = "0jkapw18icz59cmlmsl00nwwz0wh291kb4hc9z9hxmq45drqrhkw"; sha256 = "1abrkqhca5p8n6ly3vp1232rny03s7lrd8f8iz2m2m141nxgqx3f";
}; };
outputs = [ "out" "dev" ]; 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 ]; nativeBuildInputs = [ pkgconfig gnum4 ];
propagatedBuildInputs = [ glib libsigcxx ]; propagatedBuildInputs = [ glib libsigcxx ];

View File

@ -35,6 +35,7 @@ stdenv.mkDerivation rec {
''; '';
license = licenses.lgpl2Plus; license = licenses.lgpl2Plus;
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ matthewbauer ];
}; };
preConfigure = '' preConfigure = ''

View File

@ -6,6 +6,7 @@
, libsoup, libpulseaudio, libintl , libsoup, libpulseaudio, libintl
, darwin, lame, mpg123, twolame , darwin, lame, mpg123, twolame
, gtkSupport ? false, gtk3 ? null , gtkSupport ? false, gtk3 ? null
, ncurses
}: }:
assert gtkSupport -> gtk3 != null; assert gtkSupport -> gtk3 != null;
@ -26,6 +27,7 @@ stdenv.mkDerivation rec {
''; '';
license = licenses.lgpl2Plus; license = licenses.lgpl2Plus;
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ matthewbauer ];
}; };
src = fetchurl { src = fetchurl {
@ -39,11 +41,14 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig python meson ninja gettext ]; nativeBuildInputs = [ pkgconfig python meson ninja gettext ];
NIX_LDFLAGS = "-lncurses";
buildInputs = [ buildInputs = [
gst-plugins-base orc bzip2 gst-plugins-base orc bzip2
libdv libvpx speex flac taglib libdv libvpx speex flac taglib
cairo gdk_pixbuf aalib libcaca cairo gdk_pixbuf aalib libcaca
libsoup libshout lame mpg123 twolame libintl libsoup libshout lame mpg123 twolame libintl
ncurses
] ]
++ optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ] ++ optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
++ optionals stdenv.isLinux [ libv4l libpulseaudio libavc1394 libiec61883 ]; ++ optionals stdenv.isLinux [ libv4l libpulseaudio libavc1394 libiec61883 ];

View File

@ -1,13 +1,14 @@
{ stdenv, fetchurl, meson, ninja, pkgconfig, python { stdenv, fetchurl, meson, ninja, pkgconfig, python
, gst-plugins-base, orc, gettext , gst-plugins-base, orc, gettext
, a52dec, libcdio, libdvdread , a52dec, libcdio, libdvdread
, libmad, libmpeg2, x264, libintl , libmad, libmpeg2, x264, libintl, lib
, darwin
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gst-plugins-ugly-1.14.0"; name = "gst-plugins-ugly-1.14.0";
meta = with stdenv.lib; { meta = with lib; {
description = "Gstreamer Ugly Plugins"; description = "Gstreamer Ugly Plugins";
homepage = "https://gstreamer.freedesktop.org"; homepage = "https://gstreamer.freedesktop.org";
longDescription = '' longDescription = ''
@ -18,6 +19,7 @@ stdenv.mkDerivation rec {
''; '';
license = licenses.lgpl2Plus; license = licenses.lgpl2Plus;
platforms = platforms.unix; platforms = platforms.unix;
maintainers = with maintainers; [ matthewbauer ];
}; };
src = fetchurl { src = fetchurl {
@ -34,5 +36,6 @@ stdenv.mkDerivation rec {
a52dec libcdio libdvdread a52dec libcdio libdvdread
libmad libmpeg2 x264 libmad libmpeg2 x264
libintl libintl
]; ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks;
[ IOKit CoreFoundation DiskArbitration ]);
} }

View File

@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
description = "A library that implements DVD navigation features such as DVD menus"; description = "A library that implements DVD navigation features such as DVD menus";
license = stdenv.lib.licenses.gpl2; license = stdenv.lib.licenses.gpl2;
maintainers = [ stdenv.lib.maintainers.wmertens ]; maintainers = [ stdenv.lib.maintainers.wmertens ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.unix;
}; };
passthru = { inherit libdvdread; }; passthru = { inherit libdvdread; };

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, libusb1 }: { stdenv, fetchurl, pkgconfig, libusb1, libiconv }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libmtp-1.1.15"; name = "libmtp-1.1.15";
@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" ]; outputs = [ "bin" "dev" "out" ];
buildInputs = [ libiconv ];
propagatedBuildInputs = [ libusb1 ]; propagatedBuildInputs = [ libusb1 ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
in the form of a library suitable primarily for POSIX compliant operating in the form of a library suitable primarily for POSIX compliant operating
systems. We implement MTP Basic, the stuff proposed for standardization. systems. We implement MTP Basic, the stuff proposed for standardization.
''; '';
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.unix;
maintainers = [ ]; maintainers = [ ];
}; };
} }

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl }: { stdenv, fetchurl, lib, darwin }:
# Based on https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD # Based on https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD
let let
@ -12,19 +12,23 @@ stdenv.mkDerivation {
sha256 = "0zi47asv1qmb09g321m02q684i3c90vci0mgkdh1mlmx2rbg1d1d"; sha256 = "0zi47asv1qmb09g321m02q684i3c90vci0mgkdh1mlmx2rbg1d1d";
}; };
postPatch = "sed 's,/bin/rm,rm,g' -i genMakefiles" postPatch = ''
+ stdenv.lib.optionalString (stdenv ? glibc) '' 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 \ substituteInPlace liveMedia/include/Locale.hh \
--replace '<xlocale.h>' '<locale.h>' --replace '<xlocale.h>' '<locale.h>'
''; '';
configurePhase = '' configurePhase = ''
sed \ ./genMakefiles ${{
-e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ x86_64-darwin = "macosx";
-i config.linux i686-linux = "linux";
x86_64-linux = "linux-64bit";
./genMakefiles linux aarch64-linux = "linux-64bit";
}.${stdenv.system}}
''; '';
installPhase = '' installPhase = ''
@ -35,10 +39,12 @@ stdenv.mkDerivation {
done 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)"; description = "Set of C++ libraries for multimedia streaming, using open standard protocols (RTP/RTCP, RTSP, SIP)";
homepage = http://www.live555.com/liveMedia/; homepage = http://www.live555.com/liveMedia/;
license = licenses.lgpl21Plus; license = licenses.lgpl21Plus;
platforms = platforms.linux; platforms = platforms.unix;
}; };
} }

View File

@ -9,9 +9,8 @@ args:
let let
args_ = { args_ = {
qmakeFlags = qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
(args.qmakeFlags or []) ++ (args.qmakeFlags or []);
++ [ ("CONFIG+=" + (if debug then "debug" else "release")) ];
NIX_CFLAGS_COMPILE = NIX_CFLAGS_COMPILE =
optional (!debug) "-DQT_NO_DEBUG" optional (!debug) "-DQT_NO_DEBUG"

View File

@ -11,9 +11,8 @@
, libcap , libcap
, pciutils , pciutils
, systemd , systemd
, enableProprietaryCodecs ? true , enableProprietaryCodecs ? true
, gn, darwin, openbsm
, lib, stdenv # lib.optional, needsPax , lib, stdenv # lib.optional, needsPax
}: }:
@ -25,7 +24,7 @@ qtModule {
name = "qtwebengine"; name = "qtwebengine";
qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ]; qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
nativeBuildInputs = [ nativeBuildInputs = [
bison coreutils flex git gperf ninja pkgconfig python2 which bison coreutils flex git gperf ninja pkgconfig python2 which gn
]; ];
doCheck = true; doCheck = true;
outputs = [ "bin" "dev" "out" ]; outputs = [ "bin" "dev" "out" ];
@ -61,8 +60,50 @@ qtModule {
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc 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<NSString*>*" "NSArray*"
substituteInPlace src/3rdparty/chromium/base/mac/sdk_forward_declarations.h \
--replace "NSDictionary<VNImageOption, id>*" "NSDictionary*" \
--replace "NSArray<VNRequest*>*" "NSArray*" \
--replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption"
cat <<EOF > src/3rdparty/chromium/build/mac/find_sdk.py
#!/usr/bin/env python
print("10.10.0")
print("")
EOF
cat <<EOF > 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 = '' preConfigure = ''
export NINJAFLAGS=-j$NIX_BUILD_CORES export NINJAFLAGS=-j$NIX_BUILD_CORES
@ -70,13 +111,9 @@ qtModule {
if [ -d "$PWD/tools/qmake" ]; then if [ -d "$PWD/tools/qmake" ]; then
QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH" QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
fi fi
''; '';
qmakeFlags = qmakeFlags = optional enableProprietaryCodecs "-- -proprietary-codecs";
[
# Use system Ninja because bootstrapping it is fragile
"WEBENGINE_CONFIG+=use_system_ninja"
] ++ optional enableProprietaryCodecs "WEBENGINE_CONFIG+=use_proprietary_codecs";
propagatedBuildInputs = [ propagatedBuildInputs = [
# Image formats # Image formats
@ -90,9 +127,10 @@ qtModule {
# Text rendering # Text rendering
harfbuzz icu harfbuzz icu
]
++ optionals (!stdenv.isDarwin) [ libevent
dbus zlib minizip snappy nss protobuf jsoncpp libevent ] ++ optionals (!stdenv.isDarwin) [
dbus zlib minizip snappy nss protobuf jsoncpp
# Audio formats # Audio formats
alsaLib alsaLib
@ -106,17 +144,44 @@ qtModule {
# X11 libs # X11 libs
xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
xorg.libXcomposite xorg.libXdamage libdrm 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; dontUseNinjaBuild = true;
dontUseNinjaInstall = true; dontUseNinjaInstall = true;
postInstall = '' postInstall = lib.optionalString stdenv.isLinux ''
cat > $out/libexec/qt.conf <<EOF cat > $out/libexec/qt.conf <<EOF
[Paths] [Paths]
Prefix = .. Prefix = ..
EOF EOF
paxmark m $out/libexec/QtWebEngineProcess paxmark m $out/libexec/QtWebEngineProcess
''; '';
meta = with lib; {
description = "A web engine based on the Chromium web browser";
maintainers = with maintainers; [ matthewbauer ];
platforms = platforms.unix;
};
} }

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, orc, pkgconfig }: { stdenv, fetchurl, orc, pkgconfig, fetchpatch, autoreconfHook }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "schroedinger-1.0.11"; name = "schroedinger-1.0.11";
@ -13,15 +13,23 @@ stdenv.mkDerivation {
outputs = [ "out" "dev" "devdoc" ]; outputs = [ "out" "dev" "devdoc" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig autoreconfHook ];
buildInputs = [ orc ]; buildInputs = [ orc ];
doCheck = true; doCheck = (!stdenv.isDarwin);
patchFlags = "-p0";
patches = [
(fetchpatch {
url = "https://raw.githubusercontent.com/macports/macports-ports/master/multimedia/schroedinger/files/patch-testsuite-Makefile.am.diff";
sha256 = "0cc8ymvgjgwy7ghca2dd8m8pxpinf27s2i8krf2m3fzv2ckq09v3";
})
];
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://diracvideo.org/; homepage = http://diracvideo.org/;
maintainers = [ maintainers.spwhitt ]; maintainers = [ maintainers.spwhitt ];
license = [ licenses.mpl11 licenses.lgpl2 licenses.mit ]; license = [ licenses.mpl11 licenses.lgpl2 licenses.mit ];
platforms = platforms.linux; platforms = platforms.unix;
}; };
} }

View File

@ -1,77 +1,124 @@
{ stdenv, lib, fetchgit, fetchurl, libevent, ninja, python }: { stdenv, lib, fetchgit, fetchurl, fetchpatch
, libevent, ninja, python, darwin }:
let let
depsGit = { depsGit = {
"tools/gn" = fetchgit { "tools/gn" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/tools/gn"; url = "https://chromium.googlesource.com/chromium/src/tools/gn";
rev = "d0c518db129975ce88ff1de26c857873b0619c4b"; rev = "0fa417a0d2d8484e9a5a636e3301da322f586601";
sha256 = "0l15vzmjyx6bwlz1qhn3fy7yx3qzzxr3drnkj3l0p0fmyxza52vx"; sha256 = "0pigcl14yc4aak6q1ghfjxdz2ah4fg4m2r5y3asw2rz6mpr5y9z0";
}; };
"base" = fetchgit { "base" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/base"; url = "https://chromium.googlesource.com/chromium/src/base";
rev = "bc6e3ce8ca01b894751e1f7b22b561e3ae2e7f17"; rev = "ab1d7c3b92ce9c9bc756bdefb8338360d1a33a1e";
sha256 = "1yl49v6nxbrfms52xf7fiwh7d4301m2aj744pa3hzzh989c5j6g5"; sha256 = "15wis6qg9ka62k6v1vamg0bp3v5vkpapg485jsn4bbfcaqp6di0f";
}; };
"build" = fetchgit { "build" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/build"; url = "https://chromium.googlesource.com/chromium/src/build";
rev = "e934a19ae908081fba13769924e4ea45a7a451ce"; rev = "8d44c08a4c9997695db8098198bdd5026bc7a6f9";
sha256 = "0jhy418vaiin7djg9zvk83f8zhasigki4442x5j7gkmgmgmyc4am"; sha256 = "19sajgf55xfmvnwvy2ss7g6pyljp751cfsws30w415m6m00lmpxl";
}; };
"config" = fetchgit { "config" = fetchgit {
url = "https://chromium.googlesource.com/chromium/src/build/config"; url = "https://chromium.googlesource.com/chromium/src/build/config";
rev = "df16c6a2c070704b0a25efe46ee9af16de1e65b3"; rev = "14116c0cdcb9e28995ca8bb384a12e5c9dbd1dbb";
sha256 = "1x18syzz1scwhd8lf448hy5lnfpq118l403x9qmwm0np318w09wg"; sha256 = "04nif0lm4wcy05b7xhal023874s4r0iq067q57cgwdm72i2gml40";
}; };
"testing/gtest" = fetchgit { "testing/gtest" = fetchgit {
url = "https://chromium.googlesource.com/chromium/testing/gtest"; url = "https://chromium.googlesource.com/chromium/testing/gtest";
rev = "585ec31ea716f08233a815e680fc0d4699843938"; rev = "585ec31ea716f08233a815e680fc0d4699843938";
sha256 = "0csn1cza66851nmxxiw42smsm3422mx67vcyykwn0a71lcjng6rc"; sha256 = "0csn1cza66851nmxxiw42smsm3422mx67vcyykwn0a71lcjng6rc";
}; };
"third_party/apple_apsl" = fetchurl {
url = "https://chromium.googlesource.com/chromium/src/third_party/+archive/8e6ccb8c74db6dfa15dd21401ace3ac96c054cf7/apple_apsl.tar.gz";
sha256 = "0sc7b7zdw7f9piyyijl7xq3v1fzflqlck1apwm8kvgdhkyz3l63k";
};
}; };
in in stdenv.mkDerivation {
stdenv.mkDerivation rec { name = "gn";
name = "gn"; version = "20180423";
version = "0.0.0.20170629"; sourceRoot = ".";
sourceRoot = ".";
unpackPhase = '' unpackPhase = ''
${lib.concatStringsSep "\n" ( ${lib.concatStringsSep "\n" (
lib.mapAttrsToList (n: v: '' lib.mapAttrsToList (n: v: ''
mkdir -p $sourceRoot/${n} mkdir -p $sourceRoot/${n}
if [ -d ${v} ]; then
cp -r ${v}/* $sourceRoot/${n} cp -r ${v}/* $sourceRoot/${n}
'') depsGit)} else
''; mkdir -p $sourceRoot/${n}
pushd $sourceRoot/${n}
unpackFile ${v}
popd
fi
'') depsGit)}
postPatch = '' chmod u+w -R $sourceRoot
# Patch shebands (for sandbox build) '';
chmod u+w -R build
patchShebangs build
# Patch out Chromium-bundled libevent patches = [
chmod u+w tools/gn/bootstrap tools/gn/bootstrap/bootstrap.py (fetchpatch {
sed -i -e '/static_libraries.*libevent/,/^ *\]\?[})]$/d' \ url = "https://raw.githubusercontent.com/Eloston/ungoogled-chromium/master/resources/patches/ungoogled-chromium/macos/fix-gn-bootstrap.patch";
tools/gn/bootstrap/bootstrap.py sha256 = "1h8jgxznm7zrxlzb4wcfx4zx4lyvfrmpd0r7cd7h0s23wn8ibb3a";
''; })
];
NIX_LDFLAGS = "-levent"; postPatch = ''
# Disable libevent bootstrapping (we will provide it).
sed -i -e '/static_libraries.*libevent/,/^ *\]\?[})]$/d' \
tools/gn/bootstrap/bootstrap.py
nativeBuildInputs = [ ninja python ]; # FIXME Needed with old Apple SDKs
buildInputs = [ libevent ]; substituteInPlace base/mac/foundation_util.mm \
--replace "NSArray<NSString*>*" "NSArray*"
substituteInPlace base/mac/sdk_forward_declarations.h \
--replace "NSDictionary<VNImageOption, id>*" "NSDictionary*" \
--replace "NSArray<VNRequest*>*" "NSArray*" \
--replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption"
buildPhase = '' # Patch shebangs (for sandbox build)
python tools/gn/bootstrap/bootstrap.py -s patchShebangs build
''; '';
installPhase = '' # FIXME again this shouldn't be necessary but I can't figure out a better way
install -vD out/Release/gn "$out/bin/gn" 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; { NIX_LDFLAGS = "-levent";
description = "A meta-build system that generates NinjaBuild files";
homepage = https://chromium.googlesource.com/chromium/src/tools/gn; nativeBuildInputs = [ ninja python ];
license = licenses.bsd3; buildInputs = [ libevent ]
platforms = platforms.linux;
maintainers = [ maintainers.stesie ]; # 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 ];
};
}