Github messages for voidlinux
 help / color / mirror / Atom feed
From: leahneukirchen <leahneukirchen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Babashka
Date: Thu, 15 Jul 2021 21:37:45 +0200	[thread overview]
Message-ID: <20210715193745.K_IwxAgpkXdknntFkZ7P0SqPc4Sjl19MqXoVcgMdTVM@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-31981@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

There is an updated pull request by leahneukirchen against master on the void-packages repository

https://github.com/leahneukirchen/void-packages babashka
https://github.com/void-linux/void-packages/pull/31981

Babashka
<!-- Mark items with [x] where applicable -->

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

do_fetch uses submodules for now.

A patch file from https://github.com/void-linux/void-packages/pull/31981.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-babashka-31981.patch --]
[-- Type: text/x-diff, Size: 11412 bytes --]

From ff1e48236a11eb3d4701b727a990e69f10ad4e16 Mon Sep 17 00:00:00 2001
From: Leah Neukirchen <leah@vuxu.org>
Date: Mon, 5 Jul 2021 18:17:48 +0200
Subject: [PATCH 1/3] openjdk11: add openjdk11-static-libs subpackage.

Needed for tooling related to GraalVM.
---
 srcpkgs/openjdk11-static-libs |  1 +
 srcpkgs/openjdk11/template    | 13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/openjdk11-static-libs

diff --git a/srcpkgs/openjdk11-static-libs b/srcpkgs/openjdk11-static-libs
new file mode 120000
index 000000000000..8213494c49ed
--- /dev/null
+++ b/srcpkgs/openjdk11-static-libs
@@ -0,0 +1 @@
+openjdk11
\ No newline at end of file
diff --git a/srcpkgs/openjdk11/template b/srcpkgs/openjdk11/template
index 87b309bfa014..7ff1a89d3249 100644
--- a/srcpkgs/openjdk11/template
+++ b/srcpkgs/openjdk11/template
@@ -1,7 +1,7 @@
 # Template file for 'openjdk11'
 pkgname=openjdk11
 version=11.0.12+5
-revision=1
+revision=2
 _java_ver="${version%%.*}"
 _openjdk_version="openjdk-${_java_ver}"
 wrksrc="jdk${_java_ver}u-jdk-${version}"
@@ -24,7 +24,7 @@ configure_args="
  --with-vendor-url="https://voidlinux.org/"
  --with-vendor-bug-url="https://github.com/void-linux/void-packages/issues"
  --with-vendor-vm-bug-url="https://github.com/void-linux/void-packages/issues""
-make_build_args="images $(vopt_if docs docs)"
+make_build_args="images static-libs-image $(vopt_if docs docs)"
 make_check_target="test-hotspot-gtest"
 hostmakedepends="pkg-config automake autoconf cpio tar unzip zip ca-certificates
  openssl zlib-devel which make-ca"
@@ -190,3 +190,12 @@ openjdk11-src_package() {
 		vmove "usr/lib/jvm/openjdk11/lib/src.zip"
 	}
 }
+
+openjdk11-static-libs_package() {
+	notstrip=yes
+	short_desc+=" -- static libs"
+	pkg_install() {
+		vmkdir usr/lib/jvm/openjdk${_java_ver}
+		vcopy build/*-normal-*-release/images/static-libs/lib "usr/lib/jvm/openjdk${_java_ver}"
+	}
+}

From 95bcd1bfdbd7b9d27bc3fdaa501c6ae71052ccf6 Mon Sep 17 00:00:00 2001
From: Leah Neukirchen <leah@vuxu.org>
Date: Tue, 6 Jul 2021 11:10:59 +0200
Subject: [PATCH 2/3] New package: mandrel-21.1.0.0

---
 common/shlibs                    |  6 ++++
 srcpkgs/mandrel/files/musl.patch | 58 ++++++++++++++++++++++++++++++++
 srcpkgs/mandrel/template         | 51 ++++++++++++++++++++++++++++
 3 files changed, 115 insertions(+)
 create mode 100644 srcpkgs/mandrel/files/musl.patch
 create mode 100644 srcpkgs/mandrel/template

diff --git a/common/shlibs b/common/shlibs
index 6377f40613a8..a26b4a7c7808 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1837,6 +1837,12 @@ libawt_xawt.so openjdk10-bootstrap-10.0.2p13_1
 libjava.so openjdk10-bootstrap-10.0.2p13_1
 libjli.so openjdk10-bootstrap-10.0.2p13_1
 libjvm.so openjdk10-bootstrap-10.0.2p13_1
+libjawt.so mandrel-21.1.0.0_1
+libawt.so mandrel-21.1.0.0_1
+libawt_xawt.so mandrel-21.1.0.0_1
+libjava.so mandrel-21.1.0.0_1
+libjli.so mandrel-21.1.0.0_1
+libjvm.so mandrel-21.1.0.0_1
 libucl.so.5 libucl-0.8.1_6
 libhandle.so.1 xfsprogs-3.2.1_1
 libnfnetlink.so.0 libnfnetlink-1.0.1_1
diff --git a/srcpkgs/mandrel/files/musl.patch b/srcpkgs/mandrel/files/musl.patch
new file mode 100644
index 000000000000..50e58332d03a
--- /dev/null
+++ b/srcpkgs/mandrel/files/musl.patch
@@ -0,0 +1,58 @@
+Make musl a native libc.
+
+--- substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/MuslLibC.java.orig
++++ substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/MuslLibC.java
+@@ -43,13 +43,12 @@
+ 
+     @Override
+     public List<String> getAdditionalQueryCodeCompilerOptions() {
+-        /* Avoid the dependency to muslc for builds cross compiling to muslc. */
+-        return Collections.singletonList("--static");
++        return Collections.emptyList();
+     }
+ 
+     @Override
+     public String getTargetCompiler() {
+-        return "musl-gcc";
++        return "gcc";
+     }
+ 
+     @Override
+@@ -59,14 +58,11 @@
+ 
+     @Override
+     public boolean requiresLibCSpecificStaticJDKLibraries() {
+-        return true;
++        return false;
+     }
+ 
+     @Override
+     public void checkIfLibCSupported() {
+-        if (!SubstrateOptions.StaticExecutable.getValue()) {
+-            throw UserError.abort("Musl can only be used for statically linked executables.");
+-        }
+         if (JavaVersionUtil.JAVA_SPEC != 11) {
+             throw UserError.abort("Musl can only be used with labsjdk 11.");
+         }
+--- substratevm/src/com.oracle.svm.native.jvm.posix/src/JvmFuncs.c.orig
++++ substratevm/src/com.oracle.svm.native.jvm.posix/src/JvmFuncs.c
+@@ -128,7 +128,7 @@
+     return listen(fd, count);
+ }
+ 
+-JNIEXPORT int JNICALL JVM_Send(int fd, char* buf, size_t nBytes, uint flags) {
++JNIEXPORT int JNICALL JVM_Send(int fd, char* buf, size_t nBytes, unsigned int flags) {
+     RESTARTABLE_RETURN_INT(send(fd, buf, nBytes, flags));
+ }
+ 
+--- substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/LibCFeature.java.orig
++++ substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/libc/LibCFeature.java
+@@ -55,7 +55,7 @@
+             @Override
+             public String getValueOrDefault(UnmodifiableEconomicMap<OptionKey<?>, Object> values) {
+                 if (!values.containsKey(this)) {
+-                    return Platform.includedIn(Platform.ANDROID.class) ? "bionic" : "glibc";
++                    return Platform.includedIn(Platform.ANDROID.class) ? "bionic" : "musl";
+                 }
+                 return (String) values.get(this);
+             }
diff --git a/srcpkgs/mandrel/template b/srcpkgs/mandrel/template
new file mode 100644
index 000000000000..d5d41332a0d5
--- /dev/null
+++ b/srcpkgs/mandrel/template
@@ -0,0 +1,51 @@
+# Template file for 'mandrel'
+pkgname=mandrel
+version=21.1.0.0
+revision=1
+_java_ver=11
+_mx_ver=5.304.3
+archs="aarch64* x86_64*"  # upstream supported archs
+wrksrc="mandrel-${version}"
+create_wrksrc=yes
+hostmakedepends="openjdk${_java_ver} openjdk${_java_ver}-src
+ openjdk${_java_ver}-static-libs python3"
+makedepends="zlib-devel"
+short_desc="Downstream distribution of the GraalVM community edition"
+maintainer="Leah Neukirchen <leah@vuxu.org>"
+license="GPL-2.0-only, Classpath-exception-2.0"
+homepage="https://github.com/graalvm/mandrel"
+distfiles="https://github.com/graalvm/mandrel-packaging/archive/refs/tags/mandrel-${version}-Final.tar.gz>packaging-${version}.tar.gz
+ https://github.com/graalvm/mandrel/archive/refs/tags/mandrel-${version}-Final.tar.gz
+ https://github.com/graalvm/mx/archive/refs/tags/${_mx_ver}.tar.gz"
+checksum="3f99ec20491cf79f8be19dfabb8fea6a82ea673bf450f2701f293db44fba4c95
+ 670dd01e196d51aac0e5e3a4aa9b92e6b3953e16efbc7b7f6bb9dc39f3d1f9a7
+ b5d15a3ed5c4ab1a3d84055a84375acac67a344c91a3c8076c429ecff8062e9d"
+shlib_provides="libawt.so libawt_xawt.so libjava.so libjli.so libjvm.so libjawt.so"
+nocross=yes
+
+post_patch() {
+	if [ "$XBPS_TARGET_LIBC" = musl ]; then
+		# XXX: only static builds with native-image work
+		# (else TEXTREL issues)
+		patch -d mandrel-mandrel-* -p0 < ${FILESDIR}/musl.patch
+	fi
+}
+
+do_build() {
+	cd mandrel-packaging-*
+	export JAVA_HOME=/usr/lib/jvm/openjdk${_java_ver}
+	$JAVA_HOME/bin/java -ea build.java \
+		--mx-home $PWD/../mx-* \
+		--mandrel-repo $PWD/../mandrel-mandrel-* \
+		--verbose
+}
+
+do_install() {
+	cd mandrel-packaging*/mandrel-java*
+
+	vmkdir usr/lib/jvm/mandrel${_java_ver}
+	vcopy . usr/lib/jvm/mandrel${_java_ver}
+
+	vlicense LICENSE
+	vlicense THIRD_PARTY_LICENSE.txt
+}

From 0a731963f35500313dd3c3bb0b9d7e46614434de Mon Sep 17 00:00:00 2001
From: Leah Neukirchen <leah@vuxu.org>
Date: Tue, 6 Jul 2021 11:11:04 +0200
Subject: [PATCH 3/3] New package: babashka-0.5.0.

---
 srcpkgs/babashka/template | 83 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 srcpkgs/babashka/template

diff --git a/srcpkgs/babashka/template b/srcpkgs/babashka/template
new file mode 100644
index 000000000000..0a8b279864d3
--- /dev/null
+++ b/srcpkgs/babashka/template
@@ -0,0 +1,83 @@
+# Template file for 'babashka'
+pkgname=babashka
+version=0.5.0
+revision=1
+hostmakedepends="mandrel leiningen git"
+makedepends="zlib-devel"
+checkdepends="clojure curl"
+short_desc="Native, fast starting Clojure interpreter for scripting"
+maintainer="Leah Neukirchen <leah@vuxu.org>"
+license="EPL-1.0"
+homepage="https://babashka.org/"
+_sci_commit=5ed2190f3c97de6d30f3aba96362bf6c68e95e90
+_babashka_curl_commit=cf71c8ae24a4f8ec85663970f4b8a3f63a0c1a6b
+_babashka_nrepl_commit=bd1ce0cbc0861350a4a36e9c31ef79fa0c7cff84
+_depstar_commit=c419b8c82041855d55593c5b561fc7cea8234712
+_process_commit=4c6699d06b49773d3e5c5b4c11d3334fb78cc996
+_pods_commit=de4c3610c9ef3879370d01b7202a9f3a9d056f6e
+_deps_clj_commit=985e5ca7f9cb123f86a0747aded1ee98e1f3deee
+_fs_commit=1beb91cd5f352d1e3a914c94e7ec25a2644b07e5
+distfiles="https://github.com/babashka/babashka/archive/refs/tags/v${version}.tar.gz
+ https://github.com/borkdude/sci/archive/${_sci_commit}.tar.gz
+ https://github.com/babashka/babashka.curl/archive/${_babashka_curl_commit}.tar.gz
+ https://github.com/babashka/babashka.nrepl/archive/${_babashka_nrepl_commit}.tar.gz
+ https://github.com/babashka/depstar/archive/${_depstar_commit}.tar.gz
+ https://github.com/babashka/process/archive/${_process_commit}.tar.gz
+ https://github.com/babashka/pods/archive/${_pods_commit}.tar.gz
+ https://github.com/borkdude/deps.clj/archive/${_deps_clj_commit}.tar.gz
+ https://github.com/babashka/fs/archive/${_fs_commit}.tar.gz"
+checksum="485866c1aeb9c5e17707f67a0efcd39404aa8b75fa7f34f49b0b4353beb5b412
+ 86a95fa5966d1aae1632102a2c8dd4fe6bea41533eaa07943f116a2ac3d727f7
+ e318e4563a278488a0a2d91b2d7c56bd8a0e2be8b895d91435822a047e85c0c3
+ 83e3e122bdca4449649199ea7916a46423ac29c0611b7fc7d0f84557105bfdcc
+ 9d214a10a4f5e4f15b9c80354dae85689a40e941ec3417203354c0dc3ce9457b
+ 83816c89603bc1b1c938eca9ab941222e51cbe1ab110329717e13760c0f4d1eb
+ 9fdd931dc27ff8831dcd456ee5382eda5698cb4d34bf4a72ded0c8c7ac6f74bc
+ 836d73dbcd05b370911eb9b6dc9a99c8047173b9a96650efe53da0e7c4ac3a2d
+ b9977751969dbe38403f235fe757a8d1a07d539857d01b31f4bea24e4d58e7e3"
+
+post_extract() {
+	rmdir -v ${wrksrc}/sci
+	mv ${wrksrc}/../sci-${_sci_commit} ${wrksrc}/sci
+	rmdir -v ${wrksrc}/babashka.curl
+	mv ${wrksrc}/../babashka.curl-${_babashka_curl_commit} ${wrksrc}/babashka.curl
+	rmdir -v ${wrksrc}/babashka.nrepl
+	mv ${wrksrc}/../babashka.nrepl-${_babashka_nrepl_commit} ${wrksrc}/babashka.nrepl
+	rmdir -v ${wrksrc}/depstar
+	mv ${wrksrc}/../depstar-${_depstar_commit} ${wrksrc}/depstar
+	rmdir -v ${wrksrc}/process
+	mv ${wrksrc}/../process-${_process_commit} ${wrksrc}/process
+	rmdir -v ${wrksrc}/pods
+	mv ${wrksrc}/../pods-${_pods_commit} ${wrksrc}/pods
+	rmdir -v ${wrksrc}/deps.clj
+	mv ${wrksrc}/../deps.clj-${_deps_clj_commit} ${wrksrc}/deps.clj
+	rmdir -v ${wrksrc}/fs
+	mv ${wrksrc}/../fs-${_fs_commit} ${wrksrc}/fs
+}
+
+do_patch() {
+	vsed -i -e '/install native-image/d' script/compile
+}
+
+do_build() {
+	export GRAALVM_HOME=/usr/lib/jvm/mandrel11
+	if [ "$XBPS_TARGET_LIBC" = musl ]; then
+		export BABASHKA_MUSL=true
+		export BABASHKA_STATIC=true  # mandrel workaround
+	fi
+
+	lein deps
+	script/uberjar
+	script/compile
+}
+
+do_check() {
+	export BABASHKA_TEST_ENV=native
+	script/test
+	script/run_lib_tests
+}
+
+do_install() {
+	vbin bb
+	vlicense LICENSE
+}

  parent reply	other threads:[~2021-07-15 19:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 16:17 [PR PATCH] Babashka leahneukirchen
2021-07-15 16:24 ` [PR PATCH] [Updated] Babashka leahneukirchen
2021-07-15 19:37 ` leahneukirchen [this message]
2021-07-15 19:50 ` Babashka leahneukirchen
2021-07-16 11:33 ` [PR PATCH] [Updated] Babashka leahneukirchen
2021-07-16 21:10 ` Babashka knusbaum
2021-07-17 11:49 ` [PR PATCH] [Merged]: Babashka leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210715193745.K_IwxAgpkXdknntFkZ7P0SqPc4Sjl19MqXoVcgMdTVM@z \
    --to=leahneukirchen@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).