# supertux/cfg - "Build" settings for package

#---------------------------------------------------------------------

[technotes]

1. The Laclin version of SuperTux 0.6.X and above includes the follow-
ing changes:

      * It  adds most of  the  background images that  came previously
        with  SuperTux 0.3.3  using their original relative pathnames.
        This makes it possible  for some older  SuperTux levels and/or
        worlds to work with newer releases of the program.

      * It adds extra SuperTux levels and/or worlds.

      * On world-maps, Tux is now allowed to walk past levels that the
        player hasn't solved yet.

      * It adds a single-instance feature.  Specifically,  if you exe-
        cute  "supertux" and the program is already running,  the com-
        mand simply brings the existing instance to the front.

#---------------------------------------------------------------------

[buildtimes]

00.11 hours (or 006.65 minutes) - ThinkPad W530 i7 4x2 32GB RAM

#---------------------------------------------------------------------

[settings]
license  = See "license*.txt" in installed tree
licfile  = LICENSE.txt
tmpsize  = 375M

setpaths = \
curl    freetype2  libglew  libogg \
libpng  libvorbis  openal   sdl2 \
zlib

#---------------------------------------------------------------------

[depends]
boost
cmake
curl
expat
freetype2
gtkcore
libglew
libicu
libogg
libpng
libsamplerate
libvorbis
openal
pulseaudio
sdl
tiff
xorg
zlib

#---------------------------------------------------------------------

[configure]
mkdir obj && cd obj
cmake \
    -DCMAKE_BUILD_TYPE=RELEASE           \
    -DCMAKE_INSTALL_PREFIX=$PKGDIR_PROD  \
    -DCMAKE_INSTALL_LIBDIR=lib           \
    ..

#---------------------------------------------------------------------

[build]
export LACINCDIRS=$LACINCDIRS:$PRODTREE/sdl2/include/SDL2

cd obj
smpmake
make install

#---------------------------------------------------------------------

[postbuild]
BINDIR=$PKGDIR_PROD/bin
SHADIR=$PKGDIR_PROD/share/games/supertux2
BASE=supertux
mkdir -p $BINDIR

cd $BINDIR
cp -p $PKGDIR_SPECIAL/$BASE.wrapper.in $BASE
chmod 755 $BASE

cd $PKGDIR_PROD/games
cat > $BASE.bin << END
cd $PRODTREE/$BASE/games/
exec ./supertux2
END
chmod 755 $BASE.bin

cd $SHADIR/levels/
unzip -qo $PKGDIR_SPECIAL/stux-added-levels.zip
mv     Dr_Small_s_Domain/*.jpg      $SHADIR/images/background/
rm -fr Dr_Small_s_Domain/readme.txt
cd                                  $SHADIR/images/background/
unzip -qo $PKGDIR_SPECIAL/stux-bgim-033.zip

#---------------------------------------------------------------------

# Original URLs. These URLs were valid at one point, but may have died
# since then. If you download newer versions of tarballs [etc.], don't
# delete  the  original versions,  as you may not  be able  to replace
# them.

[urls]
url_debian  = tbd
url_home    = tbd
url_lfs     = tbd

url_tarball = https://github.com/SuperTux/supertux/releases/\
download/v0.6.2/SuperTux-v0.6.2-Source.tar.gz

#---------------------------------------------------------------------

[history]
070315 Added package. Started with 0.1.3.
211019 Replaced some add-on levels