summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/janet')
-rw-r--r--dev-lang/janet/Manifest1
-rw-r--r--dev-lang/janet/files/janet-1.16.1-make.patch13
-rw-r--r--dev-lang/janet/janet-1.16.1.ebuild64
3 files changed, 78 insertions, 0 deletions
diff --git a/dev-lang/janet/Manifest b/dev-lang/janet/Manifest
index 035d97b34cd2..b861800be747 100644
--- a/dev-lang/janet/Manifest
+++ b/dev-lang/janet/Manifest
@@ -1,2 +1,3 @@
DIST janet-1.13.1.tar.gz 584998 BLAKE2B f1bfd9e62dde786127a1307d38f48fc7e75b9fb09f009f9d01eeefa593b67c2469e213fd366fac7c52e0372e61b1a9afdb558e8a1be1ab2f4f538b5fb39075f3 SHA512 8022ecbaf7680855611202a3c17b8e5f6dc61a9302508c9de5312dbd9e80d40c24786bb5e8ae653ab5a7b00191a2d7c44cc3e305d31245e3e8c53be0e1c80372
DIST janet-1.15.5.tar.gz 601033 BLAKE2B dfc8c2a2d238f2554aae667f706e84905ba15c732fa2f06b3c537f08d064375dcb00043117dfc56328365627e2e8f4e2a8f171731d9d6bc0d48206cea58f127c SHA512 ebdc090de6fbea0c94f0618957a4b36776fa0009298df77b279b79064d4524e73f42723ba2c315167cb6f3a40f2a4dffbb2a865fa2d479ba196aa9f0aa24cbf6
+DIST janet-1.16.1.tar.gz 493490 BLAKE2B 7542644a647d9d2ddd73d8e284f749cdad1900b8df2797c99a2f176c93eca412427b7f571493cfe62f64dd9c90bd12d8506b0f4b6b485ab2d3633e989e735cd9 SHA512 f4be0703676acad8896e41b46d79c4f6d99990c487028f1fd1abd681f756db119a06a5d6a0653b9301afcd62f45d6f1bb7876b9613c0ea28d7199e310a52895d
diff --git a/dev-lang/janet/files/janet-1.16.1-make.patch b/dev-lang/janet/files/janet-1.16.1-make.patch
new file mode 100644
index 000000000000..09429f4ff08b
--- /dev/null
+++ b/dev-lang/janet/files/janet-1.16.1-make.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 7efef93b..12758ab0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -254,7 +254,7 @@ build/doc.html: $(JANET_TARGET) tools/gendoc.janet
+
+ build/jpm: jpm $(JANET_TARGET)
+ $(JANET_TARGET) tools/patch-jpm.janet jpm build/jpm "--libpath=$(LIBDIR)" "--headerpath=$(INCLUDEDIR)/janet" "--binpath=$(BINDIR)"
+- chmod +x build/jpm
++ chmod +x jpm
+
+ .INTERMEDIATE: build/janet.pc
+ build/janet.pc: $(JANET_TARGET)
diff --git a/dev-lang/janet/janet-1.16.1.ebuild b/dev-lang/janet/janet-1.16.1.ebuild
new file mode 100644
index 000000000000..16f31087d1a9
--- /dev/null
+++ b/dev-lang/janet/janet-1.16.1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic
+
+DESCRIPTION="A dynamic Lisp dialect and bytecode vm"
+HOMEPAGE="https://janet-lang.org https://github.com/janet-lang/janet/"
+SRC_URI="https://github.com/janet-lang/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="static-libs"
+
+MY_RELEASE="${PV::-2}"
+
+PATCHES="${FILESDIR}/janet-1.16.1-make.patch"
+
+src_configure() {
+ append-ldflags -Wl,-soname,libjanet.so.1.${MY_RELEASE}
+ append-cflags -fPIC
+}
+
+src_compile() {
+ # janet_build is the git hash of the commit related to the
+ # current release - it defines a constant which is then shown
+ # when starting janet
+ local janet_build='\"'${PV}'\"'
+ emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" JANET_BUILD="${janet_build}"
+ emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" build/janet.pc JANET_BUILD="${janet_build}"
+ emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" docs JANET_BUILD="${janet_build}"
+ emake LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" build/jpm JANET_BUILD="${janet_build}"
+}
+
+src_install() {
+ dobin "build/janet"
+ dobin "jpm"
+ insinto "usr/include/janet"
+ doheader "src/include/janet.h"
+ doheader "src/conf/janetconf.h"
+
+ dolib.so "build/libjanet.so"
+ dosym libjanet.so /usr/$(get_libdir)/libjanet.so.${MY_RELEASE}
+ dosym libjanet.so.${MY_RELEASE} /usr/$(get_libdir)/libjanet.so.${PV}
+
+ if use static-libs; then
+ dolib.a "build/libjanet.a"
+ fi
+ doman "janet.1"
+ doman "jpm.1"
+
+ insinto /usr/$(get_libdir)/pkgconfig/
+ doins "build/janet.pc"
+ dodoc -r examples
+ dodoc "build/doc.html"
+ # required for jpm
+ keepdir /usr/$(get_libdir)/janet/.cache
+}
+
+pkg_postinst() {
+ elog "Enable use flag \"static-libs\" for building stand-alone executables with jpm"
+}