From e4dae813f107de0c28986db3019441930161b3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sun, 1 Dec 2019 08:45:07 +0100 Subject: [PATCH] ilmbase: update to 2.4.0 Use qemu-user-static to run binaries for the target. [ci skip] --- common/shlibs | 10 +-- srcpkgs/ilmbase/files/eLut.sh | 39 ---------- srcpkgs/ilmbase/files/toFloat.sh | 71 ------------------- .../patches/ilmbase-2.0.1-no_undefined.patch | 22 ------ srcpkgs/ilmbase/patches/musl-_fpstate.patch | 21 ++++++ .../ilmbase/patches/pkgconfig-prefix.patch | 15 ++++ srcpkgs/ilmbase/template | 36 +++++----- 7 files changed, 57 insertions(+), 157 deletions(-) delete mode 100644 srcpkgs/ilmbase/files/eLut.sh delete mode 100644 srcpkgs/ilmbase/files/toFloat.sh delete mode 100644 srcpkgs/ilmbase/patches/ilmbase-2.0.1-no_undefined.patch create mode 100644 srcpkgs/ilmbase/patches/musl-_fpstate.patch create mode 100644 srcpkgs/ilmbase/patches/pkgconfig-prefix.patch diff --git a/common/shlibs b/common/shlibs index 40a39de1873..e3b3266ef2b 100644 --- a/common/shlibs +++ b/common/shlibs @@ -1655,11 +1655,11 @@ libtcmalloc_minimal_debug.so.4 gperftools-2.1.90_1 libtcmalloc_debug.so.4 gperftools-2.1.90_1 libprofiler.so.0 gperftools-2.1.90_1 libtcmalloc_and_profiler.so.4 gperftools-2.1.90_1 -libHalf.so.24 ilmbase-2.3.0_1 -libIex-2_3.so.24 ilmbase-2.3.0_1 -libIexMath-2_3.so.24 ilmbase-2.3.0_1 -libImath-2_3.so.24 ilmbase-2.3.0_1 -libIlmThread-2_3.so.24 ilmbase-2.3.0_1 +libHalf-2_4.so.24 ilmbase-2.4.0_1 +libIex-2_4.so.24 ilmbase-2.4.0_1 +libIexMath-2_4.so.24 ilmbase-2.4.0_1 +libImath-2_4.so.24 ilmbase-2.4.0_1 +libIlmThread-2_4.so.24 ilmbase-2.4.0_1 libIlmImf-2_3.so.24 libopenexr-2.3.0_1 libIlmImfUtil-2_3.so.24 libopenexr-2.3.0_1 libGraphicsMagick.so.3 libgraphicsmagick-1.3.19_1 diff --git a/srcpkgs/ilmbase/files/eLut.sh b/srcpkgs/ilmbase/files/eLut.sh deleted file mode 100644 index 4467333e009..00000000000 --- a/srcpkgs/ilmbase/files/eLut.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -eLut() { - local i=$1 - e=$(((i & 0xff) - (127 - 15))) - j=$((i>>8)) - if [ $e -le 0 -o $e -ge 30 ]; then - # Special case - echo "0" - elif [ $j -eq 0 ]; then - # Common case - normalized half, no exponent overflow possible - echo $((e << 10)) - else - echo $(((e << 10) | 0x8000)) - fi -} - -echo "//" -echo "// This is an automatically generated file." -echo "// Do not edit." -echo "//" -echo "" -echo "{" -echo -n " " - -i=0 -j=0 -while [ $i -lt 512 ]; do - out="$(eLut $i)" - printf "%7s," $out - j=$((j + 1)) - if [ $j -eq 8 ]; then - j=0 - printf "\n" - [ $i -lt 511 ] && printf " " - fi - i=$((i + 1)) -done -echo "};" diff --git a/srcpkgs/ilmbase/files/toFloat.sh b/srcpkgs/ilmbase/files/toFloat.sh deleted file mode 100644 index 3373ea30762..00000000000 --- a/srcpkgs/ilmbase/files/toFloat.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -halfToFloat() { - local s=$1 e=$2 m=$3 - if [ $e -eq 0 ]; then - if [ $m -eq 0 ]; then - # Plus or minus zero - echo $((s << 31)) - return - else - # Denormalized number -- renormalize it - while [ $((m & 0x400)) -eq 0 ]; do - m=$((m << 1)) - e=$((e - 1)) - done - e=$((e + 1)) - m=$((m & 0x3ff)) - fi - elif [ $e -eq 31 ]; then - if [ "$m" -eq 0 ]; then - # Positive or negative infinity - echo $(((s << 31) | 0x7f800000)) - return - else - # Nan - preserve sign and significand bits - echo $(((s << 31) | 0x7f800000 | (m << 13))) - return - fi - fi - # Normalized number - e=$((e + (127 - 15))) - m=$((m << 13)) - # Assemble s, e and m - echo $(((s << 31) | (e << 23) | m)) -} - - -echo "//" -echo "// This is an automatically generated file." -echo "// Do not edit." -echo "//" -echo "" -echo "{" -echo -n " " - -s=0 -m=0 -e=0 -j=0 -k=0 -while [ $s -lt 2 ]; do - while [ $e -lt 32 ]; do - while [ $m -lt 1024 ]; do - out="$(halfToFloat $s $e $m)" - printf "{0x%08x}, " $out - m=$((m + 1)) - j=$((j + 1)) - if [ $j -eq 4 ]; then - printf "\n" - k=$((k + 1)) - [ $k -lt 16384 ] && printf " " - j=0 - fi - done - m=0 - e=$((e + 1)) - done - e=0 - s=$((s + 1)) -done -echo "};" diff --git a/srcpkgs/ilmbase/patches/ilmbase-2.0.1-no_undefined.patch b/srcpkgs/ilmbase/patches/ilmbase-2.0.1-no_undefined.patch deleted file mode 100644 index d2e44b2bb0a..00000000000 --- a/srcpkgs/ilmbase/patches/ilmbase-2.0.1-no_undefined.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- IlmThread/Makefile.am.no_undefined 2013-06-18 14:51:38.000000000 -0500 -+++ IlmThread/Makefile.am 2013-08-28 21:04:25.793391766 -0500 -@@ -14,7 +14,7 @@ libIlmThread_la_LDFLAGS = -version-info - if LIB_SUFFIX_EXISTS - libIlmThread_la_LDFLAGS += -release @LIB_SUFFIX@ - endif --libIlmThread_la_LIBADD = ../Iex/libIex.la -+libIlmThread_la_LIBADD = ../Iex/libIex.la $(PTHREAD_LIBS) - - libIlmThreadincludedir = $(includedir)/OpenEXR - ---- IlmThread/Makefile.in.no_undefined 2013-06-18 14:55:24.000000000 -0500 -+++ IlmThread/Makefile.in 2013-08-28 21:04:55.395049371 -0500 -@@ -253,7 +253,7 @@ libIlmThread_la_SOURCES = IlmThreadPool. - - libIlmThread_la_LDFLAGS = -version-info @LIBTOOL_VERSION@ \ - -no-undefined $(am__append_1) --libIlmThread_la_LIBADD = ../Iex/libIex.la -+libIlmThread_la_LIBADD = ../Iex/libIex.la $(PTHREAD_LIBS) - libIlmThreadincludedir = $(includedir)/OpenEXR - libIlmThreadinclude_HEADERS = IlmThreadPool.h IlmThread.h \ - IlmThreadSemaphore.h IlmThreadMutex.h \ diff --git a/srcpkgs/ilmbase/patches/musl-_fpstate.patch b/srcpkgs/ilmbase/patches/musl-_fpstate.patch new file mode 100644 index 00000000000..f7e6b371ed5 --- /dev/null +++ b/srcpkgs/ilmbase/patches/musl-_fpstate.patch @@ -0,0 +1,21 @@ +--- IlmBase/IexMath/IexMathFpu.cpp.orig 2019-12-01 15:42:08.143387128 +0100 ++++ IlmBase/IexMath/IexMathFpu.cpp 2019-12-01 15:43:02.402389927 +0100 +@@ -281,10 +281,18 @@ + inline void + restoreControlRegs (const ucontext_t & ucon, bool clearExceptions) + { ++#if defined(__GLIBC__) || defined(__i386__) + setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal); ++#else ++ setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal); ++#endif + + _fpstate * kfp = reinterpret_cast<_fpstate *> (ucon.uc_mcontext.fpregs); ++#if defined(__GLIBC__) || defined(__i386__) + setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions); ++#else ++ setMxcsr (kfp->mxcsr, clearExceptions); ++#endif + } + + #endif diff --git a/srcpkgs/ilmbase/patches/pkgconfig-prefix.patch b/srcpkgs/ilmbase/patches/pkgconfig-prefix.patch new file mode 100644 index 00000000000..4d514f926e5 --- /dev/null +++ b/srcpkgs/ilmbase/patches/pkgconfig-prefix.patch @@ -0,0 +1,15 @@ +--- IlmBase/IlmBase.pc.in.orig 2019-09-18 03:02:06.000000000 +0200 ++++ IlmBase/IlmBase.pc.in 2019-12-01 19:18:24.067056545 +0100 +@@ -4,9 +4,9 @@ + ## + + prefix=@prefix@ +-exec_prefix=@exec_prefix@ +-libdir=@libdir@ +-includedir=@includedir@ ++exec_prefix=${prefix}/@exec_prefix@ ++libdir=${prefix}/@libdir@ ++includedir=${prefix}/@includedir@ + libsuffix=@LIB_SUFFIX_DASH@ + Name: IlmBase + Description: Base math and exception libraries diff --git a/srcpkgs/ilmbase/template b/srcpkgs/ilmbase/template index 0e956595259..15a6db6f050 100644 --- a/srcpkgs/ilmbase/template +++ b/srcpkgs/ilmbase/template @@ -1,30 +1,26 @@ # Template file for 'ilmbase' pkgname=ilmbase -version=2.3.0 +version=2.4.0 revision=1 -build_style=gnu-configure +wrksrc="openexr-${version}" +build_wrksrc=IlmBase +build_style=cmake +build_helper="qemu" short_desc="Base libraries from ILM for OpenEXR" maintainer="Orphaned " -license="BSD" -homepage="http://www.openexr.com" -distfiles="https://github.com/openexr/openexr/releases/download/v${version}/ilmbase-${version}.tar.gz" -checksum=456978d1a978a5f823c7c675f3f36b0ae14dba36638aeaa3c4b0e784f12a3862 +license="BSD-3-Clause" +homepage="https://www.openexr.com/" +distfiles="https://github.com/openexr/openexr/archive/v${version}.tar.gz>${pkgname}-${version}.tar.gz" +checksum=4904c5ea7914a58f60a5e2fbc397be67e7a25c380d7d07c1c31a3eefff1c92f1 -LDFLAGS="-lpthread" - -pre_build() { - if [ -n "$CROSS_BUILD" ]; then - # Copy shell script header generators - slow but working - cp ${FILESDIR}/*.sh ${wrksrc}/Half - sed -i Half/Makefile \ - -e "/eLut.h: eLut/s;$;.sh;" \ - -e "s;\./eLut > eLut.h;sh eLut.sh > eLut.h;" \ - -e "/toFloat.h: toFloat/s;$;.sh;" \ - -e "s;\./toFloat > toFloat.h;sh toFloat.sh > toFloat.h;" +pre_configure() { + if [ "$CROSS_BUILD" ]; then + vsed -i Half/CMakeLists.txt \ + -e "s; COMMAND ; COMMAND qemu-${XBPS_TARGET_QEMU_MACHINE}-static ;g" fi } post_install() { - vlicense LICENSE + vlicense ../LICENSE.md } ilmbase-devel_package() { @@ -32,8 +28,8 @@ ilmbase-devel_package() { depends="${sourcepkg}>=${version}_${revision}" pkg_install() { vmove usr/include - vmove usr/lib/*.a - vmove usr/lib/*.so + vmove usr/lib/cmake vmove usr/lib/pkgconfig + vmove "usr/lib/*.so" } }