2016-02-27 16:07:09 +00:00
|
|
|
# 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"
|
2016-02-27 16:07:09 +00:00
|
|
|
|
|
|
|
LICENCES="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
PLATFORMS="~amd64"
|
|
|
|
MYOPTIONS="
|
2016-05-07 00:26:44 +00:00
|
|
|
qt4 [[ description = [ build qt4 GUI frontend ] ]]
|
2016-02-27 16:07:09 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
DEPENDENCIES="
|
|
|
|
build+run:
|
2016-05-07 00:26:44 +00:00
|
|
|
media-libs/SDL:0[X]
|
2016-02-27 16:07:09 +00:00
|
|
|
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}"
|
|
|
|
|
2016-02-27 16:07:09 +00:00
|
|
|
fix_scons() {
|
2016-02-28 23:05:15 +00:00
|
|
|
local i
|
|
|
|
for i; do
|
|
|
|
cat >> $i << END || die
|
2016-02-27 16:07:09 +00:00
|
|
|
import os
|
|
|
|
import SCons.Util
|
|
|
|
|
|
|
|
if os.environ.has_key('AR'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['AR'] = os.environ['AR']
|
2016-02-27 16:07:09 +00:00
|
|
|
if os.environ.has_key('RANLIB'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['RANLIB'] = os.environ['RANLIB']
|
2016-02-27 16:07:09 +00:00
|
|
|
if os.environ.has_key('CC'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['CC'] = os.environ['CC']
|
2016-02-27 16:07:09 +00:00
|
|
|
if os.environ.has_key('CFLAGS'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
|
2016-02-27 16:07:09 +00:00
|
|
|
if os.environ.has_key('CXX'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['CXX'] = os.environ['CXX']
|
2016-02-27 16:07:09 +00:00
|
|
|
if os.environ.has_key('CXXFLAGS'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
|
2016-02-27 16:07:09 +00:00
|
|
|
if os.environ.has_key('CPPFLAGS'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CPPFLAGS'])
|
2016-02-27 16:07:09 +00:00
|
|
|
if os.environ.has_key('LDFLAGS'):
|
2016-02-28 23:05:15 +00:00
|
|
|
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
|
2016-02-27 16:07:09 +00:00
|
|
|
END
|
2016-02-28 23:05:15 +00:00
|
|
|
done
|
2016-02-27 16:07:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_prepare() {
|
2016-02-28 23:05:15 +00:00
|
|
|
fix_scons {gambatte_sdl,libgambatte}/SConstruct
|
2016-02-27 16:07:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
2016-02-28 23:05:15 +00:00
|
|
|
if option qt4; then
|
|
|
|
edo cd "${WORK}"/gambatte_qt
|
|
|
|
eqmake ${PN}_qt.pro
|
|
|
|
fi
|
2016-02-27 16:07:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
2016-02-28 23:05:15 +00:00
|
|
|
# build core library
|
|
|
|
edo cd "${WORK}"/libgambatte
|
|
|
|
escons
|
2016-02-27 16:07:09 +00:00
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
# build sdl frontend
|
2016-05-07 00:26:44 +00:00
|
|
|
edo cd "${WORK}"/gambatte_sdl
|
|
|
|
escons
|
2016-02-27 16:07:09 +00:00
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
# build qt frontend
|
|
|
|
if option qt4; then
|
|
|
|
emake -C "${WORK}"/gambatte_qt
|
|
|
|
fi
|
2016-02-27 16:07:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2016-05-07 00:26:44 +00:00
|
|
|
dobin gambatte_sdl/gambatte_sdl
|
2016-02-28 23:05:15 +00:00
|
|
|
option qt4 && dobin gambatte_qt/bin/gambatte_qt
|
2016-02-27 16:07:09 +00:00
|
|
|
|
2016-02-28 23:05:15 +00:00
|
|
|
nonfatal dodoc README changelog
|
2016-02-27 16:07:09 +00:00
|
|
|
}
|
|
|
|
|