Skip to content

Commit

Permalink
www/librewolf: New port
Browse files Browse the repository at this point in the history
PR:	258503
  • Loading branch information
Martinfx authored and jsm222 committed Jan 21, 2023
1 parent eca308d commit 4e77dee
Show file tree
Hide file tree
Showing 36 changed files with 93,204 additions and 0 deletions.
1 change: 1 addition & 0 deletions www/Makefile
Expand Up @@ -297,6 +297,7 @@
SUBDIR += libnghttp3
SUBDIR += libresonic-standalone
SUBDIR += librespeed
SUBDIR += librewolf
SUBDIR += librtcdcpp
SUBDIR += libwpe
SUBDIR += libwww
Expand Down
99 changes: 99 additions & 0 deletions www/librewolf/Makefile
@@ -0,0 +1,99 @@
PORTNAME= librewolf
DISTVERSION= 108.0.1-1
CATEGORIES= www wayland
MASTER_SITES= https://gitlab.com/api/v4/projects/32320088/packages/generic/librewolf-source/${DISTVERSION}/
DISTNAME= ${PORTNAME}-${DISTVERSION}.source.
EXTRACT_SUFX= tar.gz

PATCH_SITES= https://gitlab.com/librewolf-community/browser/source/-/raw/${DISTVERSION}/
PATCHFILES= patches/unity-menubar.patch?inline=false:-p1

MAINTAINER= freebsd@sysctl.cz
COMMENT= Custom version of Firefox, focused on privacy, security and freedom
WWW= https://librewolf.net/

BUILD_DEPENDS= nspr>=4.32:devel/nspr \
nss>=3.84:security/nss \
icu>=71.1:devel/icu \
libevent>=2.1.8:devel/libevent \
harfbuzz>=4.4.1:print/harfbuzz \
graphite2>=1.3.14:graphics/graphite2 \
png>=1.6.37:graphics/png \
dav1d>=1.0.0:multimedia/dav1d \
libvpx>=1.12.0:multimedia/libvpx \
${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
v4l_compat>0:multimedia/v4l_compat \
autoconf2.13:devel/autoconf2.13 \
nasm:devel/nasm \
yasm:devel/yasm \
zip:archivers/zip

.include "${.CURDIR}/../../www/firefox/Makefile.options"
.include <bsd.port.options.mk>
.if ${ARCH} != powerpc64
BUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx \
${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc \
${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a:devel/wasi-compiler-rt${LLVM_DEFAULT}
.endif

USES= tar:xz
USE_GECKO= gecko
USE_MOZILLA= -sqlite
CFLAGS_powerpc64le= -DSQLITE_BYTEORDER=1234
# work around bindgen not finding ICU, e.g.
# dist/include/mozilla/intl/ICU4CGlue.h:8:10: fatal error: 'unicode/uenum.h' file not found, err: true
CONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include"
CONFIGURE_ENV+= MOZ_REQUIRE_SIGNING=""
MOZ_EXPORT+= MOZ_TELEMETRY_REPORTING="" \
MOZILLA_OFFICIAL="1" \
MOZ_OFFICIAL_BRANDING="1" \
MOZ_APP_DISPLAYNAME="Librewolf" \
MOZ_APP_NAME="librewolf"

MOZ_OPTIONs= --enable-application=browser \
--allow-addon-sideload \
--disable-crashreporter \
--disable-debug \
--disable-default-browser-agent \
--disable-tests \
--disable-updater \
--enable-hardening \
--enable-optimize \
--enable-release \
--enable-rust-simd \
--with-app-name=librewolf \
--with-branding=browser/branding/librewolf \
--with-unsigned-addon-scopes=app,system \
--with-l10n-base=$PWD/browser/locales/l10n \
--enable-bootstrap \
MOZ_CRASHREPORTER=0 \
MOZ_DATA_REPORTING=0 \
MOZ_SERVICES_HEALTHREPORT=0

# helpful when testing beta
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}

FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png
FIREFOX_DESKTOP= ${MOZSRC}/taskcluster/docker/firefox-snap/firefox.desktop

.if ${ARCH} == powerpc64
MOZ_OPTIONS+= --disable-webrtc --without-wasm-sandboxed-libraries
.else
BUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx \
${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc \
${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a:devel/wasi-compiler-rt${LLVM_DEFAULT}
MOZ_OPTIONS+= --with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot
.endif

post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/browser/app/nsBrowserApp.cpp
@${RM} ${WRKSRC}/mozconfig

post-install:
${CP} ${FIREFOX_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop
${REINPLACE_CMD} -e 's|Firefox|Librewolf|g' ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop
${REINPLACE_CMD} -e 's|firefox|librewolf|g' ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop
${REINPLACE_CMD} -e 's|Icon=.*|Icon=${FIREFOX_ICON_SRC}|g' ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop

.include <bsd.port.mk>
5 changes: 5 additions & 0 deletions www/librewolf/distinfo
@@ -0,0 +1,5 @@
TIMESTAMP = 1671892824
SHA256 (librewolf-108.0.1-1.source.tar.gz) = d1978f870ebddbcb71e92da9887e6de99818c4d8045642c46a5b3d2e2b970e81
SIZE (librewolf-108.0.1-1.source.tar.gz) = 828438372
SHA256 (patches/unity-menubar.patch?inline=false) = 84c03a4eb5dcc1bb9e2cfc343e0b98bbbc8dc791647747082d3f50ba638de965
SIZE (patches/unity-menubar.patch?inline=false) = 163635

0 comments on commit 4e77dee

Please sign in to comment.