Commits

Brad Pitcher committed 91b37d2

libopencsg package

  • Participants
  • Parent commits aa369c7

Comments (0)

Files changed (1)

src/libopencsg.mk

+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+# libopencsg
+PKG             := libopencsg
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.3.1
+$(PKG)_CHECKSUM := d94c22d4e824c6b5e69a97a726b514ecaf9e4596
+$(PKG)_SUBDIR   := OpenCSG-$($(PKG)_VERSION)
+$(PKG)_FILE     := OpenCSG-$($(PKG)_VERSION).tar.gz
+$(PKG)_WEBSITE  := http://www.opencsg.org/
+$(PKG)_URL      := http://www.opencsg.org/$($(PKG)_FILE)
+$(PKG)_DEPS     := gcc freeglut glew qt
+
+define $(PKG)_UPDATE
+    wget -q -O- 'http://www.opencsg.org/#download' | \
+    grep 'OpenCSG-' | \
+    $(SED) -n 's,.*OpenCSG-\([0-9][^>]*\)\.tar.*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    cd '$(1)/src' && $(SED) -i 's/release/release staticlib\nDEFINES += FREEGLUT_STATIC GLEW_STATIC/g' src.pro
+    cd '$(1)/example' && $(SED) -i 's,\(lGLEW\),\1 $(PREFIX)/$(TARGET)/lib/libglew32s.a $(PREFIX)/$(TARGET)/lib/libglut.a $(PREFIX)/$(TARGET)/lib/libopengl32.a\nDEFINES += FREEGLUT_STATIC GLEW_STATIC,g' example.pro
+    cd '$(1)/example' && $(SED) -i 's,opencsgexample,test-libopencsg\nRelease:DESTDIR = $(PREFIX)/$(TARGET)/bin/,g' example.pro
+    cd '$(1)/src' && '$(TARGET)-qmake' src.pro && $(MAKE) -C '$(1)/src' -j '$(JOBS)'
+    cd '$(1)/example' && '$(TARGET)-qmake' example.pro && $(MAKE) -C '$(1)/example' -j '$(JOBS)'
+    $(INSTALL) -m644 '$(1)/lib/libopencsg.a' '$(PREFIX)/$(TARGET)/lib/'
+    $(INSTALL) -m644 '$(1)/include/opencsg.h' '$(PREFIX)/$(TARGET)/include/'
+endef