summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Weiss <weiss@wsoptics.de>2015-11-03 13:16:31 (GMT)
committerTony Theodore <tonyt@logyst.com>2015-11-18 08:27:10 (GMT)
commit1118024f45c5e274bc1a82d0b14f25293302b809 (patch)
tree9a92e2e80b20c345b77d5b3c0c9e7068ea5d2f67
parentc62bcdbee56e87c81f1faa105b8777a5879d4e2e (diff)
downloadmxe-1118024f45c5e274bc1a82d0b14f25293302b809.zip
mxe-1118024f45c5e274bc1a82d0b14f25293302b809.tar.gz
mxe-1118024f45c5e274bc1a82d0b14f25293302b809.tar.bz2
Add Coin3D 3.1.3 (https://bitbucket.org/Coin3D/coin/wiki/Home)
-rw-r--r--index.html4
-rw-r--r--src/coin-1-fixes.patch153
-rw-r--r--src/coin-test.cpp24
-rw-r--r--src/coin.mk46
4 files changed, 227 insertions, 0 deletions
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)</pre>
<td class="website"><a href="http://devernay.free.fr/hacks/cminpack/cminpack.html">cminpack</a></td>
</tr>
<tr>
+ <td class="package">coin</td>
+ <td class="website"><a href="https://bitbucket.org/Coin3D/">Coin3D</a></td>
+ </tr>
+ <tr>
<td class="package">coreutils</td>
<td class="website"><a href="https://www.gnu.org/software/coreutils/">GNU Core Utilities</a></td>
</tr>
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<unsigned long>(reinterpret_cast<intptr_t>(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<DWORD>(reinterpret_cast<intptr_t>(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 <JSObject *> objects;
+ };
++#if defined(_WIN64)
++SbHash <void *, unsigned long long> * CoinVrmlJs_sensorinfohash = NULL;
++#else
+ SbHash <void *, unsigned long> * 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 <void *, unsigned long long>;
++#else
+ CoinVrmlJs_sensorinfohash = new SbHash <void *, unsigned long>;
++#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 <Inventor/C/errors/debugerror.h>
+#include <Inventor/nodes/SoCone.h>
+#include <Inventor/nodes/SoDirectionalLight.h>
+#include <Inventor/nodes/SoMaterial.h>
+#include <Inventor/nodes/SoPerspectiveCamera.h>
+#include <Inventor/nodes/SoSeparator.h>
+
+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