Skip to content

Commit

Permalink
lua: fix .pc file and rename importlib to just liblua
Browse files Browse the repository at this point in the history
The pc target in the make file is bogus, use the template from Arch
(or parts of it). And don't include the version in the import lib
to keep things simple.
  • Loading branch information
lazka committed Oct 1, 2024
1 parent 1e524f7 commit 9ff49b6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lua/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@
pkgname=lua
pkgver=5.4.7
_majorver=${pkgver%.*}
pkgrel=1
pkgrel=2
pkgdesc='Powerful lightweight programming language designed for extending applications'
arch=('x86_64')
url='https://www.lua.org/'
makedepends=('make' 'gcc')
license=('spdx:MIT')
source=(https://www.lua.org/ftp/lua-$pkgver.tar.gz)
sha256sums=('9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30')
source=(https://www.lua.org/ftp/lua-$pkgver.tar.gz
lua.pc)
sha256sums=('9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30'
'925fd82adde7e6a83a6f63531b7c21f5c5133436e8947aeaab0c707ef3972858')

prepare() {
sed "s/%VER%/$_majorver/g;s/%REL%/$pkgver/g" lua.pc > lua-$pkgver/lua.pc
}

build() {
cd "lua-$pkgver"

make \
CFLAGS="${CFLAGS}" \
AR="${CC} -shared -Wl,--out-implib,liblua${_majorver}.dll.a -o" \
AR="${CC} -shared -Wl,--out-implib,liblua.dll.a -o" \
RANLIB=: \
LUA_A="msys-lua-${_majorver}.dll" \
linux
Expand All @@ -28,16 +34,12 @@ package() {

make \
TO_BIN="msys-lua-${_majorver}.dll lua.exe luac.exe" \
TO_LIB="liblua${_majorver}.dll.a" \
TO_LIB="liblua.dll.a" \
INSTALL_TOP="$pkgdir"/usr \
INSTALL_INC="$pkgdir"/usr/include \
INSTALL_LIB="$pkgdir"/usr/lib \
INSTALL_MAN="$pkgdir"/usr/share/man/man1 \
install

mkdir -p "$pkgdir/usr/lib/pkgconfig"
make pc \
INSTALL_TOP=/usr \
INSTALL_INC=/usr/include \
INSTALL_LIB=/usr/lib > "$pkgdir"/usr/lib/pkgconfig/lua.pc
install -Dm644 lua.pc "$pkgdir"/usr/lib/pkgconfig/lua.pc
}
14 changes: 14 additions & 0 deletions lua/lua.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
V=%VER%
R=%REL%

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Lua
Description: An Extensible Extension Language
Version: ${R}
Requires:
Libs: -L${libdir} -llua
Cflags: -I${includedir}

0 comments on commit 9ff49b6

Please sign in to comment.