From fb8cd6be736604502f0f9b207b95e729a28e8040 Mon Sep 17 00:00:00 2001 From: khronosschoty Date: Thu, 3 Mar 2022 21:10:09 -0800 Subject: palemoon-dev.SlackBuild: build script for fetching and building unstable branding git snapshots of Pale Moon *added* --- README | 58 +++++ autoconf-2.13-consolidated_fixes-1.patch.gz | Bin 0 -> 5869 bytes doinst.sh | 9 + palemoon.SlackBuild | 326 ++++++++++++++++++++++++++++ palemoon.desktop | 13 ++ palemoon.info | 10 + slack-desc | 19 ++ 7 files changed, 435 insertions(+) create mode 100644 README create mode 100644 autoconf-2.13-consolidated_fixes-1.patch.gz create mode 100644 doinst.sh create mode 100644 palemoon.SlackBuild create mode 100644 palemoon.desktop create mode 100644 palemoon.info create mode 100644 slack-desc diff --git a/README b/README new file mode 100644 index 0000000..61cdab4 --- /dev/null +++ b/README @@ -0,0 +1,58 @@ +palemoon (Web browser -- BUILD FROM SOURCE) + +This SlackBuild builds Pale Moon from source. +For a binary repackage, see 'palemoon-bin' at SlackBuilds.org. + +Pale Moon is an Open Source, Goanna-based web browser available for +Microsoft Windows and Linux (with other operating systems in +development), focusing on efficiency and ease of use. + +This SlackBuild attempts to compile, build and package Pale Moon, +Slackware style, in a manner that conforms to official Pale Moon Linux +releases; while, at the same time, providing useful and easy ways to +deviate if desired. This SlackBuild may conflict with the alternative +SlackBuild known, here at SBo, as "palemoon-bin"; which repackages +binaries offically released by the Pale Moon devs. + +------------------------------------------------------------------------ + +See http://docs.slackware.com/howtos:software:palemoon for additional +tips and help resources. + +Using the Oxygen theme is known to cause Pale Moon to crash; if you are +experiencing crashes, and segfaults, make sure you are not using this +theme; or use Alienbob's patched oxygen-gtk2; which will fix this issue. +http://www.slackware.com/~alien/slackbuilds/oxygen-gtk2/build/ See the +help doc link above for other creative tips and workarounds. + +A native fork of FireFox's developer tools exists as an external add-on +or internally. Pale Moon by default ships with the developer tools +internally; if this is undesirable, dev tools can be disabled by passing +the script the parameter: + + DEVTOOLS=no ./palemoon.SlackBuild + +Pale Moon's default is to build, ship, and use its own internal +dictionary; if desired, however, do USE_SYSTEM_HUNSPELL=yes +./palemoon.SlackBuild, to use the Slackware system Hunspell instead. +This assumes you have dictionaries such as hunspell-en or hunspell-es +installed in /usr/share/hunspell -- the location that a few SlackBuilds +at SBo install them. + +To remove the "AdNauseam" extension from the Pale Moon blocklist, do + + ADNAUSEAM=unblock ./palemoon.SlackBuild + +If your processor doesn't support sse2 instructions or you get +segfaults, try looking in the SlackBuild for the OPTIMIZE build option +(eventually refer to the Pale Moon developers for help). + +jack-audio-connection-kit is an optional dependency and, if detected, +automatically built. If this is undesirable you can blacklist jack, by +passing the variable: + + BLACKLIST_JACK=yes ./palemoon.SlackBuild + +To enable debug information, pass the script the parameter + + ENABLE_DEBUG=yes diff --git a/autoconf-2.13-consolidated_fixes-1.patch.gz b/autoconf-2.13-consolidated_fixes-1.patch.gz new file mode 100644 index 0000000..1be2c68 Binary files /dev/null and b/autoconf-2.13-consolidated_fixes-1.patch.gz differ diff --git a/doinst.sh b/doinst.sh new file mode 100644 index 0000000..afea6d7 --- /dev/null +++ b/doinst.sh @@ -0,0 +1,9 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/palemoon.SlackBuild b/palemoon.SlackBuild new file mode 100644 index 0000000..827ea3e --- /dev/null +++ b/palemoon.SlackBuild @@ -0,0 +1,326 @@ +#!/bin/bash + +# Slackware build script for Pale Moon + +# Copyright 2018,2019,2022 Vasily Sora USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Modified by SlackBuilds.org +# Special thanks to Ponce + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=palemoon +VERSION=${VERSION:-git} +SRCNAM1=${SRCNAM1:-$PRGNAM-$VERSION.source} +SRCNAM2=${SRCNAM2:-GRE-git.source} +#SRCNAM3=${SRCNAM3:-} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +DOCS="AUTHORS LICENSE README.md" +DOCS_GRE="AUTHORS LEGAL SECURITY.md" + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +OBJ=${OBJ:-obj-$PRGNAM} +GTK=${GTK:-gtk2} + +# You can try changing the optimization level to simply "-O2" if your processor +# doesn't support sse2 instructions. +# "-Os" might help if you experience segfaults. +OPTIMIZE=${OPTIMIZE:-"-O2 -msse2 -mfpmath=sse"} +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +# look into adding this as an option: +# elif [ "$ARCH" = "x86_64" ]; then +# SLKCFLAGS="-O2 -D_FORTIFY_SOURCE=2 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -Wl,-z,relro,-z,now -mindirect-branch=th + + +# The default is to build with official branding. This SlackBuild is used to +# produce officially approved third party "contributed builds" of Pale Moon. +# This SlackBuild can also be used to produce unapproved packages -- which +# requires the use of the "new moon", or if applicable, "unstable" branding. +# In general, the "unstable" branding is intended for those building from the +# master trunck of the Pale Moon github repository. +BRANDING=${BRANDING:---with-branding=other-licenses/branding/palemoon/unstable} +if [ "$BRANDING" = "NewMoon" ]; then + BRANDING="--disable-official-branding --with-branding=browser/branding/unofficial" +elif [ "$BRANDING" = "unstable" ]; then + BRANDING="--disable-official-branding --with-branding=other-licenses/branding/palemoon/unstable" +fi + +rm -rf $PKG $TMP/gold $TMP/$OBJ +mkdir -p $TMP $PKG $OUTPUT $TMP/gold $TMP/$OBJ + +DEBUG=" --enable-strip --disable-debug --disable-debug-symbols --enable-release" +if [ "${ENABLE_DEBUG:-no}" = "yes" ]; then + DEBUG=" --disable-strip --disable-install-strip --enable-debug --enable-debug-symbols " + # On IA32, use gold since GNU ld runs out of memory linking libxul.so + # when debug is turned on + if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then + echo "#!/bin/bash" >> $TMP/gold/gold + echo "/usr/bin/ld.gold \"\$@\"" >> $TMP/gold/gold + cp $TMP/gold/gold $TMP/gold/ld + chmod +x $TMP/gold/* + PATH="$TMP/gold:$PATH" + export CC="$CC -B$TMP/gold" + export CXX="$CXX -B$TMP/gold" + fi +fi + +set -e + +# We need to use the incredibly ancient autoconf-2.13 for this :/ +# (Taken from Slackware's Firefox build Script) +cd $TMP +rm -rf autoconf-2.13 +tar xvf $CWD/autoconf-2.13.tar.xz +cd autoconf-2.13 +zcat $CWD/autoconf-2.13-consolidated_fixes-1.patch.gz | patch -p1 --verbose +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Build a temporary copy of autoconf-2.13 only to be used to compile +# Pale Moon, since it somewhat inexplicably requires this ancient version: +rm -rf $TMP/autoconf-tmp +mkdir -p $TMP/autoconf-tmp +# This will be at the beginning of the $PATH, so protect against nonsense +# happening in $TMP: +chmod 700 $TMP/autoconf-tmp +rm -rf $TMP/autoconf-tmp/* +mkdir -p $TMP/autoconf-tmp/usr + +./configure \ + --prefix=$TMP/autoconf-tmp/usr \ + --program-suffix=-2.13 \ + --infodir=$TMP/autoconf-tmp/usr/info \ + --mandir=$TMP/autoconf-tmp/usr/man \ + --build=$ARCH-slackware-linux + +make || make -j1 +make install +PATH=$TMP/autoconf-tmp/usr/bin:$PATH + + +# fetch Pale Moon and platform sources from git +if [ "$SRCNAM1" = "${PRGNAM}-git.source" ]; then + +if [ ! -d $CWD/$SRCNAM1/.git ]; then +cd $CWD +git clone -b master --depth=1 git://git.schotynet.org/Pale-Moon $SRCNAM1 +else +cd $CWD/$SRCNAM1 +git pull --depth=1 origin master +fi + +if [ ! -d $CWD/$SRCNAM2/.git ]; then +cd $CWD +git clone -b master --depth=1 git://git.schotynet.org/GRE $SRCNAM2 +else +cd $CWD/$SRCNAM2 +git pull --depth=1 origin master +fi + +fi + +# Build Pale Moon +cd $TMP +rm -rf $SRCNAM1 + +if [ "$SRCNAM1" = "${PRGNAM}-git.source" ]; then +git clone -b master --depth=1 file://localhost:$CWD/$SRCNAM1 $SRCNAM1 +else +tar -xvf $CWD/$SRCNAM1.tar.xz +fi +cd $SRCNAM1 +if [ "$SRCNAM1" = "${PRGNAM}-git.source" ]; then +git clone -b master --depth=1 file://localhost:$CWD/$SRCNAM2 platform +else +tar xvf $CWD/$SRCNAM2.tar.xz --transform="flags=r;s/$SRCNAM2/platform/" +fi + +# Set the package and internal "dist" version: +if [ "$SRCNAM1" = "${PRGNAM}-git.source" ]; then +"{COMMIT:=}" ] && git fetch --unshallow --tags && git checkout "$COMMIT" +HEAD="$(git rev-parse --short HEAD)" +DATE="$(git show -s --format=%cd --date=format:%Y.%m.%d)" +PKGVERSION="${DATE}_$HEAD" +VERSION=$(cat ./browser/config/version.txt) +else +PKGVERSION=$VERSION +VERSION=$(cat ./browser/config/version.txt) +fi + +# look into updating this patch +#if [ "${ADNAUSEAM:-block}" = "unblock" ]; then +# patch -p1 < $CWD/adNauseam-unblock.patch +#fi + +patch -p1 < $CWD/0001-system-graphics-2d-BaseRect.h-system-network-base-ns.patch + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# Without LANG=C, building the Python environment may fail with: +# "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: ordinal not in range(128)" +export LANG=C + +export MOZCONFIG="$TMP/$SRCNAM1/.mozconfig" +export MOZILLA_OFFICIAL=1 +export MOZ_MAKE_FLAGS=$MAKEFLAGS +export CFLAGS="$SLKCFLAGS" +export CXXFLAGS="$SLKCFLAGS" +export BUILDING_RELEASE=1 +export MOZ_ADDON_SIGNING= +export MOZ_REQUIRE_SIGNING= +export MOZ_TELEMETRY_REPORTING= +export PYTHON=/usr/bin/python2 + + +# Dev tools are enabled by default in the official binaries, so we should do the same here; +# passing DEVTOOLS=no to the script, however, will disable them. +if [ "$DEVTOOLS" = "no" ]; then + DEVTOOLS="--disable-devtools" +else + DEVTOOLS="--enable-devtools" +fi + + +# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding. +# Our building options, in a configure-like display ;) +OPTIONS="\ + ${BRANDING} \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --with-default-mozilla-five-home=/usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION \ + --x-libraries=/usr/lib${LIBDIRSUFFIX} \ + --enable-default-toolkit=cairo-$GTK \ + --disable-accessibility \ + $DEBUG \ + $DEVTOOLS \ + --enable-application=browser \ + --disable-crashreporter \ + --disable-updater \ + --disable-tests \ + --enable-jemalloc \ + --with-pthreads" + +echo "mk_add_options MOZ_OBJDIR=$TMP/$OBJ" > .mozconfig + +# Write in the .mozconfig the options above +for option in $OPTIONS; do echo "ac_add_options $option" >> .mozconfig; done +echo "ac_add_options --enable-optimize=\"$OPTIMIZE\"" >> .mozconfig + +if ! pkg-config --exists libpulse; then +echo "ac_add_options --disable-pulseaudio" >> .mozconfig; fi + +if pkg-config --exists jack && [ "${BLACKLIST_JACK:-no}" != "yes" ]; then +echo "ac_add_options --enable-jack" >> .mozconfig; fi + +./mach build + +## Clean up; and package Pale Moon. +DESTDIR=$PKG ./mach install +mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins +cd $TMP/$OBJ + +cd $PKG +# We don't need these (just symlinks anyway): +rm -rf usr/lib${LIBDIRSUFFIX}/$PRGNAM-devel-$VERSION + +# Avoid duplicate binaries; details: https://bugzilla.mozilla.org/show_bug.cgi?id=658850 +# Pale Moon package scripts appear to attempt this, on other 'distros'; those scripts, +# however, appear to fail on Slackware. +rm -f usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/$PRGNAM-bin + +# Use system provided Hunspell, if desired. +if [ "${USE_SYSTEM_HUNSPELL}" = "yes" ]; then + rm -rfv usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/dictionaries + cp -vsr /usr/share/hunspell usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/dictionaries +fi + +# Install icons: +for PX in 16 32 48 ; do + mkdir -p $PKG/usr/share/icons/hicolor/${PX}x${PX}/apps + ln -s /usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/chrome/icons/default/default${PX}.png \ + $PKG/usr/share/icons/hicolor/${PX}x${PX}/apps/$PRGNAM.png +done +# ... and the 128px icon file too: +mkdir -p $PKG/usr/share/icons/hicolor/128x128/apps +ln -s /usr/lib${LIBDIRSUFFIX}/$PRGNAM-$VERSION/icons/mozicon128.png \ + $PKG/usr/share/icons/hicolor/128x128/apps/$PRGNAM.png + +mkdir -p $PKG/usr/share/applications +cat $CWD/palemoon.desktop > $PKG/usr/share/applications/$PRGNAM.desktop + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/GRE +for i in $DOCS; do + cp $TMP/$SRCNAM1/$i $PKG/usr/doc/$PRGNAM-$VERSION +done +for i in $DOCS_GRE; do + cp $TMP/$SRCNAM1/platform/$i $PKG/usr/doc/$PRGNAM-$VERSION/GRE/ +done +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/palemoon.desktop b/palemoon.desktop new file mode 100644 index 0000000..10f9ecc --- /dev/null +++ b/palemoon.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Name=Pale Moon Web Browser +Comment=Browse the World Wide Web +Keywords=Internet;WWW;Browser;Web;Explorer +Exec=palemoon %u +Terminal=false +X-MultipleArgs=false +Type=Application +Icon=palemoon +Categories=Network;WebBrowser +MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; +StartupNotify=true diff --git a/palemoon.info b/palemoon.info new file mode 100644 index 0000000..530caf7 --- /dev/null +++ b/palemoon.info @@ -0,0 +1,10 @@ +PRGNAM="palemoon" +VERSION="git" +HOMEPAGE="http://www.palemoon.org/" +DOWNLOAD="http://ponce.cc/slackware/sources/repo/autoconf-2.13.tar.xz" +MD5SUM="f2994d302cf736e7e71974edfa51da3c" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="khronosschoty" +EMAIL="khronosschoty@posteo.org" diff --git a/slack-desc b/slack-desc new file mode 100644 index 0000000..d84669c --- /dev/null +++ b/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +palemoon: palemoon (Web browser -- BUILD FROM SOURCE) +palemoon: +palemoon: Pale Moon is an Open Source, Goanna-based web browser available for +palemoon: Microsoft Windows and Linux (with other operating systems in +palemoon: development), focusing on efficiency and ease of use. Make sure to +palemoon: get the most out of your browser! +palemoon: +palemoon: Pale Moon's been built from its own, independently developed source +palemoon: that has been forked off from Firefox/Mozilla code. +palemoon: +palemoon: -- cgit v1.2.3