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

3ds: add luajit #135

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions 3ds/luajit/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributor: Teddy Astie <[email protected]>

pkgname=3ds-luajit
pkgver=2.0.5
pkgrel=1
pkgdesc='Just-in-time compiler and drop-in replacement for Lua 5.1 (for Nintendo 3DS homebrew development)'
arch=('any')
url='http://luajit.org/'
license=('MIT')
options=(!strip)
makedepends=('3ds-pkg-config' 'devkitpro-pkgbuild-helpers')
source=("https://luajit.org/download/LuaJIT-$pkgver.tar.gz")
sha256sums=('874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979')
groups=('3ds-portlibs')

build() {
cd LuaJIT-$pkgver
source /opt/devkitpro/3dsvars.sh

# Remove link options.
sed -i -e "s| *-Wl,-E||g" -e "s|-ldl||g" etc/luajit.pc

touch src/luajit src/jit/vmdef.lua
make BUILDMODE=static \
TARGET_FLAGS="$CFLAGS -I$PORTLIBS_PREFIX/include" TARGET_T=libluajit.a \
CFLAGS="" LDFLAGS="" LIBS="" HOST_CFLAGS="" HOST_LIBS="" HOST_LDFLAGS="" \
HOST_CC="gcc -m32" XCFLAGS="-DLUAJIT_USE_SYSMALLOC" CROSS=${TOOL_PREFIX} \
amalg
}

package() {
cd LuaJIT-$pkgver
source /opt/devkitpro/3dsvars.sh

make PREFIX=$PORTLIBS_PREFIX DESTDIR=$pkgdir INSTALL_DEP= install

cd $pkgdir$PORTLIBS_PREFIX
rm -rf bin share lib/lua
}