# 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 putting downloaded files to the correct location or applying patches prepare() { cd "$BPM_SOURCE"/FreeImage patch -Np1 -i "$BPM_WORKDIR"/freeimage-unbundle.patch # Patch from AUR, but originates from Fedora rm -r Source/Lib* Source/ZLib Source/OpenEXR > Source/FreeImage/PluginG3.cpp > Source/FreeImageToolkit/JPEGTransform.cpp # Patches from AUR patch -p1 -i "$BPM_WORKDIR"/freeimage-libraw-0.20.patch # Fix build with libraw 0.20 patch -p1 -i "$BPM_WORKDIR"/freeimage-libraw-0.21.patch # Fix build with libraw 0.21 } # The build function is executed in the source directory # This function is used to compile the source code build() { cd FreeImage sh gensrclist.sh sh genfipsrclist.sh make -f Makefile.gnu make -f Makefile.fip } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { cd FreeImage make -f Makefile.gnu DESTDIR="$BPM_OUTPUT" install make -f Makefile.fip DESTDIR="$BPM_OUTPUT" install # Install package licenses install -Dm644 license-*.txt -t "$BPM_OUTPUT"/usr/share/licenses/freeimage }