From 0048eb7c2827c7705f43da4ec1cd91470277bde4 Mon Sep 17 00:00:00 2001 From: Crestwave <35413013+Crestwave@users.noreply.github.com> Date: Sun, 19 May 2019 22:39:41 +0800 Subject: [PATCH] janet: new recipe (#3864) --- dev-lang/janet/janet-0.5.0.recipe | 80 ++++++++++++++++++++++++ dev-lang/janet/patches/janet-0.5.0.patch | 22 +++++++ 2 files changed, 102 insertions(+) create mode 100644 dev-lang/janet/janet-0.5.0.recipe create mode 100644 dev-lang/janet/patches/janet-0.5.0.patch diff --git a/dev-lang/janet/janet-0.5.0.recipe b/dev-lang/janet/janet-0.5.0.recipe new file mode 100644 index 000000000..13ac66919 --- /dev/null +++ b/dev-lang/janet/janet-0.5.0.recipe @@ -0,0 +1,80 @@ +SUMMARY="Dynamic Lisp dialect and bytecode vm" +DESCRIPTION="Janet is a functional and imperative programming language \ +and bytecode interpreter. It is a modern lisp, but lists are replaced by \ +other data structures with better utility and performance (arrays, tables, \ +structs, tuples). The language also supports bridging to native code written \ +in C, meta-programming with macros, and bytecode assembly." +HOMEPAGE="https://janet-lang.org/" +COPYRIGHT="2019 Calvin Rose and contributors" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="https://github.com/janet-lang/janet/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="f5c90122715869657427cbba62809a1d53eaaced2268e7d55202301d65a75076" +SOURCE_FILENAME="janet-$portVersion.tar.gz" +PATCHES="janet-0.5.0.patch" + +ARCHITECTURES="!x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +libVersion="$portVersion" +libVersionCompat="$libVersion compat >= ${portVersion%%.*}" + +PROVIDES=" + janet$secondaryArchSuffix = $portVersion + cmd:janet$secondaryArchSuffix + lib:libjanet$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +PROVIDES_devel=" + janet${secondaryArchSuffix}_devel = $portVersion + devel:libjanet$secondaryArchSuffix = $libVersionCompat + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:git + cmd:make + " + +defineDebugInfoPackage janet$secondaryArchSuffix \ + "$binDir/janet" \ + "$libDir/libjanet.so.$libVersion" + +BUILD() +{ + make $jobArgs +} + +INSTALL() +{ + install -m 755 -d "$binDir" "$developDir/headers" "$libDir/janet" \ + "$docDir" "$manDir/man1/janet" + install -m 755 build/janet "$binDir" + install -m 644 src/include/janet{,conf}.h "$developDir/headers" + + install -m 755 build/libjanet.so "$libDir/libjanet.so.$libVersion" + ln -sf "libjanet.so.${libVersionCompat##* }" "$libDir/libjanet.so" + ln -sf "libjanet.so.$libVersion" \ + "$libDir/libjanet.so.${libVersionCompat##* }" + install -m 644 tools/{cook,highlight,bars}.janet "$libDir/janet" + + prepareInstalledDevelLib libjanet + fixPkgconfig + + packageEntries devel \ + "$developDir" + + install -m 644 README.md "$docDir" + install -m 644 janet.1 "$manDir/man1" +} + +TEST() +{ + make test +} diff --git a/dev-lang/janet/patches/janet-0.5.0.patch b/dev-lang/janet/patches/janet-0.5.0.patch new file mode 100644 index 000000000..cde93abc5 --- /dev/null +++ b/dev-lang/janet/patches/janet-0.5.0.patch @@ -0,0 +1,22 @@ +--- a/Makefile ++++ b/Makefile +@@ -47,6 +47,9 @@ else ifeq ($(UNAME), Linux) + CLIBS:=$(CLIBS) -lrt -ldl + endif + # For other unix likes, add flags here! ++ifeq ($(UNAME),Haiku) ++ LDFLAGS=-Wl,--export-dynamic ++endif + + $(shell mkdir -p build/core build/mainclient build/webclient build/boot) + all: $(JANET_TARGET) $(JANET_LIBRARY) +--- a/src/include/janet.h ++++ b/src/include/janet.h +@@ -51,6 +51,7 @@ extern "C" { + || defined(__FreeBSD__) || defined(__DragonFly__) \ + || defined(__FreeBSD_kernel__) \ + || defined(__GNU__) /* GNU/Hurd */ \ ++ || defined(__HAIKU__) \ + || defined(__linux__) \ + || defined(__NetBSD__) \ + || defined(__OpenBSD__) \