mirror of
https://github.com/void-linux/void-packages.git
synced 2025-04-16 14:17:02 +02:00
New package: j-807
This commit is contained in:
parent
67970f2331
commit
bd0bf09dc3
5 changed files with 219 additions and 0 deletions
28
srcpkgs/j/files/profilex_template.ijs
Normal file
28
srcpkgs/j/files/profilex_template.ijs
Normal file
|
@ -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'
|
11
srcpkgs/j/patches/crossbuild-jconsole.patch
Normal file
11
srcpkgs/j/patches/crossbuild-jconsole.patch
Normal file
|
@ -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"
|
61
srcpkgs/j/patches/crossbuild-libj.patch
Normal file
61
srcpkgs/j/patches/crossbuild-libj.patch
Normal file
|
@ -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
|
||||
|
117
srcpkgs/j/template
Normal file
117
srcpkgs/j/template
Normal file
|
@ -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
|
||||
}
|
2
srcpkgs/j/update
Normal file
2
srcpkgs/j/update
Normal file
|
@ -0,0 +1,2 @@
|
|||
site='https://jsoftware.com/indexno.html'
|
||||
pattern='The latest release is \K[\d]+(=?\.)'
|
Loading…
Add table
Reference in a new issue