summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.html5
-rw-r--r--src/sfml-1-disable-merge-libs.patch32
-rw-r--r--src/sfml-2-static-openal.patch14
-rw-r--r--src/sfml-3-remove-dirty-installs.patch25
-rw-r--r--src/sfml-test.cpp46
-rw-r--r--src/sfml.mk34
6 files changed, 156 insertions, 0 deletions
diff --git a/index.html b/index.html
index de18b23..1b3081d 100644
--- a/index.html
+++ b/index.html
@@ -2147,6 +2147,11 @@ USE_OSGPLUGIN(<plugin2>)
<td id="sdl_ttf-website"><a href="http://www.libsdl.org/projects/SDL_ttf/">SDL_ttf</a></td>
</tr>
<tr>
+ <td id="sfml-package">sfml</td>
+ <td id="sfml-version">2.0</td>
+ <td id="sfml-website"><a href="http://www.sfml-dev.org/">SFML</a></td>
+ </tr>
+ <tr>
<td id="smpeg-package">smpeg</td>
<td id="smpeg-version">0.4.5+cvs20030824</td>
<td id="smpeg-website"><a href="http://icculus.org/smpeg/">smpeg</a></td>
diff --git a/src/sfml-1-disable-merge-libs.patch b/src/sfml-1-disable-merge-libs.patch
new file mode 100644
index 0000000..41b4cb5
--- /dev/null
+++ b/src/sfml-1-disable-merge-libs.patch
@@ -0,0 +1,32 @@
+This file is part of MXE.
+See index.html for further information.
+
+diff -urN SFML-2.0.orig/cmake/Macros.cmake SFML-2.0/cmake/Macros.cmake
+--- SFML-2.0.orig/cmake/Macros.cmake 2013-04-06 10:17:56.000000000 -0300
++++ SFML-2.0/cmake/Macros.cmake 2013-06-24 09:45:56.694654704 -0300
+@@ -11,25 +11,6 @@
+ # out-of-the-box (CMake forwards the dependencies automatically)
+ macro(sfml_static_add_libraries target)
+ if(WINDOWS AND COMPILER_GCC)
+- # Windows - gcc
+- foreach(lib ${ARGN})
+- if(NOT ${lib} MATCHES ".*/.*")
+- string(REGEX REPLACE "(.*)/bin/.*\\.exe" "\\1" STANDARD_LIBS_PATH "${CMAKE_CXX_COMPILER}")
+- if(COMPILER_GCC_W64)
+- set(lib "${STANDARD_LIBS_PATH}/${GCC_MACHINE}/lib/lib${lib}.a")
+- else()
+- set(lib "${STANDARD_LIBS_PATH}/lib/lib${lib}.a")
+- endif()
+- endif()
+- string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
+- get_target_property(TARGET_FILENAME ${target} ${BUILD_TYPE}_LOCATION)
+- add_custom_command(TARGET ${target}
+- POST_BUILD
+- COMMAND ${CMAKE_AR} x ${lib}
+- COMMAND ${CMAKE_AR} rcs ${TARGET_FILENAME} *.o
+- COMMAND del *.o /f /q
+- VERBATIM)
+- endforeach()
+ elseif(MSVC)
+ # Visual C++
+ set(LIBRARIES "")
diff --git a/src/sfml-2-static-openal.patch b/src/sfml-2-static-openal.patch
new file mode 100644
index 0000000..ecbf7f0
--- /dev/null
+++ b/src/sfml-2-static-openal.patch
@@ -0,0 +1,14 @@
+This file is part of MXE.
+See index.html for further information.
+
+diff -urN SFML-2.0.orig/CMakeLists.txt SFML-2.0/CMakeLists.txt
+--- SFML-2.0.orig/CMakeLists.txt 2013-02-25 20:16:00.000000000 -0300
++++ SFML-2.0/CMakeLists.txt 2013-06-24 10:39:42.514647661 -0300
+@@ -51,6 +51,7 @@
+ # define SFML_STATIC if the build type is not set to 'shared'
+ if(NOT BUILD_SHARED_LIBS)
+ add_definitions(-DSFML_STATIC)
++ add_definitions(-DAL_LIBTYPE_STATIC)
+ endif()
+
+ # remove SL security warnings with Visual C++
diff --git a/src/sfml-3-remove-dirty-installs.patch b/src/sfml-3-remove-dirty-installs.patch
new file mode 100644
index 0000000..d8eb32e
--- /dev/null
+++ b/src/sfml-3-remove-dirty-installs.patch
@@ -0,0 +1,25 @@
+This file is part of MXE.
+See index.html for further information.
+
+diff -urN SFML-2.0.orig/CMakeLists.txt SFML-2.0/CMakeLists.txt
+--- SFML-2.0.orig/CMakeLists.txt 2013-06-24 10:56:39.114645000 -0300
++++ SFML-2.0/CMakeLists.txt 2013-06-24 10:58:33.294645192 -0300
+@@ -187,18 +187,7 @@
+ COMPONENT devel)
+ endif()
+
+-install(FILES cmake/Modules/FindSFML.cmake DESTINATION ${INSTALL_MISC_DIR}/cmake/Modules)
+-install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR})
+-install(FILES readme.txt DESTINATION ${INSTALL_MISC_DIR})
+-
+ if(WINDOWS)
+- if(ARCH_32BITS)
+- install(FILES extlibs/bin/x86/libsndfile-1.dll DESTINATION bin)
+- install(FILES extlibs/bin/x86/openal32.dll DESTINATION bin)
+- elseif(ARCH_64BITS)
+- install(FILES extlibs/bin/x64/libsndfile-1.dll DESTINATION bin)
+- install(FILES extlibs/bin/x64/openal32.dll DESTINATION bin)
+- endif()
+ elseif(MACOSX)
+ install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
+ install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
diff --git a/src/sfml-test.cpp b/src/sfml-test.cpp
new file mode 100644
index 0000000..5c08538
--- /dev/null
+++ b/src/sfml-test.cpp
@@ -0,0 +1,46 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
+#include <SFML/Audio.hpp>
+#include <SFML/Network.hpp>
+#include <SFML/Graphics.hpp>
+
+using namespace sf;
+
+int main()
+{
+ // Create the main window
+ RenderWindow window(VideoMode(800, 600), "SFML window");
+
+ Music music;
+ Texture texture;
+ Font font;
+ Text text;
+ TcpSocket socket;
+
+ CircleShape shape(200);
+ shape.setPosition(200, 100);
+ shape.setFillColor(Color::Red);
+
+ while (window.isOpen())
+ {
+ // Process events
+ Event event;
+ while (window.pollEvent(event))
+ {
+ // Close window : exit
+ if (event.type == Event::Closed)
+ window.close();
+ }
+ // Clear screen
+ window.clear();
+ // Draw the sprite
+ window.draw(shape);
+ // Update the window
+ window.display();
+ }
+
+ return 0;
+}
diff --git a/src/sfml.mk b/src/sfml.mk
new file mode 100644
index 0000000..04a2bf8
--- /dev/null
+++ b/src/sfml.mk
@@ -0,0 +1,34 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := sfml
+$(PKG)_IGNORE :=
+$(PKG)_CHECKSUM := ff8cf290f49e1a1d8517a4a344e9214139da462f
+$(PKG)_SUBDIR := SFML-$($(PKG)_VERSION)
+$(PKG)_FILE := SFML-$($(PKG)_VERSION)-sources.zip
+$(PKG)_URL := http://sfml-dev.org/download/sfml/$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc freetype glew jpeg openal libsndfile
+
+define $(PKG)_UPDATE
+ $(WGET) -q -O- 'http://www.sfml-dev.org/download.php' | \
+ grep 'download/sfml/' | \
+ $(SED) -n 's,.*\([0-9.]\+\).*,\1,p' | \
+ head -1
+endef
+
+define $(PKG)_BUILD
+ mkdir '$(1)/build'
+ cd '$(1)/build' && cmake .. \
+ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)'
+
+ $(MAKE) -C '$(1)/build' -j '$(JOBS)' install VERBOSE=1
+
+ '$(TARGET)-g++' \
+ -W -Wall -Werror \
+ -DSFML_STATIC -DAL_LIBTYPE_STATIC \
+ '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-sfml.exe' \
+ -lsfml-audio-s -lsfml-network-s -lsfml-graphics-s -lsfml-window-s -lsfml-system-s \
+ -lGLEW -lopengl32 -lgdi32 -lOpenAL32 -lwinmm -luuid -lole32 -ljpeg \
+ -lsndfile -lws2_32 -lfreetype -lFLAC -lvorbisenc -lvorbis -logg -lm -lpng -lz -lbz2
+
+endef