2011-10-18 00:08:46 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Fceux < Formula
|
|
|
|
homepage 'http://fceux.com'
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/project/fceultra/Source%20Code/2.2.2%20src/fceux-2.2.2.src.tar.gz'
|
2013-10-21 01:18:08 +00:00
|
|
|
sha1 'ec50d8eae04794ba10f441a26cdb410c1cf6832b'
|
2011-10-18 00:08:46 +00:00
|
|
|
|
2012-08-28 05:03:58 +00:00
|
|
|
option 'no-gtk', "Build without Gtk+ support"
|
|
|
|
|
2013-10-21 01:18:08 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2011-10-18 00:08:46 +00:00
|
|
|
depends_on 'scons' => :build
|
|
|
|
depends_on 'sdl'
|
|
|
|
depends_on 'libzip'
|
2012-08-28 05:03:58 +00:00
|
|
|
depends_on 'gtk+' unless build.include? "no-gtk"
|
2013-02-03 19:06:28 +00:00
|
|
|
depends_on 'lua'
|
2012-09-03 11:31:35 +00:00
|
|
|
depends_on :x11
|
2011-10-18 00:08:46 +00:00
|
|
|
|
2013-10-21 01:18:09 +00:00
|
|
|
# Make scons honor PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR
|
|
|
|
# Reported upstream: https://sourceforge.net/p/fceultra/bugs/625
|
2014-03-18 21:51:41 +00:00
|
|
|
patch :DATA
|
2013-10-21 01:18:09 +00:00
|
|
|
|
2011-10-18 00:08:46 +00:00
|
|
|
def install
|
2013-10-21 01:18:09 +00:00
|
|
|
args = []
|
|
|
|
args << "GTK=0" if build.include? "no-gtk"
|
2014-02-25 15:45:54 +00:00
|
|
|
scons *args
|
2011-10-18 00:08:46 +00:00
|
|
|
bin.install 'src/fceux'
|
|
|
|
end
|
|
|
|
end
|
2013-10-21 01:18:09 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/SConstruct b/SConstruct
|
|
|
|
index 4d5b446..36be2c4 100644
|
|
|
|
--- a/SConstruct
|
|
|
|
+++ b/SConstruct
|
|
|
|
@@ -62,6 +62,10 @@ if os.environ.has_key('CPPFLAGS'):
|
|
|
|
env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split())
|
|
|
|
if os.environ.has_key('LDFLAGS'):
|
|
|
|
env.Append(LINKFLAGS = os.environ['LDFLAGS'].split())
|
|
|
|
+if os.environ.has_key('PKG_CONFIG_PATH'):
|
|
|
|
+ env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH']
|
|
|
|
+if os.environ.has_key('PKG_CONFIG_LIBDIR'):
|
|
|
|
+ env['ENV']['PKG_CONFIG_LIBDIR'] = os.environ['PKG_CONFIG_LIBDIR']
|
|
|
|
|
|
|
|
print "platform: ", env['PLATFORM']
|
|
|
|
|
|
|
|
@@ -112,16 +116,12 @@ else:
|
|
|
|
Exit(1)
|
|
|
|
# Add compiler and linker flags from pkg-config
|
|
|
|
config_string = 'pkg-config --cflags --libs gtk+-2.0'
|
|
|
|
- if env['PLATFORM'] == 'darwin':
|
|
|
|
- config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
|
|
|
env.ParseConfig(config_string)
|
|
|
|
env.Append(CPPDEFINES=["_GTK2"])
|
|
|
|
env.Append(CCFLAGS = ["-D_GTK"])
|
|
|
|
if env['GTK3']:
|
|
|
|
# Add compiler and linker flags from pkg-config
|
|
|
|
config_string = 'pkg-config --cflags --libs gtk+-3.0'
|
|
|
|
- if env['PLATFORM'] == 'darwin':
|
|
|
|
- config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
|
|
|
env.ParseConfig(config_string)
|
|
|
|
env.Append(CPPDEFINES=["_GTK3"])
|
|
|
|
env.Append(CCFLAGS = ["-D_GTK"])
|
|
|
|
diff --git a/src/drivers/sdl/SConscript b/src/drivers/sdl/SConscript
|
|
|
|
index 7a53b07..23e11b9 100644
|
|
|
|
--- a/src/drivers/sdl/SConscript
|
|
|
|
+++ b/src/drivers/sdl/SConscript
|
|
|
|
@@ -2,8 +2,6 @@
|
|
|
|
# Thanks Antonio Ospite!
|
|
|
|
Import('env')
|
|
|
|
config_string = 'pkg-config --cflags --libs x11'
|
|
|
|
-if env['PLATFORM'] == 'darwin':
|
|
|
|
- config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
|
|
|
env.ParseConfig(config_string)
|
|
|
|
Export('env')
|
|
|
|
|