5 # Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
7 # ------------------------------------------------------------------------------
9 # This library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License as published by the Free Software Foundation; either
12 # version 2.1 of the License, or (at your option) any later version.
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with this library; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 # ------------------------------------------------------------------------------
25 # Please feel free to send questions, suggestions or improvements to:
31 package SDL::Build::Darwin;
33 use base 'SDL::Build';
38 '/usr/local/include/SDL' => '/usr/local/lib',
39 '/usr/local/include' => '/usr/local/lib',
40 '/usr/local/include/smpeg' => '/usr/local/lib',
41 '/usr/include/SDL' => '/usr/lib',
42 '/usr/include' => '/usr/lib',
43 '/usr/include/smpeg' => '/usr/lib',
44 '/usr/local/include/GL' => '/usr/local/lib',
45 '/usr/local/include/gl' => '/usr/local/lib',
46 '/usr/include/GL' => '/usr/lib',
47 '/usr/include/gl' => '/usr/lib',
48 '/opt/local/include/SDL' => '/opt/local/lib', # Mac Ports
49 '/opt/local/include' => '/opt/local/lib', # Mac Ports
51 '/System/Library/Frameworks/SDL_mixer.framework/Headers' => '../../lib',
52 '/System/Library/Frameworks/SDL_image.framework/Headers' => '../../lib',
53 '/System/Library/Frameworks/SDL_ttf.framework/Headers' => '../../lib',
54 '/System/Library/Frameworks/libogg.framework/Headers' => '../../lib',
55 '/System/Library/Frameworks/libvorbis.framework/Headers' => '../../lib',
56 '/System/Library/Frameworks/libvorbisfile.framework/Headers' => '../../lib',
57 '/System/Library/Frameworks/libvorbisenc.framework/Headers' => '../../lib',
58 '../../include' => '../../lib',
59 '/System/Library/Frameworks/OpenGL.framework/Headers' => '/System/Library/Frameworks/OpenGL.framework/Libraries',
75 sub build_install_base
77 return "SDLPerl.app/Contents/Resources";
82 $bundle_contents="SDLPerl.app/Contents";
83 system "mkdir -p \"$bundle_contents\"";
84 mkdir "$bundle_contents/MacOS",0755;
85 $cflags = `sdl-config --cflags`;
87 $cflags .= ' ' . `perl -MExtUtils::Embed -e ccopts`;
89 $libs = `sdl-config --libs`;
91 $libs .= ' ' . `perl -MExtUtils::Embed -e ldopts`;
93 $libs =~ s/-lSDLmain//g;
94 print STDERR "gcc $cflags MacOSX/launcher.m $libs -framework Cocoa -o \"$bundle_contents/MacOS/SDLPerl\"";
95 print STDERR `gcc $cflags MacOSX/launcher.m $libs -framework Cocoa -o \"$bundle_contents/MacOS/SDLPerl\"`;
96 mkdir "$bundle_contents/Resources",0755;
97 system "echo \"APPL????\" > \"$bundle_contents/PkgInfo\"";
98 system "cp MacOSX/Info.plist \"$bundle_contents/\"";
99 system "cp \"MacOSX/SDLPerl.icns\" \"$bundle_contents/Resources\"";