Skip to content

Commit

Permalink
alembic: update to 1.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune authored Apr 9, 2022
1 parent 8bc0893 commit 94ca40a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,29 @@ diff -Naur alembic-1.7.9.orig/lib/Alembic/AbcCoreOgawa/ReadUtil.cpp alembic-1.7.
diff -Naur alembic-1.7.9.orig/lib/Alembic/AbcCoreOgawa/StreamManager.cpp alembic-1.7.9/lib/Alembic/AbcCoreOgawa/StreamManager.cpp
--- alembic-1.7.9.orig/lib/Alembic/AbcCoreOgawa/StreamManager.cpp 2018-10-12 17:05:37.151983900 -0400
+++ alembic-1.7.9/lib/Alembic/AbcCoreOgawa/StreamManager.cpp 2018-10-12 17:08:47.009950000 -0400
@@ -46,10 +46,10 @@
#if !defined( ALEMBIC_LIB_USES_TR1 ) && __cplusplus >= 201103L
@@ -46,7 +46,7 @@
#if __cplusplus >= 201103L
#define COMPARE_EXCHANGE( V, COMP, EXCH ) V.compare_exchange_weak( COMP, EXCH, std::memory_order_seq_cst, std::memory_order_seq_cst )
// Windows
-#elif defined( _MSC_VER )
+#elif defined( _WIN32 )
#define COMPARE_EXCHANGE( V, COMP, EXCH ) (InterlockedCompareExchange64( &V, EXCH, COMP ) == COMP)
#elif defined( __HAIKU__ )

@@ -61,10 +61,10 @@
#error Please contact [email protected] for support.
#endif

-#ifdef _MSC_VER
+#ifdef _WIN32

#ifdef _WIN64
-Alembic::Util::int64_t ffsll( Alembic::Util::int64_t iValue )
+Alembic::Util::int64_t __builtin_ffsll( Alembic::Util::int64_t iValue )
{
if ( !iValue )
{
@@ -138,7 +138,7 @@
unsigned long index = 0;
_BitScanForward64(&index, iValue);
@@ -130,7 +130,7 @@
do
{
oldVal = m_streams;
Expand Down Expand Up @@ -121,14 +130,6 @@ diff -Naur alembic-1.7.9.orig/lib/Alembic/Ogawa/IStreams.cpp alembic-1.7.9/lib/A
diff -Naur alembic-1.7.9.orig/lib/Alembic/Util/Foundation.h alembic-1.7.9/lib/Alembic/Util/Foundation.h
--- alembic-1.7.9.orig/lib/Alembic/Util/Foundation.h 2018-10-12 17:05:37.058224500 -0400
+++ alembic-1.7.9/lib/Alembic/Util/Foundation.h 2018-10-12 17:10:58.673701400 -0400
@@ -51,7 +51,6 @@
#include <boost/foreach.hpp>
#include <boost/unordered_map.hpp>

-// tr1 is not available in older versions of Visual Studio i.e. _MSC_VER <= 1600
#elif defined(ALEMBIC_LIB_USES_TR1)
#include <tr1/memory>
#include <tr1/unordered_map>
@@ -83,7 +82,7 @@

#include <Alembic/Util/Export.h>
Expand Down
52 changes: 27 additions & 25 deletions mingw-w64-alembic/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_realname=alembic
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.7.16
pkgver=1.8.3
pkgrel=1
pkgdesc="A open framework for storing and sharing scene data (mingw-w64)"
arch=('any')
Expand All @@ -14,84 +14,86 @@ depends=("${MINGW_PACKAGE_PREFIX}-openexr"
"${MINGW_PACKAGE_PREFIX}-boost"
"${MINGW_PACKAGE_PREFIX}-hdf5"
"${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-cc"
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-boost")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/alembic/${_realname}/archive/${pkgver}.tar.gz"
"0001-alembic-1.7.9-fix-windows-build.patch"
"0002-alembic-1.7.9-remove-msc_ver-and-fix-builtins-and-includes.patch")
sha512sums=('bd4777dc4abf15bfb8307b00fd2d67671e89944d0dd8a74a657f4aee49e6a1cd0ab1fe5bb7f9afc63abcce2123466bb8a9a3886d41724ed2c242bc61d7d5b3a1'
'29d6d68e7b82b8d71b6d29b83d846e3c2e11369e2ff7b99c84053b8e7c27cf8a09d451069c918613fd0f9adb8f6df763434a089704253e2985c16f8829fcfb9f'
'e3f69356519d000004d68836c09340a78830c671f00bd9e317d798fa91b72c4d879e938ab2fc1e935775c193b9622dca2c42327aff5ee3d0e185e3a1a402a9d9')
"0002-alembic-1.7.9-remove-msc_ver-and-fix-builtins-and-includes.patch"
"https://patch-diff.githubusercontent.com/raw/alembic/alembic/pull/373.patch")
sha256sums=('b0bc74833bff118a869e81e6acb810a58797e77ef63143954b2f8e817c7f65cb'
'83f80cca3c27bc1ffcfc772010e12c05756178e1107768f55391069db7dde0d0'
'639eec0611f3f40a74003e58946f556e6e4e0a54c85f10bcda8c3da1b1de6a81'
'1f80151b776d6fe9a3bc7b556797a03625a7f95a4f125b3d05d4407ab922f9e9')

prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
patch -Np1 -i "${srcdir}/0001-alembic-1.7.9-fix-windows-build.patch"
# Fix Building on 32bit envs
patch -Np1 -i "${srcdir}/373.patch"
patch -Np1 -i "${srcdir}/0002-alembic-1.7.9-remove-msc_ver-and-fix-builtins-and-includes.patch"
}

build() {
# Static Build
cd "${srcdir}"/${_realname}-${pkgver}
[[ -d "${srcdir}"/build-${CARCH}-static ]] && rm -rf "${srcdir}"/build-${CARCH}-static
mkdir -p "${srcdir}"/build-${CARCH}-static && cd "${srcdir}"/build-${CARCH}-static
[[ -d "${srcdir}"/build-${MSYSTEM}-static ]] && rm -rf "${srcdir}"/build-${MSYSTEM}-static
mkdir -p "${srcdir}"/build-${MSYSTEM}-static && cd "${srcdir}"/build-${MSYSTEM}-static

declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

export ILMBASE_ROOT=${MINGW_PREFIX}
export OPENEXR_ROOT=${MINGW_PREFIX}
export PYILMBASE_ROOT=${MINGW_PREFIX}

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G'MSYS Makefiles' \
-G'Ninja' \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
-DUSE_HDF5=ON \
-DALEMBIC_ILMBASE_LINK_STATIC=OFF \
-DALEMBIC_SHARED_LIBS=0 \
../${_realname}-${pkgver}

make
${MINGW_PREFIX}/bin/cmake --build .

# Shared Build
cd "${srcdir}"/${_realname}-${pkgver}
[[ -d "${srcdir}"/build-${CARCH}-shared ]] && rm -rf "${srcdir}"/build-${CARCH}-shared
mkdir -p "${srcdir}"/build-${CARCH}-shared && cd "${srcdir}"/build-${CARCH}-shared
[[ -d "${srcdir}"/build-${MSYSTEM}-shared ]] && rm -rf "${srcdir}"/build-${MSYSTEM}-shared
mkdir -p "${srcdir}"/build-${MSYSTEM}-shared && cd "${srcdir}"/build-${MSYSTEM}-shared

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G'MSYS Makefiles' \
-G'Ninja' \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
-DUSE_HDF5=ON \
-DUSE_PYALEMBIC=OFF \
-DALEMBIC_SHARED_LIBS=1 \
../${_realname}-${pkgver}

make
${MINGW_PREFIX}/bin/cmake --build .
}

package() {

# Static Install
cd "${srcdir}"/build-${CARCH}-static
make install DESTDIR="${pkgdir}"
cd "${srcdir}"/build-${MSYSTEM}-static
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .

# Shared Install
cd "${srcdir}"/build-${CARCH}-shared
make install DESTDIR="${pkgdir}"
cd "${srcdir}"/build-${MSYSTEM}-shared
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .

local WINPREFIX=$(cygpath -wm ${MINGW_PREFIX})
# Fix paths
sed -i "s|${WINPREFIX}|${MINGW_PREFIX}|g" \
${pkgdir}${MINGW_PREFIX}/lib/cmake/Alembic/AlembicTargets.cmake \
${pkgdir}${MINGW_PREFIX}/lib/cmake/Alembic/AlembicTargets-release.cmake

install -Dm644 ${srcdir}/${_realname}-${pkgver}/LICENSE.txt "${pkgdir}${MINGW_PREFIX}"/share/licenses/${_realname}/LICENSE
}

0 comments on commit 94ca40a

Please sign in to comment.