j: update to 901.d.

This commit is contained in:
B. Wilson 2020-01-21 10:51:34 +09:00 committed by Leah Neukirchen
parent 41a9d70b35
commit 038c76952e
3 changed files with 62 additions and 107 deletions

View file

@ -1,19 +0,0 @@
--- make/build_jconsole.sh 2019-12-17 18:25:11.713700768 +0900
+++ make/build_jconsole.sh 2019-12-17 18:26:45.090341029 +0900
@@ -5,6 +5,7 @@
cd ~
macmin="-mmacosx-version-min=10.6"
+ccver=$(${CC} --version)
USE_LINENOISE="${USE_LINENOISE:=1}"
if [ "x$CC" = x'' ] ; then
@@ -20,7 +21,7 @@
export CC
fi
-if [ $CC = "gcc" ] ; then
+if [ -z "${ccver##*(GCC)*}" ]; then
# gcc
common=" -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses"
OVER_GCC_VER6=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 6 | bc)

View file

@ -1,25 +0,0 @@
--- make/build_libj.sh 2020-01-19 11:41:50.017038941 +0900
+++ make/build_libj.sh 2020-01-19 11:47:52.455846176 +0900
@@ -10,19 +10,20 @@
# too early to move main linux release package to gcc 5
macmin="-mmacosx-version-min=10.6"
+ccver=$(${CC} --version)
USE_OPENMP="${USE_OPENMP:=0}"
if [ $USE_OPENMP -eq 1 ] ; then
OPENMP=" -fopenmp "
LDOPENMP=" -fopenmp "
-if [ -z "${$CCcc##*gcc*}" ] || [ -z "${CC##*gcc*}" ]; then
+if [ -z "${ccver##*(GCC)*}" ]; then
LDOPENMP32=" -l:libgomp.so.1 " # gcc
else
LDOPENMP32=" -l:libomp.so.5 " # clang
fi
fi
-if [ $CC = "gcc" ] ; then
+if [ -z "${ccver##*(GCC)*}" ]; then
# gcc
common="$OPENMP -Werror -fPIC -O2 -fwrapv -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-type-limits"
GNUC_MAJOR=$(echo __GNUC__ | $CC -E -x c - | tail -n 1)

View file

@ -1,7 +1,7 @@
# Template file for 'j' # Template file for 'j'
pkgname=j pkgname=j
_vmaj=901 _vmaj=901
_vmin=c _vmin=d
_vrel=${_vmaj}-release${_vmin:+-}${_vmin} _vrel=${_vmaj}-release${_vmin:+-}${_vmin}
version=${_vmaj}.${_vmin} version=${_vmaj}.${_vmin}
revision=1 revision=1
@ -14,7 +14,7 @@ maintainer="B. Wilson <x@wilsonb.com>"
license="GPL-3.0-or-later" license="GPL-3.0-or-later"
homepage="https://jsoftware.com/" homepage="https://jsoftware.com/"
distfiles="https://github.com/jsoftware/jsource/archive/j${_vrel}.tar.gz" distfiles="https://github.com/jsoftware/jsource/archive/j${_vrel}.tar.gz"
checksum=3e7b7f9ea8e23bf055bee0761ea8928e7ff616131b7ab66918956404d8750252 checksum=5d581c3587253566375f4229dd76ec4108f6eea80d7e4ccf5725328c9f8b408a
_jsz="j${XBPS_TARGET_WORDSIZE}" _jsz="j${XBPS_TARGET_WORDSIZE}"
_jtype="release" _jtype="release"
@ -25,8 +25,8 @@ _jetc="/etc/j"
_juser=".j" _juser=".j"
case "${XBPS_TARGET_MACHINE}" in case "${XBPS_TARGET_MACHINE}" in
aarch64*) _jplatform="raspberry";; aarch64*) _jpl="raspberry";;
*) _jplatform="linux";; *) _jpl="linux";;
esac esac
case "${XBPS_TARGET_MACHINE}" in case "${XBPS_TARGET_MACHINE}" in
@ -34,88 +34,87 @@ case "${XBPS_TARGET_MACHINE}" in
esac esac
## do_configure() {
# Crossbuilds do not distinguish between AVX- and non-AVX-enabled targets, so sed "/jversion/s@${_vmaj}@${_vrel}@
# here we build libraries for both cases. /jplatform/s@unknown@${_jpl}@
do_build() {
sed "/jplatform/s@unknown@${_jplatform}@
/jtype/s@beta@${_jtype}@ /jtype/s@beta@${_jtype}@
/jbuilder/s@unknown@${_jbuilder}@" \ /jbuilder/s@unknown@${_jbuilder}@" \
jsrc/jversion-x.h > jsrc/jversion.h 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}@ sed -i "/^install=./s@/usr/share/j/[0-9.]\+@${_jshare}@
/^user=./s@home,userx@home,'/${_juser}'@" \ /^user=./s@home,userx@home,'/${_juser}'@" \
jlibrary/bin/profile.ijs 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} # Crossbuilds do not distinguish between AVX- and non-AVX targets, so instead
jc=${2} # we build all applicable binaries.
libj=${3} do_build() {
jplatform=${_jpl} j64x=${_jsz} make2/build_jconsole.sh
jplatform=${_jpl} j64x=${_jsz} make2/build_libj.sh
for f in "${dir}"/*.ijs; do if [ "${_jsz}" = 'j64' ]; then
printf '%s(%s): ' "${f}" "${libj}" jplatform=${_jpl} j64x=${_jsz}avx make2/build_jconsole.sh
if ${jc} -lib "${libj}" <"${f}" >/dev/null; then jplatform=${_jpl} j64x=${_jsz}avx make2/build_libj.sh
echo "PASS"
else jplatform=${_jpl} j64x=${_jsz}avx2 make2/build_jconsole.sh
echo "FAIL" jplatform=${_jpl} j64x=${_jsz}avx2 make2/build_libj.sh
return 1 fi
fi
done
} }
do_check() { do_check() {
ln -srf jlibrary/bin/* build/${_jsz}/bin/ if [ -d "${_jlib}/j64avx2" ] \
ln -srf jlibrary/{addons,system,tools} build/${_jsz}/ && sed -n '/^flags/{s/\<avx2\>//;t;q1}' /proc/cpuinfo; then
javx='avx2'
# Test AVX-enabled library if all host CPUs have AVX flag set elif [ -d "${_jlib}/j64avx" ] \
if sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then && sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; then
_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj.so" javx='avx'
else
javx=''
fi fi
_runtestdir ./test "build/${_jsz}/bin/jconsole" "libj-nonavx.so"
ln -srf jlibrary/bin/* bin/${_jpl}/${_jsz}${javx}/
ln -srf jlibrary/{addons,system,tools} bin/${_jpl}/
echo 'RECHO ddall' | "bin/${_jpl}/${_jsz}${javx}/jconsole" test/tsu.ijs
}
##
# Script to detect AVX/AVX2 support and launch appropriate jconsole binary
_jconsole_wrapper_script() {
cat <<JC
#!/usr/bin/env sh
cpu_has_avx() { sed -n '/^flags/{s/\<avx\>//;t;q1}' /proc/cpuinfo; }
cpu_has_avx2() { sed -n '/^flags/{s/\<avx2\>//;t;q1}' /proc/cpuinfo; }
if [ -d "${_jlib}/j64avx2" ] && cpu_has_avx2; then
javx='avx2'
elif [ -d "${_jlib}/j64avx" ] && cpu_has_avx; then
javx='avx'
elif [ -d "${_jlib}/j64" ]; then
javx=''
else
>&2 echo "\${0}: Cannot find jconsole executable"
exit 1
fi
${_jlib}/${_jsz}\${javx}/jconsole -jprofile "${_jetc}/profile.ijs" "\${@}"
JC
} }
do_install() { do_install() {
vmkdir "${_jshare}" 0755 vmkdir "${_jshare}" 0755
vcopy jlibrary/addons "${_jshare}"
vcopy jlibrary/system "${_jshare}" vcopy jlibrary/system "${_jshare}"
vcopy jlibrary/tools "${_jshare}" vcopy jlibrary/tools "${_jshare}"
vmkdir "${_jlib}" 0755 vmkdir "${_jlib}" 0755
vinstall "build/${_jsz}/bin/jconsole" 755 "${_jlib}" vcopy "bin/${_jpl}/*" "${_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 vmkdir "${_jetc}" 0755
vinstall "${FILESDIR}/profilex_template.ijs" 644 "${_jetc}" vinstall "${FILESDIR}/profilex_template.ijs" 644 "${_jetc}"
vinstall "jlibrary/bin/profile.ijs" 644 "${_jetc}" vinstall "jlibrary/bin/profile.ijs" 644 "${_jetc}"
cat >build/${_jsz}/bin/jc.sh <<-JC _jconsole_wrapper_script >bin/jc.sh
#!/usr/bin/env sh vbin "bin/jc.sh" jc
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
} }