- Added -n option to AppRun (closes #3) - Bumped love version to 11.3 - Updated Fennel to current master branch b2d2155
This commit is contained in:
parent
f583452b77
commit
460f54eef1
|
@ -6,8 +6,8 @@ CURRENT_APPIMAGEKIT_RELEASE=9
|
||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
|
|
||||||
if [[ $# -lt 1 ]]; then
|
if [[ $# -lt 1 ]]; then
|
||||||
echo "Usage: $0 <version>"
|
echo "Usage: $0 <version>"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION="$1"
|
VERSION="$1"
|
||||||
|
@ -16,78 +16,78 @@ LOVEFILE="$2"
|
||||||
LOVE_TAR_URL=https://bitbucket.org/rude/love/downloads/love-${VERSION}-linux-${ARCH}.tar.gz
|
LOVE_TAR_URL=https://bitbucket.org/rude/love/downloads/love-${VERSION}-linux-${ARCH}.tar.gz
|
||||||
LOVE_TAR=${HOME}/.cache/love-release/love/love-${VERSION}-${ARCH}.tar.gz
|
LOVE_TAR=${HOME}/.cache/love-release/love/love-${VERSION}-${ARCH}.tar.gz
|
||||||
if ! test -f ${LOVE_TAR}; then
|
if ! test -f ${LOVE_TAR}; then
|
||||||
echo "No tarball found for $VERSION in $LOVE_TAR"
|
echo "No tarball found for $VERSION in $LOVE_TAR"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
download_if_needed() {
|
download_if_needed() {
|
||||||
if ! test -f "$1"; then
|
if ! test -f "$1"; then
|
||||||
if ! curl -L -o "$1" "https://github.com/AppImage/AppImageKit/releases/download/${CURRENT_APPIMAGEKIT_RELEASE}/$1"; then
|
if ! curl -L -o "$1" "https://github.com/AppImage/AppImageKit/releases/download/${CURRENT_APPIMAGEKIT_RELEASE}/$1"; then
|
||||||
echo "Failed to download appimagetool"
|
echo "Failed to download appimagetool"
|
||||||
echo "Please supply it manually"
|
echo "Please supply it manually"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
chmod +x "$1"
|
chmod +x "$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
download_if_needed appimagetool-${ARCH}.AppImage
|
download_if_needed appimagetool-${ARCH}.AppImage
|
||||||
download_if_needed AppRun-${ARCH}
|
download_if_needed AppRun-${ARCH}
|
||||||
|
|
||||||
# Extract the tarball build into a folder
|
# Extract the tarball build into a folder
|
||||||
rm -rf love-prepared
|
rm -rf love-prepared
|
||||||
mkdir love-prepared
|
mkdir love-prepared
|
||||||
tar xf ${LOVE_TAR} -C love-prepared --strip-components=1
|
tar xf ${LOVE_TAR} -C love-prepared --strip-components=1
|
||||||
|
|
||||||
cd love-prepared
|
cd love-prepared
|
||||||
|
|
||||||
# Add our small wrapper script (yay, more wrappers), and AppRun
|
# Add our small wrapper script (yay, more wrappers), and AppRun
|
||||||
cp ../wrapper usr/bin/wrapper-love
|
cp ../wrapper usr/bin/wrapper-love
|
||||||
cp ../AppRun-${ARCH} AppRun
|
cp ../AppRun-${ARCH} AppRun
|
||||||
|
|
||||||
local desktopfile="love.desktop"
|
local desktopfile="love.desktop"
|
||||||
local icon="love"
|
local icon="love"
|
||||||
local target="love-${VERSION}"
|
local target="love-${VERSION}"
|
||||||
|
|
||||||
if test -f ../../game.desktop.in; then
|
if test -f ../../game.desktop.in; then
|
||||||
desktopfile="game.desktop"
|
desktopfile="game.desktop"
|
||||||
cp ../../game.desktop.in .
|
cp ../../game.desktop.in .
|
||||||
fi
|
fi
|
||||||
if test -f ../../game.svg; then
|
if test -f ../../game.svg; then
|
||||||
icon="game"
|
icon="game"
|
||||||
cp ../../game.svg .
|
cp ../../game.svg .
|
||||||
fi
|
fi
|
||||||
if test -f ${LOVEFILE}; then
|
if test -f ${LOVEFILE}; then
|
||||||
target="game"
|
target="game"
|
||||||
cat usr/bin/love ${LOVEFILE} > usr/bin/love-fused
|
cat usr/bin/love ${LOVEFILE} > usr/bin/love-fused
|
||||||
mv usr/bin/love-fused usr/bin/love
|
mv usr/bin/love-fused usr/bin/love
|
||||||
chmod +x usr/bin/love
|
chmod +x usr/bin/love
|
||||||
else
|
else
|
||||||
echo "Love file ${LOVEFILE} not found"
|
echo "Love file ${LOVEFILE} not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add our desktop file
|
# Add our desktop file
|
||||||
sed -e 's/%BINARY%/wrapper-love/' -e "s/%ICON%/${icon}/" "${desktopfile}.in" > "$desktopfile"
|
sed -e 's/%BINARY%/wrapper-love/' -e "s/%ICON%/${icon}/" "${desktopfile}.in" > "$desktopfile"
|
||||||
rm "${desktopfile}.in"
|
rm "${desktopfile}.in"
|
||||||
|
|
||||||
# Add a DirIcon
|
# Add a DirIcon
|
||||||
cp "${icon}.svg" .DirIcon
|
cp "${icon}.svg" .DirIcon
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
if test -f ../../game.desktop.in; then
|
if test -f ../../game.desktop.in; then
|
||||||
rm love.desktop.in
|
rm love.desktop.in
|
||||||
fi
|
fi
|
||||||
if test -f ../../game.svg; then
|
if test -f ../../game.svg; then
|
||||||
rm love.svg
|
rm love.svg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now build the final AppImage
|
# Now build the final AppImage
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Work around missing FUSE/docker
|
# Work around missing FUSE/docker
|
||||||
./appimagetool-${ARCH}.AppImage --appimage-extract
|
./appimagetool-${ARCH}.AppImage --appimage-extract
|
||||||
./squashfs-root/AppRun love-prepared "${target}-${ARCH}.AppImage"
|
./squashfs-root/AppRun love-prepared "${target}-${ARCH}.AppImage"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
2
conf.lua
2
conf.lua
|
@ -6,5 +6,5 @@ love.conf = function(t)
|
||||||
t.window.width = 720
|
t.window.width = 720
|
||||||
t.window.height = 450
|
t.window.height = 450
|
||||||
t.window.vsync = false
|
t.window.vsync = false
|
||||||
t.version = "11.2"
|
t.version = "11.3"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1403,8 +1403,11 @@ SPECIALS["fn"] = function(ast, scope, parent)
|
||||||
local isLocalFn
|
local isLocalFn
|
||||||
local docstring
|
local docstring
|
||||||
fScope.vararg = false
|
fScope.vararg = false
|
||||||
|
local multi = fnName and isMultiSym(fnName[1])
|
||||||
|
assertCompile(not multi or not multi.multiSymMethodCall,
|
||||||
|
"malformed function name: " .. tostring(fnName), ast)
|
||||||
if fnName and fnName[1] ~= 'nil' then
|
if fnName and fnName[1] ~= 'nil' then
|
||||||
isLocalFn = not isMultiSym(fnName[1])
|
isLocalFn = not multi
|
||||||
if isLocalFn then
|
if isLocalFn then
|
||||||
fnName = declareLocal(fnName, {}, scope, ast)
|
fnName = declareLocal(fnName, {}, scope, ast)
|
||||||
else
|
else
|
||||||
|
@ -1473,8 +1476,8 @@ SPECIALS["fn"] = function(ast, scope, parent)
|
||||||
:gsub('"', '\\"') .. '"')
|
:gsub('"', '\\"') .. '"')
|
||||||
end
|
end
|
||||||
local metaStr = ('require("%s").metadata'):format(rootOptions.moduleName or "fennel")
|
local metaStr = ('require("%s").metadata'):format(rootOptions.moduleName or "fennel")
|
||||||
emit(parent, string.format('%s:setall(%s, %s)', metaStr,
|
emit(parent, string.format('pcall(function() %s:setall(%s, %s) end)',
|
||||||
fnName, table.concat(metaFields, ', ')))
|
metaStr, fnName, table.concat(metaFields, ', ')))
|
||||||
end
|
end
|
||||||
|
|
||||||
checkUnused(fScope, ast)
|
checkUnused(fScope, ast)
|
||||||
|
@ -2017,7 +2020,7 @@ docSpecial("length", {"x"}, "Returns the length of a table or string.")
|
||||||
SPECIALS["#"] = SPECIALS["length"]
|
SPECIALS["#"] = SPECIALS["length"]
|
||||||
|
|
||||||
-- Save current macro scope
|
-- Save current macro scope
|
||||||
local macroCurrentScope = GLOBAL_SCOPE
|
local macroCurrentScope = nil
|
||||||
|
|
||||||
-- Covert a macro function to a special form
|
-- Covert a macro function to a special form
|
||||||
local function macroToSpecial(mac)
|
local function macroToSpecial(mac)
|
||||||
|
@ -2523,15 +2526,22 @@ local function makeCompilerEnv(ast, scope, parent)
|
||||||
list = list,
|
list = list,
|
||||||
sym = sym,
|
sym = sym,
|
||||||
unpack = unpack,
|
unpack = unpack,
|
||||||
gensym = function() return sym(gensym(macroCurrentScope)) end,
|
gensym = function() return sym(gensym(macroCurrentScope or scope)) end,
|
||||||
["list?"] = isList,
|
["list?"] = isList,
|
||||||
["multi-sym?"] = isMultiSym,
|
["multi-sym?"] = isMultiSym,
|
||||||
["sym?"] = isSym,
|
["sym?"] = isSym,
|
||||||
["table?"] = isTable,
|
["table?"] = isTable,
|
||||||
["sequence?"] = isSequence,
|
["sequence?"] = isSequence,
|
||||||
["varg?"] = isVarg,
|
["varg?"] = isVarg,
|
||||||
["get-scope"] = function() return macroCurrentScope end,
|
["get-scope"] = function()
|
||||||
|
if io and io.stderr then
|
||||||
|
io.stderr:
|
||||||
|
write(("-- %s:%s get-scope is deprecated and will be removed\n"):
|
||||||
|
format(ast.filename, ast.line))
|
||||||
|
end
|
||||||
|
return macroCurrentScope end,
|
||||||
["in-scope?"] = function(symbol)
|
["in-scope?"] = function(symbol)
|
||||||
|
assertCompile(macroCurrentScope, "must call in-scope? from macro", ast)
|
||||||
return macroCurrentScope.manglings[tostring(symbol)]
|
return macroCurrentScope.manglings[tostring(symbol)]
|
||||||
end
|
end
|
||||||
}, { __index = _ENV or _G })
|
}, { __index = _ENV or _G })
|
||||||
|
@ -2617,7 +2627,7 @@ SPECIALS['include'] = function(ast, scope, parent, opts)
|
||||||
emit(tempChunk, subChunk, ast)
|
emit(tempChunk, subChunk, ast)
|
||||||
-- if lua, simply emit the setting of package.preload
|
-- if lua, simply emit the setting of package.preload
|
||||||
if not isFennel then
|
if not isFennel then
|
||||||
emit(tempChunk, target .. ' = ' .. target .. ' or function()\n' .. s .. 'end', ast)
|
emit(tempChunk, target .. ' = ' .. target .. ' or function()\n' .. s .. '\nend', ast)
|
||||||
end
|
end
|
||||||
-- Splice tempChunk to begining of rootChunk
|
-- Splice tempChunk to begining of rootChunk
|
||||||
for i, v in ipairs(tempChunk) do
|
for i, v in ipairs(tempChunk) do
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#!/usr/local/Cellar/bash/4.4.23/bin/bash
|
#!/usr/bin/env bash
|
||||||
## #!/usr/bin/env bash
|
|
||||||
|
## For users on macos
|
||||||
|
## #!/usr/local/Cellar/bash/4.4.23/bin/bash
|
||||||
|
|
||||||
# LÖVE version
|
# LÖVE version
|
||||||
LOVE_DEF_VERSION=0.11.2
|
LOVE_DEF_VERSION=0.11.3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
7
makefile
7
makefile
|
@ -1,8 +1,9 @@
|
||||||
VERSION=0.1.0
|
VERSION=0.1.0
|
||||||
|
LOVE_VERSION=11.3
|
||||||
NAME=change-me
|
NAME=change-me
|
||||||
ITCH_ACCOUNT=change-me-too
|
ITCH_ACCOUNT=change-me-too
|
||||||
URL=https://gitlab.com/alexjgriffith/min-love2d-fennel
|
URL=https://gitlab.com/alexjgriffith/min-love2d-fennel
|
||||||
AUTHOR="Alexander Griffith"
|
AUTHOR="Your Name"
|
||||||
DESCRIPTION="Minimal setup for trying out Phil Hagelberg's fennel/love game design process."
|
DESCRIPTION="Minimal setup for trying out Phil Hagelberg's fennel/love game design process."
|
||||||
|
|
||||||
LIBS := $(wildcard lib/*)
|
LIBS := $(wildcard lib/*)
|
||||||
|
@ -33,10 +34,10 @@ love: $(LOVEFILE)
|
||||||
|
|
||||||
REL=$(PWD)/love-release.sh # https://p.hagelb.org/love-release.sh
|
REL=$(PWD)/love-release.sh # https://p.hagelb.org/love-release.sh
|
||||||
FLAGS=-a "$(AUTHOR)" --description $(DESCRIPTION) \
|
FLAGS=-a "$(AUTHOR)" --description $(DESCRIPTION) \
|
||||||
--love 11.2 --url $(URL) --version $(VERSION) --lovefile $(LOVEFILE)
|
--love $(LOVE_VERSION) --url $(URL) --version $(VERSION) --lovefile $(LOVEFILE)
|
||||||
|
|
||||||
releases/$(NAME)-$(VERSION)-x86_64.AppImage: $(LOVEFILE)
|
releases/$(NAME)-$(VERSION)-x86_64.AppImage: $(LOVEFILE)
|
||||||
cd appimage && ./build.sh 11.1 $(PWD)/$(LOVEFILE)
|
cd appimage && ./build.sh $(LOVE_VERSION) $(PWD)/$(LOVEFILE)
|
||||||
mv appimage/game-x86_64.AppImage $@
|
mv appimage/game-x86_64.AppImage $@
|
||||||
|
|
||||||
releases/$(NAME)-$(VERSION)-macos.zip: $(LOVEFILE)
|
releases/$(NAME)-$(VERSION)-macos.zip: $(LOVEFILE)
|
||||||
|
|
Loading…
Reference in a new issue