[92255] trunk/dports/games/simutrans
ryandesign at macports.org
ryandesign at macports.org
Sun Apr 22 20:58:04 PDT 2012
Revision: 92255
https://trac.macports.org/changeset/92255
Author: ryandesign at macports.org
Date: 2012-04-22 20:58:00 -0700 (Sun, 22 Apr 2012)
Log Message:
-----------
simutrans:
* update to 111.2.2
* use dots in the version number as per normal, instead of dashes
* support filenames containing spaces in the wrapper script
* rewrite master_sites to avoid redirects
* use notes
* rename enable_music variant to just music
* endian fix for PowerPC builds
* split graphics into simutrans-pak64 subport
Modified Paths:
--------------
trunk/dports/games/simutrans/Portfile
trunk/dports/games/simutrans/files/patch-Makefile.diff
trunk/dports/games/simutrans/files/patch-config.default.diff
Added Paths:
-----------
trunk/dports/games/simutrans/files/patch-powerpc.diff
trunk/dports/games/simutrans/files/simutrans.in
Removed Paths:
-------------
trunk/dports/games/simutrans/files/simutrans
Modified: trunk/dports/games/simutrans/Portfile
===================================================================
--- trunk/dports/games/simutrans/Portfile 2012-04-23 03:01:41 UTC (rev 92254)
+++ trunk/dports/games/simutrans/Portfile 2012-04-23 03:58:00 UTC (rev 92255)
@@ -3,8 +3,10 @@
PortSystem 1.0
name simutrans
-version 99-17-1
-revision 1
+version 111.2.2
+set branch [join [lrange [split ${version} .] 0 1] .]
+set my_version [strsed ${version} {g/\./-/}]
+set my_branch [strsed ${branch} {g/\./-/}]
categories games
platforms darwin
maintainers nomaintainer
@@ -14,68 +16,124 @@
Linux that focuses on the transporting of goods, people, \
mail and power. It was originally written by Hansjörg \
Malthaner, and is now maintained and developed by a \
- small team. \
- \
- This port installs simutrans with the default pak64 \
- image set. If you want to use another pak, download it \
- (for example from \
- http://simutrans.sourceforge.net/ufcs.htm) and put it \
- into \"${prefix}/share/simutrans\".
+ small team.
homepage http://www.simutrans.com/
-master_sites sourceforge
use_zip yes
-set source ${name}-src-${version}${extract.suffix}
-set pak64 pak64-${version}${extract.suffix}
-distfiles ${source} \
- ${pak64}
-checksums ${source} md5 2ebeb3439707c955d87f1b1ff0f1c0da \
- ${source} sha1 c66429cf2578fdcf6e41e443b4edac58650ac23e \
- ${source} rmd160 157f6e55317bb719badfd68743ce36f1ceaa1f49 \
- ${pak64} md5 9a7d4494ec15f4311737bfadf991a6fe \
- ${pak64} sha1 ab978c43b4b02a4c7eda226a4a7984f0b29135f2 \
- ${pak64} rmd160 682334005d38cb6516327869a935eb9a8c012ea6
+
extract.mkdir yes
-depends_lib port:libpng \
- path:lib/pkgconfig/sdl.pc:libsdl \
- port:zlib
-
-pre-patch {
- copy -force ${worksrcpath}/config.template ${worksrcpath}/config.default
-}
-
-patchfiles patch-config.default.diff \
- patch-Makefile.diff
-
-post-patch {
- reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Makefile
-}
-
use_configure no
-build.args CC="${configure.cc} ${configure.cc_archflags}" \
- CXX="${configure.cxx} ${configure.cxx_archflags}"
+set data_dir ${prefix}/share/${name}
-destroot {
- # Install the simutrans data into share/simutrans.
- copy ${worksrcpath}/simutrans ${destroot}${prefix}/share
- # Install the simutrans binary to the directory in share/. Necessary as
- # the data and binary needs to be in the same directory.
- xinstall ${worksrcpath}/sim ${destroot}${prefix}/share/simutrans
-
- # Install the helper script which allows to simply call simutrans. Also
- # use the correct prefix path in the helper script.
- xinstall ${portpath}/${filesdir}/simutrans ${destroot}${prefix}/bin
- reinplace "s|__PREFIX__|${prefix}|g" ${destroot}${prefix}/bin/simutrans
+subport simutrans {
+ master_sites sourceforge:project/simutrans/simutrans/${my_version}
+
+ distname ${name}-src-${my_version}
+
+ checksums rmd160 306f5b618dc5190f3a8b31462c44e6db8c1e5ea6 \
+ sha256 e97279ab7149cef430bb53c6206786ff039915dfa98a1b597e61e3f192840732
+
+ depends_build port:pkgconfig
+
+ depends_lib port:libpng \
+ path:lib/pkgconfig/sdl.pc:libsdl \
+ port:zlib
+
+ post-extract {
+ copy -force ${worksrcpath}/config.template ${worksrcpath}/config.default
+ copy -force ${filespath}/simutrans.in ${worksrcpath}/simutrans-wrapper
+ }
+
+ patchfiles patch-config.default.diff \
+ patch-Makefile.diff
+
+ post-patch {
+ reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Makefile
+ reinplace "s|__DATA_DIR__|${data_dir}|g" ${worksrcpath}/simutrans-wrapper
+ }
+
+ build.args CC="${configure.cc} [get_canonical_archflags cc]" \
+ CXX="${configure.cxx} [get_canonical_archflags cxx]"
+
+ destroot {
+ # Install the simutrans data.
+ copy ${worksrcpath}/simutrans ${destroot}${data_dir}
+
+ # Install the simutrans binary. It has to be in the same directory
+ # as the data.
+ xinstall ${worksrcpath}/build/default/sim ${destroot}${data_dir}
+
+ # Install the wrapper script.
+ xinstall ${worksrcpath}/simutrans-wrapper ${destroot}${prefix}/bin/simutrans
+ }
+
+ variant enable_music requires music description {legacy compatibility variant} {}
+ variant music description {allow listening to simutrans music while playing (may reduce speed)} {
+ depends_lib-append port:libsdl_mixer
+ post-patch {
+ reinplace "s|#BACKEND = mixer_sdl|BACKEND = mixer_sdl|g" \
+ ${worksrcpath}/config.default
+ }
+ }
+
+ variant pak64 description {Install the 64x64 graphics pak} {
+ depends_run-append port:simutrans-pak64
+ notes-append "
+${name} is installed with the default pak64 image set.\
+If you want to use another pak, download it (for example from\
+http://www.simutrans.com/paksets.htm) and put it into\
+${data_dir}.
+"
+ }
+
+ if {![variant_isset pak64]} {
+ default_variants +pak64
+ }
+
+ platform powerpc {
+ patchfiles-append patch-powerpc.diff
+ }
}
-
-variant enable_music description {Allows to listen to simutrans own music\
- while playing. May reduce speed.} {
- depends_lib-append port:libsdl_mixer
- post-patch {
- reinplace "s|#BACKEND = mixer_sdl|BACKEND = mixer_sdl|g" \
- ${worksrcpath}/config.default
+subport simutrans-pak64 {
+ version ${branch}
+ supported_archs noarch
+
+ description Standard 64x64 graphics for simutrans
+
+ long_description ${description}
+
+ master_sites sourceforge:project/simutrans/pak64/${my_branch}
+
+ distname simupak64-${my_branch}
+
+ checksums rmd160 40b5c0e57427eda83ef357a1bbb8cdb5250a79ac \
+ sha256 5cda187d578e5263a1a77f8cd09268e2694157f6ca4c3ad4921b3fc8710fea38
+
+ post-extract {
+ fs-traverse item ${worksrcpath} {
+ if {[file isdirectory ${item}]} {
+ file attributes ${item} -permissions 0755
+ } elseif {[file isfile ${item}]} {
+ file attributes ${item} -permissions 0644
+ }
+ }
}
+
+ build {}
+
+ destroot {
+ copy ${worksrcpath}/${name} ${destroot}${data_dir}
+ }
+
+ # Deactivate old simutrans port that had an integrated pak64 that would conflict
+ pre-activate {
+ if {[file exists ${prefix}/bin/simutrans]
+ && ![catch {set vers [lindex [registry_active simutrans] 0]}]
+ && [vercmp [lindex $vers 1] 111.2.2] < 0} {
+ registry_deactivate simutrans "" [list ports_nodepcheck 1]
+ }
+ }
}
Modified: trunk/dports/games/simutrans/files/patch-Makefile.diff
===================================================================
--- trunk/dports/games/simutrans/files/patch-Makefile.diff 2012-04-23 03:01:41 UTC (rev 92254)
+++ trunk/dports/games/simutrans/files/patch-Makefile.diff 2012-04-23 03:58:00 UTC (rev 92255)
@@ -1,13 +1,24 @@
---- Makefile 2008-02-11 15:37:02.000000000 +0100
-+++ Makefile 2008-02-11 15:37:16.000000000 +0100
-@@ -92,8 +92,8 @@
- LDFLAGS += -pg
+--- Makefile.orig 2012-03-20 16:34:16.000000000 -0500
++++ Makefile 2012-04-22 21:53:59.000000000 -0500
+@@ -125,7 +125,7 @@
+ endif
endif
--CFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -Wstrict-prototypes $(OS_INC) $(OS_OPT) $(FLAGS)
--CXXFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(OS_INC) $(OS_OPT) $(FLAGS)
-+CFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -Wstrict-prototypes $(OS_INC) $(OS_OPT) $(FLAGS) -I__PREFIX__/include -L__PREFIX__/lib
-+CXXFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(OS_INC) $(OS_OPT) $(FLAGS) -I__PREFIX__/include -L__PREFIX__/lib
+-CFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(FLAGS)
++CFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(FLAGS) -I__PREFIX__/include -L__PREFIX__/lib
+ CCFLAGS += -Wstrict-prototypes
- SOURCES += bauer/brueckenbauer.cc
+@@ -396,10 +396,8 @@
+ SOURCES += simsys_s.cc
+ CFLAGS += -DUSE_16BIT_DIB
+ ifeq ($(OSTYPE),mac)
+- # Core Audio (Quicktime) base sound system routines
+- SOURCES += sound/core-audio_sound.mm
+- SOURCES += music/core-audio_midi.mm
+- LIBS += -framework Foundation -framework QTKit
++ SOURCES += sound/sdl_sound.cc
++ SOURCES += music/no_midi.cc
+ else
+ SOURCES += sound/sdl_sound.cc
+ ifeq ($(findstring $(OSTYPE), cygwin mingw),)
Modified: trunk/dports/games/simutrans/files/patch-config.default.diff
===================================================================
--- trunk/dports/games/simutrans/files/patch-config.default.diff 2012-04-23 03:01:41 UTC (rev 92254)
+++ trunk/dports/games/simutrans/files/patch-config.default.diff 2012-04-23 03:58:00 UTC (rev 92255)
@@ -1,21 +1,22 @@
---- config.template 2007-12-17 22:01:56.000000000 -0600
-+++ config.default 2010-10-04 18:31:32.000000000 -0500
-@@ -5,29 +5,29 @@
-
+--- config.default.orig 2012-03-15 16:23:32.000000000 -0500
++++ config.default 2012-04-22 21:45:34.000000000 -0500
+@@ -6,12 +6,12 @@
#BACKEND = allegro
#BACKEND = gdi
+ #BACKEND = opengl
-#BACKEND = sdl
+BACKEND = sdl
#BACKEND = mixer_sdl
- #BACKEND = x11
+ #BACKEND = posix
- #COLOUR_DEPTH = 8
+ #COLOUR_DEPTH = 0
-#COLOUR_DEPTH = 16
+COLOUR_DEPTH = 16
+ #OSTYPE = amiga
#OSTYPE = beos
- #OSTYPE = cygwin
- #OSTYPE = freebsd
+@@ -20,10 +20,10 @@
+ #OSTYPE = haiku
#OSTYPE = linux
#OSTYPE = mingw
-#OSTYPE = mac
@@ -25,14 +26,20 @@
-#OPTIMISE = 1 # Add umpteen optimisation flags
+DEBUG = 3 # Level 1-3, higher number means more debug-friendly, see Makefile
+OPTIMISE = 1 # Add umpteen optimisation flags
- #PROFILE = 1
+ #PROFILE = 1 # Enable profiling
+ #PROFILE = 2 # Enable profiling with optimisation flags, can be used with `OPTIMISE = 1'
- # Define these as empty strings, if you don't have allegro/sdl-config
+@@ -34,10 +34,10 @@
+
+ # Define these as empty strings, if you don't have the respective config program
#ALLEGRO_CONFIG = allegro-config
- #SDL_CONFIG = sdl-config
+-#PNG_CONFIG = pkg-config libpng
+-#SDL_CONFIG = sdl-config
++PNG_CONFIG = pkg-config libpng
++SDL_CONFIG = sdl-config
-#VERBOSE = 1
+VERBOSE = 1
- # Do not determine dependencies
- # Header dependencies get NOT tracked this way, so if a header changes you're
+ # The following useful conditional compilation flags exist
+ #
Added: trunk/dports/games/simutrans/files/patch-powerpc.diff
===================================================================
--- trunk/dports/games/simutrans/files/patch-powerpc.diff (rev 0)
+++ trunk/dports/games/simutrans/files/patch-powerpc.diff 2012-04-23 03:58:00 UTC (rev 92255)
@@ -0,0 +1,10 @@
+--- config.default.orig 2012-03-15 16:23:32.000000000 -0500
++++ config.default 2012-04-22 21:56:03.000000000 -0500
+@@ -66,6 +66,7 @@
+ #
+ # In order to use the flags, add a line like this: (-Dxxx)
+ # FLAGS = -DUSE_C
++FLAGS = -DSIM_BIG_ENDIAN
+
+ # Output directories:
+ #
Deleted: trunk/dports/games/simutrans/files/simutrans
===================================================================
--- trunk/dports/games/simutrans/files/simutrans 2012-04-23 03:01:41 UTC (rev 92254)
+++ trunk/dports/games/simutrans/files/simutrans 2012-04-23 03:58:00 UTC (rev 92255)
@@ -1,6 +0,0 @@
-#!/usr/bin/env sh
-
-# This is a shell wrapper to make executing simutrans simpler.
-#
-
-__PREFIX__/share/simutrans/sim $@
Copied: trunk/dports/games/simutrans/files/simutrans.in (from rev 72123, trunk/dports/games/simutrans/files/simutrans)
===================================================================
--- trunk/dports/games/simutrans/files/simutrans.in (rev 0)
+++ trunk/dports/games/simutrans/files/simutrans.in 2012-04-23 03:58:00 UTC (rev 92255)
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+
+exec __DATA_DIR__/sim "$@"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120422/308d6f8a/attachment-0001.html>
More information about the macports-changes
mailing list