diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/sfml |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/sfml')
-rw-r--r-- | community/sfml/PKGBUILD | 96 | ||||
-rw-r--r-- | community/sfml/sfml.install | 3 | ||||
-rw-r--r-- | community/sfml/use-system-libs.patch | 70 |
3 files changed, 169 insertions, 0 deletions
diff --git a/community/sfml/PKGBUILD b/community/sfml/PKGBUILD new file mode 100644 index 000000000..00f1d39c9 --- /dev/null +++ b/community/sfml/PKGBUILD @@ -0,0 +1,96 @@ +# $Id: PKGBUILD 23743 2010-08-16 10:49:18Z svenstaro $ +# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> +# Contributor: scj <scj archlinux us> + +pkgname=sfml +pkgver=1.6 +pkgrel=3 +pkgdesc="A simple, fast, cross-platform and object-oriented multimedia API." +arch=('i686' 'x86_64') +url="http://www.sfml-dev.org" +license=('custom:zlib') +depends=('libxrandr' 'libsndfile' 'openal' 'glew' 'libjpeg' 'libpng' 'soil' 'zlib' 'freetype2') +optdepends=('qt: build qt-sample' 'wxgtk: build wxwidgets-sample') +install=sfml.install +source=(http://downloads.sourceforge.net/${pkgname}/SFML-${pkgver}-sdk-linux-64.tar.gz + use-system-libs.patch) +md5sums=('7a9b3a1ef6d14cd25090e440ccdbb3a8' + '505ea908fb6e4b9359061d8d55373963') + +build() { + cd "${srcdir}/SFML-${pkgver}" + + # apply patch to use system libs in favor of included ones (fixes many problems) + patch -Np1 < ../use-system-libs.patch + + # compile sfml + make + + # prepare samples + sed -e '/export LDFLAGS/d' -i samples/Makefile + + #check optional dependencies + if [ ! -e "/usr/bin/wx-config" ]; then + sed -e 's/wxwidgets-sample //' -i samples/Makefile + fi + if [ ! -e "/usr/include/QtGui" ]; then + sed -e 's/qt-sample //' -i samples/Makefile + fi + + # fix some samples + sed -e 's|qt4/||g' -i samples/qt/Makefile + sed -e '/#include <iostream>/a\#include <stdlib.h>' -i \ + samples/sockets/Sockets.cpp \ + samples/voip/VoIP.cpp + + # fix the library softlinks for samples + cd lib + for lib in *; do + ln -sf $lib ${lib/.${pkgver}/} + done + cd .. + + # compile samples + LDFLAGS="-L${srcdir}/SFML-${pkgver}/lib" make sfml-samples +} + +package() { + cd "${srcdir}/SFML-${pkgver}" + + # prepare some dirs + mkdir -p ${pkgdir}/usr/lib \ + ${pkgdir}/usr/include \ + ${pkgdir}/usr/share/sfml \ + ${pkgdir}/usr/share/doc \ + ${pkgdir}/opt/SFML + + # install it + sed '/export DESTDIR/d' -i src/SFML/Makefile + make DESTDIR="${pkgdir}/usr" install + + # fix the library softlinks - again + cd ${pkgdir}/usr/lib + rm *.so + for lib in *; do + ln -s $lib ${lib/.${pkgver}/} + done + cd "${srcdir}/SFML-${pkgver}" + + # install samples + cp -r samples ${pkgdir}/opt/SFML/samples + + # install docs + cp -r doc ${pkgdir}/usr/share/doc/sfml + + # handy symlinks + cd ${pkgdir}/usr/share/sfml + ln -s ../../../opt/SFML/samples samples + ln -s ../doc/sfml docs + + # install license + install -Dm 644 ${srcdir}/SFML-${pkgver}/license.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + # clean up + find "${pkgdir}/opt/SFML/samples" -name "*.o" -delete +} +# vim:set ts=2 sw=2 et: diff --git a/community/sfml/sfml.install b/community/sfml/sfml.install new file mode 100644 index 000000000..9d18b5251 --- /dev/null +++ b/community/sfml/sfml.install @@ -0,0 +1,3 @@ +post_install() { + echo "To view the SFML samples, go to /opt/SFML/samples/bin and run them individually" +} diff --git a/community/sfml/use-system-libs.patch b/community/sfml/use-system-libs.patch new file mode 100644 index 000000000..5d3200225 --- /dev/null +++ b/community/sfml/use-system-libs.patch @@ -0,0 +1,70 @@ +Only in SFML-1.6-old/lib: libsfml-graphics.so.1.6 +Binary files SFML-1.6-old/lib/libsfml-network.so.1.6 and SFML-1.6/lib/libsfml-network.so.1.6 differ +Binary files SFML-1.6-old/lib/libsfml-system.so.1.6 and SFML-1.6/lib/libsfml-system.so.1.6 differ +Binary files SFML-1.6-old/lib/libsfml-window.so.1.6 and SFML-1.6/lib/libsfml-window.so.1.6 differ +diff -ur SFML-1.6-old/src/SFML/Graphics/ImageLoader.cpp SFML-1.6/src/SFML/Graphics/ImageLoader.cpp +--- SFML-1.6-old/src/SFML/Graphics/ImageLoader.cpp 2010-01-27 15:00:05.000000000 +0100 ++++ SFML-1.6/src/SFML/Graphics/ImageLoader.cpp 2010-08-16 12:27:33.983627625 +0200 +@@ -28,10 +28,10 @@ + #include <SFML/Graphics/ImageLoader.hpp>
+ extern "C"
+ {
+- #include <SFML/Graphics/libjpeg/jpeglib.h>
+- #include <SFML/Graphics/libjpeg/jerror.h>
++ #include <jpeglib.h>
++ #include <jerror.h>
+ }
+-#include <SFML/Graphics/libpng/png.h>
++#include <png.h>
+ #include <SFML/Graphics/SOIL/SOIL.h>
+ #include <iostream>
+
+Only in SFML-1.6-old/src/SFML/Graphics: ImageLoader.cpp.rej +diff -ur SFML-1.6-old/src/SFML/Graphics/Makefile SFML-1.6/src/SFML/Graphics/Makefile +--- SFML-1.6-old/src/SFML/Graphics/Makefile 2010-01-27 15:00:05.000000000 +0100 ++++ SFML-1.6/src/SFML/Graphics/Makefile 2010-08-16 12:25:13.663501212 +0200 +@@ -1,15 +1,5 @@ + SRC = $(wildcard *.cpp)
+-SRCGLEW = $(wildcard ./GLEW/*.c)
+-SRCJPEG = $(wildcard ./libjpeg/*.c)
+-SRCPNG = $(wildcard ./libpng/*.c)
+-SRCSOIL = $(wildcard ./SOIL/*.c)
+-SRCZLIB = $(wildcard ./zlib/*.c)
+ OBJ = $(SRC:.cpp=.o)
+-OBJGLEW = $(SRCGLEW:.c=.o)
+-OBJJPEG = $(SRCJPEG:.c=.o)
+-OBJPNG = $(SRCPNG:.c=.o)
+-OBJSOIL = $(SRCSOIL:.c=.o)
+-OBJZLIB = $(SRCZLIB:.c=.o)
+
+ ifeq ($(STATIC), yes)
+ LIB = libsfml-graphics-s.a
+@@ -23,22 +13,19 @@ +
+ all: $(LIB)
+
+-libsfml-graphics-s.a: $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
+- $(AR) $(ARFLAGS) $(LIBNAME) $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
++libsfml-graphics-s.a: $(OBJ)
++ $(AR) $(ARFLAGS) $(LIBNAME) $(OBJ) -static -lGLEW -ljpeg -lpng -lsoil -lz -lSOIL
+
+-libsfml-graphics.so: $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
+- $(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB) -lfreetype -lX11 -lGL
++libsfml-graphics.so: $(OBJ)
++ $(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) -lGLEW -ljpeg -lpng -lSOIL -lz -lfreetype -lX11 -lGL
+
+ $(OBJ): %.o: %.cpp
+ $(CPP) -o $@ -c $< $(CFLAGS) -I/usr/include/freetype2
+
+-$(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB): %.o: %.c
+- $(CC) -o $@ -c $< $(CFLAGSEXT) -DSTBI_FAILURE_USERMSG
+-
+ .PHONY: clean mrproper
+
+ clean:
+- @rm -rf $(OBJ) $(OBJGLEW) $(OBJJPEG) $(OBJPNG) $(OBJSOIL) $(OBJZLIB)
++ @rm -rf $(OBJ)
+
+ mrproper: clean
+ @rm -rf $(LIBNAME)
+Only in SFML-1.6-old/src/SFML/Graphics: Makefile.rej |