hasufell-repository/packages/games-emulation/gambatte/gambatte-scm.exheres-0

94 lines
2.0 KiB
Bash
Raw Permalink Normal View History

# Copyright 2016 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2
require qmake
require scons
require github [ user=sinamas ]
SUMMARY="An accuracy-focused Gameboy / Gameboy Color emulator"
2016-04-23 10:37:22 +00:00
HOMEPAGE+=" http://sourceforge.net/projects/gambatte"
LICENCES="GPL-2"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS="
qt4 [[ description = [ build qt4 GUI frontend ] ]]
"
DEPENDENCIES="
build+run:
media-libs/SDL:0[X]
sys-libs/zlib
qt4? (
sys-sound/alsa-lib
x11-libs/libX11
x11-libs/libXext
x11-libs/libXrandr
x11-libs/libXv
x11-libs/qt:4[opengl]
)
"
2016-04-23 10:37:22 +00:00
REMOTE_IDS+=" sourceforge:${PN}"
fix_scons() {
2016-02-28 23:05:15 +00:00
local i
for i; do
cat >> $i << END || die
import os
import SCons.Util
if os.environ.has_key('AR'):
2016-02-28 23:05:15 +00:00
env['AR'] = os.environ['AR']
if os.environ.has_key('RANLIB'):
2016-02-28 23:05:15 +00:00
env['RANLIB'] = os.environ['RANLIB']
if os.environ.has_key('CC'):
2016-02-28 23:05:15 +00:00
env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
2016-02-28 23:05:15 +00:00
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
2016-02-28 23:05:15 +00:00
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
2016-02-28 23:05:15 +00:00
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('CPPFLAGS'):
2016-02-28 23:05:15 +00:00
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CPPFLAGS'])
if os.environ.has_key('LDFLAGS'):
2016-02-28 23:05:15 +00:00
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
END
2016-02-28 23:05:15 +00:00
done
}
src_prepare() {
2016-02-28 23:05:15 +00:00
fix_scons {gambatte_sdl,libgambatte}/SConstruct
}
src_configure() {
2016-02-28 23:05:15 +00:00
if option qt4; then
edo cd "${WORK}"/gambatte_qt
eqmake ${PN}_qt.pro
fi
}
src_compile() {
2016-02-28 23:05:15 +00:00
# build core library
edo cd "${WORK}"/libgambatte
escons
2016-02-28 23:05:15 +00:00
# build sdl frontend
edo cd "${WORK}"/gambatte_sdl
escons
2016-02-28 23:05:15 +00:00
# build qt frontend
if option qt4; then
emake -C "${WORK}"/gambatte_qt
fi
}
src_install() {
dobin gambatte_sdl/gambatte_sdl
2016-02-28 23:05:15 +00:00
option qt4 && dobin gambatte_qt/bin/gambatte_qt
nonfatal emagicdocs
}