source: trunk/dports/www/webkit-gtk/Portfile @ 115312

Last change on this file since 115312 was 115312, checked in by jeremyhu@…, 5 years ago

webkit-gtk: Reference upstream bug reports

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.7 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 115312 2013-12-31 05:22:47Z jeremyhu@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
10epoch       2
11version     2.2.2
12revision    1
13description Apple's WebKit HTML rendering library for GTK+
14long_description ${description}
15maintainers jeremyhu devans
16categories  www gnome
17platforms   darwin freebsd
18license     LGPL-2+ BSD
19homepage    http://webkitgtk.org/
20master_sites    http://webkitgtk.org/releases/
21
22use_xz      yes
23distname    webkitgtk-${version}
24
25checksums           sha1    6376d7d55802c3389c74a2ca8a33d53efc340c37 \
26                    rmd160  2f4ec373d71f7912e2315bf09c708df90da5e61c \
27                    sha256  4a45768695ccded14fdc47f99dbcdb750076f55dad61560cadac7b55db0b304d
28
29depends_lib \
30        path:lib/pkgconfig/glib-2.0.pc:glib2 \
31        port:bison \
32        port:flex \
33        port:enchant \
34        port:geoclue \
35        port:gobject-introspection \
36        port:harfbuzz-icu \
37        port:libxslt \
38        port:libpng \
39        port:libsecret \
40        port:libsoup \
41        port:mesa \
42        port:sqlite3 \
43        port:webp \
44        port:xorg-libXt
45
46depends_build   \
47        port:gtk-doc \
48        port:pkgconfig
49
50# case-insensitive.patch: https://bugs.webkit.org/show_bug.cgi?id=65811
51# our-icu.patch: No upstream bug report, probably not wanted
52# ruby-1.8.patch: http://trac.macports.org/ticket/37740
53# ListableHandler.patch: https://trac.macports.org/ticket/37828
54# execinfo.patch: https://trac.macports.org/ticket/37882
55# ppc.patch: https://bugs.webkit.org/show_bug.cgi?id=96005
56# tiger.patch: No upstream bug, http://trac.macports.org/ticket/35923
57# quartz-webcore.patch: https://bugs.webkit.org/show_bug.cgi?id=126326
58# clang-check.patch: https://bugs.webkit.org/show_bug.cgi?id=126324
59
60patchfiles \
61        clang-assertions.patch \
62        case-insensitive.patch \
63        our-icu.patch \
64        execinfo.patch \
65        ruby-1.8.patch \
66        ListableHandler.patch \
67        ppc.patch \
68        tiger.patch \
69        quartz-webcore.patch \
70        clang-check.patch \
71        patch-freetype-includes.diff \
72        no-WebCoreLayer.a.patch
73
74conflicts_build     google-test
75
76# https://trac.macports.org/ticket/36329
77configure.python    /usr/bin/python
78
79configure.args  \
80        --disable-webkit2 \
81        --enable-introspection \
82        --disable-video \
83        --enable-svg \
84        --enable-geolocation \
85        --enable-webgl
86
87# TODO: Check ${configure.cxx_stdlib} directly once MacPorts 2.3 is released
88platform darwin {
89    pre-configure {
90        set cxxstdlib {}
91
92        if {[info exists configure.cxx_stdlib] &&
93            ${configure.cxx_stdlib} ne {} &&
94            [string match *clang* ${configure.cxx}]} {
95            set cxxstdlib ${configure.cxx_stdlib}
96        } elseif {[string match *clang* ${configure.cxx}] &&
97                  ${os.major} >= 13} {
98            set cxxstdlib libc++
99        } else {
100            set cxxstdlib libstdc++
101        }
102
103        if {${cxxstdlib} eq "libstdc++"} {
104            ui_error "${subport} is not supported for this installation of MacPorts.  It requires libc++ be selected as your C++ runtime.  Please use ${subport}-2.0 instead"
105            error "unsupported configuration"
106        }
107    }
108}
109
110subport webkit-gtk3 {
111    conflicts   webkit-gtk3-2.0
112    depends_lib-append      port:gtk3
113    configure.args-append   --with-gtk=3.0
114
115#
116# move gtk-docs to allow parallel install with webkit-gtk
117#
118    if {[variant_isset universal]} {
119#
120# using diff to merge derived include files sometimes
121# results in a corrupted file due to nested /* */ blocks
122#
123        global merger_dont_diff
124        set merger_dont_diff    "${prefix}/include/webkitgtk-3.0/webkitdom/WebKitDOMNavigator.h"
125        merger-post-destroot {
126            foreach arch ${universal_archs_to_use} {
127                set docpath ${workpath}/destroot-${arch}${prefix}/share/gtk-doc/html
128                move ${docpath}/webkitgtk ${docpath}/webkitgtk3
129                move ${docpath}/webkitgtk3/webkitgtk.devhelp2 ${docpath}/webkitgtk3/webkitgtk3.devhelp2
130            }
131        }
132    } else {
133        post-destroot {
134           set docpath ${destroot}${prefix}/share/gtk-doc/html
135           move ${docpath}/webkitgtk ${docpath}/webkitgtk3
136           move ${docpath}/webkitgtk3/webkitgtk.devhelp2 ${docpath}/webkitgtk3/webkitgtk3.devhelp2
137        }
138    }
139}
140
141if {${name} eq ${subport}} {
142    conflicts   webkit-gtk-2.0
143    depends_lib-append      port:gtk2
144    configure.args-append   --with-gtk=2.0
145}
146
147# https://bugs.webkit.org/show_bug.cgi?id=94488
148configure.universal_args-delete --disable-dependency-tracking
149
150# configure checks that we're clang 3.0, gcc 4.7, or better
151compiler.blacklist-append gcc-3.3 gcc-4.0 apple-gcc-4.0 gcc-4.2 apple-gcc-4.2 llvm-gcc-4.2 macports-llvm-gcc-4.2
152compiler.blacklist-append macports-gcc-4.2 macports-gcc-4.3 macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6
153compiler.blacklist-append {clang < 300} macports-clang-2.9
154
155# gobject-introspection uses g-ir-scanner, which uses $CC from env
156if {[variant_isset universal]} {
157    foreach arch ${configure.universal_archs} {
158        lappend merger_build_args(${arch})     CC='${configure.cc} -arch ${arch}'
159        lappend merger_destroot_args(${arch})  CC='${configure.cc} -arch ${arch}'
160    }
161} else {
162    build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
163    destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}"
164}
165
166# In 1.10.1:
167# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp: In constructor 'WebCore::FFTFrame::FFTFrame(unsigned int)':
168# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:48: error: 'm_complexData' was not declared in this scope
169# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:48: error: 'GstFFTF32Complex' was not declared in this scope
170# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:48: error: no matching function for call to 'fastNewArray(size_t)'
171# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:50: error: 'gst_fft_next_fast_length' was not declared in this scope
172# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:51: error: 'm_fft' was not declared in this scope
173# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:51: error: 'FALSE' was not declared in this scope
174# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:51: error: 'gst_fft_f32_new' was not declared in this scope
175# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:52: error: 'm_inverseFft' was not declared in this scope
176# Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:52: error: 'TRUE' was not declared in this scope
177#        --enable-web-audio \
178
179# We don't want to use the headers from the installed WebKit
180configure.cppflags-delete -I${prefix}/include
181
182# google-test suite build fix
183configure.cppflags-append -DGTEST_USE_OWN_TR1_TUPLE=1
184
185# https://trac.macports.org/ticket/41560#comment:2
186configure.cflags-append -ftemplate-depth=256
187configure.cxxflags-append -ftemplate-depth=256
188
189autoreconf.env-append ACLOCAL="aclocal -I Source/autotools"
190use_autoreconf  yes
191autoreconf.args -fvi
192
193lappend merger_dont_diff ${prefix}/include/webkitgtk-1.0/webkitdom/WebKitDOMNavigator.h
194
195post-patch {
196    # https://bugs.webkit.org/show_bug.cgi?id=88407
197    reinplace "s:echo -n:/bin/echo -n:g" \
198        ${worksrcpath}/Source/WebCore/GNUmakefile.am
199
200    # https://bugs.webkit.org/show_bug.cgi?id=99683
201    reinplace "s:PLATFORM(MAC):OS(DARWIN):g" \
202        ${worksrcpath}/Source/JavaScriptCore/heap/VTableSpectrum.cpp \
203        ${worksrcpath}/Source/JavaScriptCore/jit/ThunkGenerators.cpp \
204        ${worksrcpath}/Source/JavaScriptCore/tools/CodeProfile.cpp
205
206    # https://bugs.webkit.org/show_bug.cgi?id=58737
207    reinplace "s:OS(MAC_OS_X):PLATFORM(MAC):" \
208        ${worksrcpath}/Source/WTF/wtf/ThreadingPthreads.cpp
209
210    # https://bugs.webkit.org/show_bug.cgi?id=126325
211    reinplace "s:-stdlib=libstdc\+\+::" \
212        ${worksrcpath}/Source/autotools/SetupCompilerFlags.m4
213
214    # TODO: Email/file a bug
215    # In file included from Source/JavaScriptCore/runtime/JSGlobalObject.cpp:83:
216    # ./Source/JavaScriptCore/API/ObjCCallbackFunction.h:32:9: fatal error: 'JavaScriptCore/JSCallbackFunction.h' file not found
217    # #import <JavaScriptCore/JSCallbackFunction.h>
218    #         ^
219    reinplace "/^#define JSC_OBJC_API_ENABLED/s/^.*$/#define JSC_OBJC_API_ENABLED 0/" \
220        ${worksrcpath}/Source/JavaScriptCore/API/JSBase.h
221}
222
223# TODO: fix this for muniversal
224# keep it for debug
225#post-destroot {
226#    file copy ${worksrcpath}/Programs/.libs/GtkLauncher ${destroot}${prefix}/bin
227#}
228
229build.args-append V=1
230
231# see bug #24622
232variant quartz {
233    configure.args-append --with-target=quartz
234
235    # TODO: See if this will build with OpenGL.framework
236    configure.args-delete --enable-webgl
237    depends_lib-delete \
238        port:mesa \
239        port:xorg-libXt
240
241    # quartz-include-widgetbackingstorecairo.patch
242    # https://trac.macports.org/ticket/38203
243    # https://bugs.webkit.org/show_bug.cgi?id=111598
244    patchfiles-append quartz-duplicate-symbols.patch \
245                      quartz-include-widgetbackingstorecairo.patch
246}
247
248variant video description {Enable HTML5 video support using gstreamer} {
249        depends_lib-append      port:gstreamer1-gst-plugins-base
250        configure.args-delete   --disable-video
251        configure.args-append   --enable-video
252}
253
254default_variants +video
255
256platform darwin {
257    if {${os.major} < 10} {
258        depends_build-append      port:python27
259        # https://trac.macports.org/ticket/35793
260        configure.python          ${prefix}/bin/python2.7
261
262        # https://trac.macports.org/ticket/38682
263        configure.optflags-append -fno-blocks
264    }
265
266    if {[string match "*10.5*" ${configure.sdkroot}] ||
267        (${os.major} == 9 && ${configure.sdkroot} eq "")} {
268
269        # https://trac.macports.org/ticket/37418
270        configure.cppflags-append -D__MAC_OS_X_VERSION_MAX_ALLOWED=1050
271    }
272
273    if {[string match "*10.4*" ${configure.sdkroot}] ||
274        (${os.major} == 8 && ${configure.sdkroot} eq "")} {
275
276        # https://trac.macports.org/ticket/37828
277        configure.cppflags-append -D__MAC_OS_X_VERSION_MAX_ALLOWED=1040
278    }
279
280    if {$macosx_deployment_target eq "10.4" ||
281        (${os.major} == 8 && $macosx_deployment_target eq "")} {
282
283        # https://trac.macports.org/ticket/37828
284        configure.cppflags-append -D__MAC_OS_X_VERSION_MIN_REQUIRED=1040
285    }
286}
287
288platform powerpc {
289    # https://trac.macports.org/ticket/37839
290    configure.optflags-replace -O2 -Os
291}
292
293if {[string match *clang* ${configure.compiler}]} {
294    configure.cxxflags-append -Wno-c++11-extensions
295}
296
297livecheck.type  regex
298livecheck.url   http://webkitgtk.org/?page=download
299livecheck.regex webkitgtk-(\[0-9\]+\\.\[0-9\]*\[02468\]\\.\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.