From dd60b2f8178502417471ba931b7dc030a38731ae Mon Sep 17 00:00:00 2001 From: Daniele Di Proietto Date: Sat, 2 Nov 2013 13:08:26 +0100 Subject: Added glfw (version 2) package --- index.html | 4 ++++ src/glfw2-1-no-build-test.patch | 25 +++++++++++++++++++++++++ src/glfw2-test.c | 28 ++++++++++++++++++++++++++++ src/glfw2.mk | 26 ++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 src/glfw2-1-no-build-test.patch create mode 100644 src/glfw2-test.c create mode 100644 src/glfw2.mk diff --git a/index.html b/index.html index 9248838..fd87131 100644 --- a/index.html +++ b/index.html @@ -1351,6 +1351,10 @@ local-pkg-list: $(LOCAL_PKG_LIST) GLEW + glfw2 + GLEW + + glib GLib diff --git a/src/glfw2-1-no-build-test.patch b/src/glfw2-1-no-build-test.patch new file mode 100644 index 0000000..3f26022 --- /dev/null +++ b/src/glfw2-1-no-build-test.patch @@ -0,0 +1,25 @@ +This file is part of MXE. +See index.html for further information. + +Do not waste time building examples and tests. We use our test + +--- a/Makefile ++++ b/Makefile +@@ -128,13 +128,13 @@ + + cross-mgw: + cd lib/win32 && $(MAKE) -f Makefile.win32.cross-mgw +- cd examples && $(MAKE) -f Makefile.win32.cross-mgw +- cd tests && $(MAKE) -f Makefile.win32.cross-mgw ++ #cd examples && $(MAKE) -f Makefile.win32.cross-mgw ++ #cd tests && $(MAKE) -f Makefile.win32.cross-mgw + + cross-mgw-clean: + cd lib/win32 && $(MAKE) -f Makefile.win32.cross-mgw clean +- cd examples && $(MAKE) -f Makefile.win32.cross-mgw clean +- cd tests && $(MAKE) -f Makefile.win32.cross-mgw clean ++ #cd examples && $(MAKE) -f Makefile.win32.cross-mgw clean ++ #cd tests && $(MAKE) -f Makefile.win32.cross-mgw clean + + + ########################################################################### diff --git a/src/glfw2-test.c b/src/glfw2-test.c new file mode 100644 index 0000000..8542147 --- /dev/null +++ b/src/glfw2-test.c @@ -0,0 +1,28 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include + +int main(void) +{ + /* Initialise GLFW */ + if( !glfwInit() ) + { + return EXIT_FAILURE; + } + + /* Open a window and create its OpenGL context */ + if( !glfwOpenWindow( 640, 480, 0,0,0,0, 0,0, GLFW_WINDOW ) ) + { + glfwTerminate(); + return EXIT_FAILURE; + } + + /* Close OpenGL window and terminate GLFW*/ + glfwTerminate(); + + return EXIT_SUCCESS; +} diff --git a/src/glfw2.mk b/src/glfw2.mk new file mode 100644 index 0000000..ef7d91b --- /dev/null +++ b/src/glfw2.mk @@ -0,0 +1,26 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := glfw2 +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.7.9 +$(PKG)_CHECKSUM := b189922e9804062a0014a3799b4dc35431034623 +$(PKG)_SUBDIR := glfw-$($(PKG)_VERSION) +$(PKG)_FILE := glfw-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/glfw/glfw/$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + echo 'TODO: write update script for $(PKG).' >&2; + echo $($(PKG)_VERSION) +endef + +define $(PKG)_BUILD + $(MAKE) -C '$(1)' -j '$(JOBS)' cross-mgw-install TARGET=$(TARGET)- PREFIX='$(PREFIX)/$(TARGET)' + + #Test + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-glfw.exe' \ + `'$(TARGET)-pkg-config' libglfw --cflags --libs` +endef -- cgit v0.12