diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/webkitgtk')
8 files changed, 322 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/2.4.nix b/nixpkgs/pkgs/development/libraries/webkitgtk/2.4.nix new file mode 100644 index 000000000000..25868cdb886e --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/2.4.nix @@ -0,0 +1,111 @@ +{ stdenv, fetchurl, fetchpatch, perl, python, ruby, bison, gperf, flex +, pkgconfig, which, gettext, gobject-introspection +, gtk2, gtk3, wayland, libwebp, enchant, sqlite +, libxml2, libsoup, libsecret, libxslt, harfbuzz, xorg +, gst-plugins-base, libobjc +, withGtk2 ? false +, enableIntrospection ? !stdenv.isDarwin +, enableCredentialStorage ? !stdenv.isDarwin +, readline, libedit +}: + +assert stdenv.isDarwin -> !enableIntrospection; +assert stdenv.isDarwin -> !enableCredentialStorage; + +with stdenv.lib; +stdenv.mkDerivation rec { + pname = "webkitgtk"; + version = "2.4.11"; + + meta = with stdenv.lib; { + description = "Web content rendering engine, GTK+ port"; + homepage = http://webkitgtk.org/; + license = licenses.bsd2; + platforms = with platforms; linux ++ darwin; + maintainers = []; + knownVulnerabilities = [ + "WSA-2016-0004" + "WSA-2016-0005" + "WSA-2016-0006" + "WSA-2017-0001" + "WSA-2017-0002" + ]; + }; + + src = fetchurl { + url = "https://webkitgtk.org/releases/${pname}-${version}.tar.xz"; + sha256 = "1xsvnvyvlywwyf6m9ainpsg87jkxjmd37q6zgz9cxb7v3c2ym2jq"; + }; + + CC = "cc"; + + prePatch = '' + patchShebangs Tools/gtk + ''; + patches = [ + ./webcore-svg-libxml-cflags.patch + (fetchpatch { + url = https://raw.githubusercontent.com/gentoo/gentoo/7c5457e265bd40c156a8fe6b2ff94a4e34bcea8e/net-libs/webkit-gtk/files/webkit-gtk-2.4.9-gcc-6.patch; + sha256 = "0ll93dr5vxd40wvly1jaw41lvw86krac0jc6k6cacrps4i5ql5j0"; + }) + ] ++ optionals stdenv.isDarwin [ + ./configure.patch + ./quartz-webcore.patch + ./libc++.patch + ./plugin-none.patch + ] ++ optionals stdenv.hostPlatform.isMusl [ + ./fix-execinfo.patch + ]; + + configureFlags = with stdenv.lib; [ + "--disable-geolocation" + "--disable-jit" + # needed for parallel building + "--enable-dependency-tracking" + (optionalString enableIntrospection "--enable-introspection") + ] ++ optional withGtk2 [ + "--with-gtk=2.0" + ] ++ optionals (withGtk2 || stdenv.isDarwin) [ + "--disable-webkit2" + ] ++ optionals stdenv.isDarwin [ + "--disable-x11-target" + "--enable-quartz-target" + "--disable-web-audio" + "CFLAGS=-DJSC_OBJC_API_ENABLED=0" + "CXXFLAGS=-DJSC_OBJC_API_ENABLED=0" + ] ++ optionals (!enableCredentialStorage) [ + "--disable-credential-storage" + ]; + + NIX_CFLAGS_COMPILE = [ + "-DU_NOEXCEPT=" + "-Wno-expansion-to-defined" + ]; + + dontAddDisableDepTrack = true; + + nativeBuildInputs = [ + perl python ruby bison gperf flex + pkgconfig which gettext gobject-introspection + ]; + + buildInputs = [ + gtk2 libwebp enchant + libxml2 libxslt + gst-plugins-base sqlite xorg.libXt xorg.libXdamage + ] ++ optionals enableCredentialStorage [ + libsecret + ] ++ (if stdenv.isDarwin then [ + readline libedit libobjc + ] else [ + wayland + ]); + + propagatedBuildInputs = [ + libsoup harfbuzz/*icu in *.la*/ + (if withGtk2 then gtk2 else gtk3) + ]; + + enableParallelBuilding = true; + +} diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/configure.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/configure.patch new file mode 100644 index 000000000000..2f4c1e7ad314 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/configure.patch @@ -0,0 +1,20 @@ +--- webkitgtk-2.4.11-orig/configure 2016-04-10 17:00:06.000000000 +0800 ++++ webkitgtk-2.4.11/configure 2016-07-21 23:04:10.000000000 +0800 +@@ -17738,7 +17738,7 @@ + cat >>confdefs.h <<_ACEOF + #define HAVE_WEBP_DECODE_H 1 + _ACEOF +- WEBP_LIBS='-lwebp' ++ WEBP_LIBS=`$PKG_CONFIG --libs libwebp` + else + as_fn_error $? "WebP library (libwebp) not found" "$LINENO" 5 + fi +@@ -18388,7 +18388,7 @@ + case "$host" in + *-*-darwin*) + UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu" +- UNICODE_LIBS="-licucore" ++ UNICODE_LIBS="/usr/lib/libicucore.dylib" + ;; + *-*-mingw*) + diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix new file mode 100644 index 000000000000..71b30960bacd --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix @@ -0,0 +1,83 @@ +{ stdenv, fetchurl, perl, python2, ruby, bison, gperf, cmake, ninja +, pkgconfig, gettext, gobject-introspection, libnotify, gnutls, libgcrypt +, gtk3, wayland, libwebp, enchant2, xorg, libxkbcommon, epoxy, at-spi2-core +, libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs, pcre, nettle, libtasn1, p11-kit +, libidn, libedit, readline, libGLU_combined, libintl, openjpeg +, enableGeoLocation ? true, geoclue2, sqlite +, enableGtk2Plugins ? false, gtk2 ? null +, gst-plugins-base, gst-plugins-bad, woff2 +}: + +assert enableGeoLocation -> geoclue2 != null; +assert enableGtk2Plugins -> gtk2 != null; +assert stdenv.isDarwin -> !enableGtk2Plugins; + +with stdenv.lib; +stdenv.mkDerivation rec { + pname = "webkitgtk"; + version = "2.24.3"; + + meta = { + description = "Web content rendering engine, GTK+ port"; + homepage = https://webkitgtk.org/; + license = licenses.bsd2; + platforms = platforms.linux; + hydraPlatforms = []; + maintainers = with maintainers; [ ]; + }; + + src = fetchurl { + url = "https://webkitgtk.org/releases/${pname}-${version}.tar.xz"; + sha256 = "0lbcrw5axwrbrajxq7fqywfyh0djqi23ynzb5wi5ghw2grnp83cl"; + }; + + patches = optionals stdenv.isDarwin [ + ## TODO add necessary patches for Darwin + ]; + + postPatch = '' + patchShebangs . + ''; + + cmakeFlags = [ + "-DPORT=GTK" + "-DUSE_LIBHYPHEN=0" + "-DENABLE_INTROSPECTION=ON" + ] + ++ optional (!enableGtk2Plugins) "-DENABLE_PLUGIN_PROCESS_GTK2=OFF" + ++ optional stdenv.isLinux "-DENABLE_GLES2=ON" + ++ optionals stdenv.isDarwin [ + "-DUSE_SYSTEM_MALLOC=ON" + "-DUSE_ACCELERATE=0" + "-DENABLE_MINIBROWSER=OFF" + "-DENABLE_VIDEO=ON" + "-DENABLE_QUARTZ_TARGET=ON" + "-DENABLE_X11_TARGET=OFF" + "-DENABLE_OPENGL=OFF" + "-DENABLE_WEB_AUDIO=OFF" + "-DENABLE_WEBGL=OFF" + "-DENABLE_GRAPHICS_CONTEXT_3D=OFF" + "-DENABLE_GTKDOC=OFF" + ]; + + nativeBuildInputs = [ + cmake ninja perl python2 ruby bison gperf + pkgconfig gettext gobject-introspection + ]; + + buildInputs = [ + libintl libwebp enchant2 libnotify gnutls pcre nettle libidn libgcrypt woff2 + libxml2 libsecret libxslt harfbuzz libpthreadstubs libtasn1 p11-kit openjpeg + sqlite gst-plugins-base gst-plugins-bad libxkbcommon epoxy at-spi2-core + ] ++ optional enableGeoLocation geoclue2 + ++ optional enableGtk2Plugins gtk2 + ++ (with xorg; [ libXdmcp libXt libXtst libXdamage ]) + ++ optionals stdenv.isDarwin [ libedit readline libGLU_combined ] + ++ optional stdenv.isLinux wayland; + + propagatedBuildInputs = [ + libsoup gtk3 + ]; + + outputs = [ "out" "dev" ]; +} diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/fix-execinfo.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/fix-execinfo.patch new file mode 100644 index 000000000000..eb825312f3be --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/fix-execinfo.patch @@ -0,0 +1,20 @@ +--- webkitgtk-2.2.0.orig/Source/WTF/wtf/Assertions.cpp ++++ webkitgtk-2.2.0/Source/WTF/wtf/Assertions.cpp +@@ -64,7 +64,7 @@ + #include <windows.h> + #endif + +-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__)) ++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)) + #include <cxxabi.h> + #include <dlfcn.h> + #include <execinfo.h> +@@ -242,7 +242,7 @@ + + void WTFGetBacktrace(void** stack, int* size) + { +-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__)) ++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)) + *size = backtrace(stack, *size); + #elif OS(WINDOWS) && !OS(WINCE) + // The CaptureStackBackTrace function is available in XP, but it is not defined diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/libc++.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/libc++.patch new file mode 100644 index 000000000000..5a9df0ddae98 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/libc++.patch @@ -0,0 +1,20 @@ +--- webkitgtk-2.4.9-orig/GNUmakefile.in 2016-02-02 13:23:23.000000000 -0500 ++++ webkitgtk-2.4.9/GNUmakefile.in 2016-02-02 22:10:23.000000000 -0500 +@@ -23321,7 +23321,7 @@ + $(WINMM_LIBS) \ + -lm \ + -lpthread \ +- -lstdc++ ++ -lc++ + + Programs_minidom_LDFLAGS = \ + -no-install +@@ -23344,7 +23344,7 @@ + $(WINMM_LIBS) \ + -lm \ + -lpthread \ +- -lstdc++ ++ -lc++ + + Programs_LLIntOffsetsExtractor_LDFLAGS = \ + -no-install diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/plugin-none.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/plugin-none.patch new file mode 100644 index 000000000000..5e2b36bf62dd --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/plugin-none.patch @@ -0,0 +1,38 @@ +--- webkitgtk-2.4.9-orig/GNUmakefile.in 2016-02-02 13:23:23.000000000 -0500 ++++ webkitgtk-2.4.9/GNUmakefile.in 2016-02-08 00:27:10.000000000 -0500 +@@ -4799,6 +4799,8 @@ + Source/WebCore/plugins/PluginViewBase.h \ + Source/WebCore/plugins/PluginView.cpp \ + Source/WebCore/plugins/PluginView.h \ ++ Source/WebCore/plugins/PluginViewNone.cpp \ ++ Source/WebCore/plugins/PluginPackageNone.cpp \ + Source/WebCore/plugins/npapi.h \ + Source/WebCore/plugins/npfunctions.h \ + Source/WebCore/plugins/npruntime.h \ +@@ -6375,6 +6377,8 @@ + Source/WebCore/plugins/libWebCore_la-PluginPackage.lo \ + Source/WebCore/plugins/libWebCore_la-PluginStream.lo \ + Source/WebCore/plugins/libWebCore_la-PluginView.lo \ ++ Source/WebCore/plugins/libWebCore_la-PluginViewNone.lo \ ++ Source/WebCore/plugins/libWebCore_la-PluginPackageNone.lo \ + Source/WebCore/rendering/libWebCore_la-AutoTableLayout.lo \ + Source/WebCore/rendering/libWebCore_la-BidiRun.lo \ + Source/WebCore/rendering/libWebCore_la-break_lines.lo \ +@@ -10796,6 +10800,8 @@ + Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProcessConnectionManager.lo \ + Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProxy.lo \ + Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginView.lo \ ++ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginViewNone.lo \ ++ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginPackageNone.lo \ + Source/WebKit2/WebProcess/ResourceCache/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-WebResourceCacheManager.lo \ + Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaImpl.lo \ + Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaMap.lo \ +@@ -19503,6 +19509,8 @@ + Source/WebCore/plugins/PluginViewBase.h \ + Source/WebCore/plugins/PluginView.cpp \ + Source/WebCore/plugins/PluginView.h \ ++ Source/WebCore/plugins/PluginViewNone.cpp \ ++ Source/WebCore/plugins/PluginPackageNone.cpp \ + Source/WebCore/plugins/npapi.h \ + Source/WebCore/plugins/npfunctions.h \ + Source/WebCore/plugins/npruntime.h \ diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/quartz-webcore.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/quartz-webcore.patch new file mode 100644 index 000000000000..a7bf859d6c62 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/quartz-webcore.patch @@ -0,0 +1,22 @@ +--- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.cpp 2016-02-02 13:23:23.000000000 -0500 ++++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.cpp 2016-02-02 18:28:07.000000000 -0500 +@@ -839,7 +839,7 @@ + #if defined(XP_MACOSX) + , m_contextRef(0) + #endif +-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API) ++#if defined(X11) && ENABLE(NETSCAPE_PLUGIN_API) + , m_hasPendingGeometryChange(true) + , m_drawable(0) + , m_visual(0) +--- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.h 2016-02-02 13:23:23.000000000 -0500 ++++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.h 2016-02-02 18:26:37.000000000 -0500 +@@ -378,7 +378,7 @@ + void setNPWindowIfNeeded(); + #endif + +-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API) ++#if PLATFORM(X11) && ENABLE(NETSCAPE_PLUGIN_API) + bool m_hasPendingGeometryChange; + Pixmap m_drawable; + Visual* m_visual; diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch new file mode 100644 index 000000000000..03fc3f3f97de --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch @@ -0,0 +1,8 @@ +--- webkitgtk-2.2.3-orig/GNUmakefile.in 2013-12-04 17:56:28.000000000 +0800 ++++ webkitgtk-2.2.3/GNUmakefile.in 2013-12-05 17:32:37.976689248 +0800 +@@ -21911,6 +21911,7 @@ + @ENABLE_SVG_TRUE@ $(CAIRO_CFLAGS) \ + @ENABLE_SVG_TRUE@ $(FREETYPE_CFLAGS) \ + @ENABLE_SVG_TRUE@ $(LIBSOUP_CFLAGS) \ ++@ENABLE_SVG_TRUE@ $(LIBXML_CFLAGS) \ + @ENABLE_SVG_TRUE@ $(UNICODE_CFLAGS) |