source: trunk/dports/www/webkit-gtk-2.0/Portfile

Last change on this file was 149159, checked in by jeremyhu@…, 16 months ago

webkit-gtk-2.0: Fixup compiler selection (#51549)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 149159 2016-06-03 08:38:59Z ryandesign@macports.org $
3
4PortSystem  1.0
5PortGroup   conflicts_build 1.0
6PortGroup   muniversal 1.0
7PortGroup   compiler_blacklist_versions 1.0
8
9name        webkit-gtk-2.0
10version     2.0.4
11revision    7
12description Apple's WebKit HTML rendering library for GTK+
13long_description ${description}
14maintainers jeremyhu devans
15categories  www gnome
16platforms   darwin freebsd
17license     LGPL-2+ BSD
18homepage    http://webkitgtk.org/
19master_sites    http://webkitgtk.org/releases/
20
21use_xz      yes
22distname    webkitgtk-${version}
23
24dist_subdir webkit-gtk
25
26checksums           sha1    3b9ddbdc61e38b5c8fdd108e891b7db5fb12d55a \
27                    rmd160  19643cac3f53928757a7c3fe8ea33f144a581456 \
28                    sha256  bd1550b7f6e1a55f803efe7d64438163ff6c04f02186002cb81d0c090aac734f
29
30depends_lib \
31        path:lib/pkgconfig/glib-2.0.pc:glib2 \
32        port:bison \
33        port:flex \
34        port:enchant \
35        port:gobject-introspection \
36        port:harfbuzz-icu \
37        port:icu \
38        port:libxslt \
39        port:libpng \
40        port:libsecret \
41        port:libsoup \
42        port:mesa \
43        port:sqlite3 \
44        port:webp \
45        port:xorg-libXt
46
47depends_build   \
48        port:gtk-doc \
49        port:pkgconfig
50
51# case-insensitive.patch: https://bugs.webkit.org/show_bug.cgi?id=65811
52# our-icu.patch: No upstream bug report, probably not wanted
53# ruby-1.8.patch: https://bugs.webkit.org/show_bug.cgi?id=126327
54# ListableHandler.patch: https://trac.macports.org/ticket/37828
55# execinfo.patch: https://trac.macports.org/ticket/37882
56# ppc.patch: https://bugs.webkit.org/show_bug.cgi?id=96005
57# tiger.patch: No upstream bug, http://trac.macports.org/ticket/35923
58# quartz-webcore.patch: https://bugs.webkit.org/show_bug.cgi?id=126326
59# bison3.patch: https://bugs.webkit.org/show_bug.cgi?id=119798
60
61patchfiles \
62        clang-assertions.patch \
63        case-insensitive.patch \
64        our-icu.patch \
65        execinfo.patch \
66        ruby-1.8.patch \
67        ListableHandler.patch \
68        ppc.patch \
69        tiger.patch \
70        quartz-webcore.patch \
71        patch-freetype-includes.diff \
72        bison3.patch
73
74conflicts_build     google-test
75
76# https://trac.macports.org/ticket/36329
77configure.python    /usr/bin/python
78
79configure.args  \
80        --disable-geolocation \
81        --disable-webkit2 \
82        --enable-introspection \
83        --disable-video \
84        --enable-svg \
85        --enable-webgl
86
87platform darwin {
88    pre-configure {
89        if {${configure.cxx_stdlib} eq "libc++"} {
90            ui_error "${name} is provided for configurations that are unable to use webkit-gtk.  Since you are on Mavericks or later (or have configured MacPorts to use libc++), please use webkit-gtk or webkit-gtk-devel instead."
91            error "unsupported configuration"
92        }
93    }
94}
95
96subport webkit-gtk3-2.0 {
97    conflicts   webkit-gtk3 webkit-gtk3-devel
98
99    depends_lib-append      port:gtk3
100    configure.args-append   --with-gtk=3.0
101
102#
103# move gtk-docs to allow parallel install with webkit-gtk
104#
105    if {[variant_isset universal]} {
106#
107# using diff to merge derived include files sometimes
108# results in a corrupted file due to nested /* */ blocks
109#
110        global merger_dont_diff
111        set merger_dont_diff    "${prefix}/include/webkitgtk-3.0/webkitdom/WebKitDOMNavigator.h"
112        merger-post-destroot {
113            foreach arch ${universal_archs_to_use} {
114                set docpath ${workpath}/destroot-${arch}${prefix}/share/gtk-doc/html
115                move ${docpath}/webkitgtk ${docpath}/webkitgtk3
116                move ${docpath}/webkitgtk3/webkitgtk.devhelp2 ${docpath}/webkitgtk3/webkitgtk3.devhelp2
117            }
118        }
119    } else {
120        post-destroot {
121           set docpath ${destroot}${prefix}/share/gtk-doc/html
122           move ${docpath}/webkitgtk ${docpath}/webkitgtk3
123           move ${docpath}/webkitgtk3/webkitgtk.devhelp2 ${docpath}/webkitgtk3/webkitgtk3.devhelp2
124        }
125    }
126}
127
128if {${name} eq ${subport}} {
129    conflicts   webkit-gtk webkit-gtk-devel
130
131    depends_lib-append      port:gtk2
132    configure.args-append   --with-gtk=2.0
133}
134
135# https://bugs.webkit.org/show_bug.cgi?id=94488
136configure.universal_args-delete --disable-dependency-tracking
137
138# configure checks that we're clang 3.0, gcc 4.7, or better
139# clang 3.4+ fail (error: no template named 'allocateCell'; did you mean 'validateCell' (https://trac.macports.org/ticket/43987))
140# Ideally we'd just do this, but https://trac.macports.org/ticket/51549
141# compiler.whitelist {clang >= 300 <= 503} macports-clang-3.3
142compiler.blacklist-append *gcc* 
143compiler.blacklist-append {clang < 300} {clang > 503}
144compiler.blacklist-append macports-clang-3.4 macports-clang-3.5 macports-clang-3.6 macports-clang-3.7 macports-clang-3.8 macports-clang-3.9
145compiler.fallback-append macports-clang-3.3
146
147# gobject-introspection uses g-ir-scanner, which uses $CC from env
148if {[variant_isset universal]} {
149    foreach arch ${configure.universal_archs} {
150        lappend merger_build_args(${arch})     CC='${configure.cc} -arch ${arch}'
151        lappend merger_destroot_args(${arch})  CC='${configure.cc} -arch ${arch}'
152    }
153} else {
154    build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
155    destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}"
156}
157
158# In 1.10.1:
159# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp: In constructor 'WebCore::FFTFrame::FFTFrame(unsigned int)':
160# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:48: error: 'm_complexData' was not declared in this scope
161# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:48: error: 'GstFFTF32Complex' was not declared in this scope
162# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:48: error: no matching function for call to 'fastNewArray(size_t)'
163# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:50: error: 'gst_fft_next_fast_length' was not declared in this scope
164# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:51: error: 'm_fft' was not declared in this scope
165# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:51: error: 'FALSE' was not declared in this scope
166# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:51: error: 'gst_fft_f32_new' was not declared in this scope
167# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:52: error: 'm_inverseFft' was not declared in this scope
168# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:52: error: 'TRUE' was not declared in this scope
169#        --enable-web-audio \
170
171# We don't want to use the headers from the installed WebKit
172configure.cppflags-delete -I${prefix}/include
173
174# google-test suite build fix
175configure.cppflags-append -DGTEST_USE_OWN_TR1_TUPLE=1
176
177autoreconf.env-append ACLOCAL="aclocal -I Source/autotools"
178use_autoreconf  yes
179autoreconf.args -fvi
180
181lappend merger_dont_diff ${prefix}/include/webkitgtk-1.0/webkitdom/WebKitDOMNavigator.h
182
183post-patch {
184    # https://bugs.webkit.org/show_bug.cgi?id=88407
185    reinplace "s:echo -n:/bin/echo -n:g" \
186        ${worksrcpath}/Source/WebCore/GNUmakefile.am
187
188    # https://bugs.webkit.org/show_bug.cgi?id=99683
189    reinplace "s:PLATFORM(MAC):OS(DARWIN):g" \
190        ${worksrcpath}/Source/JavaScriptCore/heap/VTableSpectrum.cpp \
191        ${worksrcpath}/Source/JavaScriptCore/jit/ThunkGenerators.cpp \
192        ${worksrcpath}/Source/JavaScriptCore/tools/CodeProfile.cpp
193
194    # https://bugs.webkit.org/show_bug.cgi?id=58737
195    reinplace "s:OS(MAC_OS_X):PLATFORM(MAC):" \
196        ${worksrcpath}/Source/WTF/wtf/ThreadingPthreads.cpp
197}
198
199# TODO: fix this for muniversal
200# keep it for debug
201#post-destroot {
202#    file copy ${worksrcpath}/Programs/.libs/GtkLauncher ${destroot}${prefix}/bin
203#}
204
205build.args-append V=1
206
207# see bug #24622
208variant quartz {
209    configure.args-append --with-target=quartz
210
211    # TODO: See if this will build with OpenGL.framework
212    configure.args-delete --enable-webgl
213    depends_lib-delete \
214        port:mesa \
215        port:xorg-libXt
216
217    # quartz-include-widgetbackingstorecairo.patch
218    # https://trac.macports.org/ticket/38203
219    # https://bugs.webkit.org/show_bug.cgi?id=111598
220    patchfiles-append quartz-duplicate-symbols.patch \
221                      quartz-include-widgetbackingstorecairo.patch
222}
223
224variant geolocation description {Enable geolocation support using geoclue} {
225        depends_lib-append      port:geoclue
226        configure.args-delete   --disable-geolocation
227        configure.args-append   --enable-geolocation
228}
229
230variant video description {Enable HTML5 video support using gstreamer} {
231        depends_lib-append      port:gstreamer1-gst-plugins-base
232        configure.args-delete   --disable-video
233        configure.args-append   --enable-video
234}
235
236default_variants +video
237
238platform darwin {
239    if {${os.major} < 10} {
240        depends_build-append      port:python27
241        # https://trac.macports.org/ticket/35793
242        configure.python          ${prefix}/bin/python2.7
243
244        # https://trac.macports.org/ticket/38682
245        configure.optflags-append -fno-blocks
246    }
247
248    if {[string match "*10.5*" ${configure.sdkroot}] ||
249        (${os.major} == 9 && ${configure.sdkroot} eq "")} {
250
251        # https://trac.macports.org/ticket/37418
252        configure.cppflags-append -D__MAC_OS_X_VERSION_MAX_ALLOWED=1050
253    }
254
255    if {[string match "*10.4*" ${configure.sdkroot}] ||
256        (${os.major} == 8 && ${configure.sdkroot} eq "")} {
257
258        # https://trac.macports.org/ticket/37828
259        configure.cppflags-append -D__MAC_OS_X_VERSION_MAX_ALLOWED=1040
260    }
261
262    if {$macosx_deployment_target eq "10.4" ||
263        (${os.major} == 8 && $macosx_deployment_target eq "")} {
264
265        # https://trac.macports.org/ticket/37828
266        configure.cppflags-append -D__MAC_OS_X_VERSION_MIN_REQUIRED=1040
267    }
268}
269
270platform powerpc {
271    # https://trac.macports.org/ticket/37839
272    configure.optflags-replace -O2 -Os
273}
274
275if {[string match *clang* ${configure.compiler}]} {
276    configure.cxxflags-append -Wno-c++11-extensions
277}
278
279livecheck.type  none
Note: See TracBrowser for help on using the repository browser.