#!/bin/sh
#
# Copyright 2020 Your name <lbhe@rznvy.pbz>
# Available under the terms of the GNU GPL.
#

NAME="mozjs68"
VERSION="68.4.2"
REVISION="1"

PKG_SOURCEURL='http://ftp.acc.umu.se/pub/GNOME/teams/releng/tarballs-needing-help/mozjs/mozjs-$VERSION.tar.bz2'
PKG_SANIFYNOTOUCH='oo'

. $DLG_ROOT/etc/config
. $DLG_ROOT/lib/dl-base

cflags
cxxflags
prepare
analyzesource

PKG_BUILDDIR='js/src/obj'
spewdo "createdir $PKG_BUILDROOT/$PKG_BUILDDIR"
spewdo "cd $PKG_BUILDROOT/$PKG_BUILDDIR"

# We have to have AUTOCONF set as for some reason confgure
# does not find it alone and errors.
spewdo "export AUTOCONF=`which autoconf`"
# Configure is now a dir under where we are.
spewdo "../configure --with-system-nspr \
	--with-system-nss \
	--with-system-icu \
	--with-system-png \
	--with-system-zlib \
	--with-intl-api \
	--disable-jemalloc \
	--enable-readline \
	--prefix=${PKG_PREFIX} \
	--libdir=${PKG_LIBDIR}${LIBSUFFIX}"

make
makeinstall
tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
