Skip to content

Commit

Permalink
coin added patch from fedora
Browse files Browse the repository at this point in the history
fixes segfaults in freecad
  • Loading branch information
demmm committed Jun 13, 2017
1 parent c900902 commit 42b69a6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
27 changes: 9 additions & 18 deletions coin/PKGBUILD
@@ -1,27 +1,25 @@

pkgname=coin
pkgver=3.1.3
pkgrel=4
pkgrel=5
pkgdesc='High-level 3D graphics toolkit on top of OpenGL'
url='https://bitbucket.org/Coin3D/coin/wiki/Home'
license=('GPL')
arch=('x86_64')
depends=('libgl' 'expat')
depends=('libgl' 'expat' 'openal' 'fontconfig' 'zlib' 'freetype2' 'js')
makedepends=('doxygen')
optdepends=('openal: sound/dynamic linking support'
'fontconfig: dynamic linking support'
'zlib: dynamic linking support'
'freetype2: dynamic linking support'
'js: dynamic linking support')
options=('!libtool')
source=("https://bitbucket.org/Coin3D/coin/downloads/Coin-${pkgver}.tar.gz")
md5sums=('1538682f8d92cdf03e845c786879fbea')
source=("https://bitbucket.org/Coin3D/coin/downloads/Coin-${pkgver}.tar.gz"
'memhandler.patch')
md5sums=('1538682f8d92cdf03e845c786879fbea'
'25897deed88fdaf6a4950fce79211f9f')

build() {
cd Coin-${pkgver}

sed -i '/^#include "fonts\/freetype.h"$/i #include <cstdlib>\n#include <cmath>' src/fonts/freetype.cpp
#sed -i '/^#include "fonts\/freetype.h"$/i #include <cstdlib>\n#include <cmath>' src/fonts/freetype.cpp
sed -i '/^#include <Inventor\/C\/basic.h>$/i #include <Inventor/C/errors/debugerror.h>' include/Inventor/SbBasic.h
patch -p1 -i ${srcdir}/memhandler.patch

./configure \
--prefix=/usr \
Expand All @@ -47,13 +45,6 @@ package() {
cd Coin-${pkgver}
make DESTDIR=${pkgdir} install

for _FILE in threads deprecated errors events ; do
mv ${pkgdir}/usr/share/man/man3/${_FILE}.3 ${pkgdir}/usr/share/man/man3/coin-${_FILE}.3
done
# man pages conflicting with perl
rm ${pkgdir}/usr/share/man/man3/fields.3
rm ${pkgdir}/usr/share/man/man3/base.3
# not needed
rm ${pkgdir}/usr/share/man/man3/_build*
rm -r ${pkgdir}/usr/share/man/man3
}

19 changes: 19 additions & 0 deletions coin/memhandler.patch
@@ -0,0 +1,19 @@
--- Coin-3.1.3/src/misc/SbHash.h.init 2010-03-02 22:20:09.000000000 +0900
+++ Coin-3.1.3/src/misc/SbHash.h 2016-04-22 16:52:39.888883757 +0900
@@ -89,6 +89,8 @@
cc_memalloc_deallocate(entry->memhandler, ptr);
}
SbHashEntry(const Key & key, const Type & obj) : key(key), obj(obj) {}
+ SbHashEntry(const Key & key, const Type & obj, cc_memalloc *memhandler)
+ : key(key), obj(obj), memhandler(memhandler) {}

Key key;
Type obj;
@@ -218,7 +220,7 @@
/* Key not already in the hash table; insert a new
* entry as the first element in the bucket
*/
- entry = new (this->memhandler) SbHashEntry<Type, Key>(key, obj);
+ entry = new (this->memhandler) SbHashEntry<Type, Key>(key, obj, this->memhandler);
entry->next = this->buckets[i];
this->buckets[i] = entry;

0 comments on commit 42b69a6

Please sign in to comment.