Line 0
Link Here
|
|
|
1 |
# $FreeBSD$ |
2 |
|
3 |
PORTNAME= palemoon |
4 |
DISTVERSION= 29.4.3 |
5 |
CATEGORIES= www |
6 |
MASTER_SITES= http://archive.palemoon.org/source/ |
7 |
DISTFILES= palemoon-${DISTVERSION}.source.tar.xz |
8 |
DIST_SUBDIR= MoonchildProductions |
9 |
|
10 |
MAINTAINER= olce.freebsd.ports@certner.fr |
11 |
COMMENT= Open-source web browser |
12 |
|
13 |
LICENSE= MPL20 MISC |
14 |
LICENSE_COMB= multi |
15 |
LICENSE_NAME_MISC= Miscellaneous free and open-source licenses |
16 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
17 |
LICENSE_FILE_MISC= ${WRKSRC}/platform/toolkit/content/license.html |
18 |
LICENSE_PERMS_MISC= dist-mirror pkg-mirror auto-accept |
19 |
|
20 |
ONLY_FOR_ARCHS= amd64 i386 |
21 |
ONLY_FOR_ARCHS_REASON=Upstream only cares about i386/amd64 |
22 |
|
23 |
# Common deps & build options |
24 |
BUILD_DEPENDS= autoconf-2.13:devel/autoconf213 \ |
25 |
yasm:devel/yasm \ |
26 |
zip:archivers/zip \ |
27 |
|
28 |
LIB_DEPENDS= libdbus-1.so:devel/dbus \ |
29 |
libdbus-glib-1.so:devel/dbus-glib \ |
30 |
libfontconfig.so:x11-fonts/fontconfig \ |
31 |
libfreetype.so:print/freetype2 |
32 |
|
33 |
USES= pkgconfig perl5 gmake gnome xorg desktop-file-utils |
34 |
USE_PERL5= build |
35 |
# XXX |
36 |
# GTK3 support currently needs gtk20 and gconf2 to pass old-configure (and |
37 |
# maybe more). |
38 |
# See also: https://repo.palemoon.org/MoonchildProductions/UXP/issues/1638. |
39 |
USE_GNOME= cairo gdkpixbuf2 glib20 pango \ |
40 |
gtk30 gtk20:build gconf2:build |
41 |
USE_XORG= xt x11 xcb xext xrender |
42 |
|
43 |
# We require GCC (see also GCC_DEFAULT below), but we need to make sure that |
44 |
# there are no runtime dependencies to libstdc++, i.e., that libc++'s headers |
45 |
# and libraries are used during compilation and link. |
46 |
USES+= compiler:gcc-c++11-lib |
47 |
|
48 |
# Put this here pending creation of USES=gtar |
49 |
BUILD_DEPENDS+= gtar:archivers/gtar |
50 |
BINARY_ALIAS+= tar=${LOCALBASE}/bin/gtar |
51 |
|
52 |
USES+= python:2.7,build |
53 |
# BUILD_DEPENDS+= tauthon:lang/tauthon |
54 |
# BINARY_ALIAS+= python=${LOCALBASE}/bin/tauthon \ |
55 |
# python2=${LOCALBASE}/bin/tauthon \ |
56 |
# python2.7=${LOCALBASE}/bin/tauthon |
57 |
|
58 |
BUNDLE_LIBS= yes |
59 |
|
60 |
## Options |
61 |
|
62 |
# Official branding is enabled in compliance with Pale Moon's redistribution |
63 |
# license (see https://www.palemoon.org/redist.shtml), point 8b, as explicitly |
64 |
# confirmed by the owner (Moonchild; see |
65 |
# https://forum.palemoon.org/viewtopic.php?f=5&t=25625), provided options are |
66 |
# not modified beyond what is necessary to get a stable build on FreeBSD. So DO |
67 |
# NOT CHANGE default options without the maintainer's approval. |
68 |
|
69 |
OPTIONS_SINGLE+= SOUND |
70 |
OPTIONS_SINGLE_SOUND= ALSA PULSEAUDIO SNDIO |
71 |
OPTIONS_DEFAULT+= ALSA |
72 |
|
73 |
OPTIONS_DEFINE+= SYNC |
74 |
OPTIONS_DEFAULT+= SYNC |
75 |
|
76 |
OPTIONS_DEFINE+= SYSTEM_MALLOC |
77 |
|
78 |
ALSA_BUILD_DEPENDS= ${PREFIX}/include/alsa/asoundlib.h:audio/alsa-lib |
79 |
ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib |
80 |
PULSEAUDIO_BUILD_DEPENDS=${LOCALBASE}/include/pulse/pulseaudio.h:audio/pulseaudio |
81 |
PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio |
82 |
SNDIO_BUILD_DEPENDS= ${PREFIX}/include/sndio.h:audio/sndio |
83 |
SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio |
84 |
|
85 |
SYNC_DESC= Pale Moon Sync service (see https://www.palemoon.org/sync/) |
86 |
|
87 |
SYSTEM_MALLOC_DESC= Use system's jemalloc instead of bundled one |
88 |
|
89 |
.include <bsd.port.pre.mk> |
90 |
|
91 |
# We require GCC, and even a specific version of it. 10 is the last version I |
92 |
# tested and validated, and the last version endorsed upstream. It is also the |
93 |
# current default in ports, a nice conjunction that cannot always be |
94 |
# maintained. Version bumps *MUST* be validated by the maintainer (after |
95 |
# thorough testing, and following upstream's recommendations). |
96 |
GCC_DEFAULT= 10 |
97 |
|
98 |
## Vars and targets |
99 |
|
100 |
WRKSRC= ${WRKDIR}/palemoon-source |
101 |
|
102 |
DOT_MOZCONFIG= ${WRKSRC}/.mozconfig |
103 |
PM_BUILD_DIR= ${WRKSRC}/pmbuild |
104 |
|
105 |
PALEMOON_DESKTOP=${WRKSRC}/palemoon/branding/official/palemoon.desktop |
106 |
|
107 |
# Extract only -O options |
108 |
PM_OPTIMIZE=${CFLAGS:M-O*} |
109 |
|
110 |
.for VAR in PM_BUILD_DIR PM_OPTIMIZE |
111 |
PM_MOZCONFIG_REINPLACE_ARGS+=-e 's!%%${VAR}%%!${${VAR}}!' |
112 |
.endfor |
113 |
|
114 |
# Taken from bsd.gecko.mk. See comment there. |
115 |
.if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE) |
116 |
MAKE_JOBS_NUMBER= 1 |
117 |
.endif |
118 |
.if defined(MAKE_JOBS_NUMBER) |
119 |
MOZ_MAKE_FLAGS+= -j${MAKE_JOBS_NUMBER} |
120 |
.endif |
121 |
|
122 |
# Prepare '.mozconfig' for 'configure' |
123 |
pre-configure: |
124 |
${CP} ${FILESDIR}/dot.mozconfig ${DOT_MOZCONFIG} |
125 |
${REINPLACE_CMD} ${PM_MOZCONFIG_REINPLACE_ARGS} ${DOT_MOZCONFIG} |
126 |
.if ${PORT_OPTIONS:MALSA} |
127 |
${ECHO_CMD} ac_add_options --enable-alsa >> ${DOT_MOZCONFIG} |
128 |
${ECHO_CMD} ac_add_options --disable-pulseaudio >> ${DOT_MOZCONFIG} |
129 |
.endif |
130 |
.if ${PORT_OPTIONS:MSNDIO} |
131 |
${ECHO_CMD} ac_add_options --enable-sndio >> ${DOT_MOZCONFIG} |
132 |
${ECHO_CMD} ac_add_options --disable-pulseaudio >> ${DOT_MOZCONFIG} |
133 |
.endif |
134 |
.if ! ${PORT_OPTIONS:MSYNC} |
135 |
${ECHO_CMD} ac_add_options --disable-sync >> ${DOT_MOZCONFIG} |
136 |
.endif |
137 |
.if ${PORT_OPTIONS:MSYSTEM_MALLOC} |
138 |
${ECHO_CMD} ac_add_options --disable-jemalloc >> ${DOT_MOZCONFIG} |
139 |
.else |
140 |
${ECHO_CMD} ac_add_options --enable-jemalloc >> ${DOT_MOZCONFIG} |
141 |
.endif |
142 |
.if defined(MOZ_MAKE_FLAGS) |
143 |
${ECHO_CMD} mk_add_options MOZ_MAKE_FLAGS=${MOZ_MAKE_FLAGS:Q} \ |
144 |
>> ${DOT_MOZCONFIG} |
145 |
.endif |
146 |
# Add build variables |
147 |
.for VAR in CPP CXXCPP CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS \ |
148 |
LD AS AR RANLIB OBJDUMP NM |
149 |
.if defined(${VAR}) |
150 |
# Remove -rpath options to GCC's directory, we don't need them (no dependencies |
151 |
# on libs compiled with gfortran, see |
152 |
# https://wiki.freebsd.org/libgcc%20problem) and we don't want them (triggering |
153 |
# a link to a different libgcc_s depending on whether GCC is installed at |
154 |
# runtime). |
155 |
${ECHO_CMD} export ${VAR}=\"${${VAR}:N*-rpath*lib/gcc*}\" >> ${DOT_MOZCONFIG} |
156 |
.endif |
157 |
.endfor |
158 |
|
159 |
# Running 'mach configure' separately is "strongly discouraged" (see Mozilla's |
160 |
# doc on build options configuration). But this does not seem relevant to Pale |
161 |
# Moon. |
162 |
do-configure: |
163 |
cd ${WRKSRC} && ${SETENV} PATH=${PATH} ./mach configure |
164 |
|
165 |
do-build: |
166 |
cd ${WRKSRC} && ${SETENV} PATH=${PATH} ./mach build |
167 |
# Going through the package route (the only one documented upstream) |
168 |
cd ${WRKSRC} && ${SETENV} PATH=${PATH} ./mach package |
169 |
|
170 |
do-install: |
171 |
${TAR} -C ${STAGEDIR}${PREFIX}/lib \ |
172 |
-xf ${PM_BUILD_DIR:Q}/dist/palemoon*.tar* \ |
173 |
palemoon |
174 |
${RLN} ${STAGEDIR}${PREFIX}/lib/palemoon/palemoon \ |
175 |
${STAGEDIR}${PREFIX}/bin/palemoon |
176 |
${INSTALL_DATA} ${PALEMOON_DESKTOP} \ |
177 |
${STAGEDIR}${PREFIX}/share/applications/palemoon.desktop |
178 |
${RLN} ${STAGEDIR}${PREFIX}/lib/palemoon/browser/icons/mozicon128.png \ |
179 |
${STAGEDIR}${PREFIX}/share/pixmaps/palemoon.png |
180 |
|
181 |
.include <bsd.port.mk> |