Browse Source

add package sfml

gtk-stack-updates
Guilherme Bernal 9 years ago
committed by Tony Theodore
parent
commit
86b660d258
  1. 5
      index.html
  2. 32
      src/sfml-1-disable-merge-libs.patch
  3. 14
      src/sfml-2-static-openal.patch
  4. 25
      src/sfml-3-remove-dirty-installs.patch
  5. 46
      src/sfml-test.cpp
  6. 34
      src/sfml.mk

5
index.html

@ -2146,6 +2146,11 @@ USE_OSGPLUGIN(<plugin2>)
<td id="sdl_ttf-version">2.0.11</td>
<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>

32
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 "")

14
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++

25
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})

46
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;
}

34
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
Loading…
Cancel
Save