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

Last change on this file was 153186, checked in by jeremyhu@…, 2 months ago

webkit-gtk: Unconditionally use --disable-accelerated-compositing for the quartz variant (#52395).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.5 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 153186 2016-09-26 16:57:23Z ryandesign@macports.org $
3
4# We have an umbrella radar tracking webkit-gtk issues on OS X.  Please relate
5# any future issues with this tracker.
6# http://bugs.webkit.org/show_bug.cgi?id=126492
7
8PortSystem          1.0
9PortGroup           conflicts_build 1.0
10PortGroup           muniversal 1.0
11PortGroup           compiler_blacklist_versions 1.0
12PortGroup           cxx11 1.0
13
14name                webkit-gtk
15epoch               2
16version             2.4.11
17description         Apple's WebKit HTML rendering library for GTK+
18long_description    ${description}
19maintainers         jeremyhu devans
20categories          www gnome
21platforms           darwin freebsd
22license             LGPL-2+ BSD
23homepage            http://webkitgtk.org/
24master_sites        http://webkitgtk.org/releases/
25
26use_xz              yes
27distname            webkitgtk-${version}
28
29dist_subdir         webkit-gtk
30
31checksums           rmd160  e1f72498f911465f5ba152313dd9c62ae8d5eee6 \
32                    sha256  588aea051bfbacced27fdfe0335a957dca839ebe36aa548df39c7bbafdb65bf7
33
34depends_build       port:pkgconfig \
35                    port:gtk-doc \
36                    port:python27 \
37                    port:py27-simplejson
38
39depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
40                    port:bison \
41                    port:flex \
42                    port:enchant \
43                    port:geoclue2 \
44                    port:gobject-introspection \
45                    port:harfbuzz-icu \
46                    port:icu \
47                    port:libxslt \
48                    port:libpng \
49                    port:libsecret \
50                    port:libsoup \
51                    port:mesa \
52                    port:sqlite3 \
53                    port:webp \
54                    port:xorg-libXt
55
56# case-insensitive.patch: https://bugs.webkit.org/show_bug.cgi?id=65811
57# our-icu.patch: No upstream bug report, probably not wanted
58# ruby-1.8.patch: https://bugs.webkit.org/show_bug.cgi?id=126327
59# quartz-webcore.patch: https://bugs.webkit.org/show_bug.cgi?id=126326
60# gstreamer.patch: https://bugs.webkit.org/show_bug.cgi?id=126437
61# libedit.patch: https://bugs.webkit.org/show_bug.cgi?id=127059
62# leopard-malloc.patch: https://bugs.webkit.org/show_bug.cgi?id=140143
63# leopard-platform.patch: https://bugs.webkit.org/show_bug.cgi?id=140143
64# remove-cf-available.patch: https://trac.macports.org/ticket/49849
65# RenderThemeGtk2-toRenderBox.patch: https://trac.macports.org/ticket/51406
66
67patchfiles          clang-assertions.patch \
68                    case-insensitive.patch \
69                    our-icu.patch \
70                    ruby-1.8.patch \
71                    quartz-webcore.patch \
72                    gstreamer.patch \
73                    leopard-platform.patch \
74                    leopard-malloc.patch \
75                    libedit.patch \
76                    remove-cf-available.patch \
77                    RenderThemeGtk2-toRenderBox.patch
78
79conflicts_build     google-test
80
81# https://trac.macports.org/ticket/36329
82configure.perl      /usr/bin/perl
83configure.python    ${prefix}/bin/python2.7
84
85# --disable-webkit2: https://bugs.webkit.org/show_bug.cgi?id=126416
86# --disable-web-audio: https://bugs.webkit.org/show_bug.cgi?id=126438
87# --disable-jit: https://bugs.webkit.org/show_bug.cgi?id=133293
88configure.args      --disable-webkit2 \
89                    --disable-web-audio \
90                    --enable-x11-target=yes \
91                    --enable-quartz-target=no \
92                    --enable-wayland-target=no \
93                    --enable-introspection \
94                    --disable-video \
95                    --enable-svg \
96                    --enable-geolocation \
97                    --enable-webgl \
98                    --disable-jit
99
100subport webkit-gtk3 {
101    conflicts webkit-gtk3-devel webkit-gtk3-2.0
102    depends_lib-append      port:gtk3
103    configure.args-append   --with-gtk=3.0
104
105#
106# move gtk-docs to allow parallel install with webkit-gtk
107#
108    if {[variant_isset universal]} {
109#
110# using diff to merge derived include files sometimes
111# results in a corrupted file due to nested /* */ blocks
112#
113        global merger_dont_diff
114        set merger_dont_diff    "${prefix}/include/webkitgtk-3.0/webkitdom/WebKitDOMNavigator.h"
115        merger-post-destroot {
116            foreach arch ${universal_archs_to_use} {
117                set docpath ${workpath}/destroot-${arch}${prefix}/share/gtk-doc/html
118                move ${docpath}/webkitgtk ${docpath}/webkitgtk3
119                move ${docpath}/webkitdomgtk ${docpath}/webkitdomgtk3
120                move ${docpath}/webkitgtk3/webkitgtk.devhelp2 ${docpath}/webkitgtk3/webkitgtk3.devhelp2
121            }
122        }
123    } else {
124        post-destroot {
125           set docpath ${destroot}${prefix}/share/gtk-doc/html
126           move ${docpath}/webkitgtk ${docpath}/webkitgtk3
127           move ${docpath}/webkitdomgtk ${docpath}/webkitdomgtk3
128           move ${docpath}/webkitgtk3/webkitgtk.devhelp2 ${docpath}/webkitgtk3/webkitgtk3.devhelp2
129        }
130    }
131}
132
133if {${name} eq ${subport}} {
134    conflicts webkit-gtk-devel webkit-gtk-2.0
135    depends_lib-append      port:gtk2
136    configure.args-append   --with-gtk=2.0
137}
138
139# https://bugs.webkit.org/show_bug.cgi?id=94488
140configure.universal_args-delete --disable-dependency-tracking
141
142# gobject-introspection uses g-ir-scanner, which uses $CC from env
143if {[variant_isset universal]} {
144    foreach arch ${configure.universal_archs} {
145        lappend merger_build_args(${arch})     CC='${configure.cc} -arch ${arch}'
146        lappend merger_destroot_args(${arch})  CC='${configure.cc} -arch ${arch}'
147    }
148} else {
149    build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
150    destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}"
151}
152
153# We don't want to use the headers from the installed WebKit
154configure.cppflags-delete   -I${prefix}/include
155
156# google-test suite build fix
157configure.cppflags-append   -DGTEST_USE_OWN_TR1_TUPLE=1
158
159# https://trac.macports.org/ticket/41560#comment:2
160configure.cflags-append     -ftemplate-depth=256
161configure.cxxflags-append   -ftemplate-depth=256
162
163autoreconf.env-append ACLOCAL="aclocal -I Source/autotools"
164use_autoreconf      yes
165autoreconf.args     -fvi
166
167lappend merger_dont_diff ${prefix}/include/webkitgtk-1.0/webkitdom/WebKitDOMNavigator.h
168
169post-patch {
170    # https://bugs.webkit.org/show_bug.cgi?id=126433
171    reinplace "s/def __APPLE__/ 0/" \
172        ${worksrcpath}/Source/JavaScriptCore/API/WebKitAvailability.h
173
174    # https://bugs.webkit.org/show_bug.cgi?id=58737
175    reinplace "s:OS(MAC_OS_X):PLATFORM(MAC):" \
176        ${worksrcpath}/Source/WTF/wtf/ThreadingPthreads.cpp
177
178    # https://bugs.webkit.org/show_bug.cgi?id=126325
179    reinplace "s:-stdlib=libstdc\+\+::" \
180        ${worksrcpath}/Source/autotools/SetupCompilerFlags.m4
181
182    # https://bugs.webkit.org/show_bug.cgi?id=126329
183    # In file included from Source/JavaScriptCore/runtime/JSGlobalObject.cpp:83:
184    # ./Source/JavaScriptCore/API/ObjCCallbackFunction.h:32:9: fatal error: 'JavaScriptCore/JSCallbackFunction.h' file not found
185    # #import <JavaScriptCore/JSCallbackFunction.h>
186    #         ^
187    reinplace "/^#define JSC_OBJC_API_ENABLED/s/^.*$/#define JSC_OBJC_API_ENABLED 0/" \
188        ${worksrcpath}/Source/JavaScriptCore/API/JSBase.h
189}
190
191# TODO: fix this for muniversal
192# keep it for debug
193#post-destroot {
194#    file copy ${worksrcpath}/Programs/.libs/GtkLauncher ${destroot}${prefix}/bin
195#}
196
197# Apple's gnumake (patched 3.81) gets wedged at some point during the build process
198depends_build-append    port:gmake
199build.cmd               ${prefix}/bin/gmake
200
201build.args-append V=1
202
203# see bug #24622
204variant quartz {
205    configure.args-replace --enable-x11-target=yes --enable-x11-target=no
206    configure.args-replace --enable-quartz-target=no --enable-quartz-target=yes
207    configure.args-append --disable-accelerated-compositing
208
209    # TODO: See if this will build with OpenGL.framework
210    configure.args-delete --enable-webgl
211    depends_lib-delete \
212        port:mesa \
213        port:xorg-libXt
214}
215
216variant video description {Enable HTML5 video support using gstreamer} {
217        depends_lib-append      port:gstreamer1-gst-plugins-base
218        configure.args-delete   --disable-video
219        configure.args-append   --enable-video
220}
221
222default_variants    +video
223
224if {[string match *clang* ${configure.cxx}]} {
225    configure.cxxflags-append -Wno-c++11-extensions
226}
227
228livecheck.type      regex
229livecheck.url       http://webkitgtk.org/releases/
230livecheck.regex     "webkitgtk-(2\\.4(?:\\.\\d+)*)"
Note: See TracBrowser for help on using the repository browser.