Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] j: update to 901.d.
Date: Fri, 24 Jan 2020 04:43:05 +0100	[thread overview]
Message-ID: <20200124034305.CZ4tgX-mPZ2s8gV6C5cSTlmeg-1zolKvKVkDnL-Gt9s@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-18441@inbox.vuxu.org>

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

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

https://github.com/xelxebar/void-packages package/j
https://github.com/void-linux/void-packages/pull/18441

j: update to 901.d.


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

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

From 70e19d5d06bd8e453d0cc88ea00fe54968b3a787 Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Tue, 21 Jan 2020 10:51:34 +0900
Subject: [PATCH] j: update to 901.d.

---
 srcpkgs/j/patches/crossbuild-jconsole.patch |  19 ---
 srcpkgs/j/patches/crossbuild-libj.patch     |  25 ----
 srcpkgs/j/template                          | 125 ++++++++++----------
 3 files changed, 62 insertions(+), 107 deletions(-)
 delete mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 delete mode 100644 srcpkgs/j/patches/crossbuild-libj.patch

diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
deleted file mode 100644
index 00bda4ccd40..00000000000
--- a/srcpkgs/j/patches/crossbuild-jconsole.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- make/build_jconsole.sh	2019-12-17 18:25:11.713700768 +0900
-+++ make/build_jconsole.sh	2019-12-17 18:26:45.090341029 +0900
-@@ -5,6 +5,7 @@
- cd ~
- 
- macmin="-mmacosx-version-min=10.6"
-+ccver=$(${CC} --version)
- USE_LINENOISE="${USE_LINENOISE:=1}"
- 
- if [ "x$CC" = x'' ] ; then
-@@ -20,7 +21,7 @@
- export CC
- fi
- 
--if [ $CC = "gcc" ] ; then
-+if [ -z "${ccver##*(GCC)*}" ]; then
- # gcc
- common=" -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses"
- OVER_GCC_VER6=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 6 | bc)
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
deleted file mode 100644
index 34a7786c82b..00000000000
--- a/srcpkgs/j/patches/crossbuild-libj.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- make/build_libj.sh	2020-01-19 11:41:50.017038941 +0900
-+++ make/build_libj.sh	2020-01-19 11:47:52.455846176 +0900
-@@ -10,19 +10,20 @@
- # too early to move main linux release package to gcc 5
- 
- macmin="-mmacosx-version-min=10.6"
-+ccver=$(${CC} --version)
- 
- USE_OPENMP="${USE_OPENMP:=0}"
- if [ $USE_OPENMP -eq 1 ] ; then
- OPENMP=" -fopenmp "
- LDOPENMP=" -fopenmp "
--if [ -z "${$CCcc##*gcc*}" ] || [ -z "${CC##*gcc*}" ]; then
-+if [ -z "${ccver##*(GCC)*}" ]; then
- LDOPENMP32=" -l:libgomp.so.1 "    # gcc
- else
- LDOPENMP32=" -l:libomp.so.5 "     # clang
- fi
- fi
- 
--if [ $CC = "gcc" ] ; then
-+if [ -z "${ccver##*(GCC)*}" ]; then
- # gcc
- common="$OPENMP -Werror -fPIC -O2 -fwrapv -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-type-limits"
- GNUC_MAJOR=$(echo __GNUC__ | $CC -E -x c - | tail -n 1)
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
index d4dbec09909..3874aa484ff 100644
--- a/srcpkgs/j/template
+++ b/srcpkgs/j/template
@@ -1,7 +1,7 @@
 # Template file for 'j'
 pkgname=j
 _vmaj=901
-_vmin=c
+_vmin=d
 _vrel=${_vmaj}-release${_vmin:+-}${_vmin}
 version=${_vmaj}.${_vmin}
 revision=1
@@ -14,7 +14,7 @@ maintainer="B. Wilson <x@wilsonb.com>"
 license="GPL-3.0-or-later"
 homepage="https://jsoftware.com/"
 distfiles="https://github.com/jsoftware/jsource/archive/j${_vrel}.tar.gz"
-checksum=3e7b7f9ea8e23bf055bee0761ea8928e7ff616131b7ab66918956404d8750252
+checksum=5d581c3587253566375f4229dd76ec4108f6eea80d7e4ccf5725328c9f8b408a
 
 _jsz="j${XBPS_TARGET_WORDSIZE}"
 _jtype="release"
@@ -25,8 +25,8 @@ _jetc="/etc/j"
 _juser=".j"
 
 case "${XBPS_TARGET_MACHINE}" in
-aarch64*) _jplatform="raspberry";;
-*)        _jplatform="linux";;
+aarch64*) _jpl="raspberry";;
+*)        _jpl="linux";;
 esac
 
 case "${XBPS_TARGET_MACHINE}" in
@@ -34,88 +34,87 @@ case "${XBPS_TARGET_MACHINE}" in
 esac
 
 
-##
-# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
-# here we build libraries for both cases.
-do_build() {
-	sed "/jplatform/s@unknown@${_jplatform}@
+do_configure() {
+	sed "/jversion/s@${_vmaj}@${_vrel}@
+	     /jplatform/s@unknown@${_jpl}@
 	     /jtype/s@beta@${_jtype}@
 	     /jbuilder/s@unknown@${_jbuilder}@" \
-		jsrc/jversion-x.h > jsrc/jversion.h
-
-	sed -i "/jgit=/s@~/git/jsource@${wrksrc}@
-	        /jbld=/s@~/jbld@${wrksrc}/build@
-	        /jplatform=/s@=.*\$@=${_jplatform}@
-	        /CC=/s@clang@${CC}@" \
-		make/jvars.sh
+	    jsrc/jversion-x.h > jsrc/jversion.h
 
 	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
 	        /^user=./s@home,userx@home,'/${_juser}'@" \
-		jlibrary/bin/profile.ijs
+	       jlibrary/bin/profile.ijs
+}
 
-	mkdir -p build/${_jsz}/bin
-	. make/jvars.sh
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX targets, so instead
+# we build all applicable binaries.
+do_build() {
+	jplatform=${_jpl} j64x=${_jsz} make2/build_jconsole.sh
+	jplatform=${_jpl} j64x=${_jsz} make2/build_libj.sh
 
-	make/build_jconsole.sh ${_jsz}
-	make/build_libj.sh ${_jsz}
-	make/build_libj.sh ${_jsz}nonavx
-}
+	if [ "${_jsz}" = 'j64' ]; then
+		jplatform=${_jpl} j64x=${_jsz}avx make2/build_jconsole.sh
+		jplatform=${_jpl} j64x=${_jsz}avx make2/build_libj.sh
 
-_runtestdir() {
-	dir=${1}
-	jc=${2}
-	libj=${3}
-
-	for f in "${dir}"/*.ijs; do
-		printf '%s(%s): ' "${f}" "${libj}"
-		if ${jc} -lib "${libj}" <"${f}" >/dev/null; then
-			echo "PASS"
-		else
-			echo "FAIL"
-			return 1
-		fi
-	done
+		jplatform=${_jpl} j64x=${_jsz}avx2 make2/build_jconsole.sh
+		jplatform=${_jpl} j64x=${_jsz}avx2 make2/build_libj.sh
+	fi
 }
 
 do_check() {
-	ln -srf jlibrary/bin/* build/${_jsz}/bin/
-	ln -srf jlibrary/{addons,system,tools} build/${_jsz}/
-
-	# Test AVX-enabled library if all host CPUs have AVX flag set
-	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
-		_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj.so"
+	if [ -d "${_jlib}/j64avx2" ] \
+	   && sed -n '/^flags/{s/\<avx2\>//;t;q1}' /proc/cpuinfo; then
+		javx='avx2'
+	elif [ -d "${_jlib}/j64avx" ] \
+	     && sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		javx='avx'
+	else
+		javx=''
 	fi
-	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+
+	ln -srf jlibrary/bin/* bin/${_jpl}/${_jsz}${javx}/
+	ln -srf jlibrary/{addons,system,tools} bin/${_jpl}/
+
+	echo 'RECHO ddall' | "bin/${_jpl}/${_jsz}${javx}/jconsole" test/tsu.ijs
+}
+
+##
+# Script to detect AVX/AVX2 support and launch appropriate jconsole binary
+_jconsole_wrapper_script() {
+cat <<JC
+#!/usr/bin/env sh
+
+cpu_has_avx() { sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; }
+cpu_has_avx2() { sed -n '/^flags/{s/\<avx2\>//;t;q1}' /proc/cpuinfo; }
+
+if [ -d "${_jlib}/j64avx2" ] && cpu_has_avx2; then
+	javx='avx2'
+elif [ -d "${_jlib}/j64avx" ] && cpu_has_avx; then
+	javx='avx'
+elif [ -d "${_jlib}/j64" ]; then
+	javx=''
+else
+	>&2 echo "\${0}: Cannot find jconsole executable"
+	exit 1
+fi
+
+${_jlib}/${_jsz}\${javx}/jconsole -jprofile "${_jetc}/profile.ijs" "\${@}"
+JC
 }
 
 do_install() {
 	vmkdir "${_jshare}" 0755
-	vcopy jlibrary/addons "${_jshare}"
 	vcopy jlibrary/system "${_jshare}"
 	vcopy jlibrary/tools "${_jshare}"
 
 	vmkdir "${_jlib}" 0755
-	vinstall "build/${_jsz}/bin/jconsole" 755 "${_jlib}"
-	vinstall "build/${_jsz}/bin/libj.so" 755 "${_jlib}"
-	if [ -f "build/${_jsz}/bin/libj-nonavx.so" ]; then
-		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
-	fi
+	vcopy "bin/${_jpl}/*" "${_jlib}"
 
 	vmkdir "${_jetc}" 0755
 	vinstall "${FILESDIR}/profilex_template.ijs" 644 "${_jetc}"
 	vinstall "jlibrary/bin/profile.ijs" 644 "${_jetc}"
 
-	cat >build/${_jsz}/bin/jc.sh <<-JC
-		#!/usr/bin/env sh
-
-		if [ -f "${_jlib}/libj-nonavx.so" ] \\
-		   && ! sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
-		   lib='libj-nonavx.so'
-		fi
-
-		${_jlib}/jconsole -lib "${_jlib}/\${lib:-libj.so}" \\
-		                  -jprofile "${_jetc}/profile.ijs" \\
-		                  "\${@}"
-	JC
-	vbin "build/${_jsz}/bin/jc.sh" jc
+	_jconsole_wrapper_script >bin/jc.sh
+	vbin "bin/jc.sh" jc
 }

  parent reply	other threads:[~2020-01-24  3:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21  1:58 [PR PATCH] " voidlinux-github
2020-01-21 13:23 ` [PR PATCH] [Updated] " voidlinux-github
2020-01-21 13:25 ` voidlinux-github
2020-01-24  3:43 ` voidlinux-github [this message]
2020-01-24  3:45 ` voidlinux-github
2020-01-24  9:19 ` [PR PATCH] [Merged]: " voidlinux-github

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=20200124034305.CZ4tgX-mPZ2s8gV6C5cSTlmeg-1zolKvKVkDnL-Gt9s@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --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).