0: #!/usr/bin/zsh
1: #
2: # This is a Zsh script for downloading, building, and
3: # installing SDL-Perl 1.17.4. I wrote it for a friend who
4: # was having a hard time installing SDL-Perl, and I
5: # figured there might be someone on here who would find it
6: # useful. I didn't want all this work to go to waste,
7: # afterall.
8: #
9: # Think of it as a poor man's qx(apt-get install libsdl-perl),
10: # and get it while it's hot, because it only works for
11: # SDL-Perl 1.17.4. You won't want to use it after Dave
12: # releases a newer version. (At least not without modifications).
13:
14: # -------------------------------------------------------
15: #
16: # In order for this script to work, you must have the
17: # following things installed:
18: #
19: # [ debian packages ]
20: # - sudo
21: # - wget
22: # - libsdl1.2-dev
23: # - libsdl1.2-debian
24: # - zsh
25: # - and the rest of the usual suspects
26: # like g++, autoconf, patch, etc.
27:
28: # After you have all that set up, just run this script and
29: # it will download and install a pretty decent SDL-Perl
30: # for you.
31:
32: # You might not like the way it does certain things, but I
33: # think this script is layed out simply enough that you
34: # can make certain tweaks to it that will make it just
35: # right for your system.
36:
37: # [ extra libs ]
38: # x SDL_gfx-2.0.3.tar.gz
39: # x SDL_image-1.2.2.tar.gz
40: # x SDL_mixer-1.2.3.tar.gz
41: # x SDL_net-1.2.4.tar.gz
42: # x SDL_ttf-2.0.5.tar.gz
43: # o smpeg-0.4.4.tar.gz :-( c++ was uncooperative )
44: #
45: # [ gl from sgi ]
46: # o ogl-sample.20000807.tgz mesa is good enough for now
47:
48: alias p print
49:
50: url="http://www.sdlperl.org/downloads"
51:
52: sdl_src=SDL_perl-1.17.4.tar.gz
53:
54: src=(
55: SDL_gfx-2.0.3.tar.gz
56: SDL_image-1.2.2.tar.gz
57: SDL_mixer-1.2.3.tar.gz
58: SDL_net-1.2.4.tar.gz
59: SDL_ttf-2.0.5.tar.gz
60: )
61:
62: deb=(
63: wget
64: patch
65: mikmod
66: timidity
67: vorbis-tools
68: libfreetype6-dev
69: libjpeg62-dev
70: libpng2-dev
71: libtiff3g-dev
72: libungif4-dev
73: xlibmesa-dev
74: )
75:
76: typeset -A cfg
77: cfg[SDL_gfx]=""
78: cfg[SDL_image]="--enable-tif --enable-xcf"
79: cfg[SDL_mixer]=""
80: cfg[SDL_net]="--disable-gui"
81: cfg[SDL_ttf]=""
82:
83: p install debian packages
84: [ -e /etc/alternatives ] && sudo apt-get install $deb
85:
86: p get sources
87: for i in $src ; do
88: [ -e $i ] || wget $url/utils/$i
89: done
90: [ -e $sdl_src ] || wget $url/$sdl_src
91:
92: p untar sources
93: for i in $src $sdl_src ; do
94: pkg=${i/.tar.gz/}
95: if [ -d $pkg ] ; then
96: pushd $pkg && make clean
97: popd
98: else
99: tar zxvf $i
100: fi
101: done
102:
103: p build auxiliary packages
104: for i in $src ; do
105: # pkg
106: pkg=${i/.tar.gz/}
107:
108: # prefix
109: prefix=/opt/$pkg
110:
111: # build
112: pushd $pkg
113: echo $pkg ./configure ${cfg[${pkg/-*/}]}
114: sleep 3
115: ./configure ${cfg[${pkg/-*/}]}
116: make
117:
118: # install (normal)
119: sudo make install
120:
121: # install (symlink tree from /opt to /usr/local)
122: # [note] google knows how to find "lncp"
123: #sudo make install prefix=$prefix
124: #cd /opt
125: #sudo lncp $pkg /usr/local
126: popd
127: done
128:
129: p build sdlperl
130: cd SDL_perl*(/)
131:
132: #
133: # LOOK! Perl code, below! ;-) I'm not entirely off-topic.
134: #
135: ( echo '37a38;' ;
136: echo '> $inc_flags .= join(" ", map { "-I$_" } @dirs);' ) \
137: | patch Makefile.linux
138:
139: perl Makefile.linux
140: make
141: sudo make install
142:
In reply to SDL-Perl Installation Script by beppu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |