# aryarya/cfg - "Build" settings for package

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

[technotes]

1. The Laclin version of "aryarya" starts up in three stages:

      (a) A  "bash" wrapper named  "aryarya"  handles  single-instance
          setup and then executes a compiled 'C' program named "aryar-
          ya.middle".

      (b) "aryarya.middle" works around some problems and  then execu-
          tes a compiled 'C' program named "aryarya.main".

      (c) "aryarya.main" is the "aryarya" main program.

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

2. The  upstream version of "aryarya" has a  keyboard-related bug:  If
you abort  the program  (using either the window manager or a signal),
it breaks keyboard auto-repeat.

"aryarya.middle" does some required cleanup operations after  the main
executable exits.  This solves the problem for  window-manager  aborts
but not for signals.

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

3. The Laclin version of  "aryarya" makes four sound-related modifica-
tions:

      a. It disables the built-in background music.

      b. It uses an  external player (mikmod) to  play alternate back-
         ground music ("aryarya.middle" sets up this part).  Note: The
         alternate music is a  Creative Commons-licensed  piece  named
         "A Touch of Green".

      c. It disables the "boss" sound effect.

      d. It replaces  a  broken sound file  (the  "fire" sound effect)
         with a non-broken version.

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

[buildtimes]

00.00 hours (or 000.12 minutes) - HP EliteBook 8560w 32GB RAM
00.00 hours (or 000.13 minutes) - ThinkPad E540 i7 4x2 16GB RAM
00.00 hours (or 000.20 minutes) - Dell Inspiron 6400 2.0 GHz Intel Duo
                                  7200 2GB RAM
00.01 hours (or 000.35 minutes) - Compaq 1.7 GHz Intel Pentium 4 512MB
                                  RAM

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

[settings]
build    = default
exepack  = yes
license  = See "license*.txt" in installed tree
licfile  = COPYING
revision = numeric
unpack   = relaxed
setpaths = libkxl xorg
tmpsize  = 2M

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

[depends]
actools
libkxl
mikmod                          # Used at runtime
xorg

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

[configure]
tree2unixtext --run
patch -p1 < $PKGDIR_SPECIAL/aryarya-01-main.spcpat
patch -p1 < $PKGDIR_SPECIAL/aryarya-02-scorefile.spcpat

MANBASE=$PKGDIR_PROD/man
mkdir -p $MANBASE

bash ./configure \
    --prefix=$PKGDIR_PROD  \
    --build=$LACARCHBUILD  \
    --host=$LACARCHHOST    \
    --mandir=$MANBASE

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

[postbuild]
BINDIR=$PKGDIR_PROD/bin
DATADIR=$PKGDIR_PROD/data
XBINDIR=$PKGDIR_PROD/xbin
SPCDIR=$PKGDIR_SPECIAL

mkdir -p $BINDIR $DATADIR $XBINDIR

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

mv $BINDIR/spacearyarya $XBINDIR/aryarya.main

sed -e "s|__META_PREFIX__|$PKGDIR_PROD|g" \
      < $SPCDIR/aryarya-middle.c.in \
              > aryarya-middle.c

gcc -o $XBINDIR/aryarya.middle \
                aryarya-middle.c -lKXL -lX11

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

PROGBASE=aryarya
cd $BINDIR
cp $PKGDIR_SPECIAL/$PROGBASE.wrapper.in $PROGBASE
chmod 755  $PROGBASE

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

WAVDIR=$PKGDIR_PROD/share/SpaceAryarya/wav
rm -fr $WAVDIR/{bgm1,boss,fire}.wav
cd $WAVDIR
unzip -o $SPCDIR/fire.zip
cp -a $SPCDIR/atogreen.mod $DATADIR/aryarya.mod

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

# 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  = Not checked yet
url_home    = http://kxl.orz.hm/
url_lfs     = n/a

url_tarball = http://kxl.orz.hm/dl.php?file=\
SpaceAryarya-KXL-1.0.2.tar.gz&name=sh

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

[history]
250203 Patched to fix FTBFS with newer 'C' compilers