Line 0
Link Here
|
|
|
1 |
# $FreeBSD$ |
2 |
# Created by Olivier Certner <olce.freebsd.ports@certner.fr> |
3 |
|
4 |
PORTNAME= palemoon |
5 |
DISTVERSION= 29.0.1 |
6 |
# UXP_VERSION has to be updated according to DISTVERSION (see recorded commit |
7 |
# of the 'platform' git sub-module and corresponding release in UXP/releases; |
8 |
# see MASTER_SITES for base URLs). |
9 |
UXP_VERSION= 20210205 |
10 |
CATEGORIES= www |
11 |
MASTER_SITES= https://repo.palemoon.org/MoonchildProductions/Pale-Moon/archive/:palemoon \ |
12 |
https://repo.palemoon.org/MoonchildProductions/UXP/archive/:uxp |
13 |
DISTFILES= ${DISTVERSION}_Release.tar.gz:palemoon \ |
14 |
RELBASE_${UXP_VERSION}.tar.gz:uxp |
15 |
DIST_SUBDIR= MoonchildProductions |
16 |
WRKSRC= ${WRKDIR}/pale-moon |
17 |
|
18 |
MAINTAINER= olce.freebsd.ports@certner.fr |
19 |
COMMENT= Open-source web browser |
20 |
|
21 |
# Not sure about the real status of ARM, but only ARM packages of old versions of |
22 |
# PM are available in some Linux distros. |
23 |
ONLY_FOR_ARCHS= amd64 i386 |
24 |
ONLY_FOR_ARCHS_REASON=Upstream only cares about i386/amd64 |
25 |
|
26 |
# Common deps & build options |
27 |
BUILD_DEPENDS= autoconf-2.13:devel/autoconf213 \ |
28 |
yasm:devel/yasm \ |
29 |
zip:archivers/zip \ |
30 |
|
31 |
LIB_DEPENDS= libdbus-1.so:devel/dbus \ |
32 |
libdbus-glib-1.so:devel/dbus-glib \ |
33 |
libfontconfig.so:x11-fonts/fontconfig \ |
34 |
libfreetype.so:print/freetype2 |
35 |
|
36 |
USES= perl5 gmake gnome xorg desktop-file-utils |
37 |
USE_PERL5= build |
38 |
# XXX |
39 |
# GTK3 support currently needs gtk20 and gconf2 to pass old-configure (and |
40 |
# maybe more). |
41 |
# See also: https://repo.palemoon.org/MoonchildProductions/UXP/issues/1638. |
42 |
USE_GNOME= cairo gdkpixbuf2 glib20 pango \ |
43 |
gtk30 gtk20:build gconf2:build |
44 |
USE_XORG= xt x11 xcb xext xrender |
45 |
# 9 is the last version endorsed upstream (and was the default in ports when |
46 |
# this was written). Should ideally be bumped with GCC's default version, but |
47 |
# *only if* validated by upstream (or thoroughly tested by us). Hence |
48 |
# hardcoded. (For the record, building with clang produces malfunctioning |
49 |
# executables.) |
50 |
# NOTE: We make sure that there are no runtime dependencies to GCC. See |
51 |
# [GCC-no-rdep-*] tags below. This should rather be solved in the ports |
52 |
# infrastructure proper (see PR 211154; also, allowing to choose among C++ |
53 |
# standard libraries, besides providing a common default, would be great). |
54 |
USE_GCC= 9 |
55 |
|
56 |
# Put this here pending creation of USES=gtar |
57 |
BUILD_DEPENDS+= gtar:archivers/gtar |
58 |
BINARY_ALIAS+= tar=${LOCALBASE}/bin/gtar |
59 |
|
60 |
BUILD_DEPENDS+= tauthon:lang/tauthon |
61 |
BINARY_ALIAS+= python=${LOCALBASE}/bin/tauthon \ |
62 |
python2=${LOCALBASE}/bin/tauthon \ |
63 |
python2.7=${LOCALBASE}/bin/tauthon |
64 |
|
65 |
BUNDLE_LIBS= yes |
66 |
|
67 |
# Options |
68 |
|
69 |
# Official branding is enabled in compliance with Pale Moon's redistribution |
70 |
# license (see https://www.palemoon.org/redist.shtml), point 8b, as explicitly |
71 |
# confirmed by the owner (Moonchild; see |
72 |
# https://forum.palemoon.org/viewtopic.php?f=5&t=25625), provided options are |
73 |
# not modified beyond what is necessary to get a stable build on FreeBSD. So DO |
74 |
# NOT CHANGE default options without the maintainer's approval. |
75 |
|
76 |
OPTIONS_SINGLE+= SOUND |
77 |
OPTIONS_SINGLE_SOUND= ALSA PULSEAUDIO |
78 |
OPTIONS_DEFAULT+= ALSA |
79 |
|
80 |
OPTIONS_DEFINE+= SYNC |
81 |
OPTIONS_DEFAULT+= SYNC |
82 |
|
83 |
OPTIONS_DEFINE+= SYSTEM_MALLOC |
84 |
|
85 |
ALSA_BUILD_DEPENDS= ${PREFIX}/include/alsa/asoundlib.h:audio/alsa-lib |
86 |
ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib |
87 |
PULSEAUDIO_BUILD_DEPENDS=${LOCALBASE}/include/pulse/pulseaudio.h:audio/pulseaudio |
88 |
PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio |
89 |
|
90 |
SYNC_DESC= Pale Moon Sync service (see https://www.palemoon.org/sync/) |
91 |
|
92 |
SYSTEM_MALLOC_DESC= Use system's jemalloc instead of bundled one |
93 |
|
94 |
.include <bsd.port.options.mk> |
95 |
|
96 |
# Vars and targets |
97 |
|
98 |
# Have GCC link with libc++. Needed because some library dependencies (e.g., |
99 |
# libgraphite2.so) are linked against libc++ already, and mixing both with this |
100 |
# codebase results in instant executable crash. |
101 |
# As advised here: |
102 |
# https://libcxx.llvm.org/docs/UsingLibcxx.html#using-libc-with-gcc |
103 |
# with the change of linking gcc statically, so that this port doesn't need |
104 |
# to depend on GCC at all at runtime. [GCC-no-rdep-1] |
105 |
# This is similar to what 'compiler.mk' does on using "gcc-c++11-lib". |
106 |
CXXFLAGS+= -nostdinc++ -I/usr/include/c++/v1 -nodefaultlibs \ |
107 |
-lc++ -lcxxrt -lm -lc -lgcc \ |
108 |
-pthread -lpthread |
109 |
LDFLAGS+= -lgcc |
110 |
|
111 |
DOT_MOZCONFIG= ${WRKSRC}/.mozconfig |
112 |
PM_BUILD_DIR= ${WRKSRC}/pmbuild |
113 |
|
114 |
PALEMOON_DESKTOP=${WRKSRC}/palemoon/branding/official/palemoon.desktop |
115 |
|
116 |
# Extract only -O options |
117 |
PM_OPTIMIZE=${CFLAGS:M-O*} |
118 |
|
119 |
.for VAR in PM_BUILD_DIR PM_OPTIMIZE |
120 |
PM_MOZCONFIG_REINPLACE_ARGS+=-e 's!%%${VAR}%%!${${VAR}}!' |
121 |
.endfor |
122 |
|
123 |
|
124 |
# Taken from bsd.gecko.mk. See comment there. |
125 |
.if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE) |
126 |
MAKE_JOBS_NUMBER= 1 |
127 |
.endif |
128 |
.if defined(MAKE_JOBS_NUMBER) |
129 |
MOZ_MAKE_FLAGS+= -j${MAKE_JOBS_NUMBER} |
130 |
.endif |
131 |
|
132 |
|
133 |
post-extract: |
134 |
${RMDIR} ${WRKSRC}/platform |
135 |
${RLN} ${WRKDIR}/uxp ${WRKSRC}/platform |
136 |
|
137 |
# Prepare '.mozconfig' for 'configure' |
138 |
pre-configure: |
139 |
${CP} ${FILESDIR}/dot.mozconfig ${DOT_MOZCONFIG} |
140 |
${REINPLACE_CMD} ${PM_MOZCONFIG_REINPLACE_ARGS} ${DOT_MOZCONFIG} |
141 |
.if ${PORT_OPTIONS:MALSA} |
142 |
${ECHO_CMD} ac_add_options --enable-alsa >> ${DOT_MOZCONFIG} |
143 |
${ECHO_CMD} ac_add_options --disable-pulseaudio >> ${DOT_MOZCONFIG} |
144 |
.endif |
145 |
.if ! ${PORT_OPTIONS:MSYNC} |
146 |
${ECHO_CMD} ac_add_options --disable-sync >> ${DOT_MOZCONFIG} |
147 |
.endif |
148 |
.if ${PORT_OPTIONS:MSYSTEM_MALLOC} |
149 |
${ECHO_CMD} ac_add_options --disable-jemalloc >> ${DOT_MOZCONFIG} |
150 |
.else |
151 |
${ECHO_CMD} ac_add_options --enable-jemalloc >> ${DOT_MOZCONFIG} |
152 |
.endif |
153 |
.if defined(MOZ_MAKE_FLAGS) |
154 |
${ECHO_CMD} mk_add_options MOZ_MAKE_FLAGS=${MOZ_MAKE_FLAGS:Q} \ |
155 |
>> ${DOT_MOZCONFIG} |
156 |
.endif |
157 |
# Add build variables |
158 |
.for VAR in CPP CXXCPP CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS \ |
159 |
LD AS AR RANLIB OBJDUMP NM |
160 |
.if defined(${VAR}) |
161 |
# Remove -rpath options to GCC's directory [GCC-no-rdep-2] |
162 |
${ECHO_CMD} export ${VAR}=\"${${VAR}:N*-rpath*lib/gcc*}\" >> ${DOT_MOZCONFIG} |
163 |
.endif |
164 |
.endfor |
165 |
|
166 |
# Running 'mach configure' separately is "strongly discouraged" (see Mozilla's |
167 |
# doc on build options configuration). Still, things seem to work correctly |
168 |
# even with this separate step. |
169 |
do-configure: |
170 |
cd ${WRKSRC} && ${SETENV} PATH=${PATH} ./mach configure |
171 |
|
172 |
do-build: |
173 |
cd ${WRKSRC} && ${SETENV} PATH=${PATH} ./mach build |
174 |
# Going through the package route (the only one documented upstream) |
175 |
cd ${WRKSRC} && ${SETENV} PATH=${PATH} ./mach package |
176 |
|
177 |
do-install: |
178 |
${TAR} -C ${STAGEDIR}${PREFIX}/lib \ |
179 |
-xf ${PM_BUILD_DIR:Q}/dist/palemoon*.tar* \ |
180 |
palemoon |
181 |
${RLN} ${STAGEDIR}${PREFIX}/lib/palemoon/palemoon \ |
182 |
${STAGEDIR}${PREFIX}/bin/palemoon |
183 |
${INSTALL_DATA} ${PALEMOON_DESKTOP} \ |
184 |
${STAGEDIR}${PREFIX}/share/applications/palemoon.desktop |
185 |
${RLN} ${STAGEDIR}${PREFIX}/lib/palemoon/browser/icons/mozicon128.png \ |
186 |
${STAGEDIR}${PREFIX}/share/pixmaps/palemoon.png |
187 |
|
188 |
.include <bsd.port.mk> |
189 |
# [GCC-no-rdep-3] |
190 |
RUN_DEPENDS:= ${RUN_DEPENDS:Ngcc*} |