summaryrefslogtreecommitdiff
path: root/community/vbam
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-10-12 00:05:36 -0700
committerroot <root@rshg054.dnsready.net>2013-10-12 00:05:36 -0700
commit20bff71e3bf43ce7f3621da9cee37eb6ea3c14ad (patch)
treeb334b815f671a193959abd9378c0859168f0080e /community/vbam
parentc38c20f4261c973628038df011b526c6ad4e0489 (diff)
Sat Oct 12 00:05:35 PDT 2013
Diffstat (limited to 'community/vbam')
-rwxr-xr-xcommunity/vbam/PKGBUILD106
-rwxr-xr-xcommunity/vbam/sfml.patch181
-rwxr-xr-xcommunity/vbam/soil.patch51
-rwxr-xr-xcommunity/vbam/vbam-gtk.install14
-rwxr-xr-xcommunity/vbam/vbam-wx.install13
5 files changed, 365 insertions, 0 deletions
diff --git a/community/vbam/PKGBUILD b/community/vbam/PKGBUILD
new file mode 100755
index 000000000..3ea2ab4e0
--- /dev/null
+++ b/community/vbam/PKGBUILD
@@ -0,0 +1,106 @@
+# $Id: PKGBUILD 98482 2013-10-11 16:52:10Z alucryd $
+# Maintainer: Maxime Gauduin <alucryd@gmail.com>
+# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+
+pkgbase=vbam
+pkgname=('vbam-cli' 'vbam-gtk' 'vbam-wx')
+pkgver=1.8.0.1202
+pkgrel=1
+arch=('i686' 'x86_64')
+url="http://vba-m.com"
+license=('GPL2')
+makedepends=('cmake' 'desktop-file-utils' 'freetype2' 'gtkglextmm' 'imagemagick' 'glew' 'libjpeg' 'libpng' 'libsndfile' 'libxrandr' 'mesa' 'openal' 'wxgtk' 'zip')
+[[ $CARCH == i686 ]] && makedepends+=('nasm')
+source=("http://downloads.sourceforge.net/project/vbam/vbam-src/vbam-r${pkgver##*.}-src.tar.bz2"
+ 'http://downloads.sourceforge.net/sfml/SFML-1.6-sdk-linux-64.tar.gz'
+ 'http://www.lonesock.net/files/soil.zip'
+ 'sfml.patch'
+ 'soil.patch')
+sha256sums=('148d866c08d7a810be5c845247d212f1d1d07395f2ccdecef10ad81a76072877'
+ '05bdc32286ab2ec8cb1ccdafe53f31830284e09e11ebfc3ab3836c99a0d9654b'
+ 'a2305b8d64f6d636e36d669bbdb0ca5445d1345c754b3d61d3f037dad2e5f701'
+ 'c3c2fc48f4edc303ad24d91583a57aef9b7ca3b78de1d6734cb666745fff9bad'
+ '65705aeef90667bd4e28dd03ac0b43685470f2925b642637b7ff6e2f3acd34c7')
+
+prepare() {
+ patch -Np0 -i soil.patch
+ patch -Np0 -i sfml.patch
+}
+
+build() {
+# Build static SOIL
+ pushd "Simple OpenGL Image Library/src"
+ make -f "../projects/makefile/alternate Makefile.txt"
+ make -f "../projects/makefile/alternate Makefile.txt" DESTDIR="${srcdir}/staging" install
+ popd
+
+# Build static SFML
+ pushd SFML-1.6
+ make
+ make DESTDIR="${srcdir}/staging/usr" install
+ popd
+
+# Build VBA-M
+ if [[ -d build ]]; then
+ rm -rf build
+ fi
+ mkdir build && cd build
+
+ local _cmakeargs="-DCMAKE_INSTALL_PREFIX='/usr' -DCMAKE_CXX_FLAGS=-I${srcdir}/staging/usr/include -DENABLE_GTK='ON' -DENABLE_WX='ON' \
+ -DSFML_INCLUDE_DIR='../staging/usr/include/SFML' \
+ -DSFML_AUDIO_INCLUDE_DIR='../staging/usr/include/SFML/Audio' \
+ -DSFML_AUDIO_LIBRARY='../staging/usr/lib/libsfml-audio-s.a' \
+ -DSFML_GRAPHICS_INCLUDE_DIR='../staging/usr/include/SFML/Graphics' \
+ -DSFML_GRAPHICS_LIBRARY='../staging/usr/lib/libsfml-graphics-s.a' \
+ -DSFML_NETWORK_INCLUDE_DIR='../staging/usr/include/SFML/Network' \
+ -DSFML_NETWORK_LIBRARY='../staging/usr/lib/libsfml-network-s.a' \
+ -DSFML_SYSTEM_INCLUDE_DIR='../staging/usr/include/SFML/System' \
+ -DSFML_SYSTEM_LIBRARY='../staging/usr/lib/libsfml-system-s.a'"
+
+ if [[ $CARCH == i686 ]]; then
+ cmake .. ${_cmakeargs} -DENABLE_ASM_{CORE,SCALERS}='ON'
+ else
+ cmake .. ${_cmakeargs}
+ fi
+ make
+}
+
+package_vbam-cli() {
+pkgdesc="Nintendo GameBoy Advance emulator - SDL version"
+depends=('mesa' 'libpng' 'sdl')
+backup=('etc/vbam.cfg')
+
+ cd build
+
+ make DESTDIR="${pkgdir}" install
+ rm -rf "${pkgdir}"/usr/{bin/{g,wx}vbam,share}
+}
+
+package_vbam-gtk() {
+pkgdesc="Nintendo GameBoy Advance emulator - GTK version"
+depends=('desktop-file-utils' 'gtkglextmm' 'sdl')
+conflicts=('vbam-wx')
+install='vbam-gtk.install'
+
+ cd build
+
+ make DESTDIR="${pkgdir}" install
+ rm -rf "${pkgdir}"/{etc,usr/bin/vbam}
+ find "${pkgdir}" -type f -regex .*wxvbam.* -exec rm {} +
+}
+
+package_vbam-wx() {
+pkgdesc="Nintendo GameBoy Advance emulator - wx version"
+depends=('wxgtk')
+conflicts=('vbam-gtk')
+options=('!emptydirs')
+install='vbam-wx.install'
+
+ cd build
+
+ make DESTDIR="${pkgdir}" install
+ rm -rf "${pkgdir}"/{etc,usr/{bin,share}/vbam}
+ find "${pkgdir}" -type f -regex .*gvbam.* -exec rm {} +
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/community/vbam/sfml.patch b/community/vbam/sfml.patch
new file mode 100755
index 000000000..30e7c137b
--- /dev/null
+++ b/community/vbam/sfml.patch
@@ -0,0 +1,181 @@
+diff -rupN SFML-1.6.orig/include/SFML/System/Resource.hpp SFML-1.6/include/SFML/System/Resource.hpp
+--- SFML-1.6.orig/include/SFML/System/Resource.hpp 2010-01-27 14:53:54.000000000 +0100
++++ SFML-1.6/include/SFML/System/Resource.hpp 2013-10-11 15:22:44.416388808 +0200
+@@ -29,7 +29,7 @@
+ // Headers
+ ////////////////////////////////////////////////////////////
+ #include <set>
+-
++#include <cstddef>
+
+ namespace sf
+ {
+diff -rupN SFML-1.6.orig/src/SFML/Audio/Makefile SFML-1.6/src/SFML/Audio/Makefile
+--- SFML-1.6.orig/src/SFML/Audio/Makefile 2010-01-27 15:00:19.000000000 +0100
++++ SFML-1.6/src/SFML/Audio/Makefile 2013-10-11 15:24:44.588725944 +0200
+@@ -25,7 +25,7 @@ $(OBJ): %.o: %.cpp
+ $(CPP) -o $@ -c $< $(CFLAGS)
+
+ $(OBJVORBIS): %.o: %.c
+- $(CC) -o $@ -c $< $(CFLAGSEXT)
++ $(CC) -o $@ -c $< $(CFLAGS)
+
+ .PHONY: clean mrproper
+
+diff -rupN SFML-1.6.orig/src/SFML/Graphics/GraphicsContext.hpp SFML-1.6/src/SFML/Graphics/GraphicsContext.hpp
+--- SFML-1.6.orig/src/SFML/Graphics/GraphicsContext.hpp 2010-01-27 15:00:05.000000000 +0100
++++ SFML-1.6/src/SFML/Graphics/GraphicsContext.hpp 2013-10-11 15:22:44.419722114 +0200
+@@ -30,7 +30,7 @@
+ ////////////////////////////////////////////////////////////
+ #include <SFML/Config.hpp>
+ #include <SFML/System/NonCopyable.hpp>
+-#include <SFML/Graphics/GLEW/glew.h>
++#include <GL/glew.h>
+ #include <iostream>
+ #include <string>
+
+diff -rupN SFML-1.6.orig/src/SFML/Graphics/ImageLoader.cpp SFML-1.6/src/SFML/Graphics/ImageLoader.cpp
+--- SFML-1.6.orig/src/SFML/Graphics/ImageLoader.cpp 2010-01-27 15:00:05.000000000 +0100
++++ SFML-1.6/src/SFML/Graphics/ImageLoader.cpp 2013-10-11 15:22:44.419722114 +0200
+@@ -28,11 +28,12 @@
+ #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 <SFML/Graphics/SOIL/SOIL.h>
++#include <png.h>
++#include <SOIL/SOIL.h>
++#include <cstring>
+ #include <iostream>
+
+
+@@ -44,7 +45,7 @@ namespace
+ void PngErrorHandler(png_structp Png, png_const_charp Message)
+ {
+ std::cerr << "Failed to write PNG image. Reason : " << Message << std::endl;
+- longjmp(Png->jmpbuf, 1);
++ longjmp(png_jmpbuf(Png), 1);
+ }
+ }
+
+@@ -289,7 +290,7 @@ bool ImageLoader::WritePng(const std::st
+ }
+
+ // For proper error handling...
+- if (setjmp(Png->jmpbuf))
++ if (setjmp(png_jmpbuf(Png)))
+ {
+ png_destroy_write_struct(&Png, &PngInfo);
+ return false;
+diff -rupN SFML-1.6.orig/src/SFML/Graphics/Makefile SFML-1.6/src/SFML/Graphics/Makefile
+--- SFML-1.6.orig/src/SFML/Graphics/Makefile 2010-01-27 15:00:05.000000000 +0100
++++ SFML-1.6/src/SFML/Graphics/Makefile 2013-10-11 15:26:37.971432986 +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 @@ endif
+
+ 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)
+
+-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 -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)
+diff -rupN SFML-1.6.orig/src/SFML/Makefile SFML-1.6/src/SFML/Makefile
+--- SFML-1.6.orig/src/SFML/Makefile 2010-01-27 15:00:37.000000000 +0100
++++ SFML-1.6/src/SFML/Makefile 2013-10-11 15:29:14.687273136 +0200
+@@ -1,10 +1,10 @@
+ export DEBUGBUILD = no
+-export STATIC = no
++export STATIC = yes
+
+ ifeq ($(DEBUGBUILD), yes)
+ DEBUGFLAGS = -g -DDEBUG
+ else
+- DEBUGFLAGS = -O2 -DNDEBUG
++ DEBUGFLAGS = -DNDEBUG
+ endif
+
+ ifeq ($(STATIC), no)
+@@ -17,9 +17,9 @@ endif
+
+ export CC = gcc
+ export CPP = g++
+-export CFLAGS = -W -Wall -pedantic -I../../../include -I../../ $(DEBUGFLAGS) $(BUILDFLAGS)
+-export CFLAGSEXT = -I../../../include -I../.. $(DEBUGFLAGS) $(BUILDFLAGS)
+-export LDFLAGS = $(LINKFLAGS)
++export CFLAGS += -W -Wall -pedantic -I../../../include -I../../../../staging/usr/include -I../../ $(DEBUGFLAGS) $(BUILDFLAGS)
++export CFLAGSEXT = -I../../../include -I../../../../staging/usr/include -I../.. $(DEBUGFLAGS) $(BUILDFLAGS)
++export LDFLAGS += $(LINKFLAGS)
+ export LIBPATH = ../../../lib
+ export VERSION = 1.6
+ export CP = cp
+diff -rupN SFML-1.6.orig/src/SFML/Window/Linux/Joystick.cpp SFML-1.6/src/SFML/Window/Linux/Joystick.cpp
+--- SFML-1.6.orig/src/SFML/Window/Linux/Joystick.cpp 2010-01-27 15:00:27.000000000 +0100
++++ SFML-1.6/src/SFML/Window/Linux/Joystick.cpp 2013-10-11 15:22:44.423055420 +0200
+@@ -27,7 +27,7 @@
+ ////////////////////////////////////////////////////////////
+ #include <SFML/Window/Joystick.hpp>
+ #include <sstream>
+-
++#include <unistd.h>
+
+ namespace sf
+ {
+diff -rupN SFML-1.6.orig/src/SFML/Window/Makefile SFML-1.6/src/SFML/Window/Makefile
+--- SFML-1.6.orig/src/SFML/Window/Makefile 2010-01-27 15:00:37.000000000 +0100
++++ SFML-1.6/src/SFML/Window/Makefile 2013-10-11 15:31:52.909728371 +0200
+@@ -1,6 +1,5 @@
+ SRC = $(wildcard *.cpp ./Linux/*.cpp)
+ OBJ = $(SRC:.cpp=.o)
+-OBJGLEW = $(SRCGLEW:.c=.o)
+
+ ifeq ($(STATIC), yes)
+ LIB = libsfml-window-s.a
+@@ -18,7 +17,7 @@ libsfml-window-s.a: $(OBJ)
+ $(AR) $(ARFLAGS) $(LIBNAME) $(OBJ)
+
+ libsfml-window.so: $(OBJ)
+- $(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) $(OBJGLEW) -lX11 -lXrandr -lGL
++ $(CPP) $(LDFLAGS) -Wl,-soname,$(LIB).$(VERSION) -o $(LIBNAME) $(OBJ) -lGLEW -lX11 -lXrandr -lGL
+
+ $(OBJ): %.o: %.cpp
+ $(CPP) -o $@ -c $< $(CFLAGS)
diff --git a/community/vbam/soil.patch b/community/vbam/soil.patch
new file mode 100755
index 000000000..bf38faed3
--- /dev/null
+++ b/community/vbam/soil.patch
@@ -0,0 +1,51 @@
+diff -rupN "Simple OpenGL Image Library.orig/projects/makefile/alternate Makefile.txt" "Simple OpenGL Image Library/projects/makefile/alternate Makefile.txt"
+--- "Simple OpenGL Image Library.orig/projects/makefile/alternate Makefile.txt" 2008-07-07 18:13:28.000000000 +0200
++++ "Simple OpenGL Image Library/projects/makefile/alternate Makefile.txt" 2013-10-11 12:31:18.545860800 +0200
+@@ -1,7 +1,7 @@
+ MAKE = make
+ CC = gcc
+-INSTALL_FILE = install -p -o root -g root -m 644
+-INSTALL_DIR = install -p -o root -g root -d
++INSTALL_FILE = install -p -m 644
++INSTALL_DIR = install -p -d
+ LN = ln -s
+ RM = rm -fv
+ CFLAGS += -c -O2 -Wall
+@@ -10,13 +10,12 @@ LDFLAGS +=
+ CFILES = image_DXT.c image_helper.c SOIL.c stb_image_aug.c
+ OFILES = $(CFILES:.c=.o)
+ LIBNAME = libSOIL
+-VERSION = 1.07-20071110
++VERSION = 1.16
+ MAJOR = 1
+
+ HFILES = SOIL.h image_DXT.h image_helper.h \
+ stbi_DDS_aug.h stbi_DDS_aug_c.h stb_image_aug.h
+ AFILE = libSOIL.a
+-SOFILE = libSOIL.so.$(VERSION)
+ INCLUDEDIR = /usr/include/SOIL
+ LIBDIR = /usr/lib
+
+@@ -29,22 +28,17 @@ lib: $(OFILES)
+ # create static library
+ ar -cvq $(LIBNAME).a $(OFILES)
+ # create shared library
+- gcc -shared -Wl,-soname,$(LIBNAME).so.$(MAJOR) -o $(LIBNAME).so.$(VERSION) $(OFILES)
+
+ install:
+ $(INSTALL_DIR) $(DESTDIR)/$(INCLUDEDIR)
+ $(INSTALL_FILE) $(HFILES) $(DESTDIR)/$(INCLUDEDIR)
+ $(INSTALL_DIR) $(DESTDIR)/$(LIBDIR)
+ $(INSTALL_FILE) $(AFILE) $(DESTDIR)/$(LIBDIR)
+- $(INSTALL_FILE) $(SOFILE) $(DESTDIR)/$(LIBDIR)
+- ( cd $(DESTDIR)/$(LIBDIR) && $(LN) $(SOFILE) $(LIBNAME).so.$(MAJOR) \
+- && $(LN) $(SOFILE) $(LIBNAME).so )
+
+ clean:
+ $(RM) *.o
+ $(RM) *~
+
+ distclean:
+- $(RM) $(AFILE) $(SOFILE)
+
+ .PHONY: all lib clean distclean
diff --git a/community/vbam/vbam-gtk.install b/community/vbam/vbam-gtk.install
new file mode 100755
index 000000000..1ade13cc7
--- /dev/null
+++ b/community/vbam/vbam-gtk.install
@@ -0,0 +1,14 @@
+post_install() {
+ update-desktop-database -q
+ gtk-update-icon-cache -ftq usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/community/vbam/vbam-wx.install b/community/vbam/vbam-wx.install
new file mode 100755
index 000000000..11027f6ea
--- /dev/null
+++ b/community/vbam/vbam-wx.install
@@ -0,0 +1,13 @@
+post_install() {
+ gtk-update-icon-cache -ftq usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
+
+# vim: ts=2 sw=2 et: