diff options
Diffstat (limited to 'repos/extra/librewolf/abuild')
| -rw-r--r-- | repos/extra/librewolf/abuild | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/repos/extra/librewolf/abuild b/repos/extra/librewolf/abuild new file mode 100644 index 00000000..aa09e73a --- /dev/null +++ b/repos/extra/librewolf/abuild @@ -0,0 +1,98 @@ +name=librewolf +version=137.0.3 +_ver=${version%.*} +_sion=${version##*.} +_version=${_ver}-${_sion} +release=1 +source="https://gitlab.com/api/v4/projects/32320088/packages/generic/librewolf-source/${_version}/librewolf-${_version}.source.tar.gz + visibility.patch + fix-rust-target.patch" + +build() { + cat > mozconfig << EOF +ac_add_options --prefix=/usr +ac_add_options --libdir=/usr/lib +ac_add_options --with-app-name=$name +ac_add_options --with-branding=browser/branding/$name +export MOZ_APP_REMOTINGNAME=$name +ac_add_options --enable-release +ac_add_options --enable-audio-backends=alsa +ac_add_options --enable-install-strip +ac_add_options --enable-optimize +ac_add_options --enable-hardening +ac_add_options --with-system-ffi +ac_add_options --with-system-jpeg +ac_add_options --with-system-libvpx +ac_add_options --with-system-nspr +ac_add_options --with-system-nss +ac_add_options --with-system-pixman +ac_add_options --with-system-png +ac_add_options --with-system-webp +ac_add_options --with-system-zlib +ac_add_options --without-wasm-sandboxed-libraries +ac_add_options --disable-eme +#ac_add_options --disable-dbus +ac_add_options --disable-bootstrap +ac_add_options --disable-tests +ac_add_options --disable-vtune +ac_add_options --disable-updater +ac_add_options --disable-jemalloc +ac_add_options --disable-elf-hack +ac_add_options --disable-callgrind +ac_add_options --disable-profiling +ac_add_options --disable-necko-wifi +ac_add_options --disable-crashreporter +ac_add_options --disable-accessibility +ac_add_options --disable-debug +ac_add_options --disable-debug-symbols +ac_add_options --disable-parental-controls +ac_add_options --disable-system-extension-dirs +EOF + + if [ -f $SPM_PKGDB/libx11 ] && [ ! -f $SPM_PKGDB/wayland ]; then + echo "ac_add_options --enable-default-toolkit=cairo-gtk3-x11-only" >> mozconfig + elif [ -f $SPM_PKGDB/wayland ] && [ ! -f $SPM_PKGDB/libx11 ]; then + echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland-only" >> mozconfig + fi + + if [ -e '/usr/bin/ccache' ]; then + echo 'ac_add_options --enable-ccache' >> mozconfig + PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//') + fi + + export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none + export MOZBUILD_STATE_PATH=${PWD}/mozbuild + export RUST_TARGET=x86_64-unknown-linux-musl + + export CFLAGS="$CFLAGS -w" + export CXXFLAGS="$CXXFLAGS -w" + export LDFLAGS="$LDFLAGS -Wl,-rpath=/usr/lib/$name,--enable-new-dtags" + export CXXSTDLIB=c++ + + ./mach build + ./mach install + + mkdir -pv $PKG/usr/share/applications + mkdir -pv $PKG/usr/share/pixmaps + + cat > $PKG/usr/share/applications/$name.desktop << EOF +[Desktop Entry] +Encoding=UTF-8 +Name=Librewolf +Comment=Browse the World Wide Web +GenericName=Web Browser +Exec=librewolf %u +Terminal=false +Type=Application +Icon=librewolf +Categories=GNOME;GTK;Network;WebBrowser; +MimeType=text/xml;text/mml;text/html;application/xhtml+xml;application/vnd.mozilla.xul+xml;x-scheme-handler/http;x-scheme-handler/https +StartupNotify=true +EOF + + mkdir -p $PKG/usr/share/pixmaps + ln -sfv /usr/lib/$name/browser/chrome/icons/default/default128.png \ + $PKG/usr/share/pixmaps/$name.png + + rm $PKG/usr/lib/$name/$name-bin +} |