Files

51 lines
2.1 KiB
Bash

# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for downloading files and putting them into the correct location
prepare() {
cd "$BPM_SOURCE"
# Fix warning about underquoted definition of AM_PATH_AALIB
# https://sourceforge.net/p/aa-project/patches/5/
patch -Np0 -i ../aclocal-fixes.patch
# Fix --with-aalib-prefix argument
# https://sourceforge.net/p/aa-project/patches/9/
patch -Np0 -i ../aalib-m4.patch
# Fix builtin-declaration-mismatch compiler warnings
# https://sourceforge.net/p/aa-project/bugs/10/
patch -Np1 -i ../aalib-c99.patch
# Fix free-nonheap-object compiler warning
patch -Np1 -i ../aalib-free-offset-pointer.patch
# Fix aggressive-loop-optimizations compiler warning
patch -Np1 -i ../aalib-key-down-OOB.patch
# Fix 'return' with no value compiler warning
patch -Np1 -i ../aalib-aalinuxkbd-return.patch
# Fix build for ncurses built with opaque-curses option
patch -Np1 -i ../aalib-opaque-ncurses-fix.patch
# Fix rendering with custom aspect ratio
patch -Np1 -i ../aalib-fix-aarender.patch
# Fix typo for KEY_MOUSE condition
patch -Np1 -i ../aalib-mouse.patch
# Fix build (too many arguments)
sed -i 's/Gpm_Wgetch(stdscr)/Gpm_Wgetch()/' src/aacurkbd.c
autoreconf -fi
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
./configure --prefix=/usr --with-curses-driver --disable-static
make
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
make DESTDIR="$BPM_OUTPUT" install
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/aalib/COPYING
}