community/polymake to 4.1-1

This commit is contained in:
Kevin Mihelich 2020-06-15 18:31:22 +00:00
parent 38049eec2d
commit 5c67c8221f
2 changed files with 6 additions and 105 deletions

View file

@ -7,8 +7,8 @@
highmem=1
pkgname=polymake
pkgver=4.0.r1
pkgrel=6
pkgver=4.1
pkgrel=1
_perlver=5.30.3
pkgdesc="Open source software for research in polyhedral geometry"
arch=(x86_64)
@ -18,17 +18,11 @@ depends=(normaliz singular ppl lrs perl-xml-writer perl-xml-libxml perl-xml-libx
perl-term-readline-gnu perl-term-readkey perl-json sympol perl=$_perlver)
makedepends=(ninja cddlib ant boost bliss libnsl jdk8-openjdk permlib)
optdepends=('java-runtime: java module')
source=("https://polymake.org/lib/exe/fetch.php/download/polymake-${pkgver/.r/r}-minimal.tar.bz2"
polymake-gcc10.patch)
sha256sums=('b29de50dda6f657f2e82ef6acff62df1b51128a20c5d53bd97226ea22fdc3b52'
'64095f8688d70d88003eb67fe2c9ddc056033205aaeed19b264859c85589578c')
prepare() {
patch -d polymake-${pkgver%.*} -p0 -i ../polymake-gcc10.patch # Fix build with GCC 10 (Fedora)
}
source=("https://polymake.org/lib/exe/fetch.php/download/polymake-${pkgver/.r/r}-minimal.tar.bz2")
sha256sums=('7e8d45bce800007e5c26ce5b7b5ac95731cbfc99df021e715abeb494ae550ac9')
build() {
cd polymake-${pkgver%.*}
cd polymake-$pkgver
./configure \
--prefix=/usr \
--with-cdd=/usr \
@ -40,6 +34,6 @@ build() {
}
package() {
cd polymake-${pkgver%.*}
cd polymake-$pkgver
make DESTDIR="$pkgdir" install
}

View file

@ -1,93 +0,0 @@
--- lib/core/include/internal/pool_allocator.h.orig 2020-02-19 02:55:20.000000000 -0700
+++ lib/core/include/internal/pool_allocator.h 2020-02-19 20:30:07.385673716 -0700
@@ -33,15 +33,15 @@ namespace pm {
class allocator : public PM_ALLOCATOR_BASE<char> {
using base_t = PM_ALLOCATOR_BASE<char>;
public:
- void* allocate(size_t n)
+ void* allocate(std::size_t n)
{
return base_t::allocate(n, nullptr);
}
- void deallocate(void* p, size_t n)
+ void deallocate(void* p, std::size_t n)
{
base_t::deallocate(reinterpret_cast<char*>(p), n);
}
- void* reallocate(void* p, size_t old_sz, size_t new_sz);
+ void* reallocate(void* p, std::size_t old_sz, std::size_t new_sz);
template <typename Data, typename... Args>
Data* construct(Args&&... args)
--- lib/core/src/lib_init.cc.orig 2020-02-19 02:55:20.000000000 -0700
+++ lib/core/src/lib_init.cc 2020-02-19 20:30:07.386673716 -0700
@@ -17,6 +17,7 @@
#include "polymake/internal/pool_allocator.h"
+#include <cstddef>
#include <cstring>
#include <memory>
#include <cstdlib>
@@ -24,7 +25,7 @@
#include <gmp.h>
extern "C" {
- void* __gmp_default_allocate(size_t);
+ void* __gmp_default_allocate(std::size_t);
}
namespace pm {
@@ -36,19 +37,19 @@ namespace {
class pool_allocator_constants : public __gnu_cxx::__pool_alloc_base {
public:
- static constexpr size_t align = _S_align, limit = _S_max_bytes;
+ static constexpr std::size_t align = _S_align, limit = _S_max_bytes;
};
}
-void* pm::allocator::reallocate(void* p, size_t old_sz, size_t new_sz)
+void* pm::allocator::reallocate(void* p, std::size_t old_sz, std::size_t new_sz)
{
if (!p) {
assert(old_sz == 0);
return allocate(new_sz);
}
static const bool use_new = getenv("GLIBCPP_FORCE_NEW") || getenv("GLIBCXX_FORCE_NEW");
- constexpr size_t align_mask = pool_allocator_constants::align-1;
+ constexpr std::size_t align_mask = pool_allocator_constants::align-1;
if (!use_new && ((old_sz+align_mask) & ~align_mask) == ((new_sz+align_mask) & ~align_mask) && new_sz < pool_allocator_constants::limit)
return p;
void* new_p = allocate(new_sz);
@@ -61,7 +62,7 @@ void* pm::allocator::reallocate(void* p,
#else // libc++
-void* pm::allocator::reallocate(void* p, size_t old_sz, size_t new_sz)
+void* pm::allocator::reallocate(void* p, std::size_t old_sz, std::size_t new_sz)
{
void* new_p = allocate(new_sz);
if (new_p) {
@@ -76,16 +77,16 @@ void* pm::allocator::reallocate(void* p,
namespace {
allocator gmp_allocator;
-void* pm_gmp_allocate(size_t n) { return gmp_allocator.allocate(n); }
-void pm_gmp_deallocate(void* p, size_t n) { gmp_allocator.deallocate(p, n); }
-void* pm_gmp_reallocate(void* p, size_t old_sz, size_t new_sz) { return gmp_allocator.reallocate(p, old_sz, new_sz); }
+void* pm_gmp_allocate(std::size_t n) { return gmp_allocator.allocate(n); }
+void pm_gmp_deallocate(void* p, std::size_t n) { gmp_allocator.deallocate(p, n); }
+void* pm_gmp_reallocate(void* p, std::size_t old_sz, std::size_t new_sz) { return gmp_allocator.reallocate(p, old_sz, new_sz); }
void init_gmp_memory_management() __attribute__((constructor));
void init_gmp_memory_management()
{
// switch to custom GMP allocators only if no other component did it before
- typedef void* (*alloc_t)(size_t);
+ typedef void* (*alloc_t)(std::size_t);
alloc_t was_alloc;
mp_get_memory_functions(&was_alloc, nullptr, nullptr);
if (was_alloc == &__gmp_default_allocate)