Switch to new download format and update source.sh

This commit is contained in:
2025-12-30 18:09:43 +02:00
parent f650bb1f4d
commit d0d3c2003b
5 changed files with 67 additions and 97 deletions
+10 -11
View File
@@ -2,25 +2,20 @@
# 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
DOWNLOAD="https://www.lua.org/ftp/lua-${BPM_PKG_VERSION}.tar.gz"
FILENAME="${DOWNLOAD##*/}"
# 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
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
wget "$DOWNLOAD"
tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE"
cd "$BPM_SOURCE"
patch -Np1 -i ../lua-shared-library.patch # Patch from BLFS
mv ../lua.pc ./lua.pc
# Patch for compiling a shared library
patch -Np1 -i "$BPM_WORKDIR"/liblua.patch
# Create lua pkgconfig file
sed -e "s/%V/${BPM_PKG_VERSION%.*}/" -e "s/%R/${BPM_PKG_VERSION}/" "$BPM_WORKDIR"/lua.pc.in > lua.pc
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
make linux
make MYCFLAGS="$CFLAGS -fPIC" MYLDFALGS="$LDFLAGS" linux
}
# The check function is executed in the source directory
@@ -37,6 +32,10 @@ package() {
# Install pkg-config file
install -Dm644 lua.pc "$BPM_OUTPUT"/usr/lib/pkgconfig/lua.pc
# Install documentation
install -d "$BPM_OUTPUT"/usr/share/doc/lua
install -m644 doc/*.{gif,png,css,html} "$BPM_OUTPUT"/usr/share/doc/lua
# Install license
install -Dm644 "$BPM_SOURCE"/doc/readme.html "$BPM_OUTPUT"/usr/share/licenses/lua/readme.html
}