Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: j-807
Date: Fri, 27 Sep 2019 11:27:20 +0200	[thread overview]
Message-ID: <20190927092720.nClEpCISXDgs5WRJHKpMhTefFvnPf1lc0ylTjm7LZrY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-14758@inbox.vuxu.org>

[-- 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]+(=?\.)'

  parent reply	other threads:[~2019-09-27  9:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27  8:46 [PR PATCH] " 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 ` voidlinux-github [this message]
2019-09-27  9:27 ` [PR PATCH] [Updated] " 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

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20190927092720.nClEpCISXDgs5WRJHKpMhTefFvnPf1lc0ylTjm7LZrY@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

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

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