Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: j-807
@ 2019-09-27  8:46 voidlinux-github
  2019-09-27  9:11 ` voidlinux-github
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27  8:46 UTC (permalink / raw)
  To: ml

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

There is a new 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/14758

New package: j-807


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

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

From 2745200b004e8ef34d8972bc085d43975268efa4 Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 109 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 7 files changed, 224 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..8375dfdad78
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..9019edeebfa
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/${VERSION%%_*}/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..aae462140c3
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,109 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="~*-musl ~arm*"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j/${version}"
+_jshare="/usr/share/j/${version}"
+_jetc="/etc/j/${version}"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}',userx@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+do_install() {
+	vmkdir "${_jshare}" 0755
+	vcopy jlibrary/addons "${_jshare}"
+	vcopy jlibrary/system "${_jshare}"
+	vcopy jlibrary/tools "${_jshare}"
+
+	vmkdir "${_jlib}" 0755
+	vinstall "build/${_jsz}/bin/libj.so" 755 "${_jlib}" libj-avx.so
+	vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	vinstall "build/${_jsz}/bin/jconsole" 755 "${_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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
@ 2019-09-27  9:11 ` voidlinux-github
  2019-09-27  9:17 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27  9:11 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-535860562

Comment:
J is a funky programming language, and upstream's build process is equally funky. Anyway, I tried hard to package this up nicely, but there are quirks. This PR is to open discussion about how to properly package this up. I put a lot of effort into this one, so please be gentle. ;P

First, is a single character package name reasonable?

Second, J typically has "release" and "beta" distributions. Perhaps it would be better to have two packages `j-release` and `j-beta`? Just to keep files separate, for now I am putting things under `*/j/${version}` directories.

Third, the main library has two compile paths: one that includes AVX code and another that doesn't. It's only possible to detect AVX availability on the installing machine, so I just opt to build and install boths versions, with an INSTALL script creating a symlink to the appropriate version. Is there a better or more preferred way to handle this?

Fourth, the primary binary is called `jconsole` which conflicts with a similarly-named binary provided by openjdk, so I am choosing to call the thing `jc` instead. Perhaps this should be noted with an INSTALL.msg? Anyway, `/usr/bin/jc` has to be a wrapper script instead of a symlink due to upstream quirks.

Finally, in order to fit the package into FHS conventions, there is a good bit of bit of munging that is necessary. I do most of that with judicious use of sed on one of upstream's initialization files. Is there a different preffered way of handling this, such as providing patch files instead?

Anyway, those are the main points I can think of.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
  2019-09-27  9:11 ` voidlinux-github
@ 2019-09-27  9:17 ` voidlinux-github
  2019-09-27  9:17 ` voidlinux-github
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27  9:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From f837e60b218c2497228ad8f44d6fafc3b4d3d83e Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 7 files changed, 226 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..8375dfdad78
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..9019edeebfa
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/${VERSION%%_*}/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..e91fcd979d5
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j/${version}"
+_jshare="/usr/share/j/${version}"
+_jetc="/etc/j/${version}"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}',userx@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+do_install() {
+	vmkdir "${_jshare}" 0755
+	vcopy jlibrary/addons "${_jshare}"
+	vcopy jlibrary/system "${_jshare}"
+	vcopy jlibrary/tools "${_jshare}"
+
+	vmkdir "${_jlib}" 0755
+	[ -r "build/${_jsz}/bin/libj.so" ] && \
+		vinstall "build/${_jsz}/bin/libj.so" 755 "${_jlib}" libj-avx.so
+	[ -r "build/${_jsz}/bin/libj-nonavx.so" ] && \
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	vinstall "build/${_jsz}/bin/jconsole" 755 "${_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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
  2019-09-27  9:11 ` voidlinux-github
  2019-09-27  9:17 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-27  9:17 ` voidlinux-github
  2019-09-27  9:18 ` voidlinux-github
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27  9:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From f837e60b218c2497228ad8f44d6fafc3b4d3d83e Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 7 files changed, 226 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..8375dfdad78
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..9019edeebfa
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/${VERSION%%_*}/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..e91fcd979d5
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j/${version}"
+_jshare="/usr/share/j/${version}"
+_jetc="/etc/j/${version}"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}',userx@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+do_install() {
+	vmkdir "${_jshare}" 0755
+	vcopy jlibrary/addons "${_jshare}"
+	vcopy jlibrary/system "${_jshare}"
+	vcopy jlibrary/tools "${_jshare}"
+
+	vmkdir "${_jlib}" 0755
+	[ -r "build/${_jsz}/bin/libj.so" ] && \
+		vinstall "build/${_jsz}/bin/libj.so" 755 "${_jlib}" libj-avx.so
+	[ -r "build/${_jsz}/bin/libj-nonavx.so" ] && \
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	vinstall "build/${_jsz}/bin/jconsole" 755 "${_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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (2 preceding siblings ...)
  2019-09-27  9:17 ` voidlinux-github
@ 2019-09-27  9:18 ` voidlinux-github
  2019-09-27  9:27 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27  9:18 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-535860562

Comment:
J is a funky programming language, and upstream's build process is equally funky. Anyway, I tried hard to package this up nicely, but there are quirks. This PR is to open discussion about hos this should be properly done. I put a lot of effort into this already, though, so please be gentle. ;P

First, is a single character package name reasonable?

Second, J typically has "release" and "beta" distributions. Perhaps it would be better to have two packages `j-release` and `j-beta`? Just to keep files separate, for now I am putting things under `*/j/${version}` directories.

Third, the main library has two compile paths: one that includes AVX code and another that doesn't. It's only possible to detect AVX availability on the installing machine, so I just opt to build and install boths versions, with an INSTALL script creating a symlink to the appropriate version. Is there a better or more preferred way to handle this?

Fourth, the primary binary is called `jconsole` which conflicts with a similarly-named binary provided by openjdk, so I am choosing to call the thing `jc` instead. Perhaps this should be noted with an INSTALL.msg? Anyway, `/usr/bin/jc` has to be a wrapper script instead of a symlink due to upstream quirks.

Finally, in order to fit the package into FHS conventions, there is a good bit of bit of munging that is necessary. I do most of that with judicious use of sed on one of upstream's initialization files. Is there a different preffered way of handling this, such as providing patch files instead?

Anyway, those are the main points I can think of.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (3 preceding siblings ...)
  2019-09-27  9:18 ` voidlinux-github
@ 2019-09-27  9:27 ` voidlinux-github
  2019-09-27  9:27 ` voidlinux-github
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27  9:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From 98e31738ddb37f7bd885c7d55a6c8cd53d77050e Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 7 files changed, 226 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..8375dfdad78
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..9019edeebfa
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/${VERSION%%_*}/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..05925ebf076
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j/${version}"
+_jshare="/usr/share/j/${version}"
+_jetc="/etc/j/${version}"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}',userx@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+do_install() {
+	vmkdir "${_jshare}" 0755
+	vcopy jlibrary/addons "${_jshare}"
+	vcopy jlibrary/system "${_jshare}"
+	vcopy jlibrary/tools "${_jshare}"
+
+	vmkdir "${_jlib}" 0755
+	[ -f "build/${_jsz}/bin/libj.so" ] && \
+		vinstall "build/${_jsz}/bin/libj.so" 755 "${_jlib}" libj-avx.so
+	[ -f "build/${_jsz}/bin/libj-nonavx.so" ] && \
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	vinstall "build/${_jsz}/bin/jconsole" 755 "${_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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (4 preceding siblings ...)
  2019-09-27  9:27 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-27  9:27 ` voidlinux-github
  2019-09-27 10:16 ` voidlinux-github
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27  9:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From 98e31738ddb37f7bd885c7d55a6c8cd53d77050e Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 7 files changed, 226 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..8375dfdad78
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..9019edeebfa
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/${VERSION%%_*}/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..05925ebf076
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j/${version}"
+_jshare="/usr/share/j/${version}"
+_jetc="/etc/j/${version}"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}',userx@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+do_install() {
+	vmkdir "${_jshare}" 0755
+	vcopy jlibrary/addons "${_jshare}"
+	vcopy jlibrary/system "${_jshare}"
+	vcopy jlibrary/tools "${_jshare}"
+
+	vmkdir "${_jlib}" 0755
+	[ -f "build/${_jsz}/bin/libj.so" ] && \
+		vinstall "build/${_jsz}/bin/libj.so" 755 "${_jlib}" libj-avx.so
+	[ -f "build/${_jsz}/bin/libj-nonavx.so" ] && \
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	vinstall "build/${_jsz}/bin/jconsole" 755 "${_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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (6 preceding siblings ...)
  2019-09-27 10:16 ` voidlinux-github
@ 2019-09-27 10:16 ` voidlinux-github
  2019-09-27 16:23 ` voidlinux-github
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27 10:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From e6fac00882eb1b22cbfacfeb3e03edda13dcf038 Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 7 files changed, 226 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..8375dfdad78
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..9019edeebfa
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/${VERSION%%_*}/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..50c0f15d571
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j/${version}"
+_jshare="/usr/share/j/${version}"
+_jetc="/etc/j/${version}"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}',userx@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+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}" libj-avx.so
+	if [ -f "build/${_jsz}/bin/libj-nonavx.so" ]; then
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	fi
+
+	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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (5 preceding siblings ...)
  2019-09-27  9:27 ` voidlinux-github
@ 2019-09-27 10:16 ` voidlinux-github
  2019-09-27 10:16 ` voidlinux-github
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27 10:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From e6fac00882eb1b22cbfacfeb3e03edda13dcf038 Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 7 files changed, 226 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..8375dfdad78
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/${VERSION%%_*}/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..9019edeebfa
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/${VERSION%%_*}/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..50c0f15d571
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j/${version}"
+_jshare="/usr/share/j/${version}"
+_jetc="/etc/j/${version}"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}',userx@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+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}" libj-avx.so
+	if [ -f "build/${_jsz}/bin/libj-nonavx.so" ]; then
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	fi
+
+	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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (7 preceding siblings ...)
  2019-09-27 10:16 ` voidlinux-github
@ 2019-09-27 16:23 ` voidlinux-github
  2019-09-27 16:59 ` voidlinux-github
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27 16:23 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536007609

Comment:
1. We already have `R`, `c`, `s`.

2. We do not accept unstable software.

3. Should be controlled by `-march`, maybe add build option if not a case here.

No musl?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (8 preceding siblings ...)
  2019-09-27 16:23 ` voidlinux-github
@ 2019-09-27 16:59 ` voidlinux-github
  2019-09-28  9:04 ` voidlinux-github
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-27 16:59 UTC (permalink / raw)
  To: ml

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

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536019525

Comment:
Thanks for looking into this, I gave up packaging J a few time ready.

Will review when I have a bit more time, but looks quite good already.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (9 preceding siblings ...)
  2019-09-27 16:59 ` voidlinux-github
@ 2019-09-28  9:04 ` voidlinux-github
  2019-09-28 14:40 ` voidlinux-github
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-28  9:04 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536168266

Comment:
@Chocimier
Thanks for replying.

1. Excellent.  
2. Fair enough. If there is no need to distinguish versions, then I guess it makes sense to remove the `${version}` directory from the install paths.  
3. Hrm. Not sure I follow. The issue is that upstream supports *both* AVX and non-AVX architectures; however, the crossbuilds are not fine-grained enough to distinguish between those targets. Unless I am mistaken, this means we are forced to detect AVX support at install time.  

Unfortunately, upstream seems to be using `fts.h` which musl explicitly chooses to not support. The [musl FAQ][0] gives a rationale and implies that the only way to support musl is by completely removing said libc calls.

In general, upstream seems to be interested in supporting a variety of build targets. The build system, however, implicitly assumes that the build host and target are the same, and it is doing some dirty things as well, like parsing CC to set different compile flags for gcc. This all makes cross-compilation break horribly, of course. I spent a long time munging patches to try and get things working, but I honestly don't really know what I'm doing.

6. One more question. Upstream has a collection of scripts they call 'addons'. These aren't tarred up at all, and require a separate, somewhat non-obvious installation from git. However, the J documentation acts as if these addons are installed by default. Any ideas on how to handle this?

[0]:https://wiki.musl-libc.org/faq.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (10 preceding siblings ...)
  2019-09-28  9:04 ` voidlinux-github
@ 2019-09-28 14:40 ` voidlinux-github
  2019-09-29  3:09 ` voidlinux-github
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-28 14:40 UTC (permalink / raw)
  To: ml

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

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536195360

Comment:
I see no use of fts.h, it just builds on x86_64-musl here.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (11 preceding siblings ...)
  2019-09-28 14:40 ` voidlinux-github
@ 2019-09-29  3:09 ` voidlinux-github
  2019-09-29  3:10 ` voidlinux-github
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-29  3:09 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536244005

Comment:
@leahneukirchen
Thanks for checking.

Grepping `${wrksrc}` for 'fts.h` turns up one result: `jsrc/xf.c`. However, your comment prompted me to try compiling again, just in case. Here's what I did:

    $ sed -i '/archs/s/x86_64/& &-musl/' srcpkgs/j/template
    $ ./xbps-src zap
    $ ./xbps-src -a x86_64-musl binary-bootstrap
    $ ./xbps-src -a x86_64 install j

Unfortunately, that fails on the build step for me. Here is the tail of the upstream build log `${wrksrc}/build/j64/bin/build_libj.so.txt`:

    /builddir/jsource-j807-release/jsrc/xf.c:18:10: fatal error: fts.h: No such file or directory
       18 | #include <fts.h>
          |          ^~~~~~~
    compilation terminated.
    make: *** [/builddir/jsource-j807-release/make/makefile:4: xf.o] Error 1

Mind sharing how you got it working?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (12 preceding siblings ...)
  2019-09-29  3:09 ` voidlinux-github
@ 2019-09-29  3:10 ` voidlinux-github
  2019-09-29  3:10 ` voidlinux-github
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-29  3:10 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536244005

Comment:
@leahneukirchen
Thanks for checking.

Grepping `${wrksrc}` for `fts.h` turns up one result: `jsrc/xf.c`. However, your comment prompted me to try compiling again, just in case. Here's what I did:

    $ sed -i '/archs/s/x86_64/& &-musl/' srcpkgs/j/template
    $ ./xbps-src zap
    $ ./xbps-src -a x86_64-musl binary-bootstrap
    $ ./xbps-src -a x86_64 install j

Unfortunately, that fails on the build step for me. Here is the tail of the upstream build log `${wrksrc}/build/j64/bin/build_libj.so.txt`:

    /builddir/jsource-j807-release/jsrc/xf.c:18:10: fatal error: fts.h: No such file or directory
       18 | #include <fts.h>
          |          ^~~~~~~
    compilation terminated.
    make: *** [/builddir/jsource-j807-release/make/makefile:4: xf.o] Error 1

Mind sharing how you got it working?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (13 preceding siblings ...)
  2019-09-29  3:10 ` voidlinux-github
@ 2019-09-29  3:10 ` voidlinux-github
  2019-09-29  3:52 ` voidlinux-github
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-29  3:10 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536244005

Comment:
@leahneukirchen
Thanks for checking.

Grepping `${wrksrc}` for `fts.h` turns up one result: `jsrc/xf.c`. However, your comment prompted me to try compiling again, just in case. Here's what I did:

    $ sed -i '/^archs/s/x86_64/& &-musl/' srcpkgs/j/template
    $ ./xbps-src zap
    $ ./xbps-src -a x86_64-musl binary-bootstrap
    $ ./xbps-src -a x86_64 install j

Unfortunately, that fails on the build step for me. Here is the tail of the upstream build log `${wrksrc}/build/j64/bin/build_libj.so.txt`:

    /builddir/jsource-j807-release/jsrc/xf.c:18:10: fatal error: fts.h: No such file or directory
       18 | #include <fts.h>
          |          ^~~~~~~
    compilation terminated.
    make: *** [/builddir/jsource-j807-release/make/makefile:4: xf.o] Error 1

Mind sharing how you got it working?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (14 preceding siblings ...)
  2019-09-29  3:10 ` voidlinux-github
@ 2019-09-29  3:52 ` voidlinux-github
  2019-09-30  1:34 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-29  3:52 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536246221

Comment:
Ah. I just ran across this: https://code.jsoftware.com/wiki/System/Installation/Linux

I was unaware of `ijconsole` for installing addons. This answers question 6; however, the current package only supplies the `jconsole` (no leading `i`) binary. At the moment, I am unable to even find its source. Will look into this later today.


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (16 preceding siblings ...)
  2019-09-30  1:34 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-30  1:34 ` voidlinux-github
  2019-09-30  1:45 ` voidlinux-github
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30  1:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From f3fe0032f29f536a443205fea1a1f35d2978def1 Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/INSTALL.msg                       |   8 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 8 files changed, 234 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/INSTALL.msg
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..0a8b6c61cd1
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/INSTALL.msg b/srcpkgs/j/INSTALL.msg
new file mode 100644
index 00000000000..ca578961646
--- /dev/null
+++ b/srcpkgs/j/INSTALL.msg
@@ -0,0 +1,8 @@
+The J CLI (jconsole) is provided as /usr/bin/jc.
+
+To install addons use the 'jpkg' verb, documented here:
+https://code.jsoftware.com/wiki/JAL/Package_Manager/jpkg
+
+See /etc/j/profile.ijs for the default J profile settings. System-wide
+overrides may be provided in /etc/j/profilex.ijs; see the corresponding
+template /etc/j/profilex_template.ijs for details.
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..cfa7af8a6e6
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..d818200267d
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j"
+_jshare="/usr/share/j"
+_jetc="/etc/j"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}'@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+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}" libj-avx.so
+	if [ -f "build/${_jsz}/bin/libj-nonavx.so" ]; then
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	fi
+
+	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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (15 preceding siblings ...)
  2019-09-29  3:52 ` voidlinux-github
@ 2019-09-30  1:34 ` voidlinux-github
  2019-09-30  1:34 ` voidlinux-github
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30  1:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From f3fe0032f29f536a443205fea1a1f35d2978def1 Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/INSTALL                           |  10 ++
 srcpkgs/j/INSTALL.msg                       |   8 ++
 srcpkgs/j/REMOVE                            |   3 +
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 111 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 8 files changed, 234 insertions(+)
 create mode 100644 srcpkgs/j/INSTALL
 create mode 100644 srcpkgs/j/INSTALL.msg
 create mode 100644 srcpkgs/j/REMOVE
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/INSTALL b/srcpkgs/j/INSTALL
new file mode 100644
index 00000000000..0a8b6c61cd1
--- /dev/null
+++ b/srcpkgs/j/INSTALL
@@ -0,0 +1,10 @@
+case "${ACTION}" in
+post)
+	# Detect whether all CPUs have AVX flag set
+	if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
+		ln -sf "libj-avx.so" "/usr/lib/j/libj.so"
+	else
+		ln -sf "libj-nonavx.so" "/usr/lib/j/libj.so"
+	fi
+	;;
+esac
diff --git a/srcpkgs/j/INSTALL.msg b/srcpkgs/j/INSTALL.msg
new file mode 100644
index 00000000000..ca578961646
--- /dev/null
+++ b/srcpkgs/j/INSTALL.msg
@@ -0,0 +1,8 @@
+The J CLI (jconsole) is provided as /usr/bin/jc.
+
+To install addons use the 'jpkg' verb, documented here:
+https://code.jsoftware.com/wiki/JAL/Package_Manager/jpkg
+
+See /etc/j/profile.ijs for the default J profile settings. System-wide
+overrides may be provided in /etc/j/profilex.ijs; see the corresponding
+template /etc/j/profilex_template.ijs for details.
diff --git a/srcpkgs/j/REMOVE b/srcpkgs/j/REMOVE
new file mode 100644
index 00000000000..cfa7af8a6e6
--- /dev/null
+++ b/srcpkgs/j/REMOVE
@@ -0,0 +1,3 @@
+case "${ACTION}" in
+pre) rm "/usr/lib/j/libj.so";;
+esac
diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..d818200267d
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,111 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j"
+_jshare="/usr/share/j"
+_jetc="/etc/j"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+
+##
+# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so
+# here we build libraries for both cases. See do_install() for further details.
+do_build() {
+	sed "/jplatform/s@unknown@${_jplatform}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}'@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+##
+# We install the AVX-enabled library libj.so as libj-avx.so. An INSTALL script
+# then symlinks the appropriate library to libj.so, depending on whether the
+# installing machine supports AVX or not.
+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}" libj-avx.so
+	if [ -f "build/${_jsz}/bin/libj-nonavx.so" ]; then
+		vinstall "build/${_jsz}/bin/libj-nonavx.so" 755 "${_jlib}"
+	fi
+
+	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
+		${_jlib}/jconsole -lib "${_jlib}/libj.so" \\
+		                  -jprofile "${_jetc}/profile.ijs" \\
+		                  "\${@}"
+	JC
+	vbin "build/${_jsz}/bin/jc.sh" jc
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (17 preceding siblings ...)
  2019-09-30  1:34 ` voidlinux-github
@ 2019-09-30  1:45 ` voidlinux-github
  2019-09-30  3:30 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30  1:45 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536368069

Comment:
Forgive the barrage of comments.

Q6 is apparently a non-issue, given the [jpkg][0] verb. I went ahead and pushed a change that includes an `INSTALL.msg` which hopefully bridges the gap between this package and J's documentation.

Also in this change, since we don't expect to provide multple versions, I removed the final `${version}` directory from all install paths. For consistency, I did a similar thing for the user directory setting in `profile.ijs`.

[0]:https://code.jsoftware.com/wiki/JAL/Package_Manager/jpkg

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (18 preceding siblings ...)
  2019-09-30  1:45 ` voidlinux-github
@ 2019-09-30  3:30 ` voidlinux-github
  2019-09-30  3:30 ` voidlinux-github
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30  3:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From 0b7e79d8425facb9928fbd351886355799f33bef Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 113 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 5 files changed, 215 insertions(+)
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..77e0f6da0ad
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,113 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j"
+_jshare="/usr/share/j"
+_jetc="/etc/j"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+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}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}'@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+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
+
+	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
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (19 preceding siblings ...)
  2019-09-30  3:30 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-30  3:30 ` voidlinux-github
  2019-09-30  9:07 ` voidlinux-github
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30  3:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From 0b7e79d8425facb9928fbd351886355799f33bef Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 +++++++++++
 srcpkgs/j/template                          | 113 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 5 files changed, 215 insertions(+)
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..77e0f6da0ad
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,113 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="x86_64 aarch64"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j"
+_jshare="/usr/share/j"
+_jetc="/etc/j"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+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}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}'@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+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
+
+	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
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (20 preceding siblings ...)
  2019-09-30  3:30 ` voidlinux-github
@ 2019-09-30  9:07 ` voidlinux-github
  2019-09-30 12:27 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30  9:07 UTC (permalink / raw)
  To: ml

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

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536473054

Comment:
This fixes build on musl (no idea what I was thinking above):

```
case "$XBPS_TARGET_MACHINE" in
        *-musl) makedepends+=" musl-fts-devel"
esac
```

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (22 preceding siblings ...)
  2019-09-30 12:27 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-30 12:27 ` voidlinux-github
  2019-09-30 12:28 ` voidlinux-github
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30 12:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From f2c6aa4a5ac0642b560aed17162f9d9eda4c361b Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 ++++++++++
 srcpkgs/j/template                          | 117 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 5 files changed, 219 insertions(+)
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..83d66d65f82
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,117 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="aarch64* x86_64*"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j"
+_jshare="/usr/share/j"
+_jetc="/etc/j"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+case "${XBPS_TARGET_MACHINE}" in
+*-musl)   makedepends+=" musl-fts-devel";;
+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}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}'@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+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
+
+	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
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (21 preceding siblings ...)
  2019-09-30  9:07 ` voidlinux-github
@ 2019-09-30 12:27 ` voidlinux-github
  2019-09-30 12:27 ` voidlinux-github
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30 12:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 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/14758

New package: j-807


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

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

From f2c6aa4a5ac0642b560aed17162f9d9eda4c361b Mon Sep 17 00:00:00 2001
From: "B. Wilson" <x@wilsonb.com>
Date: Fri, 27 Sep 2019 17:41:02 +0900
Subject: [PATCH] New package: j-807

---
 srcpkgs/j/files/profilex_template.ijs       |  28 +++++
 srcpkgs/j/patches/crossbuild-jconsole.patch |  11 ++
 srcpkgs/j/patches/crossbuild-libj.patch     |  61 ++++++++++
 srcpkgs/j/template                          | 117 ++++++++++++++++++++
 srcpkgs/j/update                            |   2 +
 5 files changed, 219 insertions(+)
 create mode 100644 srcpkgs/j/files/profilex_template.ijs
 create mode 100644 srcpkgs/j/patches/crossbuild-jconsole.patch
 create mode 100644 srcpkgs/j/patches/crossbuild-libj.patch
 create mode 100644 srcpkgs/j/template
 create mode 100644 srcpkgs/j/update

diff --git a/srcpkgs/j/files/profilex_template.ijs b/srcpkgs/j/files/profilex_template.ijs
new file mode 100644
index 00000000000..75965d7f2a5
--- /dev/null
+++ b/srcpkgs/j/files/profilex_template.ijs
@@ -0,0 +1,28 @@
+NB. profilex.ijs template
+NB. copy template to profilex and edit as required
+NB. profilex.ijs overrides profile definitions
+NB. profilex.ijs is not replaced by installs/updates
+NB. errors may prevent startup
+NB. check SystemFolders_j_ before/after changes
+NB. install is J folder
+NB. home is HOME
+NB. userx is /807-user or /j64-807-user
+NB. see profile.ijs for more info
+
+NB. example 1: user in J folder
+NB.     user=.   install,userx
+
+NB. example 2: user in d:/
+NB.     user=.   'd:',userx
+
+NB. example 3: user in home/Documents
+NB.     user=.   home,'/Documents',userx
+
+NB. example 4: user in same folder as install
+NB.     user=.   ('/'(i:~{.])install),userx
+
+user=.    home,userx   NB. profile default - edit to change
+break=.   user,'/break'
+config=.  user,'/config'
+snap=.    user,'/snap'
+temp=.    user,'/temp'
diff --git a/srcpkgs/j/patches/crossbuild-jconsole.patch b/srcpkgs/j/patches/crossbuild-jconsole.patch
new file mode 100644
index 00000000000..a21271e47e9
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-jconsole.patch
@@ -0,0 +1,11 @@
+--- make/build_jconsole.sh	2019-09-27 16:31:47.494999152 +0900
++++ make/build_jconsole.sh	2019-09-27 16:35:41.162381710 +0900
+@@ -8,7 +8,7 @@
+ 
+ linux_j32)
+ COMPILE="$common -m32 -DREADLINE"
+-LINK=" -l:libedit.so.2 -m32 -ldl -o jconsole "
++LINK=" -ledit -m32 -ldl -o jconsole "
+ ;;
+ linux_j64)
+ COMPILE="$common -DREADLINE"
diff --git a/srcpkgs/j/patches/crossbuild-libj.patch b/srcpkgs/j/patches/crossbuild-libj.patch
new file mode 100644
index 00000000000..66da953609a
--- /dev/null
+++ b/srcpkgs/j/patches/crossbuild-libj.patch
@@ -0,0 +1,61 @@
+--- make/build_libj.sh	2019-09-27 16:31:51.711078190 +0900
++++ make/build_libj.sh	2019-09-27 16:35:36.406292466 +0900
+@@ -7,36 +7,32 @@
+ # use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
+ # too early to move main linux release package to gcc 5
+ 
+-compiler=${CC:0:3}
+-
+ USE_OPENMP="${USE_OPENMP:=0}"
+-if [ $USE_OPENMP -eq 1 ] ; then
+ OPENMP=" -fopenmp "
+ LDOPENMP=" -fopenmp "
+-if [ "x$compiler" = x'gcc' ] ; then
+-LDOPENMP32=" -l:libgomp.so.1 "    # gcc
+-else
+-LDOPENMP32=" -l:libomp.so.5 "     # clang
+-fi
+-fi
+ 
+-if [ "x$compiler" = x'gcc' ] ; then
+-# gcc
+-common="$OPENMP -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 -Wno-shift-negative-value"
+-# alternatively, add comment /* fall through */
+-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
+-if [ $OVER_GCC_VER7 -eq 1 ] ; then
+-common="$common -Wno-implicit-fallthrough"
+-fi
+-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
+-if [ $OVER_GCC_VER8 -eq 1 ] ; then
+-common="$common -Wno-cast-function-type"
+-fi
+-else
+-# clang 3.5 .. 5.0
+-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
+-fi
+-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
++common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
++for wflag in no-maybe-uninitialized \
++             no-unused-parameter \
++             no-sign-compare \
++             no-clobbered \
++             no-empty-body \
++             no-unused-value \
++             no-pointer-sign \
++             no-parentheses \
++             no-shift-negative-value \
++             no-implicit-fallthrough \
++             no-cast-function-type \
++             no-consumed \
++             no-uninitialized \
++             no-unsequenced \
++             no-string-plus-int \
++             no-return-type \
++             no-constant-logical-operand \
++             no-comment; do
++	${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
++		common="${common} -W${wflag}"
++done
+ 
+ case $jplatform\_$1 in
+ 
diff --git a/srcpkgs/j/template b/srcpkgs/j/template
new file mode 100644
index 00000000000..83d66d65f82
--- /dev/null
+++ b/srcpkgs/j/template
@@ -0,0 +1,117 @@
+# Template file for 'j'
+pkgname=j
+version=807
+revision=1
+archs="aarch64* x86_64*"
+wrksrc="jsource-j${version}-release"
+makedepends="libedit-devel libgomp-devel libomp-devel"
+short_desc="Modern, high-performance, ASCII-based successor to APL"
+maintainer="B. Wilson <x@wilsonb.com>"
+license="GPL-3.0-or-later"
+homepage="https://jsoftware.com/"
+distfiles="https://github.com/jsoftware/jsource/archive/j${version}-release.tar.gz"
+checksum=324ff0b046c9f7f24f18a72fa8a4253ad54c99a48c397fd2c724392f5e097d7f
+
+_jsz="j${XBPS_TARGET_WORDSIZE}"
+_jtype="release"
+_jbuilder="voidlinux.org"
+_jlib="/usr/lib/j"
+_jshare="/usr/share/j"
+_jetc="/etc/j"
+_juser=".j"
+
+case "${XBPS_TARGET_MACHINE}" in
+aarch64*) _jplatform="raspberry";;
+*)        _jplatform="linux";;
+esac
+
+case "${XBPS_TARGET_MACHINE}" in
+*-musl)   makedepends+=" musl-fts-devel";;
+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}@
+	     /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
+
+	sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
+	        /^user=./s@home,userx@home,'/${_juser}'@" \
+		jlibrary/bin/profile.ijs
+
+	mkdir -p build/${_jsz}/bin
+	. make/jvars.sh
+
+	make/build_jconsole.sh ${_jsz}
+	make/build_libj.sh ${_jsz}
+	make/build_libj.sh ${_jsz}nonavx
+}
+
+_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
+}
+
+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"
+	fi
+	_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
+}
+
+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
+
+	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
+}
diff --git a/srcpkgs/j/update b/srcpkgs/j/update
new file mode 100644
index 00000000000..2947eb06d95
--- /dev/null
+++ b/srcpkgs/j/update
@@ -0,0 +1,2 @@
+site='https://jsoftware.com/indexno.html'
+pattern='The latest release is \K[\d]+(=?\.)'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (23 preceding siblings ...)
  2019-09-30 12:27 ` voidlinux-github
@ 2019-09-30 12:28 ` voidlinux-github
  2019-09-30 15:07 ` voidlinux-github
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30 12:28 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536538652

Comment:
@leahneukirchen
Excellent. Patched.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (24 preceding siblings ...)
  2019-09-30 12:28 ` voidlinux-github
@ 2019-09-30 15:07 ` voidlinux-github
  2019-10-01  7:44 ` voidlinux-github
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-09-30 15:07 UTC (permalink / raw)
  To: ml

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

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536606015

Comment:
:+1: from me

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (25 preceding siblings ...)
  2019-09-30 15:07 ` voidlinux-github
@ 2019-10-01  7:44 ` voidlinux-github
  2019-10-01 16:20 ` voidlinux-github
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-10-01  7:44 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-536912758

Comment:
Regarding stuff in `/usr/share/j`, it seems that this is a directory that the J binary effectively manages. The `jpkg` verb lets users update, install and remove files from there. As such, I guess we should mark the package-provided files in that directory as mutable. Is there a different, preferred way of handling this kind of thing?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (26 preceding siblings ...)
  2019-10-01  7:44 ` voidlinux-github
@ 2019-10-01 16:20 ` voidlinux-github
  2019-10-02  0:10 ` voidlinux-github
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-10-01 16:20 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-537113992

Comment:
I rather do not want same files to be managed by both xbps and jpkg. There should be separation eg. xbps manages /usr/share/j only, jpkg manages /var (or /usr/share/jpkg, or $XDG/j) only.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (27 preceding siblings ...)
  2019-10-01 16:20 ` voidlinux-github
@ 2019-10-02  0:10 ` voidlinux-github
  2019-10-02 22:01 ` voidlinux-github
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-10-02  0:10 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-537281499

Comment:
> I rather do not want same files to be managed by both xbps and jpkg. 
Yeah, ideally we could create a clean separation, but I'm not sure we have a whole lot of room to wiggle. J needs some of these files (*e.g.* `system/util/boot.ijs`) in order to bootstrap. I think the best we can do is find a minimal set with which to mark in `mutable_files`.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (28 preceding siblings ...)
  2019-10-02  0:10 ` voidlinux-github
@ 2019-10-02 22:01 ` voidlinux-github
  2019-10-12 19:32 ` voidlinux-github
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-10-02 22:01 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-537281499

Comment:
> I rather do not want same files to be managed by both xbps and jpkg. 

Yeah, ideally we could create a clean separation, but I'm not sure we have a whole lot of room to wiggle. J needs some of these files (*e.g.* `system/util/boot.ijs`) in order to bootstrap. I think the best we can do is find a minimal set with which to mark in `mutable_files`.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (29 preceding siblings ...)
  2019-10-02 22:01 ` voidlinux-github
@ 2019-10-12 19:32 ` voidlinux-github
  2019-10-23  6:43 ` voidlinux-github
  2019-10-26 16:40 ` [PR PATCH] [Merged]: " voidlinux-github
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-10-12 19:32 UTC (permalink / raw)
  To: ml

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

New comment by leahneukirchen on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-541354980

Comment:
I think jpkg just can't write there for ordinary users, so it won't work anyway?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (30 preceding siblings ...)
  2019-10-12 19:32 ` voidlinux-github
@ 2019-10-23  6:43 ` voidlinux-github
  2019-10-26 16:40 ` [PR PATCH] [Merged]: " voidlinux-github
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-10-23  6:43 UTC (permalink / raw)
  To: ml

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

New comment by xelxebar on void-packages repository

https://github.com/void-linux/void-packages/pull/14758#issuecomment-545293920

Comment:
@the-maldridge 
I believe the changes you requested have been made. However, what do you say about the issue of `/usr/share/j/*` files being mutable? There are quite a few.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Merged]: New package: j-807
  2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
                   ` (31 preceding siblings ...)
  2019-10-23  6:43 ` voidlinux-github
@ 2019-10-26 16:40 ` voidlinux-github
  32 siblings, 0 replies; 34+ messages in thread
From: voidlinux-github @ 2019-10-26 16:40 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

New package: j-807
https://github.com/void-linux/void-packages/pull/14758

Description:


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2019-10-26 16:40 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27  8:46 [PR PATCH] New package: j-807 voidlinux-github
2019-09-27  9:11 ` voidlinux-github
2019-09-27  9:17 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-27  9:17 ` voidlinux-github
2019-09-27  9:18 ` voidlinux-github
2019-09-27  9:27 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-27  9:27 ` voidlinux-github
2019-09-27 10:16 ` voidlinux-github
2019-09-27 10:16 ` voidlinux-github
2019-09-27 16:23 ` voidlinux-github
2019-09-27 16:59 ` voidlinux-github
2019-09-28  9:04 ` voidlinux-github
2019-09-28 14:40 ` voidlinux-github
2019-09-29  3:09 ` voidlinux-github
2019-09-29  3:10 ` voidlinux-github
2019-09-29  3:10 ` voidlinux-github
2019-09-29  3:52 ` voidlinux-github
2019-09-30  1:34 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-30  1:34 ` voidlinux-github
2019-09-30  1:45 ` voidlinux-github
2019-09-30  3:30 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-30  3:30 ` voidlinux-github
2019-09-30  9:07 ` voidlinux-github
2019-09-30 12:27 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-30 12:27 ` voidlinux-github
2019-09-30 12:28 ` voidlinux-github
2019-09-30 15:07 ` voidlinux-github
2019-10-01  7:44 ` voidlinux-github
2019-10-01 16:20 ` voidlinux-github
2019-10-02  0:10 ` voidlinux-github
2019-10-02 22:01 ` voidlinux-github
2019-10-12 19:32 ` voidlinux-github
2019-10-23  6:43 ` voidlinux-github
2019-10-26 16:40 ` [PR PATCH] [Merged]: " voidlinux-github

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).