Skip to content

Commit 3c582e1

Browse files
committed
Update metadata, badge, and citation for 2025-07-09
1 parent 7dff0b9 commit 3c582e1

3 files changed

Lines changed: 117 additions & 46 deletions

File tree

.zenodo.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"language": "eng",
66
"upload_type": "software",
77
"access_right": "open",
8-
"version": "2025-04-28-151-gcf5bf12",
9-
"publication_date": "2025-07-05",
8+
"version": "2025-04-28-152-g7dff0b9-dirty",
9+
"publication_date": "2025-07-09",
1010
"creators": [
1111
{
1212
"name": "Porter, Matthew A.",
@@ -18,7 +18,7 @@
1818
"keywords": ["AI","Education","Healthcare","Post-Quantum Cryptography","Quantum","config","lua","neovim"],
1919
"related_identifiers": [
2020
{ "identifier": "https://github.com/qompassai/Lua", "relation": "isSupplementTo", "resource_type": "software" },
21-
{ "identifier": "https://github.com/qompassai/Lua/releases/tag/v2025-07-05", "relation": "isIdenticalTo", "resource_type": "software" },
21+
{ "identifier": "https://github.com/qompassai/Lua/releases/tag/v2025-07-09", "relation": "isIdenticalTo", "resource_type": "software" },
2222
{ "identifier": "https://orcid.org/0000-0002-0302-4812", "relation": "isAuthorOf", "resource_type": "person" },
2323
{ "identifier": "https://github.com/qompassai/Lua/actions", "relation": "isCompiledBy", "resource_type": "workflow" },
2424
{ "identifier": "https://loop.frontiersin.org/people/2230223", "relation": "isAuthorOf", "resource_type": "person" },

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ authors:
66
given-names: "Matthew A."
77
orcid: "https://orcid.org/0000-0002-0302-4812"
88
affiliation: "Qompass AI"
9-
version: "v2025-07-05"
10-
date-released: "2025-07-05"
9+
version: "v2025-07-09"
10+
date-released: "2025-07-09"
1111
repository-code: "https://github.com/qompassai/Lua"
1212
license: "Q-CDA-1.0"
1313
keywords:

scripts/quickstart.sh

Lines changed: 112 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,70 @@
11
#!/usr/bin/env bash
22
# qompassai/Lua/scripts/quickstart.sh
3-
# Qompass AI Diver Lua Quick Start
3+
# Qompass AI Diver · Lua + LuaRocks Quick‑Start
44
# Copyright (C) 2025 Qompass AI, All rights reserved
5-
#####################################################
5+
# --------------------------------------------------
66
set -euo pipefail
7+
8+
PREFIX="$HOME/.local"
9+
mkdir -p "$PREFIX/bin"
10+
NEEDED_TOOLS=(git curl tar make clang)
11+
MISSING=()
12+
need_tool() {
13+
local t=$1
14+
if command -v "$t" >/dev/null 2>&1; then
15+
return 0
16+
elif [[ -x "/usr/bin/$t" ]]; then
17+
ln -sf "/usr/bin/$t" "$PREFIX/bin/$t"
18+
echo " → Added symlink for $t in $PREFIX/bin (not originally in PATH)"
19+
return 0
20+
else
21+
return 1
22+
fi
23+
}
24+
25+
for tool in "${NEEDED_TOOLS[@]}"; do
26+
if ! need_tool "$tool"; then
27+
MISSING+=("$tool")
28+
fi
29+
done
30+
31+
if [[ ${#MISSING[@]} -gt 0 ]]; then
32+
echo "\n⚠ The following required tools are missing: ${MISSING[*]}"
33+
if command -v pacman >/dev/null 2>&1 && command -v sudo >/dev/null 2>&1; then
34+
echo "→ Attempting to install them system‑wide with sudo pacman -S --needed ${MISSING[*]}"
35+
if sudo -n true 2>/dev/null; then
36+
sudo pacman -Sy --needed --noconfirm "${MISSING[@]}"
37+
else
38+
echo " (sudo privileges required – please enter your password)"
39+
sudo pacman -Sy --needed "${MISSING[@]}"
40+
fi
41+
for t in "${MISSING[@]}"; do need_tool "$t"; done
42+
else
43+
echo " Please install them with your package manager, then re‑run this script."
44+
exit 1
45+
fi
46+
fi
47+
export PATH="$PREFIX/bin:$PATH"
48+
749
declare -A MENU=(
850
[1]="lua 5.1.5"
951
[2]="lua 5.2.4"
1052
[3]="lua 5.3.6"
1153
[4]="lua 5.4.6"
12-
[5]="luajit"
54+
[5]="LuaJIT"
1355
)
14-
echo "╭─────────────────────────────────────────────╮"
15-
echo "│ Qompass AI · Lua Quick-Start │"
16-
echo "╰─────────────────────────────────────────────╯"
17-
echo " © 2025 Qompass AI. All rights reserved "
18-
echo
19-
for k in "${!MENU[@]}"; do printf " %s) %s\n" "$k" "${MENU[$k]}"; done
20-
echo " a) all (default)"
21-
echo " q) quit"
22-
echo
56+
57+
printf '%s\n' "╭─────────────────────────────────────────────╮"
58+
printf '%s\n' "│ Qompass AI · Lua Quick‑Start │"
59+
printf '%s\n' "╰─────────────────────────────────────────────╯"
60+
printf '%s\n\n' " © 2025 Qompass AI. All rights reserved "
61+
for k in "${!MENU[@]}"; do printf ' %s) %s\n' "$k" "${MENU[$k]}"; done
62+
printf '%s\n' " a) all (default)"
63+
printf '%s\n\n' " q) quit"
2364
read -rp "Choose versions to build [a]: " choice
2465
choice=${choice:-a}
2566
[[ $choice == q ]] && exit 0
67+
2668
VERSIONS=()
2769
if [[ $choice == a ]]; then
2870
VERSIONS=(5.1.5 5.2.4 5.3.6 5.4.6 luajit)
@@ -41,11 +83,13 @@ else
4183
esac
4284
done
4385
fi
44-
PREFIX="$HOME/.local"
86+
87+
LUAROCKS_VERSION="3.12.1"
88+
DEFAULT_IMPL="luajit"
4589
JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu || echo 4)
4690
: "${CC:=clang}"
47-
CFLAGS="-O3 -march=native -flto -fPIC -pipe"
48-
LDFLAGS="-flto -Wl,-O1,--as-needed"
91+
CFLAGS="-O3 -march=native -flto -fPIC -pipe -fstack-protector-strong"
92+
LDFLAGS="-flto -Wl,-O1,--as-needed,-z,relro,-z,now"
4993
[[ -x $(command -v ld.lld) ]] && LDFLAGS+=" -fuse-ld=lld"
5094
case "$(uname -s)" in
5195
Darwin*)
@@ -61,56 +105,83 @@ MINGW* | MSYS* | CYG*)
61105
SHARED="-DLUA_USE_LINUX"
62106
;;
63107
esac
108+
64109
add_to_rc() {
65110
local rc_file=$1
66-
local line="export PATH='$HOME/.local/bin:$PATH'"
111+
local line="export PATH='$PREFIX/bin:$PATH'"
67112
if [[ -f "$rc_file" ]] && ! grep -Fq "$line" "$rc_file"; then
68113
printf '\n# added by lua quickstart\n%s\n' "$line" >>"$rc_file"
69-
echo " -> PATH updated in $rc_file"
114+
echo " PATH updated in $rc_file"
70115
fi
71116
}
72-
mkdir -p "$PREFIX/bin"
117+
install_luarocks() {
118+
local lua_prefix="$1"
119+
local rocks_prefix="$lua_prefix"
120+
pushd /tmp >/dev/null
121+
curl -fsSLO "https://luarocks.org/releases/luarocks-$LUAROCKS_VERSION.tar.gz"
122+
tar xf "luarocks-$LUAROCKS_VERSION.tar.gz"
123+
cd "luarocks-$LUAROCKS_VERSION"
124+
./configure \
125+
--prefix="$rocks_prefix" \
126+
--with-lua="$lua_prefix" \
127+
--with-lua-include="$lua_prefix/include" \
128+
--with-lua-lib="$lua_prefix/lib"
129+
make -j"$JOBS"
130+
make install
131+
local tag=$(basename "$lua_prefix" | sed 's/^lua//;s/^luajit$/jit/')
132+
ln -sf "$rocks_prefix/bin/luarocks" "$PREFIX/bin/luarocks$tag"
133+
popd >/dev/null
134+
rm -rf "/tmp/luarocks-$LUAROCKS_VERSION"
135+
}
136+
73137
cd /tmp
74138
for v in "${VERSIONS[@]}"; do
75139
if [[ $v == luajit ]]; then
76140
echo -e "\n=== LuaJIT ==="
77141
git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git
78-
cd LuaJIT
142+
pushd LuaJIT >/dev/null
79143
make -j"$JOBS" CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
80144
make install PREFIX="$PREFIX/luajit"
81145
ln -sf "$PREFIX/luajit/bin/luajit" "$PREFIX/bin/luajit"
82-
cd /tmp && rm -rf LuaJIT
146+
popd >/dev/null && rm -rf LuaJIT
147+
install_luarocks "$PREFIX/luajit"
83148
continue
84149
fi
150+
85151
echo -e "\n=== Lua $v ==="
86152
curl -fsSLO "https://www.lua.org/ftp/lua-$v.tar.gz"
87-
tar xf "lua-$v.tar.gz"
88-
rm "lua-$v.tar.gz"
89-
cd "lua-$v"
90-
make "$PLATFORM" \
91-
CC="$CC" \
92-
MYCFLAGS="$CFLAGS $SHARED" \
93-
MYLDFLAGS="$LDFLAGS" \
94-
-j"$JOBS"
95-
$CC "$CFLAGS" -shared -o src/liblua.so \
96-
-Wl,--whole-archive src/liblua.a -Wl,--no-whole-archive -lm
153+
tar xf "lua-$v.tar.gz" && rm "lua-$v.tar.gz"
154+
pushd "lua-$v" >/dev/null
155+
make "$PLATFORM" CC="$CC" MYCFLAGS="$CFLAGS $SHARED" MYLDFLAGS="$LDFLAGS" -j"$JOBS"
156+
$CC "$CFLAGS" -shared -o src/liblua.so -Wl,--whole-archive src/liblua.a -Wl,--no-whole-archive -lm
97157
short=${v%.*}
98158
dest="$PREFIX/lua$short"
99159
make install INSTALL_TOP="$dest"
100160
install -m 755 src/liblua.so "$dest/lib"
101161
ln -sf "$dest/bin/lua" "$PREFIX/bin/lua$short"
102162
ln -sf "$dest/bin/luac" "$PREFIX/bin/luac$short"
103-
cd /tmp && rm -rf "lua-$v"
163+
popd >/dev/null && rm -rf "lua-$v"
164+
install_luarocks "$dest"
165+
166+
cat >"$dest/lib/pkgconfig/lua$short.pc" <<EOF
167+
prefix=$dest
168+
exec_prefix=\${prefix}
169+
libdir=\${prefix}/lib
170+
includedir=\${prefix}/include
171+
Name: Lua $short
172+
Version: $v
173+
Libs: -shared -L\${libdir} -llua
174+
Cflags: -I\${includedir}
175+
EOF
104176
done
177+
if [[ $DEFAULT_IMPL == luajit ]]; then
178+
ln -sf "$PREFIX/bin/luajit" "$PREFIX/bin/lua"
179+
ln -sf "$PREFIX/bin/luajit" "$PREFIX/bin/luac"
180+
else
181+
def_short=${DEFAULT_IMPL//./}
182+
ln -sf "$PREFIX/bin/lua$def_short" "$PREFIX/bin/lua"
183+
ln -sf "$PREFIX/bin/luac$def_short" "$PREFIX/bin/luac"
184+
fi
105185
add_to_rc "$HOME/.bashrc"
106186
add_to_rc "$HOME/.zshrc"
107-
if [[ -n ${PROFILE:-} && -f "$PROFILE" ]]; then
108-
if ! grep -Fq '.local/bin' "$PROFILE"; then
109-
printf "\n# added by lua quickstart\n$Env:Path = "%s
110-
" + $Env:Path\n" \
111-
"$HOME/.local/bin" >>"$PROFILE"
112-
echo " -> PATH updated in PowerShell profile: $PROFILE"
113-
fi
114-
fi
115-
116-
echo -e "\n✔ Build complete. Open a new shell or run: source ~/.bashrc"
187+
echo -e "\n✔ Build complete. Open a new shell or run 'source ~/.bashrc' | 'source ~/.zshrc' for it to take effect ."

0 commit comments

Comments
 (0)