Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webkit2-gtk: fix for older systems #686

Merged
merged 6 commits into from Sep 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 27 additions & 6 deletions www/webkit2-gtk/Portfile
Expand Up @@ -8,7 +8,7 @@ PortSystem 1.0
PortGroup active_variants 1.1
PortGroup cmake 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup cxx11 1.0
PortGroup cxx11 1.1

name webkit2-gtk
conflicts webkit2-gtk-devel
Expand Down Expand Up @@ -100,7 +100,7 @@ configure.optflags -Os
# clang 3.4, 503.0.35, and 600.0.57 (error: call to 'make_unique' is ambiguous, error: call to 'exchange' is ambiguous)
# compiler.blacklist-append {clang < 602} macports-clang-3.4
# clang 3.3 (error: no type named 'make_index_sequence' in namespace 'std')
compiler.fallback-append macports-clang-3.8
compiler.fallback-append macports-clang-4.0
compiler.blacklist-append {clang < 602} macports-clang-3.4 macports-clang-3.3

pre-configure {
Expand Down Expand Up @@ -149,6 +149,31 @@ post-configure {
configure.cflags-append -ftemplate-depth=256
configure.cxxflags-append -ftemplate-depth=256

if {![variant_isset quartz]} {
default_variants-append +x11 +gtk2
}

# fix build on older systems
if {${os.platform} eq "darwin" && ${os.major} < 13} {

# add dep for newer ruby and spec this for build
# https://trac.macports.org/ticket/52016
depends_build-append port:ruby24
configure.args-append -DRUBY_EXECUTABLE=${prefix}/bin/ruby2.4

# fix missing PRId64 definitions on systems
# that don't define __STDC_FORMAT_MACROS by default
# https://bugs.webkit.org/show_bug.cgi?id=156596
# https://trac.macports.org/ticket/52016
patchfiles-append patch-snowleopard-cmakelists-stdcformatmacros.diff

# fix a Cursor name collision with Carbon API
# https://trac.macports.org/ticket/52016
if {[variant_isset x11]} {
patchfiles-append patch-snowleopard-npruntime-redefine-cursor.diff
}
}

variant quartz conflicts x11 gtk2 {
require_active_variants port:gtk3 quartz

Expand Down Expand Up @@ -185,10 +210,6 @@ variant gtk2 conflicts quartz description {Enable support for GTK+2 plugins} {
configure.args-append -DENABLE_PLUGIN_PROCESS_GTK2=ON
}

if {![variant_isset quartz]} {
default_variants-append +x11 +gtk2
}

livecheck.type regex
livecheck.url http://webkitgtk.org/releases/
livecheck.regex "webkitgtk-(\\d+\\.\\d*\[02468\](?:\\.\\d+)*)"
@@ -0,0 +1,11 @@
--- CMakeLists.txt.orig 2017-08-14 17:41:03.000000000 -0700
+++ CMakeLists.txt 2017-08-14 17:43:39.000000000 -0700
@@ -18,6 +18,8 @@
set(ENABLE_TOOLS ON)
endif ()

+add_definitions(-D__STDC_FORMAT_MACROS)
+
# -----------------------------------------------------------------------------
# Determine which port will be built
# -----------------------------------------------------------------------------
@@ -0,0 +1,17 @@
--- Source/WebCore/bridge/npruntime_internal.h.orig 2017-08-14 21:56:11.000000000 -0700
+++ Source/WebCore/bridge/npruntime_internal.h 2017-08-14 21:57:40.000000000 -0700
@@ -30,8 +30,14 @@
#include "npruntime.h"

#if defined(MOZ_X11)
+
+ #define Cursor QD_Cursor
+
#include <X11/Xresource.h>

+// should there be...?
+// #undef Cursor
+
#undef None
#undef Above
#undef Below