diff --git a/BUILD_ORDER b/BUILD_ORDER index 9b99ee8..8157661 100644 --- a/BUILD_ORDER +++ b/BUILD_ORDER @@ -5,6 +5,7 @@ libxkbcommon setproctitle ptyprocess autoconf-archive +mozjs cjs cracklib pam diff --git a/build-cinnamon.sh b/build-cinnamon.sh index 49abe21..1506b84 100755 --- a/build-cinnamon.sh +++ b/build-cinnamon.sh @@ -49,6 +49,7 @@ for dir in \ setproctitle \ ptyprocess \ autoconf-archive \ + mozjs \ cjs \ cracklib \ pam \ diff --git a/mozjs/autoconf/autoconf.build b/mozjs/autoconf/autoconf.build new file mode 100755 index 0000000..7dae1ba --- /dev/null +++ b/mozjs/autoconf/autoconf.build @@ -0,0 +1,81 @@ +#!/bin/sh + +# Copyright 2005-2016 Patrick J. Volkerding, Sebeka, Minnesota, 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. + + +PKGNAM=autoconf +VERSION=2.13 +BUILD=${BUILD:-1} + +NUMJOBS=${NUMJOBS:-" -j7 "} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-autoconf + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf autoconf-$VERSION +tar xvf $CWD/autoconf-$VERSION.tar.xz || exit 1 +cd autoconf-$VERSION + +zcat $CWD/autoconf-2.13-consolidated_fixes-1.patch.gz | patch -p1 --verbose || exit 1 + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -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 +# Firefox, 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 || exit 1 + +make $NUMJOBS || make || exit 1 +make install || exit 1 + diff --git a/mozjs/mozjs.SlackBuild b/mozjs/mozjs.SlackBuild new file mode 100644 index 0000000..a0d2a65 --- /dev/null +++ b/mozjs/mozjs.SlackBuild @@ -0,0 +1,132 @@ +#!/bin/sh + +# Slackware build script for mozjs + +# Copyright 2015 Willy Sudiarto Raharjo +# 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. + +PRGNAM=mozjs +VERSION=${VERSION:-52.9.0} +SRCNAM=firefox-${VERSION}esr.source +DIRNAM=firefox-${VERSION} +BUILD=${BUILD:-1} +TAG=${TAG:-_csb} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +wget -c https://ftp.mozilla.org/pub/firefox/releases/52.9.0esr/source/firefox-52.9.0esr.source.tar.xz + +CWD=$(pwd) +TMP=${TMP:-/tmp/csb} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +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 + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT $PKG/usr/lib${LIBDIRSUFFIX} + +# We need to use the incredibly ancient autoconf-2.13 for this :/ +( +cd $CWD/autoconf +wget -c http://slackware.osuosl.org/slackware64-14.2/patches/source/mozilla-firefox/autoconf/autoconf-2.13.tar.xz +./autoconf.build +) +PATH=$TMP/autoconf-tmp/usr/bin:$PATH + +cd $TMP +rm -rf firefox-unpack ${DIRNAM}esr +mkdir firefox-unpack +cd firefox-unpack +tar xvf $CWD/$SRCNAM.tar.xz +mv * .. +cd .. +rm -rf firefox-unpack +cd ${DIRNAM}esr +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 {} \; + +# Taken from ARCH +patch -p1 < $CWD/mozjs52-fix-soname.patch +patch -p1 < $CWD/mozjs52-copy-headers.patch +patch -p1 < $CWD/mozjs52-disable-mozglue.patch +patch -Np1 < $CWD/mozjs52-include-configure-script.patch +touch js/src/configure + +cd js/src +CFLAGS="$SLKCFLAGS -fno-delete-null-pointer-checks -fpermissive -fno-tree-vrp -fno-strict-aliasing" \ +CXXFLAGS="$SLKCFLAGS -fno-delete-null-pointer-checks -fpermissive -fno-tree-vrp -fno-strict-aliasing" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --disable-debug \ + --disable-debug-symbols \ + --disable-strip \ + --enable-optimize="-O2" \ + --enable-pie \ + --enable-posix-nspr-emulation \ + --enable-release \ + --with-intl-api \ + --with-system-zlib \ + --enable-shared-js + +make +make DESTDIR=$PKG install + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +cd ../.. + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS LEGAL LICENSE README.txt $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +find $PKG/usr/doc/$PRGNAM-$VERSION/ -type f -exec chmod 644 {} \; +chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} diff --git a/mozjs/mozjs52-copy-headers.patch b/mozjs/mozjs52-copy-headers.patch new file mode 100644 index 0000000..69b2161 --- /dev/null +++ b/mozjs/mozjs52-copy-headers.patch @@ -0,0 +1,30 @@ +From 8b2d7a77bfb4dbd513763501ed7e9722058ee9af Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz +Date: Wed, 5 Jul 2017 22:45:59 -0700 +Subject: [PATCH] build: Copy headers on install instead of symlinking + +Patch ported forward to mozjs52 by Philip Chimento +. +--- + python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py +index 132dcf94..33d489a6 100644 +--- a/python/mozbuild/mozbuild/backend/recursivemake.py ++++ b/python/mozbuild/mozbuild/backend/recursivemake.py +@@ -1307,11 +1307,11 @@ def _process_final_target_files(self, obj, files, backend_file): + raise Exception("Wildcards are only supported in the filename part of " + "srcdir-relative or absolute paths.") + +- install_manifest.add_pattern_symlink(basepath, wild, path) ++ install_manifest.add_pattern_copy(basepath, wild, path) + else: +- install_manifest.add_pattern_symlink(f.srcdir, f, path) ++ install_manifest.add_pattern_copy(f.srcdir, f, path) + else: +- install_manifest.add_symlink(f.full_path, dest) ++ install_manifest.add_copy(f.full_path, dest) + else: + install_manifest.add_optional_exists(dest) + backend_file.write('%s_FILES += %s\n' % ( diff --git a/mozjs/mozjs52-disable-mozglue.patch b/mozjs/mozjs52-disable-mozglue.patch new file mode 100644 index 0000000..8355cf4 --- /dev/null +++ b/mozjs/mozjs52-disable-mozglue.patch @@ -0,0 +1,66 @@ +From 7e6d628456af3e99ebcb9a01a27e1461585082a4 Mon Sep 17 00:00:00 2001 +From: Till Schneidereit +Date: Thu, 1 Oct 2015 12:59:09 +0200 +Subject: [PATCH] Disable MOZ_GLUE_IN_PROGRAM in stand-alone builds on all + platforms + +Otherwise, build fails not being able to find HashBytes. + +Patch ported forward to mozjs52 by Philip Chimento +. + +https://bugzilla.mozilla.org/show_bug.cgi?id=1176787 +--- + js/src/old-configure.in | 23 ++++++++++++++--------- + mozglue/build/moz.build | 2 +- + 2 files changed, 15 insertions(+), 10 deletions(-) + +diff --git a/js/src/old-configure.in b/js/src/old-configure.in +index 1c5c9e21..ff0617e3 100644 +--- a/js/src/old-configure.in ++++ b/js/src/old-configure.in +@@ -1623,16 +1623,21 @@ dnl ======================================================== + dnl = Enable jemalloc + dnl ======================================================== + +-case "${OS_TARGET}" in +-Android|WINNT|Darwin) ++dnl In stand-alone builds we always only want to link executables against mozglue. ++if test "$JS_STANDALONE"; then + MOZ_GLUE_IN_PROGRAM= +- ;; +-*) +- dnl On !Android !Windows !OSX, we only want to link executables against mozglue +- MOZ_GLUE_IN_PROGRAM=1 +- AC_DEFINE(MOZ_GLUE_IN_PROGRAM) +- ;; +-esac ++else ++ case "${OS_TARGET}" in ++ Android|WINNT|Darwin) ++ MOZ_GLUE_IN_PROGRAM= ++ ;; ++ *) ++ dnl On !Android !Windows !OSX, we only want to link executables against mozglue ++ MOZ_GLUE_IN_PROGRAM=1 ++ AC_DEFINE(MOZ_GLUE_IN_PROGRAM) ++ ;; ++ esac ++fi + + if test "$MOZ_MEMORY"; then + if test "x$MOZ_DEBUG" = "x1"; then +diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build +index d2897477..e3be5a2b 100644 +--- a/mozglue/build/moz.build ++++ b/mozglue/build/moz.build +@@ -6,7 +6,7 @@ + + # Build mozglue as a shared lib on Windows, OSX and Android. + # If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in +-if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'): ++if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') and not CONFIG['JS_STANDALONE']: + SharedLibrary('mozglue') + else: + Library('mozglue') + diff --git a/mozjs/mozjs52-fix-soname.patch b/mozjs/mozjs52-fix-soname.patch new file mode 100644 index 0000000..a91107c --- /dev/null +++ b/mozjs/mozjs52-fix-soname.patch @@ -0,0 +1,34 @@ +From: Laszlo Boszormenyi (GCS) +Date: Fri, 02 May 2014 22:20:45 +0200 +Subject: fix soname + +Add soname switch to linker, regardless of Operating System + +Bug-Debian: http://bugs.debian.org/746705 +--- + config/rules.mk | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +Index: mozjs52-52.2.1~artful1/config/rules.mk +=================================================================== +--- mozjs52-52.2.1~artful1.orig/config/rules.mk ++++ mozjs52-52.2.1~artful1/config/rules.mk +@@ -418,7 +418,7 @@ endif # AIX + # + # Linux: add -Bsymbolic flag for components + # +-ifeq ($(OS_ARCH),Linux) ++#ifeq ($(OS_ARCH),Linux) + ifdef IS_COMPONENT + EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic + endif +@@ -426,7 +426,8 @@ ifdef LD_VERSION_SCRIPT + EXTRA_DSO_LDOPTS += -Wl,--version-script,$(LD_VERSION_SCRIPT) + EXTRA_DEPS += $(LD_VERSION_SCRIPT) + endif +-endif ++#endif ++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0 + + ifdef SYMBOLS_FILE + ifeq ($(OS_TARGET),WINNT) diff --git a/mozjs/mozjs52-include-configure-script.patch b/mozjs/mozjs52-include-configure-script.patch new file mode 100644 index 0000000..c24d7b1 --- /dev/null +++ b/mozjs/mozjs52-include-configure-script.patch @@ -0,0 +1,48 @@ +From 4a06a1a6a71293decb83aee7adb74bc709493106 Mon Sep 17 00:00:00 2001 +From: Philip Chimento +Date: Wed, 5 Jul 2017 22:57:09 -0700 +Subject: [PATCH] build: Include configure script, be nicer about options + +A configure script is not included in the SpiderMonkey tarball by +default. Also, we have to account for JHbuild passing extra unknown +options like --disable-Werror. + +https://bugzilla.mozilla.org/show_bug.cgi?id=1379540 +--- + js/src/configure | 9 +++++++++ + python/mozbuild/mozbuild/configure/__init__.py | 2 +- + python/mozbuild/mozbuild/configure/options.py | 6 +++++- + 3 files changed, 15 insertions(+), 2 deletions(-) + create mode 100755 js/src/configure + +diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py +index 0fe640ca..09b460d3 100644 +--- a/python/mozbuild/mozbuild/configure/__init__.py ++++ b/python/mozbuild/mozbuild/configure/__init__.py +@@ -356,7 +356,7 @@ def run(self, path=None): + # All options should have been removed (handled) by now. + for arg in self._helper: + without_value = arg.split('=', 1)[0] +- raise InvalidOptionError('Unknown option: %s' % without_value) ++ print('Ignoring', without_value, ': Unknown option') + + # Run the execution queue + for func, args in self._execution_queue: +diff --git a/python/mozbuild/mozbuild/configure/options.py b/python/mozbuild/mozbuild/configure/options.py +index 4310c862..15bfe425 100644 +--- a/python/mozbuild/mozbuild/configure/options.py ++++ b/python/mozbuild/mozbuild/configure/options.py +@@ -402,7 +402,11 @@ def __init__(self, environ=os.environ, argv=sys.argv): + + def add(self, arg, origin='command-line', args=None): + assert origin != 'default' +- prefix, name, values = Option.split_option(arg) ++ try: ++ prefix, name, values = Option.split_option(arg) ++ except InvalidOptionError as e: ++ print('Ignoring', arg, ':', e) ++ return + if args is None: + args = self._extra_args + if args is self._extra_args and name in self._extra_args: + diff --git a/mozjs/slack-desc b/mozjs/slack-desc new file mode 100644 index 0000000..ac5233f --- /dev/null +++ b/mozjs/slack-desc @@ -0,0 +1,12 @@ + |-----handy-ruler------------------------------------------------------| +mozjs: mozjs (JS Binding) +mozjs: +mozjs: SpiderMonkey is Mozilla's JavaScript engine written in C/C++. +mozjs: It is used in various Mozilla products, including Firefox, and +mozjs: is available under the MPL2. +mozjs: +mozjs: +mozjs: +mozjs: +mozjs: +mozjs: