From 5832d3b707c991d8243891f571837e0c48c75180 Mon Sep 17 00:00:00 2001 From: Josh Heidenreich Date: Wed, 29 Jan 2014 09:06:27 +1030 Subject: [PATCH] add package assimp --- index.html | 4 ++++ src/assimp-test.c | 31 +++++++++++++++++++++++++++++++ src/assimp.mk | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 src/assimp-test.c create mode 100644 src/assimp.mk diff --git a/index.html b/index.html index 7afd25cd..aa019e79 100644 --- a/index.html +++ b/index.html @@ -1115,6 +1115,10 @@ local-pkg-list: $(LOCAL_PKG_LIST) armadillo Armadillo C++ linear algebra library + + assimp + Assimp Open Asset Import Library + atk ATK diff --git a/src/assimp-test.c b/src/assimp-test.c new file mode 100644 index 00000000..24866cf1 --- /dev/null +++ b/src/assimp-test.c @@ -0,0 +1,31 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + const struct aiScene* scene = NULL; + + /* NFF file for a single spere with radius 5 at pos 0x0x0 */ + const char* buf = + "--- begin of file\n" + "s 0 0 0 5\n" + "--- end of file\n"; + + (void)argc; + (void)argv; + + scene = aiImportFileFromMemory(buf, strlen(buf), aiProcessPreset_TargetRealtime_MaxQuality, "nff"); + (void)scene; + + if (scene->mNumMeshes != 1) return 1; + + aiReleaseImport(scene); + return 0; +} diff --git a/src/assimp.mk b/src/assimp.mk new file mode 100644 index 00000000..7a94034d --- /dev/null +++ b/src/assimp.mk @@ -0,0 +1,32 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := assimp +$(PKG)_IGNORE := +$(PKG)_VERSION := 3.0 +$(PKG)_VERBUILD := 3.0.1270 +$(PKG)_CHECKSUM := e80a3a4326b649ed6585c0ce312ed6dd68942834 +$(PKG)_SUBDIR := $(PKG)--$($(PKG)_VERBUILD)-source-only +$(PKG)_FILE := $(PKG)--$($(PKG)_VERBUILD)-source-only.zip +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)-$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc boost + +define $(PKG)_UPDATE + $(WGET) -q -O- "http://sourceforge.net/projects/assimp/files/assimp/" | \ + grep 'assimp/files/assimp' | \ + $(SED) -n 's,.*assimp/\([0-9][^>]*\)/.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && cmake . \ + -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ + -DBUILD_ASSIMP_TOOLS=OFF \ + -DBUILD_ASSIMP_SAMPLES=OFF + $(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1 + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-assimp.exe' \ + `'$(TARGET)-pkg-config' assimp --cflags --libs` +endef