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