source: trunk/dports/www/firefox-x11/Portfile @ 87969

Last change on this file since 87969 was 87879, checked in by jeremyhu@…, 8 years ago

firefox-x11*: Set supported_archs i386 x86_64

  • 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:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 87879 2011-12-10 18:22:31Z jeremyhu@macports.org $
3
4PortSystem      1.0
5PortGroup       archcheck 1.0
6
7name            firefox-x11
8set component   firefox
9categories      www x11
10version         7.0.1
11revision        2
12platforms       darwin
13maintainers     jeremyhu openmaintainer
14description     Mozilla.org's popular stand-alone web browser
15
16long_description \
17    Firefox empowers you to browse faster, more safely and more \
18    efficiently than with any other browser.
19
20universal_variant no
21supported_archs i386 x86_64
22
23homepage        http://www.mozilla.com/${component}/
24
25master_sites    http://releases.mozilla.org/pub/mozilla.org/${component}/releases/${version}/source/
26distname        ${component}-${version}.source
27dist_subdir     ${component}
28
29use_bzip2       yes
30
31checksums           sha1    94bbc7152832371dc0be82f411730df043c5c6ac \
32                    rmd160  cabd83f829ba54711f132749282d7d49e33b6334 \
33                    sha256  81ecf63fca67186094d49dd5a6fe7f5dbd143a39f872ad126de38f246334fc04
34
35worksrcdir      mozilla-release
36
37depends_build \
38        port:findutils \
39        port:pkgconfig \
40        port:autoconf213 \
41        port:yasm
42
43depends_lib \
44        port:heimdal \
45        port:gconf \
46        port:esound \
47        port:libcanberra \
48        port:findutils \
49        port:gtk2 \
50        port:mesa \
51        port:xorg-libXt \
52        port:libnotify
53
54archcheck.files \
55        libexec/heimdal/lib/libkrb5.dylib \
56        lib/libcanberra.dylib \
57        lib/libgconf-2.dylib \
58        lib/libgtk-x11-2.0.dylib \
59        lib/libnotify.dylib \
60        lib/libXt.dylib
61
62use_autoconf yes
63autoconf.cmd autoconf213
64
65set pkg_name ${name}
66
67configure.args \
68        --with-xulrunner-stub-name=xulrunner-stub \
69        --disable-static \
70        --enable-shared \
71        --disable-official-branding \
72        --with-branding=browser/branding/unofficial \
73        --with-distribution-id=org.macports \
74        --enable-default-toolkit=cairo-gtk2 \
75        --x-includes=${prefix}/include \
76        --x-libraries=${prefix}/lib \
77        --enable-libxul \
78        --disable-system-lcms \
79        --disable-system-cairo \
80        --disable-system-sqlite \
81        --with-default-mozilla-five-home=${prefix}/lib/${pkg_name} \
82        --enable-oji \
83        --enable-plugins \
84        --enable-mathml \
85        --enable-extensions="default,spellcheck" \
86        --enable-permissions \
87        --enable-cookie \
88        --enable-image-decoders=all \
89        --enable-image-encoder=all \
90        --enable-canvas \
91        --enable-jsd \
92        --disable-xpctools \
93        --enable-crypto \
94        --enable-pango \
95        --enable-svg \
96        --enable-svg-renderer=cairo \
97        --enable-xinerama \
98        --with-pthreads \
99        --disable-gnomevfs \
100        --disable-gnomeui \
101        --enable-postscript \
102        --enable-safe-browsing \
103        --disable-crashreporter \
104        --enable-optimize='-O2' \
105        --disable-prebinding \
106        --enable-strip \
107        --enable-install-strip \
108        --disable-debug \
109        --disable-installer \
110        --disable-updater \
111        --disable-pedantic \
112        --disable-tests \
113        --disable-mochitest \
114        --disable-necko-wifi
115
116# xpctools and necko-wifi broke in 3.6b1
117
118# XCode 3.1's gcc-4.0 and gcc-4.2 have issues
119# llvm-gcc-4.2 has trouble with some of the mmx asm
120if {${configure.compiler} == "gcc-4.0"} {
121    depends_build-append path:bin/clang:clang
122    configure.compiler macports-clang
123} elseif {${configure.compiler} == "llvm-gcc-4.2"} {
124    configure.compiler clang
125}
126
127# Yes, this is ugly... but the real fix is in the works
128# https://bugzilla.mozilla.org/show_bug.cgi?id=529878
129configure.cc ${configure.cc} -arch ${configure.build_arch}
130configure.cxx ${configure.cxx} -arch ${configure.build_arch}
131
132variant debug description {build with debugging symbols} {
133    configure.args-delete   --disable-debug \
134                            --disable-mochitest \
135                            --enable-optimize='-O2' \
136                            --enable-strip \
137                            --enable-install-strip
138
139    configure.args-append   --enable-debug='-ggdb3' \
140                            --enable-mochitest \
141                            --disable-optimize \
142                            --disable-strip \
143                            --disable-install-strip
144}
145
146variant gnome description {use gnome libraries where appropriate} {
147    depends_lib-append \
148        port:gnome-vfs \
149        port:libgnomeui \
150        port:libgnome \
151        port:gnome-icon-theme
152
153    configure.args-delete --disable-gnomevfs \
154                          --disable-gnomeui
155
156    configure.args-append --enable-gnomevfs \
157                          --enable-gnomeui
158}
159
160variant official_branding description {Enables official Firefox branding.  You may not redistribute resulting packages built with this variant.} {
161    configure.args-delete \
162        --disable-official-branding \
163        --with-branding=browser/branding/unofficial
164    configure.args-append \
165        --enable-official-branding
166}
167
168patchfiles patch-dylib_file.diff
169
170post-patch {
171    # https://bugzilla.mozilla.org/show_bug.cgi?id=485857
172    reinplace "s:XP_MACOSX:__APPLE__:g" ${worksrcpath}/xpcom/base/nsStackWalk.cpp
173
174    # https://bugzilla.mozilla.org/show_bug.cgi?id=641755
175    reinplace "s:XP_MACOSX:__APPLE__:g" ${worksrcpath}/gfx/ycbcr/update.sh
176    reinplace "s:XP_MACOSX:__APPLE__:g" ${worksrcpath}/gfx/ycbcr/yuv_row_posix.cpp
177
178    # https://bugzilla.mozilla.org/show_bug.cgi?id=486034
179    # find -xtype -> gfind -xtype
180    reinplace "s:find:gfind:g" ${worksrcpath}/toolkit/mozapps/installer/packager.mk
181
182    # Don't use the system X11
183    reinplace "s:/usr/X11R6:${prefix}:" ${worksrcpath}/dom/plugins/base/nsPluginsDirUnix.cpp
184    reinplace "s/libXt.so.6:libXext.so/libXt.dylib:libXext.dylib/" ${worksrcpath}/dom/plugins/base/nsPluginsDirUnix.cpp
185
186    # Set the right install_name on the libs
187    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/config/config.mk
188    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/config/rules.mk
189    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/js/src/config/config.mk
190    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/js/src/config/rules.mk
191    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/nsprpub/configure.in
192    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/nsprpub/configure
193    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/security/coreconf/Darwin.mk
194    reinplace "s:@executable_path:${prefix}/lib/${pkg_name}:g" ${worksrcpath}/security/nss/lib/freebl/config.mk
195
196    # Fix the correct library filenames for loading at runtime
197    reinplace "s:libatk-1.0.so.0:${prefix}/lib/libatk-1.0.dylib:" ${worksrcpath}/accessible/src/atk/nsApplicationAccessibleWrap.cpp
198
199    reinplace "s:libgssapi_krb5.so.2:${prefix}/libexec/heimdal/lib/libgssapi.2.dylib:" ${worksrcpath}/extensions/auth/nsAuthGSSAPI.cpp
200
201    reinplace "s:libgnomeui-2.so.0:${prefix}/lib/libgnomeui-2.dylib:" ${worksrcpath}/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
202    reinplace "s:libgnome-2.so.0:${prefix}/lib/libgnome-2.dylib:" ${worksrcpath}/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
203    reinplace "s:libgnomevfs-2.so.0:${prefix}/lib/libgnomevfs-2.dylib:" ${worksrcpath}/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
204
205    reinplace "s:libgconf-2.so.4:${prefix}/lib/libgconf-2.dylib:" ${worksrcpath}/extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp
206
207    reinplace "s:libcups.so.2:/usr/lib/libcups.2.dylib:" ${worksrcpath}/widget/src/gtk2/nsCUPSShim.cpp
208
209    reinplace "s:libgnomeui-2.so.0:${prefix}/lib/libgnomeui-2.dylib:" ${worksrcpath}/toolkit/xre/nsNativeAppSupportUnix.cpp
210    reinplace "s:libgnome-2.so.0:${prefix}/lib/libgnome-2.dylib:" ${worksrcpath}/toolkit/xre/nsNativeAppSupportUnix.cpp
211
212    reinplace "s:libgnomeui-2.so.0:${prefix}/lib/libgnomeui-2.dylib:" ${worksrcpath}/toolkit/crashreporter/client/crashreporter_linux.cpp
213    reinplace "s:libgnome-2.so.0:${prefix}/lib/libgnome-2.dylib:" ${worksrcpath}/toolkit/crashreporter/client/crashreporter_linux.cpp
214
215    reinplace "s:libgconf-2.so.4:${prefix}/lib/libgconf-2.dylib:" ${worksrcpath}/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
216
217    reinplace "s:libgtk-x11-2.0.so.0:${prefix}/lib/libgtk-x11-2.0.dylib:" ${worksrcpath}/widget/src/gtk2/nsBidiKeyboard.cpp
218    reinplace "s:libXss.so.1:${prefix}/lib/libXss.1.0.0.dylib:" ${worksrcpath}/widget/src/gtk2/nsIdleServiceGTK.cpp
219    reinplace "s:libXinerama.so.1:${prefix}/lib/libXinerama.1.dylib:" ${worksrcpath}/widget/src/gtk2/nsScreenManagerGtk.cpp
220    reinplace "s:libesd.so.0:${prefix}/lib/libesd.0.dylib:" ${worksrcpath}/widget/src/gtk2/nsSound.cpp
221    reinplace "s:libcanberra.so.0:${prefix}/lib/libcanberra.0.dylib:" ${worksrcpath}/widget/src/gtk2/nsSound.cpp
222
223    reinplace "s:libXss.so.1:${prefix}/lib/libXss.1.0.0.dylib:" ${worksrcpath}/widget/src/qt/nsIdleServiceQt.cpp
224    reinplace "s:libesd.so.0:${prefix}/lib/libesd.0.dylib:" ${worksrcpath}/widget/src/qt/nsSound.cpp
225
226    # Set our system plugins path
227    reinplace "s:/usr/lib/mozilla/plugins:${prefix}/lib/nsplugins:" ${worksrcpath}/xpcom/io/nsAppFileLocationProvider.cpp
228
229    reinplace "s:/etc/gre\.:${prefix}/etc/gre.:g" \
230        ${worksrcpath}/xpcom/build/nsXPCOMPrivate.h
231}
232
233configure.env \
234        MOZCONFIG="${worksrcpath}/browser/config/mozconfig" \
235        MOZILLA_FIVE_HOME="${prefix}/lib/${pkg_name}" \
236        _MACOSX_DEPLOYMENT_TARGET="${macosx_deployment_target}"
237
238build.args-append \
239        includedir="${prefix}/include/${pkg_name}" \
240        idldir="${prefix}/share/idl/${pkg_name}" \
241        installdir="${prefix}/lib/${pkg_name}" \
242        sdkdir="${prefix}/lib/${pkg_name}" \
243        SKIP_COPY_XULRUNNER=1
244
245destroot.args-append \
246        includedir="${prefix}/include/${pkg_name}" \
247        idldir="${prefix}/share/idl/${pkg_name}" \
248        installdir="${prefix}/lib/${pkg_name}" \
249        sdkdir="${prefix}/lib/${pkg_name}" \
250        SKIP_COPY_XULRUNNER=1
251
252post-destroot   {
253    file mkdir ${destroot}${prefix}/share/applications
254
255    copy \
256        ${filespath}/share-applications-${component}.desktop \
257        ${destroot}${prefix}/share/applications/${name}.desktop
258
259    move ${destroot}${prefix}/bin/${component} ${destroot}${prefix}/bin/${pkg_name}
260}
261
262livecheck.type  regex
263livecheck.url   http://releases.mozilla.org/pub/mozilla.org/${component}/releases
264livecheck.regex ">(\\d+(?:\\.\\d+)*).<"
Note: See TracBrowser for help on using the repository browser.