Updated makefile and conf to default to love 11.4

This commit is contained in:
Alexander Griffith 2022-03-16 20:22:07 -04:00
parent 915fd6a26e
commit 07061532da
17 changed files with 88 additions and 13 deletions

View file

@ -13,7 +13,6 @@ fi
VERSION="$1" VERSION="$1"
LOVEFILE="$2" LOVEFILE="$2"
# eg
# https://github.com/love2d/love/releases/download/11.4/love-11.4-x86_64.AppImage # https://github.com/love2d/love/releases/download/11.4/love-11.4-x86_64.AppImage
# https://github.com/love2d/love/releases/download/11.3/love-11.3-x86_64.AppImage # https://github.com/love2d/love/releases/download/11.3/love-11.3-x86_64.AppImage
# https://github.com/love2d/love/releases/download/11.2/love-11.2-x86_64.AppImage # https://github.com/love2d/love/releases/download/11.2/love-11.2-x86_64.AppImage
@ -57,7 +56,7 @@ main() {
rm -rf love-prepared rm -rf love-prepared
mkdir -p love-prepared mkdir -p love-prepared
cd love-prepared cd love-prepared
$LOVE_AppImage --appimage-extract 1> /dev/null $LOVE_AppImage --appimage-extract 1> /dev/null 2> /dev/null
mv squashfs-root/* . mv squashfs-root/* .
rm squashfs-root/.DirIcon rm squashfs-root/.DirIcon
rmdir squashfs-root rmdir squashfs-root
@ -110,8 +109,8 @@ main() {
# ./love-prepared/AppRun -n love-prepared "${target}-${ARCH}.AppImage" # ./love-prepared/AppRun -n love-prepared "${target}-${ARCH}.AppImage"
# Work around missing FUSE/docker # Work around missing FUSE/docker
./appimagetool-${ARCH}.AppImage --appimage-extract 1> /dev/null ./appimagetool-${ARCH}.AppImage --appimage-extract 1> /dev/null 2> /dev/null
./squashfs-root/AppRun -n love-prepared "${target}-${ARCH}.AppImage" 1> /dev/null ./squashfs-root/AppRun -n love-prepared "${target}-${ARCH}.AppImage" 1> /dev/null 2> /dev/null
rm -rf love-prepared/ rm -rf love-prepared/
} }

View file

@ -66,6 +66,7 @@ gethelp=false;
width=800 width=800
height=600 height=600
release="compat" release="compat"
love_version="11.4"
canvas_colour="54,69,79" canvas_colour="54,69,79"
page_colour=$canvas_colour page_colour=$canvas_colour
text_colour="240,234,214" text_colour="240,234,214"
@ -166,11 +167,14 @@ build(){
sed "s/{{{cachemodule}}}/${cachemodule}/g" | \ sed "s/{{{cachemodule}}}/${cachemodule}/g" | \
sed "s/{{{metadata}}}/{\"package_uuid\":\"${uuid}\",\"remote_package_size\":$module_size,\"files\":[{\"filename\":\"\/game.love\",\"crunched\":0,\"start\":0,\"end\":$module_size,\"audio\":false}]}/" > \ sed "s/{{{metadata}}}/{\"package_uuid\":\"${uuid}\",\"remote_package_size\":$module_size,\"files\":[{\"filename\":\"\/game.love\",\"crunched\":0,\"start\":0,\"end\":$module_size,\"audio\":false}]}/" > \
$file_name/game.js $file_name/game.js
cp $root/src/serve.py $file_name
cp $root/src/consolewrapper.js $file_name cp $root/src/consolewrapper.js $file_name
cp $love_file $file_name/game.love cp $love_file $file_name/game.love
cp $root/src/$release/love.js $file_name cp $root/src/love-$love_version/$release/love.js $file_name
cp $root/src/$release/love.wasm $file_name cp $root/src/love-$love_version/$release/love.wasm $file_name
if [ $release == "release" ]; then
cp $root/src/release/love.worker.js $file_name cp $root/src/release/love.worker.js $file_name
fi
} }
clean(){ clean(){
@ -191,7 +195,7 @@ run (){
debug debug
build build
cd $file_name cd $file_name
python2.7 -m SimpleHTTPServer python serve.py
} }
if [ $gethelp = true ] if [ $gethelp = true ]

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -0,0 +1 @@
var threadInfoStruct=0;var selfThreadId=0;var parentThreadId=0;var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:selfThreadId})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);Module["wasmModule"]=null;receiveInstance(instance);return instance.exports};this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["DYNAMIC_BASE"]=e.data.DYNAMIC_BASE;Module["DYNAMICTOP_PTR"]=e.data.DYNAMICTOP_PTR;Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Love(Module).then(function(instance){Module=instance;postMessage({"cmd":"loaded"})})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;threadInfoStruct=e.data.threadInfoStruct;Module["registerPthreadPtr"](threadInfoStruct,0,0);selfThreadId=e.data.selfThreadId;parentThreadId=e.data.parentThreadId;var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["_emscripten_tls_init"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].setThreadStatus(Module["_pthread_self"](),1);try{var result=Module["dynCall_ii"](e.data.start_routine,e.data.arg);if(!Module["getNoExitRuntime"]())Module["PThread"].threadExit(result)}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){Atomics.store(Module["HEAPU32"],threadInfoStruct+4>>2,ex instanceof Module["ExitStatus"]?ex.status:-2);Atomics.store(Module["HEAPU32"],threadInfoStruct+0>>2,1);Module["_emscripten_futex_wake"](threadInfoStruct+0,2147483647);if(!(ex instanceof Module["ExitStatus"]))throw ex}}}else if(e.data.cmd==="cancel"){if(threadInfoStruct){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(threadInfoStruct){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}}

View file

@ -0,0 +1,22 @@
#!/usr/bin/env python
# Attribution: https://stackoverflow.com/questions/21956683/enable-access-control-on-simple-http-server
try:
# Python 3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test as test_orig
import sys
def test (*args):
test_orig(*args, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
except ImportError: # Python 2
from BaseHTTPServer import HTTPServer, test
from SimpleHTTPServer import SimpleHTTPRequestHandler
class CORSRequestHandler (SimpleHTTPRequestHandler):
def end_headers (self):
self.send_header('Cross-Origin-Opener-Policy', 'same-origin')
self.send_header('Cross-Origin-Embedder-Policy', 'require-corp')
SimpleHTTPRequestHandler.end_headers(self)
if __name__ == '__main__':
test(CORSRequestHandler, HTTPServer)

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# LÖVE version # LÖVE version
LOVE_DEF_VERSION=0.11.3 LOVE_DEF_VERSION=0.11.4
@ -405,7 +405,7 @@ check_deps
# Get latest LÖVE version number # Get latest LÖVE version number
gen_version $LOVE_DEF_VERSION gen_version $LOVE_DEF_VERSION
LOVE_WEB_VERSION=$(curl -s https://love2d.org/releases.xml | grep -m 2 "<title>" | tail -n 1 | grep -Eo "[0-9]+.[0-9]+.[0-9]+") LOVE_WEB_VERSION=$(curl -s https://love2d.org/releases.xml | grep -m 2 "<title>" | tail -n 1 | grep -Eo "[0-9]+.[0-9]+")
gen_version $LOVE_WEB_VERSION gen_version $LOVE_WEB_VERSION
INSTALLED=false INSTALLED=false

View file

@ -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.3" t.version = "11.4"
end end

View file

@ -1,5 +1,5 @@
VERSION=0.1.0 VERSION=0.1.0
LOVE_VERSION=11.3 LOVE_VERSION=11.4
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
@ -51,7 +51,7 @@ web: releases/$(NAME)-$(VERSION)-web.zip
runweb: $(LOVEFILE) runweb: $(LOVEFILE)
buildtools/love-js/love-js.sh $(LOVEFILE) $(NAME) -v=$(VERSION) -a=$(AUTHOR) -o=releases -r buildtools/love-js/love-js.sh $(LOVEFILE) $(NAME) -v=$(VERSION) -a=$(AUTHOR) -o=releases -r -n
# If you release on itch.io, you should install butler: # If you release on itch.io, you should install butler:
# https://itch.io/docs/butler/installing.html # https://itch.io/docs/butler/installing.html

View file

@ -5,8 +5,13 @@
(love.graphics.setNewFont 30) (love.graphics.setNewFont 30)
(local (major minor revision) (love.getVersion))
{:draw (fn draw [message] {:draw (fn draw [message]
(local (w h _flags) (love.window.getMode)) (local (w h _flags) (love.window.getMode))
(love.graphics.printf
(: "Love Version: %s.%s.%s"
:format major minor revision) 0 10 w :center)
(love.graphics.printf (love.graphics.printf
(: "This window should close in %0.1f seconds" (: "This window should close in %0.1f seconds"
:format (math.max 0 (- 3 time))) :format (math.max 0 (- 3 time)))