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' =>
60 '/System/Library/Frameworks/OpenGL.framework/Libraries',
76 sub build_install_base
78 return "SDL Perl.app/Contents/Resources";
83 $bundle_contents="SDL Perl.app/Contents";
84 system "mkdir -p \"$bundle_contents\"";
85 mkdir "$bundle_contents/MacOS",0755;
86 $libs = `sdl-config --libs`;
88 $libs =~ s/-lSDLmain//g;
89 system "gcc $libs -framework Cocoa `perl -MExtUtils::Embed -e ldopts` MacOSX/launcher.o -o \"$bundle_contents/MacOS/SDL Perl\"";
91 mkdir "$bundle_contents/Resources",0755;
92 system "echo \"APPL????\" > \"$bundle_contents/PkgInfo\"";
93 system "cp MacOSX/Info.plist \"$bundle_contents/\"";
94 system "cp \"MacOSX/SDL Perl.icns\" \"$bundle_contents/Resources\"";