1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: Portfile 153175 2016-09-26 08:58:52Z ryandesign@macports.org $ |
---|
3 | |
---|
4 | # tested on 10.4 PPC/Intel, 10.5 PPC/Intel, 10.6, 10.6 with LibCxx upgrade, 10.7, 10.11 |
---|
5 | # hatari command line builds on all systems |
---|
6 | # hatari python UI not needed with macOS GUI or command line versions - has unspecified python version so not included |
---|
7 | # hatari macOS GUI builds on >= 10.6 as NSWindowDelegate is used and is only 10.6 onwards |
---|
8 | # hatari macOS GUI does not build with gcc*, llvm-gcc-4.2, or older clang versions |
---|
9 | # winuae works on all with gcc flag modification below. |
---|
10 | # SDL2 works on 10.6, 10.7 and 10.11, and likely all in between, but not 10.5 |
---|
11 | |
---|
12 | # revision 1 add portaudio dependency, add post-destroot to install default tos.img into app bundle, update clang requirements |
---|
13 | |
---|
14 | PortSystem 1.0 |
---|
15 | PortGroup cmake 1.0 |
---|
16 | PortGroup compiler_blacklist_versions 1.0 |
---|
17 | |
---|
18 | name hatari |
---|
19 | version 1.9.0 |
---|
20 | revision 1 |
---|
21 | |
---|
22 | categories emulators |
---|
23 | license GPL-2+ |
---|
24 | platforms darwin |
---|
25 | maintainers slor.net:james gmail.com:ken.cunningham.webuse openmaintainer |
---|
26 | |
---|
27 | description Atari ST/STe/STfm emulator |
---|
28 | long_description Hatari is an actively developed Atari ST/STe/STfm and Falcon emulator |
---|
29 | homepage http://hatari.tuxfamily.org/ |
---|
30 | |
---|
31 | master_sites http://download.tuxfamily.org/hatari/${version}/ |
---|
32 | checksums sha256 b2b56e6cbe7f8769a5e8b1d96599f392d9351b44cacf959da6905da06d30e992 \ |
---|
33 | rmd160 0bc9bd21a81211ebf293911d9aaa5e9cb84c0400 |
---|
34 | use_bzip2 yes |
---|
35 | |
---|
36 | cmake.out_of_source yes |
---|
37 | |
---|
38 | depends_lib port:libsdl \ |
---|
39 | port:libpng \ |
---|
40 | port:readline \ |
---|
41 | port:portaudio |
---|
42 | |
---|
43 | # 1. fix hard-coded installation directory for macOS bundle |
---|
44 | # 2. delete warning flag in winuae emulator code not supported by GCC42 |
---|
45 | # 3. disable python ui - not needed for macOS |
---|
46 | post-patch { |
---|
47 | reinplace "s|/Applications|${applications_dir}|g" ${worksrcpath}/src/CMakeLists.txt |
---|
48 | reinplace "s|-Wno-maybe-uninitialized||g" ${worksrcpath}/src/cpu/CMakeLists.txt |
---|
49 | reinplace "s|add_subdirectory(python-ui)||g" ${worksrcpath}/CMakeLists.txt |
---|
50 | } |
---|
51 | |
---|
52 | # default to install macOS GUI application, and then adjust for OS variations |
---|
53 | platform darwin { |
---|
54 | if { ${os.major} <= 9 } { |
---|
55 | # 10.4 and 10.5 cannot build the macOS GUI, even with newer clang versions. |
---|
56 | default_variants +commandlineapp |
---|
57 | } else { |
---|
58 | # *gcc* and older clang versions will not build the macOS GUI, so blacklist on 10.6+ |
---|
59 | compiler.blacklist *gcc* { clang < 211 } |
---|
60 | } |
---|
61 | } |
---|
62 | |
---|
63 | # ensure cmake's choice of compiler is correctly passed in (doesn't always seem to be) |
---|
64 | configure.args-append -DCMAKE_C_COMPILER=${configure.cc} |
---|
65 | |
---|
66 | # these settings are copied from the previous portfile (1.7 version) |
---|
67 | configure.cflags -O3 -pipe -fomit-frame-pointer |
---|
68 | configure.universal_args-delete --disable-dependency-tracking |
---|
69 | |
---|
70 | variant commandlineapp description "Install command line version only" { |
---|
71 | # we're bypassing the configure script in this portfile by using the cmake portgroup, so set these directly in cmake |
---|
72 | configure.args-append -DENABLE_OSX_BUNDLE:BOOL=0 |
---|
73 | } |
---|
74 | |
---|
75 | variant winuae description "Enable WinUAE CPU core (experimental)" { |
---|
76 | # we're bypassing the configure script in this portfile by using the cmake portgroup, so set these directly in cmake |
---|
77 | configure.args-append -DENABLE_WINUAE_CPU:BOOL=1 |
---|
78 | } |
---|
79 | |
---|
80 | platform darwin { |
---|
81 | if { ${os.major} >= 10 } { |
---|
82 | variant sdl2 description "Use SDL2" { |
---|
83 | configure.args-append -DENABLE_SDL2:BOOL=1 |
---|
84 | depends_lib-delete port:libsdl |
---|
85 | depends_lib-append port:libsdl2 |
---|
86 | } |
---|
87 | } |
---|
88 | } |
---|
89 | |
---|
90 | if {![variant_isset commandlineapp]} { |
---|
91 | # copy the included default tos.img into the app bundle if building the macOS GUI version |
---|
92 | post-destroot { |
---|
93 | copy ${worksrcpath}/src/tos.img ${destroot}${applications_dir}/hatari.app/Contents/Resources/tos.img |
---|
94 | } |
---|
95 | } |
---|
96 | |
---|
97 | |
---|
98 | notes " |
---|
99 | An online manual has been installed at |
---|
100 | |
---|
101 | file://${prefix}/share/doc/hatari/manual.html |
---|
102 | |
---|
103 | and can be accessed via the Help menu in the macOS application. |
---|
104 | " |
---|