From 1118024f45c5e274bc1a82d0b14f25293302b809 Mon Sep 17 00:00:00 2001 From: Christoph Weiss Date: Tue, 3 Nov 2015 14:16:31 +0100 Subject: Add Coin3D 3.1.3 (https://bitbucket.org/Coin3D/coin/wiki/Home) --- index.html | 4 ++ src/coin-1-fixes.patch | 153 +++++++++++++++++++++++++++++++++++++++++++++++++ src/coin-test.cpp | 24 ++++++++ src/coin.mk | 46 +++++++++++++++ 4 files changed, 227 insertions(+) create mode 100644 src/coin-1-fixes.patch create mode 100644 src/coin-test.cpp create mode 100644 src/coin.mk diff --git a/index.html b/index.html index 0541cfe..ebd9f28 100644 --- a/index.html +++ b/index.html @@ -1175,6 +1175,10 @@ local-pkg-list: $(LOCAL_PKG_LIST) cminpack + coin + Coin3D + + coreutils GNU Core Utilities diff --git a/src/coin-1-fixes.patch b/src/coin-1-fixes.patch new file mode 100644 index 0000000..cb5ced1 --- /dev/null +++ b/src/coin-1-fixes.patch @@ -0,0 +1,153 @@ +This file is part of MXE. +See index.html for further information. + +This patch has been taken from: https://bitbucket.org/msys2/coin/commits/69e9990b05cee506f5fa16c6edad02a7808bc610/raw/ + +It was modified to work with Coin 3.1.3. +(The order of the template arguments of SbHash was switched.) + +diff --git a/include/Inventor/C/glue/spidermonkey.h b/include/Inventor/C/glue/spidermonkey.h +--- a/include/Inventor/C/glue/spidermonkey.h ++++ b/include/Inventor/C/glue/spidermonkey.h +@@ -56,7 +56,7 @@ + Structs and defines. + */ + typedef int JSBool; +-typedef long jsword; ++typedef intmax_t jsword; + typedef jsword jsval; + typedef jsword jsid; + typedef int intN; +diff --git a/src/foreignfiles/SoSTLFileKit.cpp b/src/foreignfiles/SoSTLFileKit.cpp +--- a/src/foreignfiles/SoSTLFileKit.cpp ++++ b/src/foreignfiles/SoSTLFileKit.cpp +@@ -566,14 +566,14 @@ + SO_GET_ANY_PART(this, "facets", SoIndexedFaceSet); + + // find existing indexes if any +- long v1idx = PRIVATE(this)->points->findPoint(v1), v1new = (v1idx == -1); +- long v2idx = PRIVATE(this)->points->findPoint(v2), v2new = (v2idx == -1); +- long v3idx = PRIVATE(this)->points->findPoint(v3), v3new = (v3idx == -1); +- if (!v1new) { v1idx = (long) PRIVATE(this)->points->getUserData(v1idx); } +- if (!v2new) { v2idx = (long) PRIVATE(this)->points->getUserData(v2idx); } +- if (!v3new) { v3idx = (long) PRIVATE(this)->points->getUserData(v3idx); } +- long nidx = PRIVATE(this)->normals->findPoint(n); +- if (nidx != -1) { nidx = (long) PRIVATE(this)->normals->getUserData(nidx); } ++ intmax_t v1idx = PRIVATE(this)->points->findPoint(v1), v1new = (v1idx == -1); ++ intmax_t v2idx = PRIVATE(this)->points->findPoint(v2), v2new = (v2idx == -1); ++ intmax_t v3idx = PRIVATE(this)->points->findPoint(v3), v3new = (v3idx == -1); ++ if (!v1new) { v1idx = (intmax_t) PRIVATE(this)->points->getUserData(v1idx); } ++ if (!v2new) { v2idx = (intmax_t) PRIVATE(this)->points->getUserData(v2idx); } ++ if (!v3new) { v3idx = (intmax_t) PRIVATE(this)->points->getUserData(v3idx); } ++ intmax_t nidx = PRIVATE(this)->normals->findPoint(n); ++ if (nidx != -1) { nidx = (intmax_t) PRIVATE(this)->normals->getUserData(nidx); } + + // toss out invalid facets - facets where two or more points are in + // the same location. what are these - are they lines and points or +diff --git a/src/threads/thread.cpp b/src/threads/thread.cpp +--- a/src/threads/thread.cpp ++++ b/src/threads/thread.cpp +@@ -130,7 +130,7 @@ + void + cc_sleep(float seconds) + { +-#ifndef _WIN32 ++#if !defined(_WIN32) || defined(__MINGW32__) + /* FIXME: 20011107, thammer: create a configure macro to detect + * which sleep function is available */ + sleep(floor(seconds)); +@@ -164,7 +164,7 @@ + assert(0 && "unexpected failure"); + } + } +- return (unsigned long) val; ++ return static_cast(reinterpret_cast(val)); + } + + static void +diff --git a/src/threads/thread_win32.icc b/src/threads/thread_win32.icc +--- a/src/threads/thread_win32.icc ++++ b/src/threads/thread_win32.icc +@@ -38,7 +38,7 @@ + cc_w32thread_thread_proc(LPVOID lpParameter) + { + cc_thread *thread = (cc_thread *)lpParameter; +- return (DWORD) thread->func(thread->closure); ++ return static_cast(reinterpret_cast(thread->func(thread->closure))); + } + + static int +diff --git a/src/vrml97/JS_VRMLClasses.cpp b/src/vrml97/JS_VRMLClasses.cpp +--- a/src/vrml97/JS_VRMLClasses.cpp ++++ b/src/vrml97/JS_VRMLClasses.cpp +@@ -110,8 +110,11 @@ + struct CoinVrmlJs_SensorInfo { + SbList objects; + }; ++#if defined(_WIN64) ++SbHash * CoinVrmlJs_sensorinfohash = NULL; ++#else + SbHash * CoinVrmlJs_sensorinfohash = NULL; +- ++#endif + + const char * CoinVrmlJs_SFColorAliases[] = {"r", "g", "b"}; + const char * CoinVrmlJs_SFRotationAliases[] = {"x", "y", "z", "angle"}; +@@ -674,7 +677,11 @@ + { + SoNode * node = ((SoNodeSensor *) sensor)->getAttachedNode(); + void * tmp; ++#if defined(_WIN64) ++ if(!CoinVrmlJs_sensorinfohash->get((unsigned long long) node, tmp)) { ++#else + if(!CoinVrmlJs_sensorinfohash->get((unsigned long) node, tmp)) { ++#endif + assert(FALSE && "Trying to delete an unregistered SoNodeSensor. Internal error."); + return; + } +@@ -690,7 +697,11 @@ + + // Store the sensor-pointer so that it can be properly deleted later + nodesensorstobedeleted->append((SoNodeSensor *) sensor); ++#if defined(_WIN64) ++ CoinVrmlJs_sensorinfohash->remove((unsigned long long) node); ++#else + CoinVrmlJs_sensorinfohash->remove((unsigned long) node); ++#endif + delete si; + } + +@@ -1428,13 +1439,21 @@ + { + // Has the hash-table been initialized? + if (!CoinVrmlJs_sensorinfohash) { ++#if defined(_WIN64) ++ CoinVrmlJs_sensorinfohash = new SbHash ; ++#else + CoinVrmlJs_sensorinfohash = new SbHash ; ++#endif + coin_atexit(deleteSensorInfoHash, CC_ATEXIT_NORMAL); + } + + // Is a sensor already attached to this SoNode? + void * tmp; ++#if defined(_WIN64) ++ if (CoinVrmlJs_sensorinfohash->get((unsigned long long) node, tmp)) { ++#else + if (CoinVrmlJs_sensorinfohash->get((unsigned long) node, tmp)) { ++#endif + CoinVrmlJs_SensorInfo * si = (CoinVrmlJs_SensorInfo *) tmp; + si->objects.append(obj); + } +@@ -1444,7 +1463,11 @@ + ns->attach(node); + CoinVrmlJs_SensorInfo * si = new CoinVrmlJs_SensorInfo; + si->objects.append(obj); ++#if defined(_WIN64) ++ CoinVrmlJs_sensorinfohash->put((unsigned long long) node, si); ++#else + CoinVrmlJs_sensorinfohash->put((unsigned long) node, si); ++#endif + } + } + diff --git a/src/coin-test.cpp b/src/coin-test.cpp new file mode 100644 index 0000000..0974407 --- /dev/null +++ b/src/coin-test.cpp @@ -0,0 +1,24 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include +#include +#include +#include +#include + +int main() +{ + SoSeparator *root = new SoSeparator; + SoPerspectiveCamera *myCamera = new SoPerspectiveCamera; + SoMaterial *myMaterial = new SoMaterial; + root->ref(); + root->addChild(myCamera); + root->addChild(new SoDirectionalLight); + myMaterial->diffuseColor.setValue(1.0, 0.0, 0.0); + root->addChild(myMaterial); + root->addChild(new SoCone); +} diff --git a/src/coin.mk b/src/coin.mk new file mode 100644 index 0000000..c903777 --- /dev/null +++ b/src/coin.mk @@ -0,0 +1,46 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := coin +$(PKG)_IGNORE := +$(PKG)_VERSION := 3.1.3 +$(PKG)_CHECKSUM := 583478c581317862aa03a19f14c527c3888478a06284b9a46a0155fa5886d417 +$(PKG)_SUBDIR := Coin-$($(PKG)_VERSION) +$(PKG)_FILE := Coin-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := https://bitbucket.org/Coin3D/coin/downloads/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + $(WGET) -q -O- 'https://bitbucket.org/Coin3D/coin/downloads' | \ + $(SED) -n 's,.*Coin-\([0-9.]*\).tar.gz.*,\1,p' | \ + $(SORT) -V | \ + $(TAIL) -n1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + $(MXE_CONFIGURE_OPTS) \ + --disable-debug \ + --disable-symbols \ + --enable-compact \ + --without-openal \ + --without-fontconfig \ + --without-spidermonkey \ + --without-freetype \ + --without-zlib \ + --without-bzip2 \ + --without-x \ + $(if $(BUILD_STATIC), \ + --enable-static=yes --enable-shared=no, \ + --enable-static=no --enable-shared=yes) + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install + '$(TARGET)-g++' \ + -W -Wall -pedantic '$(2).cpp' \ + $(if $(BUILD_STATIC), \ + -DCOIN_NOT_DLL, \ + -DCOIN_DLL) \ + -o '$(PREFIX)/$(TARGET)/bin/test-coin.exe' \ + `'$(PREFIX)/$(TARGET)/bin/coin-config' --libs` \ + -I`'$(PREFIX)/$(TARGET)/bin/coin-config' --includedir` +endef -- cgit v0.12