From: Charles McGarvey Date: Fri, 5 Mar 2010 22:43:48 +0000 (-0700) Subject: now can create win32 portable packages X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=0b8dbc2d02c7f78d273ad9cfdf05c927c648ffd1;p=chaz%2Fyoink now can create win32 portable packages --- diff --git a/COPYING b/COPYING index 1948e77..5b126c9 100644 --- a/COPYING +++ b/COPYING @@ -55,7 +55,7 @@ Copyright: (c) 2000-2004 Unicode, Inc. Copyright: (c) 2002 Bob Pendleton License: LGPL-2.1 - Portion: libpng-3.dll + Portion: libpng14-14.dll Source: http://www.libpng.org/pub/png/libpng.html Copyright: (c) 2004, 2006-2009 Glenn Randers-Pehrson License: libpng diff --git a/Makefile.am b/Makefile.am index bb29cd0..f3c3773 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,24 +3,29 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = data doc src -EXTRA_DIST = autogen.sh extra +EXTRA_DIST = autogen.sh extra win32 -.PHONY: run debug docs package +.PHONY: run debug docs portable installer run: all - @cd src && $(MAKE) run + @$(CD) src && $(MAKE) run debug: all - @cd src && $(MAKE) debug + @$(CD) src && $(MAKE) debug docs: $(DOXYGEN) if WIN32 -package: all - @cd win32 && $(MAKE) installer -else -package: dist-bzip2 + +portable: all + $(SH) win32/makepackage.sh -p $(prefix) -d "$(DATA_FILES)" \ + -s $(STRIP) -V $(VERSION) + +installer: all + $(SH) win32/makepackage.sh -p $(prefix) -d "$(DATA_FILES)" \ + -s $(STRIP) -V $(VERSION) -i $(MAKENSIS) + endif diff --git a/README b/README index 7994e69..6c69f0a 100644 --- a/README +++ b/README @@ -13,7 +13,6 @@ II. Developers b) Sending patches III. Packagers a) The build system - b) Targeting Win32 I. Users @@ -69,7 +68,7 @@ library. These classes and helper functions reside in the Mf namespace. Since I wrote this code alongside the Yoink-specific stuff, there is somewhat of a blurry line between the two categories, unfortunately. -3. 3rd-party code. +3. Third-party code. This is made up of free code from other projects or libraries (aside from the explicit dependencies above), the licenses of which are also in the @@ -83,7 +82,7 @@ email me your stuff or tell me where to pull from (git). If you're interested in that, please observe the following: * Stick to the coding style of the source code files you edit. Follow the - general style of method and variable naming, as well as white spacing + general style of method and variable naming, as well as white space formatting. In particular, use literal tabs with an assumed tabstop of 4 characters. Also, limit line lengths to 75 characters. @@ -92,7 +91,7 @@ interested in that, please observe the following: and conditions as the files you edit, usually the 2-clause BSD license. * If you want your name and contact information in the file AUTHORS, - please just add it in the patch you provide. + please make it so in the patch you provide. III. Packagers @@ -101,25 +100,7 @@ III. Packagers a) The build system You can probably tell that the build system of this package is built from -autoconf and automake. It should be fairly sane. If you find any build -system problems or code which doesn't compile cleanly on your platform, -feel free to send back patches. - -b) Targeting Win32 - -If you have a working mingw32 toolchain with all the dependencies, you can -build a win32 binary using a command such as this: - -./configure --host=mingw32 --prefix=/usr/mingw32/usr - -where mingw32 is the correct name of your toolchain and the prefix points -to the installation of your toolchain. I maintain an archive of most of -the dependencies. The package is in the git repository; just unzip it onto -your toolchain and configure/compile. If everything goes smoothly, you -should have a new, shiny yoink.exe. You can then build a complete -installer using "make package" if you have nsis installed. - -I haven't tried building with cygwin or mingw32 on an actual Windows -machine, and I certainly haven't tried to do it with Visual Studio. You're -on your own if you go that route. +autoconf and automake. It should be fairly sane. If you find any +packaging-related problems or code which doesn't compile cleanly on your +platform, feel free to send patches. diff --git a/configure.ac b/configure.ac index a35b3a4..9331964 100644 --- a/configure.ac +++ b/configure.ac @@ -343,12 +343,6 @@ AC_CONFIG_FILES([Makefile doc/yoink.6 src/Makefile]) -if test x$WIN32 = xyes -then - AC_CONFIG_FILES([win32/Makefile win32/mkpackage.sh win32/yoink.nsi]) -fi - - AC_CONFIG_HEADERS([src/config.h]) AC_OUTPUT diff --git a/doc/man2html.sh b/doc/man2html.sh new file mode 100755 index 0000000..49f6c72 --- /dev/null +++ b/doc/man2html.sh @@ -0,0 +1,88 @@ +#!/bin/sh + +# +# Yoink +# Run this script to convert the manual page to html. +# +# Requires groff. +# Have fun! +# + +function showhelp() +{ + echo "Create an html manual page." + echo "Usage: $0 [-Hfh] [-i manpage] [-o htmlfile]" + echo "" + echo " -H Hide email addresses in the manual page." + echo " -f Force overwrite of output file." + echo " -h Show this help an exit." + echo " -i Specify the manual page to convert." + echo " -o Specify output path of html file." +} + +INFILE="doc/yoink.6" +OUTFILE="yoink.html" + +while getopts ":Hfhi:o:" opt +do + case $opt in + H) + HIDE_EMAIL=yes + ;; + f) + FORCE=yes + ;; + h) + showhelp + exit 0 + ;; + i) + INFILE="$OPTARG" + ;; + o) + OUTFILE="$OPTARG" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + showhelp + exit 1 + ;; + esac +done + +if test x$FORCE != xyes && test -e "$OUTFILE" +then + echo "Refusing to overwrite file: $OUTFILE. Use -f to override." >&2 + exit 1 +fi + +if test ! -f "$INFILE" +then + echo "Can't open file: $INFILE" >&2 + exit 1 +fi + +DATE=$(date +"%d %b %Y") + +# 1. Remove first two lines (comments about groff). +# 2. Edit page title. +# 3. Insert a footer before . +HTML=$(groff -t -e -mandoc -Thtml "$INFILE" | sed -e "1,2d" \ +-e "s|.*|Yoink Manual|" -e "s||\ +

\\ +This manual page was generated on $DATE.\\ +For more information, go to the\\ +Yoink website.\\ +

\\ +|") + +if test x$HIDE_EMAIL = xyes +then +# 4. Replace email addresses with a placeholder. + echo "$HTML" \ + | sed -e "s|<.*@.*>|\<email address not shown\>|g" \ + >"$OUTFILE" +else + echo "$HTML" >"$OUTFILE" +fi + diff --git a/doc/yoink.6.in b/doc/yoink.6.in index 4de4353..01f14bd 100644 --- a/doc/yoink.6.in +++ b/doc/yoink.6.in @@ -180,7 +180,7 @@ the \fBframerate\fP to a point such that the actual framerate is basically constant. A constant 20fps or 30fps will look better than a sporadic 40-60fps. You can also decrease the \fBtimestep\fP at the expense of decreased simulation accuracy. You'll have to experiment with this value -to find out acceptable levels. +to determine acceptable levels. .PP If you are having audio problems, you may need to upgrade OpenAL. Some systems still provide an old, busted version of OpenAL which may result in @@ -189,12 +189,12 @@ of openal-soft, a high-quality software implementation that is still being maintained. .SH BUGS .IP \(bu 3 -The robots are currently lacking in intelligence. +The robots aren't very bright. .IP \(bu Although the pixelated graphics are intentional, there are some unintended artifacts which are more obvious with certain video drivers. .PP -Send bug reports, patches, and love notes to: +Send bug reports, patches and love notes to: .IP Charles McGarvey <@PACKAGE_BUGREPORT@> .SH AUTHOR diff --git a/extra/PKGBUILD b/extra/PKGBUILD new file mode 100644 index 0000000..fed4e99 --- /dev/null +++ b/extra/PKGBUILD @@ -0,0 +1,31 @@ +# Contributor: Charles McGarvey +pkgname=yoink +pkgver=@VERSION@ +pkgrel=1 +pkgdesc="Alien-smashing action game" +arch=('i686' 'x86_64') +url="http://www.dogcows.com/yoink" +license=('BSD') +groups=() +depends=('libgl' 'libpng' 'libvorbis' 'lua' 'openal' 'sdl') +makedepends=('boost' 'pkgconfig') +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install= +source=(http://www.dogcows.com/yoink/$pkgname-$pkgver.tar.bz2) +noextract=() +md5sums=('@CHECKSUM@') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr + make || return 1 + make DESTDIR="$pkgdir/" install +} + +# vim:set ts=2 sw=2 et: diff --git a/src/Makefile.am b/src/Makefile.am index c87c412..9a7f514 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,8 +29,8 @@ libmoof_a_SOURCES = \ Moof/Event.hh \ Moof/Frustum.cc \ Moof/Frustum.hh \ - Moof/Hash.cc \ - Moof/Hash.hh \ + Moof/HashTools.cc \ + Moof/HashTools.hh \ Moof/Image.cc \ Moof/Image.hh \ Moof/Interpolator.hh \ diff --git a/src/Moof/Hash.cc b/src/Moof/HashTools.cc similarity index 95% rename from src/Moof/Hash.cc rename to src/Moof/HashTools.cc index 357b531..9bcefe3 100644 --- a/src/Moof/Hash.cc +++ b/src/Moof/HashTools.cc @@ -9,7 +9,7 @@ * **************************************************************************/ -#include "Hash.hh" +#include "HashTools.hh" namespace Mf { @@ -31,7 +31,7 @@ namespace Mf { // 2. It will not produce the same results on little-endian and big-endian // machines. -unsigned getHash::operator()(const void* key, int len, +unsigned HashFunction::operator()(const void* key, int len, unsigned int seed) const { // 'm' and 'r' are mixing constants generated offline. diff --git a/src/Moof/Hash.hh b/src/Moof/HashTools.hh similarity index 87% rename from src/Moof/Hash.hh rename to src/Moof/HashTools.hh index e97ee25..5bed739 100644 --- a/src/Moof/Hash.hh +++ b/src/Moof/HashTools.hh @@ -9,8 +9,8 @@ * **************************************************************************/ -#ifndef _MOOF_HASH_HH_ -#define _MOOF_HASH_HH_ +#ifndef _MOOF_HASHTOOLS_HH_ +#define _MOOF_HASHTOOLS_HH_ #include @@ -20,7 +20,7 @@ namespace Mf { -struct getHash +struct HashFunction { // generic hash function unsigned operator()(const void* key, int len, @@ -40,5 +40,5 @@ struct getHash } // namespace Mf -#endif // _MOOF_HASH_HH_ +#endif // _MOOF_HASHTOOLS_HH_ diff --git a/src/Moof/Manager.hh b/src/Moof/Manager.hh index 2773a59..94f07ba 100644 --- a/src/Moof/Manager.hh +++ b/src/Moof/Manager.hh @@ -23,7 +23,7 @@ #include -#include +#include namespace Mf { @@ -49,7 +49,7 @@ public: private: - typedef stlplus::hash PtrMap; + typedef stlplus::hash PtrMap; static PtrMap mPtrMap; std::string mName; @@ -88,7 +88,7 @@ private: }; template -stlplus::hash Manager::mPtrMap; +stlplus::hash Manager::mPtrMap; } // namespace Mf diff --git a/win32/Makefile.am b/win32/Makefile.am deleted file mode 100644 index 016518b..0000000 --- a/win32/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -INSTALLER_NAME = yoinksetup-$(VERSION).exe - -.PHONY: installer -installer: - @echo "Building win32 installer..." - @(sh mkpackage.sh $(INSTALLER_NAME) 2> installer.log 1>&2 && \ - rm installer.log && echo "Done.") || \ - (echo "Installer compilation failed!"; \ - echo "Check installer.log for details."; exit 1) - diff --git a/win32/tools/makedeps.sh b/win32/makedeps.sh similarity index 74% rename from win32/tools/makedeps.sh rename to win32/makedeps.sh index f5988b1..e84fac0 100755 --- a/win32/tools/makedeps.sh +++ b/win32/makedeps.sh @@ -1,14 +1,81 @@ -#!/bin/bash - -# Download and cross-compile dependencies for Yoink. This script requires -# bash, wget, md5sum, unzip, tar, patch, make and install. Have fun! - -HOST="i686-mingw32" -PREFIX="/usr/$HOST/usr" +#!/bin/sh + +# +# Yoink +# Run this script to download and cross-compile dependencies for win32. +# +# A directory named deps will be created and/or populated in the current +# directory. Upon successful completion (be patient), the compiled +# dependencies will be packaged into an archive named deps.tar.bz2 in the +# current directory. To install the dependencies, execute this command: +# +# tar xf deps.tar.bz2 -C $PREFIX +# +# where $PREFIX is the path to your mingw32 toolchain. If problems occur, +# check stdout and stderr for clues. You may be able to easily determine +# the problem and make the necessary corrections. These packages will be +# downloaded and built: +# +# SDL 1.2.14 +# boost 1.42.0 (headers only) +# libogg 1.1.4 +# libpng 1.4.1 +# libvorbis 1.2.3 +# lua 5.1.4 +# openal-soft 1.11.753 +# zlib 1.2.3 +# +# This script requires a working mingw32 toolchain and other basic tools. +# Have fun! +# +# Example usage: +# ./makedeps.sh -H i486-mingw32 -p /usr/i486-mingw32 -m "-j8" +# +# Bugs: Each time the script is run, all of the dependencies will be +# rebuilt, even the ones which were already built successfully. +# + +function showhelp() +{ + echo "Download and cross-compile dependencies for win32." + echo "Usage: $0 [-h] [-m makeopts] -H host -p prefix" + echo "" + echo " -H Specify the name of your toolchain, like i486-mingw32." + echo " -h Show this help an exit." + echo " -m Specify options to be passed to make." + echo " -p Specify the path to your toolchain installation." +} -MAKEOPTS="-j8" +while getopts ":H:hm:p:" opt +do + case $opt in + H) + HOST="$OPTARG" + ;; + h) + showhelp + exit 0 + ;; + m) + MAKEOPTS="$OPTARG" + ;; + p) + PREFIX="$OPTARG" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + showhelp + exit 1 + ;; + esac +done + +if test x$HOST = x || test x$PREFIX = x +then + showhelp + exit 1 +fi -##### function die() { @@ -24,7 +91,7 @@ rm -f $DESTDIR/README 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") +test ! -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 @@ -38,7 +105,7 @@ 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") +test ! -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 @@ -53,7 +120,7 @@ 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") +test ! -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 @@ -68,7 +135,7 @@ 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") +test ! -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 @@ -85,7 +152,7 @@ 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") +test ! -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 @@ -116,7 +183,7 @@ EOL PACKAGE="zlib123-dll" cd $DESTDIR -[[ ! -f $PACKAGE.zip ]] && (wget "http://www.zlib.net/$PACKAGE.zip" || die "downloading $PACKAGE") +test ! -f $PACKAGE.zip && (wget "http://www.zlib.net/$PACKAGE.zip" || die "downloading $PACKAGE") (md5sum -c <<"EOL" cc7fa97f9c19386bb701acc79d0abbca zlib123-dll.zip EOL @@ -135,7 +202,7 @@ 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") +test ! -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 @@ -152,7 +219,7 @@ 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") +test ! -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 @@ -179,7 +246,7 @@ diff -ur lua-5.1.4.orig/Makefile lua-5.1.4/Makefile # What to install. -TO_BIN= lua luac -+TO_BIN= lua.exe luac.exe ++TO_BIN= lua.exe luac.exe lua51.dll TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp -TO_LIB= liblua.a +TO_LIB= liblua.a liblua.dll.a diff --git a/win32/makepackage.sh b/win32/makepackage.sh new file mode 100755 index 0000000..6cb1afa --- /dev/null +++ b/win32/makepackage.sh @@ -0,0 +1,143 @@ +#!/bin/sh + +# +# Yoink +# Run this script to create a portable win32 package. +# + +function showhelp() +{ + echo "Create a portable win32 package or installer." + echo "Usage: $0 [-h] [-i makensis] [-s strip] -d assets -V version -p prefix" + echo "" + echo " -d Specify the game assets to be included." + echo " -h Show this help an exit." + echo " -i To make an installer, specify the makensis program." + echo " -V Specify the version of the program to be packaged" + echo " -s To strip the binaries, specify the strip program." + echo " -p Specify the path to your toolchain installation." +} + +while getopts ":V:hd:i:p:s:" opt +do + case $opt in + V) + VERSION="$OPTARG" + ;; + d) + ASSETS="$OPTARG" + ;; + h) + showhelp + exit 0 + ;; + i) + MAKENSIS="$OPTARG" + ;; + p) + PREFIX="$OPTARG" + ;; + s) + STRIP="$OPTARG" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + showhelp + exit 1 + ;; + esac +done + +if test "x$ASSETS" = x || test "x$VERSION" = x || test "x$PREFIX" = x +then + showhelp + exit 1 +fi + +function die() +{ + rm -rf "$BUILD" + echo "die:" $@ + exit 1 +} + +ROOT="$PWD" +BUILD="$PWD/tmp-$$" +NAME="yoink-$VERSION" +ARCHIVE="$BUILD/$NAME" +INSTALLER_SCRIPT="$ROOT/win32/yoink.nsi" + +MAN2HTML="$ROOT/doc/man2html.sh" +UNIX2DOS="$ROOT/win32/unix2dos.sh" + +DLLS="libogg-0 libpng14-14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1" + + +if test ! -f "src/version.c" +then + echo "Run the script from the repository root directory." + exit 1 +fi + +if ! mkdir "$BUILD" +then + "The temp directory $BUILD could not be created." + exit 1 +fi +mkdir -p "$ARCHIVE" + + +cp -f "$ROOT/src/yoink.exe" "$ARCHIVE" || die "copying yoink.exe" +test "x$STRIP" != x && "$STRIP" "$ARCHIVE/yoink.exe" + +for dll in $DLLS +do + cp -f "$PREFIX/bin/$dll.dll" "$ARCHIVE" || die "copying $dll" + test "x$STRIP" != x && "$STRIP" "$ARCHIVE/$dll.dll" +done + +for asset in $ASSETS +do + cp -f --parents "data/$asset" "$ARCHIVE" +done + +for doc in AUTHORS ChangeLog COPYING README TODO +do + "$UNIX2DOS" "$doc" "$ARCHIVE/$doc.txt" || die "unix2dos $doc" +done + +"$MAN2HTML" -f -o "$ARCHIVE/Manual.html" +"$UNIX2DOS" "$ARCHIVE/Manual.html" + +cp -rf "$ROOT/doc/licenses" "$ARCHIVE" || die "copying doc/licenses" +cd "$ARCHIVE/licenses" +for license in $(ls) +do + (mv "$license" "$license.txt" && "$UNIX2DOS" "$license.txt") \ + || die "moving and unix2dos $license" +done +cd "$ROOT" + + +if test "x$MAKENSIS" = x +then +# build the portable archive + cd "$BUILD" + zip -r $NAME.zip $NAME || die "zipping portable archive" + cd "$ROOT" + mv "$BUILD/$NAME.zip" . + echo "Done! Package saved to $NAME.zip." +else +# build an installer + cd "$BULID" + "$MAKENSIS" "$INSTALLER_SCRIPT" \ + -DINSTALLFILES="$NAME" -DVERSION="$VERSION" \ + || die "running '$MAKENSIS'" + cd "$ROOT" + mv "$BUILD/$NAME.exe" . + echo "Done! Installer saved to $NAME.exe." +fi + + +rm -rf "$BUILD" + diff --git a/win32/mkpackage.sh.in b/win32/mkpackage.sh.in deleted file mode 100644 index 4a760d8..0000000 --- a/win32/mkpackage.sh.in +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# -# Yoink -# Run this script to create a win32 installer. -# This was blatantly yoinked and adapted from the Wormux Project. -# - -# Paths -SCRIPT="$PWD/yoink.nsi" -BUILD_DIR="$PWD/build" -ROOT_DIR="$PWD/.." - -# Programs -MAKENSIS="@MAKENSIS@" -STRIP="@STRIP@" -UNIX2DOS="$ROOT_DIR/tools/unix2dos" - -# DLL dependencies -DLLS="libogg-0 libpng14-14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1" - -# Prepare -rm -rf "$BUILD_DIR" -mkdir -p "$BUILD_DIR" - -cp -f "$ROOT_DIR/src/yoink.exe" "$BUILD_DIR" -#"${STRIP:-strip}" "$BUILD_DIR/yoink.exe" - -for dll in $DLLS -do - cp -f "@prefix@/bin/$dll.dll" "$BUILD_DIR" - #"${STRIP:-strip}" "BUILD_DIR/$dll.dll" -done - -cd "$ROOT_DIR" -for asset in @DATA_FILES@ -do - cp -f --parents "data/$asset" "$BUILD_DIR" -done - -cd "$ROOT_DIR" -for doc in AUTHORS ChangeLog COPYING README TODO -do - "$UNIX2DOS" "$doc" "$BUILD_DIR/$doc.txt" -done - -cd "$ROOT_DIR/doc" -cp -rf licenses "$BUILD_DIR" - -cd "$BUILD_DIR/licenses" -for license in $(ls) -do - mv "$license" "$license.txt" - "$UNIX2DOS" "$license.txt" -done - - -# -# Compile the installer and cleanup. -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -if ! "${MAKENSIS:-makensis}" "$SCRIPT" -then - echo "makensis failed, aborting..." - exit 1 -fi - -#rm -rf "$BUILD_DIR" - diff --git a/tools/unix2dos b/win32/unix2dos.sh similarity index 83% rename from tools/unix2dos rename to win32/unix2dos.sh index 3c171e5..c3ee7a8 100755 --- a/tools/unix2dos +++ b/win32/unix2dos.sh @@ -1,7 +1,9 @@ #!/bin/sh +# +# Yoink # An implementation of unix2dos using sed. -# Written by Charles McGarvey; released into the public domain. +# if [ -f "$1" ]; then diff --git a/win32/yoink.nsi.in b/win32/yoink.nsi similarity index 95% rename from win32/yoink.nsi.in rename to win32/yoink.nsi index b1a1aed..7f1b635 100644 --- a/win32/yoink.nsi.in +++ b/win32/yoink.nsi @@ -12,7 +12,7 @@ ;Name and file Name "Yoink" - OutFile "../yoinksetup-@VERSION@.exe" + OutFile "yoinksetup-$VERSION.exe" SetCompressor /SOLID lzma ;Default installation folder @@ -64,7 +64,7 @@ Section "Install Yoink!" SecInstallYoink SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... - File /r "build/*" + File /r "$INSTALLFILES/*" ;Store installation folder WriteRegStr HKCU "Software\Yoink" "" $INSTDIR @@ -78,9 +78,9 @@ Section "Install Yoink!" SecInstallYoink CreateShortCut "$SMPROGRAMS\Yoink\Uninstall.lnk" "$INSTDIR\uninstall.exe" WriteRegStr HKCU "Software\Games\Yoink" "" "$INSTDIR" - WriteRegStr HKCU "Software\Games\Yoink" "Version" "@VERSION@" + WriteRegStr HKCU "Software\Games\Yoink" "Version" "$VERSION" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink" "DisplayName" "Yoink" - WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink" "DisplayVersion" "@VERSION@" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink" "DisplayVersion" "$VERSION" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Yoink" "UninstallString" "$INSTDIR\uninstall.exe" SectionEnd