# Template file for 'icecat' pkgname=icecat version=68.10.0 revision=1 build_helper="rust" hostmakedepends="autoconf213 unzip zip pkg-config perl python yasm python3 cargo llvm clang rust cbindgen nasm nodejs-lts-10 tar which" makedepends="nss-devel libjpeg-turbo-devel gtk+-devel gtk+3-devel icu-devel pixman-devel sqlite-devel libevent-devel libnotify-devel libvpx5-devel libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std libXdamage-devel $(vopt_if alsa alsa-lib-devel) $(vopt_if dbus dbus-glib-devel) $(vopt_if pulseaudio pulseaudio-devel) $(vopt_if startup_notification startup-notification-devel) $(vopt_if xscreensaver libXScrnSaver-devel) $(vopt_if sndio sndio-devel)" depends="nss>=3.53 desktop-file-utils hicolor-icon-theme" short_desc="GNU version of the Firefox browser" maintainer="Jürgen Buchmüller " license="MPL-1.1, GPL-2.0-or-later, LGPL-2.1-or-later" homepage="https://www.gnu.org/software/${pkgname}/" distfiles="https://distfiles.voidlinux.de/${pkgname}-${version}/${pkgname}-${version}-gnu1.tar.xz" checksum=b4dfc9644d64c1effa8f7721956274d071b897d1893b57f8b7bd7b749955f834 lib32disabled=yes build_options="alsa dbus gtk3 pulseaudio startup_notification sndio xscreensaver" build_options_default="alsa dbus gtk3 pulseaudio startup_notification sndio xscreensaver" case $XBPS_TARGET_MACHINE in armv[56]*) broken="required NEON extensions are not supported on armv[56]" ;; ppc64*) ;; ppc*) broken="xptcall bitrot" ;; esac if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then broken="rendering is busted, dunno why" fi CXXFLAGS="-Wno-class-memaccess -Wno-unused-function" if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then makedepends+=" libatomic-devel" fi if [ "$XBPS_WORDSIZE" -eq 32 ]; then nodebug=yes fi # We need this because cargo verifies s because cargo verifies # checksums of all files in vendor crates when it builds and # gives us no way to override or update the file sanely... # so just clear out the file list _clear_vendor_checksums() { sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/$1/.cargo-checksum.json } # Function to install a language pack # FIXME: The *.xpi files have to be signed to be accepted as plugins # yet how do you sign a package if you don't have a signing key? _install_langpack() { local tempdir=$(ls -d ${wrksrc}/build/dist/linux-*) vinstall ${tempdir}/xpi/${sourcepkg}-${version}.$1.langpack.xpi \ 644 usr/lib/icecat/browser/extensions } post_extract() { case "$XBPS_TARGET_MACHINE" in *-musl) cp "${FILESDIR}/stab.h" toolkit/crashreporter/google-breakpad/src/ ;; esac } post_patch() { _clear_vendor_checksums cssparser } do_build() { local lang languages=(ach af an ar ast az be bg bn br bs ca cak cs cy da de dsb el en-CA en-GB en-US eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hu hy-AM ia id is it ja ka kab kk km kn ko lij lt lv mk mr ms my nb-NO ne-NP nl nn-NO oc pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te th tr uk ur uz vi xh zh-CN zh-TW) local triplet cp ${FILESDIR}/mozconfig .mozconfig case "$XBPS_TARGET_MACHINE" in *-musl) echo "ac_add_options --disable-jemalloc" >>.mozconfig echo "ac_add_options --disable-gold" >>.mozconfig echo "ac_add_options --enable-release" >>.mozconfig ;; esac case "$XBPS_TARGET_MACHINE" in x86_64*|i686*|arm*) echo "ac_add_options --disable-elf-hack" >>.mozconfig ;; esac # webrtc currently fails to build on 32-bit ppc... case "$XBPS_TARGET_MACHINE" in ppc64*) ;; ppc*) echo "ac_add_options --disable-webrtc" >>.mozconfig ;; esac if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then export LDFLAGS+=" -latomic" fi if [ "$CROSS_BUILD" ]; then BINDGEN_INCLUDE_FLAGS=$( $CPP -x c++ -v /dev/null -o /dev/null 2>&1 | \ sed -n '/#include <...> search starts here:/,/End of search list./p' | \ sed '1,1d;$d' | sed 's/^ /-I/' | paste -s ) export BINDGEN_CFLAGS="--target=$XBPS_CROSS_TRIPLET \ --sysroot=${XBPS_CROSS_BASE} ${BINDGEN_INCLUDE_FLAGS}" export HOST_CC="${CC_host}" export TARGET_CC="${CC}" export HOST_CFLAGS="${XBPS_CFLAGS}" export HOST_CXXFLAGS="${XBPS_CXXFLAGS}" echo "ac_cv_sqlite_secure_delete=yes" >> .mozconfig echo "ac_cv_sqlite_threadsafe=yes" >> .mozconfig echo "ac_cv_sqlite_enable_fts3=yes" >> .mozconfig echo "ac_cv_sqlite_dbstat_vtab=yes" >> .mozconfig echo "ac_cv_sqlite_enable_unlock_notify=yes" >> .mozconfig echo "ac_cv_prog_hostcxx_works=1" >> .mozconfig echo "ac_add_options --target=$XBPS_CROSS_TRIPLET" >>.mozconfig echo "ac_add_options --host=$XBPS_TRIPLET" >>.mozconfig else echo "ac_add_options --target=$XBPS_TRIPLET" >>.mozconfig echo "ac_add_options --host=$XBPS_TRIPLET" >>.mozconfig fi mkdir -p third_party/rust/libloading/.deps case "$XBPS_TARGET_MACHINE" in armv7*) export CFLAGS+=" -mfpu=neon -Wno-psabi" export CXXFLAGS+=" -mfpu=neon -Wno-psabi" ;; esac # work around large debug symbols on 32-bit hosts if [ "$XBPS_WORDSIZE" = "32" ]; then export CFLAGS="${CFLAGS/-g/-g1}" export CXXFLAGS="${CXXFLAGS/-g/-g1}" export LDFLAGS+=" -Wl,--no-keep-memory" # patch the rust debug level, this is hardcoded sed -i "s/debug_info = '2'/debug_info = '1'/" \ build/moz.configure/toolchain.configure fi export LDFLAGS+=" -Wl,-rpath=/usr/lib/icecat" if [ "$SOURCE_DATE_EPOCH" ]; then export MOZ_BUILD_DATE=$(date --date "@$SOURCE_DATE_EPOCH" "+%Y%m%d%H%M%S") fi export MOZ_MAKE_FLAGS="${makejobs}" export MOZ_NOSPAM=1 export AS=$CC cat >>.mozconfig <