#!/bin/bash
# Download and cross-compile dependencies for Yoink. This script requires
-# bash, wget, unzip, tar, rsync, patch, make, install and sudo. Have fun!
+# bash, wget, md5sum, unzip, tar, patch, make and install. Have fun!
HOST="i686-mingw32"
PREFIX="/usr/$HOST/usr"
exit 1
}
-function sync()
-{
- # install the files from $DESTDIR to $PREFIX
- echo "Installing to $PREFIX..."
- sudo rsync -av $DESTDIR/$PREFIX/* $PREFIX/ || die "syncing dependencies"
-}
-
DESTDIR="`pwd`/deps"
mkdir -p $DESTDIR
rm -f $DESTDIR/README
-PACKAGE="zlib123-dll"
-cd $DESTDIR
-[[ ! -f $PACKAGE.zip ]] && (wget "http://www.zlib.net/$PACKAGE.zip" || die "downloading $PACKAGE")
-rm -rf $PACKAGE
-unzip -d $PACKAGE $PACKAGE.zip || die "unpackaging $PACKAGE"
-cd $PACKAGE
-($HOST-dlltool -d lib/zlib.def -l libzdll.a && \
-mkdir -p $DESTDIR/$PREFIX/{lib,include} && \
-install -p -m 0644 include/* $DESTDIR/$PREFIX/include/ && \
-install -p -m 0755 zlib1.dll $DESTDIR/$PREFIX/bin/ && \
-install -p -m 0755 libzdll.a $DESTDIR/$PREFIX/lib/ && \
-cd $DESTDIR/$PREFIX/lib && \
-ln -fs libzdll.a libz.dll.a) || die "installing $PACKAGE"
-
-PACKAGE="libogg-1.1.4"
-cd $DESTDIR
-[[ ! -f $PACKAGE.tar.gz ]] && (wget "http://downloads.xiph.org/releases/ogg/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
-rm -rf $PACKAGE
-tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
-cd $PACKAGE
-./configure --host=$HOST --prefix=$PREFIX || die "configuring $PACKAGE"
-make $MAKEOPTS || die "making $PACKAGE"
-make DESTDIR=$DESTDIR install || die "installing $PACKAGE"
-
-# install dependencies thus built thus far
-sync
PACKAGE="boost_1_42_0"
VERSION="1.42.0"
cd $DESTDIR
[[ ! -f $PACKAGE.tar.bz2 ]] && (wget "http://sourceforge.net/projects/boost/files/boost/$VERSION/$PACKAGE.tar.bz2/download" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+7bf3b4eb841b62ffb0ade2b82218ebe6 boost_1_42_0.tar.bz2
+EOL
+) || die "verifying $PACKAGE"
rm -rf $PACKAGE
tar xjf $PACKAGE.tar.bz2 || die "unpackaging $PACKAGE"
(mkdir -p $DESTDIR/$PREFIX/include && \
rm -rf $DESTDIR/$PREFIX/include/boost && \
cp -r $PACKAGE/boost $DESTDIR/$PREFIX/include/boost) || die "installing $PACKAGE"
+
PACKAGE="SDL-1.2.14"
cd $DESTDIR
[[ ! -f $PACKAGE.tar.gz ]] && (wget "http://www.libsdl.org/release/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+e52086d1b508fa0b76c52ee30b55bec4 SDL-1.2.14.tar.gz
+EOL
+) || die "verifying $PACKAGE"
rm -rf $PACKAGE
tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
cd $PACKAGE
make $MAKEOPTS || die "making $PACKAGE"
make DESTDIR=$DESTDIR install || die "installing $PACKAGE"
+
+PACKAGE="libogg-1.1.4"
+cd $DESTDIR
+[[ ! -f $PACKAGE.tar.gz ]] && (wget "http://downloads.xiph.org/releases/ogg/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+10200ec22543841d9d1c23e0aed4e5e9 libogg-1.1.4.tar.gz
+EOL
+) || die "verifying $PACKAGE"
+rm -rf $PACKAGE
+tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
+cd $PACKAGE
+./configure --host=$HOST --prefix=$PREFIX || die "configuring $PACKAGE"
+make $MAKEOPTS || die "making $PACKAGE"
+make DESTDIR=$DESTDIR install || die "installing $PACKAGE"
+
+
PACKAGE="libvorbis-1.2.3"
cd $DESTDIR
[[ ! -f $PACKAGE.tar.gz ]] && (wget "http://downloads.xiph.org/releases/vorbis/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+5aa77f55c0e0aab8eb8ed982335daac8 libvorbis-1.2.3.tar.gz
+EOL
+) || die "verifying $PACKAGE"
rm -rf $PACKAGE
tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
cd $PACKAGE
-./configure --host=$HOST --prefix=$PREFIX || die "configuring $PACKAGE"
+./configure --host=$HOST --prefix=$PREFIX \
+CPPFLAGS="-I$DESTDIR/$PREFIX/include" \
+LDFLAGS="-L$DESTDIR/$PREFIX/lib" || die "configuring $PACKAGE"
make $MAKEOPTS || die "making $PACKAGE"
make DESTDIR=$DESTDIR install || die "installing $PACKAGE"
+
PACKAGE="openal-soft-1.11.753-bin"
cd $DESTDIR
[[ ! -f $PACKAGE.zip ]] && (wget "http://kcat.strangesoft.net/$PACKAGE.zip" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+20747ce5ca0f902ae082fef15d7b41a5 openal-soft-1.11.753-bin.zip
+EOL
+) || die "verifying $PACKAGE"
rm -rf $PACKAGE
unzip $PACKAGE.zip || die "unpackaging $PACKAGE"
cd $PACKAGE
EOL
) || die "installing $PACKAGE"
+
+PACKAGE="zlib123-dll"
+cd $DESTDIR
+[[ ! -f $PACKAGE.zip ]] && (wget "http://www.zlib.net/$PACKAGE.zip" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+cc7fa97f9c19386bb701acc79d0abbca zlib123-dll.zip
+EOL
+) || die "verifying $PACKAGE"
+rm -rf $PACKAGE
+unzip -d $PACKAGE $PACKAGE.zip || die "unpackaging $PACKAGE"
+cd $PACKAGE
+($HOST-dlltool -d lib/zlib.def -l libzdll.a && \
+mkdir -p $DESTDIR/$PREFIX/{lib,include} && \
+install -p -m 0644 include/* $DESTDIR/$PREFIX/include/ && \
+install -p -m 0755 zlib1.dll $DESTDIR/$PREFIX/bin/ && \
+install -p -m 0755 libzdll.a $DESTDIR/$PREFIX/lib/ && \
+cd $DESTDIR/$PREFIX/lib && \
+ln -fs libzdll.a libz.dll.a) || die "installing $PACKAGE"
+
+
PACKAGE="libpng-1.4.1"
cd $DESTDIR
[[ ! -f $PACKAGE.tar.gz ]] && (wget "http://prdownloads.sourceforge.net/libpng/$PACKAGE.tar.gz?download" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+fa0b2a84733463f90d3ac9f43ccafabc libpng-1.4.1.tar.gz
+EOL
+) || die "verifying $PACKAGE"
rm -rf $PACKAGE
tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
cd $PACKAGE
-./configure --host=$HOST --prefix=$PREFIX || die "configuring $PACKAGE"
+./configure --host=$HOST --prefix=$PREFIX \
+CPPFLAGS="-I$DESTDIR/$PREFIX/include" \
+LDFLAGS="-L$DESTDIR/$PREFIX/lib" || die "configuring $PACKAGE"
make $MAKEOPTS || die "making $PACKAGE"
make DESTDIR=$DESTDIR install || die "installing $PACKAGE"
+
PACKAGE="lua-5.1.4"
cd $DESTDIR
[[ ! -f $PACKAGE.tar.gz ]] && (wget "http://www.lua.org/ftp/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
+(md5sum -c <<"EOL"
+d0870f2de55d59c1c8419f36e8fac150 lua-5.1.4.tar.gz
+EOL
+) || die "verifying $PACKAGE"
rm -rf $PACKAGE
tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
cd $PACKAGE
make INSTALL_TOP=$DESTDIR/$PREFIX install || die "installing $PACKAGE"
chmod 755 $DESTDIR/$PREFIX/lib/liblua.dll.a
+
# libopengl32 and libglu32 pc files
mkdir -p $DESTDIR/$PREFIX/lib/pkgconfig
cat >$DESTDIR/$PREFIX/lib/pkgconfig/gl.pc <<EOL
Cflags: -I\${includedir}
EOL
-sync
cd $DESTDIR/$PREFIX
cat >README <<EOL
Yoink Win32 Dependencies
-Created `date`
+Created `date +"%d %b %Y"`
+
+These dependencies were generated automatically by makedeps.sh, a script
+available in the Yoink repository. You should find here all the header
+files, DLL's, implibs, and pkgconfig files required to build Yoink that are
+not provided with the standard mingw32 toolchain. Yoink itself can be
+built with mingw32 and these installed dependencies like this:
-These dependencies were generated automatically by makedeps.sh available in
-the Yoink repository. You should find here all the header files, DLL's,
-implibs, and pkgconfig files required to build Yoink that are not provided
-with the standard mingw32 toolchain.
+./configure --host=$HOST --prefix=$PREFIX \\
+ PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
+make && make package
These files are licensed such that their general distribution under
reasonable conditions is allowable. The copyrights of these binaries go to
their various respective owners. Look up the specific library for specific
-terms and conditions, or see the COPYING file in the Yoink package.
+terms and conditions, or see the file COPYING in the Yoink package.
EOL
tar cjf deps.tar.bz2 * || die "archiving dependencies"
mv deps.tar.bz2 $DESTDIR/..
echo "Done!"
+echo "The dependencies are packed into the archive deps.tar.bz2."