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

Last change on this file since 139219 was 139219, checked in by devans@…, 3 years ago

webkit-gtk, webkit-gtk-devel: reformat, general cleanup, no change in installed files.

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