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