Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

development/luarocks: Fix for newer lua. #8468

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions development/luarocks/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
LuaRocks is a deployment and management system for Lua modules,
with automatic dependency checking, with access to remote
repositories and local rock source trees.

This build script by default builds for a "default Lua", which
will be 5.1 on "older" SBo tree, and 5.4 on "newer" SBo tree,
and on "-current" as of 2024-10-23.

It will pick up the compatibility interpreter "Lua 5.1", if
it is present.
44 changes: 35 additions & 9 deletions development/luarocks/luarocks.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# 20241023 lwf: Modified by SlackBuilds.org, BUILD=2:
# - support lua5.1 and lua 5.4 for 15.0 and 15.1


cd $(dirname $0) ; CWD=$(pwd)

PRGNAM="luarocks"
VERSION=${VERSION:-2.4.1}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

Expand Down Expand Up @@ -79,15 +83,37 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-lua-lib=/usr/lib$LIBDIRSUFFIX
# CFLAGS="$SLKCFLAGS" \
# CXXFLAGS="$SLKCFLAGS" \
# ./configure \
# --prefix=/usr \
# --sysconfdir=/etc \
# --versioned-rocks-dir \
# --with-lua-lib=/usr/lib$LIBDIRSUFFIX
# make build
# make install DESTDIR=$PKG

sed -i '/Invalid Lua version/d' configure

runmake ()
(
args=(--prefix=/usr
--sysconfdir=/etc
--lua-version="$(pkg-config --variable=V "$1")"
--with-lua-lib=/usr/lib$LIBDIRSUFFIX
--with-lua-include=/usr/include/"$2"
--versioned-rocks-dir)
if [[ "$3" != "" ]] ; then args=("${args[@]}" --lua-suffix="$3") ; fi
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure "${args[@]}"
make build
make install DESTDIR=$PKG
)

pkg-config --exists lua51 && runmake lua51 "lua5.1" "51"
runmake lua "" ""

make build
make install DESTDIR=$PKG

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
Expand Down