summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2020-11-13 16:49:59 +0000
committerSam James <sam@gentoo.org>2020-11-13 16:50:57 +0000
commit5d15db0d72c98412428ec951e6befeb78c456395 (patch)
tree1466ac49f7a3bcb4d2790f39de59cb169b1457d8
parentdev-libs/botan: bump to 2.7.2 (diff)
downloadgentoo-5d15db0d72c98412428ec951e6befeb78c456395.tar.gz
gentoo-5d15db0d72c98412428ec951e6befeb78c456395.tar.bz2
gentoo-5d15db0d72c98412428ec951e6befeb78c456395.zip
dev-lang/duktape: bump to 2.6.0
Bug: https://bugs.gentoo.org/730188 Closes: https://bugs.gentoo.org/752111 Closes: https://bugs.gentoo.org/722192 Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--dev-lang/duktape/Manifest1
-rw-r--r--dev-lang/duktape/duktape-2.6.0.ebuild51
-rw-r--r--dev-lang/duktape/files/duktape-2.6.0-respect-tc-env.patch33
3 files changed, 85 insertions, 0 deletions
diff --git a/dev-lang/duktape/Manifest b/dev-lang/duktape/Manifest
index 7099c24cff5..a9ff63d0552 100644
--- a/dev-lang/duktape/Manifest
+++ b/dev-lang/duktape/Manifest
@@ -1,2 +1,3 @@
DIST duktape-2.4.0.tar.xz 1027744 BLAKE2B 9fb74b0586a5ccf5ef80d69955ab0ddb94428d463e300a558b5ab6e279d2c416b794434466604caa80581883df85f889694af1dd3ea0aaa4a3d53babb855f3ef SHA512 be6b7c73ae7c3419e8ced375fcff9680946e780b71d30e3be4e4e3b4b3a2710aa8f86530081c64958507a11fc215cacc5409c7d3a1d30b757838a00c748fa281
DIST duktape-2.5.0.tar.xz 1031188 BLAKE2B 15d9190e9c723bacf8249ea31bf528793ca06e86d2697648192fee50b4ba2f7cf091e1392ac14a7a5c35b05a3ff5f200e0318cc8a4b873ad26f0c97683a2cb72 SHA512 230e298a91cb48407d7c2a4b7c85cf9d53151d550e2fd7ba6cb8f9115682abce295fb78a3c3cd22b4812ce86944dd6d28c2b25c3845668a17232e3a08ea63837
+DIST duktape-2.6.0.tar.xz 1035160 BLAKE2B 98155e1bf7e76aab37f5ccdb951d9d456df3d984ebed5058d8931e25317ffd94b4d95f08e102eb6eb2fa36ab6d2d60be6072b4101b7754e1c1440f7d6fb2c91b SHA512 d72a2aaa05391fa243861aca6ca6082f91a08b9c5d60c7b246d35d7161532b0048bb67bd8fec7996c700ee317ac2bb52e528582682e5425b0431757d8b1c5be4
diff --git a/dev-lang/duktape/duktape-2.6.0.ebuild b/dev-lang/duktape/duktape-2.6.0.ebuild
new file mode 100644
index 00000000000..f84cdd45b4b
--- /dev/null
+++ b/dev-lang/duktape/duktape-2.6.0.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Embeddable Javascript engine"
+HOMEPAGE="https://duktape.org"
+SRC_URI="https://duktape.org/${P}.tar.xz"
+
+LICENSE="MIT"
+# Upstream don't maintain binary compatibility
+# https://github.com/svaarala/duktape/issues/1524
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.6.0-respect-tc-env.patch"
+)
+
+src_prepare() {
+ # Set install path
+ sed -i "s#INSTALL_PREFIX = /usr/local#INSTALL_PREFIX = ${D%/}/usr#" \
+ Makefile.sharedlibrary || die "failed to set install path"
+
+ # Edit pkgconfig
+ sed "s#VERSION#${PV}#" "${FILESDIR}/${PN}.pc" > "${S}/${PN}.pc" || die
+ sed -i "s#LIBDIR#$(get_libdir)#" "${S}/${PN}.pc" || die
+
+ # Set lib folder
+ sed -i "s#(INSTALL_PREFIX)/lib#(INSTALL_PREFIX)/$(get_libdir)#" \
+ Makefile.sharedlibrary || die
+
+ mv Makefile.sharedlibrary Makefile || die "failed to rename makefile"
+
+ default
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dodir /usr/$(get_libdir)
+ dodir /usr/include
+ emake install
+
+ insinto /usr/$(get_libdir)/pkgconfig/
+ doins "${S}/${PN}.pc"
+}
diff --git a/dev-lang/duktape/files/duktape-2.6.0-respect-tc-env.patch b/dev-lang/duktape/files/duktape-2.6.0-respect-tc-env.patch
new file mode 100644
index 00000000000..ab58e7f9a6d
--- /dev/null
+++ b/dev-lang/duktape/files/duktape-2.6.0-respect-tc-env.patch
@@ -0,0 +1,33 @@
+diff --git a/Makefile b/Makefile
+index 156ea96..a0997b1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -52,7 +52,7 @@ INSTALL_PREFIX = /var/tmp/portage/dev-lang/duktape-2.6.0/image/usr
+ DUKTAPE_SRCDIR = ./src
+ #DUKTAPE_SRCDIR = ./src-noline
+
+-CC = gcc
++CC ?= gcc
+
+ .PHONY: all
+ all: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX)
+@@ -62,11 +62,11 @@ all: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX)
+ # to $INSTALL_PREFIX/include on installation.
+
+ libduktape.$(SO_REALNAME_SUFFIX):
+- $(CC) -shared -fPIC -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktape.$(SO_SONAME_SUFFIX) \
++ $(CC) -shared -fPIC ${CFLAGS} ${LDFLAGS} -Wl,$(LD_SONAME_ARG),libduktape.$(SO_SONAME_SUFFIX) -lm \
+ -o $@ $(DUKTAPE_SRCDIR)/duktape.c
+
+ libduktaped.$(SO_REALNAME_SUFFIX):
+- $(CC) -shared -fPIC -g -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktaped.$(SO_SONAME_SUFFIX) \
++ $(CC) -shared -fPIC ${CFLAGS} ${LDFLAGS} -Wl,$(LD_SONAME_ARG),libduktaped.$(SO_SONAME_SUFFIX) -lm \
+ -o $@ $(DUKTAPE_SRCDIR)/duktape.c
+
+ # Symlinks depend on platform conventions.
+@@ -85,4 +85,4 @@ install: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX)
+
+ CCOPTS = -I./examples/cmdline
+ duk:
+- $(CC) $(CCOPTS) -I$(INSTALL_PREFIX)/include -L$(INSTALL_PREFIX)/lib64 -Wall -Wextra -Os -o $@ ./examples/cmdline/duk_cmdline.c -lduktape -lm
++ $(CC) $(CCOPTS) -I$(INSTALL_PREFIX)/include -L$(INSTALL_PREFIX)/lib64 ${CFLAGS} -o $@ ./examples/cmdline/duk_cmdline.c -lduktape -lm