summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKino2024-05-17 08:10:59 +0800
committerKino2024-05-17 08:10:59 +0800
commit499bc793f95f43c721d54b8a4dc5b550cf307275 (patch)
tree63f517f92f3dee46e1bd55e7b885383cca97478a
parent48b070758deed8e775a420280c6fb5a9f41508ef (diff)
downloadaur-499bc793f95f43c721d54b8a4dc5b550cf307275.tar.gz
upgpkg: 3.21.12-2; enable tests
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD60
-rw-r--r--eastl-implement-allocator.patch92
3 files changed, 37 insertions, 128 deletions
diff --git a/.SRCINFO b/.SRCINFO
index be8d5f969ccf..e906c6e10665 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,13 @@
pkgbase = eastl
pkgdesc = Electronic Arts Standard Template Library. It is an extensive and robust implementation that has an emphasis on high performance.
pkgver = 3.21.12
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/electronicarts/EASTL
arch = any
- license = BSD
- license = custom
+ license = BSD-3-Clause
makedepends = cmake
makedepends = git
- source = https://github.com/electronicarts/EASTL/archive/3.21.12.tar.gz
- source = EABase::git+https://github.com/electronicarts/EABase.git
- source = eastl-implement-allocator.patch
- sha256sums = 2a4d77e5eda23ec52fea8b22abbf2ea8002f38396d2a3beddda3ff2e17f7db2e
- sha256sums = SKIP
- sha256sums = cabc604045be6f901bc40c62f87e791af7a5f84b4857cfe1a149a653c8ed1166
+ source = git+https://github.com/electronicarts/EASTL.git#tag=3.21.12
+ sha256sums = 2c0fb5138a350a3773add4916860587b692799c2959c5dfa99c8e18093320c8a
pkgname = eastl
diff --git a/PKGBUILD b/PKGBUILD
index de5f8a44aa76..d0b039f2e6f1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,46 +3,52 @@
pkgname=eastl
_pkgname=EASTL
pkgver=3.21.12
-pkgrel=1
+pkgrel=2
pkgdesc="Electronic Arts Standard Template Library. It is an extensive and robust implementation that has an emphasis on high performance."
arch=('any')
url="https://github.com/electronicarts/EASTL"
-license=('BSD' 'custom')
-depends=()
+license=("BSD-3-Clause")
makedepends=("cmake" "git")
-source=(
- "https://github.com/electronicarts/EASTL/archive/${pkgver}.tar.gz"
- "EABase::git+https://github.com/electronicarts/EABase.git"
- "eastl-implement-allocator.patch"
- )
-
-sha256sums=('2a4d77e5eda23ec52fea8b22abbf2ea8002f38396d2a3beddda3ff2e17f7db2e'
- 'SKIP'
- 'cabc604045be6f901bc40c62f87e791af7a5f84b4857cfe1a149a653c8ed1166')
+source=("git+https://github.com/electronicarts/EASTL.git#tag=$pkgver")
+sha256sums=('2c0fb5138a350a3773add4916860587b692799c2959c5dfa99c8e18093320c8a')
prepare() {
- cd ${_pkgname}-${pkgver}
- cp -r ../EABase/* test/packages/EABase
- patch -p1 < ../eastl-implement-allocator.patch
+ cd $srcdir/$_pkgname
+
+ sed -i 's|url.*eastl/EASTL$|url = https://github.com/electronicarts/EASTL.git|g' .git/config
+ git submodule update --init
+
+ # Add missing install
+ sed -i '$a install(DIRECTORY include/Common/EABase DESTINATION include)' test/packages/EABase/CMakeLists.txt
}
build() {
- mkdir -p "${_pkgname}-${pkgver}/build"
-
- cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ cmake -B build -S $srcdir/$_pkgname \
+ -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
- -DEASTL_BUILD_TESTS=OFF \
- -DEASTL_BUILD_BENCHMARK=OFF \
-DBUILD_SHARED_LIBS=ON \
- -B"${srcdir}/${_pkgname}-${pkgver}/build" \
- -H"${srcdir}/${_pkgname}-${pkgver}"
+ -DEASTL_BUILD_TESTS=ON \
+ -DEASTL_BUILD_BENCHMARK=ON \
+ -DEASTL_STD_ITERATOR_CATEGORY_ENABLED=OFF \
+ -Wno-dev
+ cmake --build build
+}
- cmake --build "${srcdir}/${_pkgname}-${pkgver}/build"
+check() {
+ ctest --test-dir build/test -VV
}
package() {
- make DESTDIR="${pkgdir}" -C "${srcdir}/${_pkgname}-${pkgver}/build" install
- mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}"
- install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}"
- install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/3RDPARTYLICENSES.TXT" "${pkgdir}/usr/share/licenses/${pkgname}"
+ DESTDIR="$pkgdir" cmake --install build
+
+ install -Dm755 "${srcdir}/build/benchmark/EASTLBenchmarks" "${pkgdir}/usr/bin/EASTLBenchmarks"
+
+ install -Dm755 "${srcdir}/build/test/packages/EAAssert/libEAAssert.so" "${pkgdir}/usr/lib"
+ install -Dm755 "${srcdir}/build/test/packages/EAMain/libEAMain.so" "${pkgdir}/usr/lib"
+ install -Dm755 "${srcdir}/build/test/packages/EAStdC/libEAStdC.so" "${pkgdir}/usr/lib"
+ install -Dm755 "${srcdir}/build/test/packages/EATest/libEATest.so" "${pkgdir}/usr/lib"
+ install -Dm755 "${srcdir}/build/test/packages/EAThread/libEAThread.so" "${pkgdir}/usr/lib"
+
+ install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm644 "${srcdir}/${_pkgname}/3RDPARTYLICENSES.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/3RDPARTYLICENSES"
}
diff --git a/eastl-implement-allocator.patch b/eastl-implement-allocator.patch
deleted file mode 100644
index 039c3e945818..000000000000
--- a/eastl-implement-allocator.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-diff -ruN EASTL-3.18.00/include/EASTL/allocator.h EASTL-3.18.00_/include/EASTL/allocator.h
---- EASTL-3.18.00/include/EASTL/allocator.h 2023-01-30 14:49:47.133053092 +0800
-+++ EASTL-3.18.00_/include/EASTL/allocator.h 2023-01-30 14:52:58.180341764 +0800
-@@ -164,18 +164,6 @@
-
- #ifndef EASTL_USER_DEFINED_ALLOCATOR // If the user hasn't declared that he has defined a different allocator implementation elsewhere...
-
-- EA_DISABLE_ALL_VC_WARNINGS()
-- #include <new>
-- EA_RESTORE_ALL_VC_WARNINGS()
--
-- #if !EASTL_DLL // If building a regular library and not building EASTL as a DLL...
-- // It is expected that the application define the following
-- // versions of operator new for the application. Either that or the
-- // user needs to override the implementation of the allocator class.
-- void* operator new[](size_t size, const char* pName, int flags, unsigned debugFlags, const char* file, int line);
-- void* operator new[](size_t size, size_t alignment, size_t alignmentOffset, const char* pName, int flags, unsigned debugFlags, const char* file, int line);
-- #endif
--
- namespace eastl
- {
- inline allocator::allocator(const char* EASTL_NAME(pName))
-@@ -237,46 +225,17 @@
- #define pName EASTL_ALLOCATOR_DEFAULT_NAME
- #endif
-
-- #if EASTL_DLL
-- return allocate(n, EASTL_SYSTEM_ALLOCATOR_MIN_ALIGNMENT, 0, flags);
-- #elif (EASTL_DEBUGPARAMS_LEVEL <= 0)
-- return ::new((char*)0, flags, 0, (char*)0, 0) char[n];
-- #elif (EASTL_DEBUGPARAMS_LEVEL == 1)
-- return ::new( pName, flags, 0, (char*)0, 0) char[n];
-- #else
-- return ::new( pName, flags, 0, __FILE__, __LINE__) char[n];
-- #endif
-+ return malloc(n);
- }
-
-
- inline void* allocator::allocate(size_t n, size_t alignment, size_t offset, int flags)
- {
-- #if EASTL_DLL
-- // We currently have no support for implementing flags when
-- // using the C runtime library operator new function. The user
-- // can use SetDefaultAllocator to override the default allocator.
-- EA_UNUSED(offset); EA_UNUSED(flags);
--
-- size_t adjustedAlignment = (alignment > EA_PLATFORM_PTR_SIZE) ? alignment : EA_PLATFORM_PTR_SIZE;
--
-- void* p = new char[n + adjustedAlignment + EA_PLATFORM_PTR_SIZE];
-- void* pPlusPointerSize = (void*)((uintptr_t)p + EA_PLATFORM_PTR_SIZE);
-- void* pAligned = (void*)(((uintptr_t)pPlusPointerSize + adjustedAlignment - 1) & ~(adjustedAlignment - 1));
--
-- void** pStoredPtr = (void**)pAligned - 1;
-- EASTL_ASSERT(pStoredPtr >= p);
-- *(pStoredPtr) = p;
--
-- EASTL_ASSERT(((size_t)pAligned & ~(alignment - 1)) == (size_t)pAligned);
--
-- return pAligned;
-- #elif (EASTL_DEBUGPARAMS_LEVEL <= 0)
-- return ::new(alignment, offset, (char*)0, flags, 0, (char*)0, 0) char[n];
-- #elif (EASTL_DEBUGPARAMS_LEVEL == 1)
-- return ::new(alignment, offset, pName, flags, 0, (char*)0, 0) char[n];
-- #else
-- return ::new(alignment, offset, pName, flags, 0, __FILE__, __LINE__) char[n];
-- #endif
-+ EASTL_ASSERT(offset % alignmnent == 0); /* We check for (offset % alignmnent == 0) instead of (offset == 0) because any block which is aligned on e.g. 64 also is aligned at an offset of 64 by definition. */
-+ if (alignment <= EASTL_SYSTEM_ALLOCATOR_MIN_ALIGNMENT) {
-+ return allocate(n, flags);
-+ }
-+ return aligned_alloc(alignment, n);
-
- #undef pName // See above for the definition of this.
- }
-@@ -284,15 +243,7 @@
-
- inline void allocator::deallocate(void* p, size_t)
- {
-- #if EASTL_DLL
-- if (p != nullptr)
-- {
-- void* pOriginalAllocation = *((void**)p - 1);
-- delete[](char*)pOriginalAllocation;
-- }
-- #else
-- delete[](char*)p;
-- #endif
-+ free(p);
- }
-
-