pfirsich / makelove

A build tool for löve games
MIT License
141 stars 12 forks source link

Love 11.4 #26

Closed josh-perry closed 2 years ago

josh-perry commented 2 years ago

Won't merge this until I can test it properly on linux but this should resolve #24

pfirsich commented 2 years ago

Using löve 11.3 still works:

$ makelove appimage
Loading config from default path 'makelove.toml'
Found conf.lua
Guessed löve version from löve config file: 11.3
Building targets: appimage
Assembling game directory..
Warning: Pattern '*/devmode' does not match any files
Created ../makelove-build-temp/love/What-a-Mess.love
>> Building target appimage
Downloading https://github.com/pfirsich/love-appimages/releases/download/v3/love-11.3-x86_64.AppImage..
Extracting source AppImage '/tmp/tmppn18177e.AppImage'..
Creating new AppImage..
Created ../makelove-build-temp/appimage/What-a-Mess.AppImage
Removing AppDir..
Target appimage complete

And the AppImage runs well.

But löve 11.4 does not work. I think the AppImages are not compatible (structured in different ways internally):

$ makelove appimage
Loading config from default path 'makelove.toml'
Found conf.lua
Guessed löve version from löve config file: 11.4
Building targets: appimage
Assembling game directory..
Warning: Pattern '*/devmode' does not match any files
Created ../makelove-build-temp/love/What-a-Mess.love
>> Building target appimage
Downloading https://github.com/love2d/love/releases/download/11.4/love-11.4-x86_64.AppImage..
Extracting source AppImage '/tmp/tmpkg3a0tz3.AppImage'..
Traceback (most recent call last):
  File "/home/joel/.local/bin/makelove", line 33, in <module>
    sys.exit(load_entry_point('makelove', 'console_scripts', 'makelove')())
  File "/home/joel/dev/python/makelove/makelove/makelove.py", line 350, in main
    build_linux(config, version, target, target_directory, love_file_path)
  File "/home/joel/dev/python/makelove/makelove/linux.py", line 156, in build_linux
    shutil.copy2(love_file_path, appdir("usr/bin"))
  File "/usr/lib/python3.10/shutil.py", line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.10/shutil.py", line 256, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '../makelove-build-temp/appimage/squashfs-root/usr/bin'

I will have a look at Game Distribution page this evening and see what needs to be changed.

pfirsich commented 2 years ago

I tested with https://github.com/pfirsich/lovejam20 and built with both 11.3 and 11.4 AppImages and both seemed to work fine. I fixed a few other things that got in my way while making the changes. I can't promise it works with everything, as is the nature of stuff like this (i.e. fucking horrible). As outlined in the commit message spaces are now stripped from the game name, because fighting with that was too depressing. If someone wants to fix this in the future, please do.

~/d/l/l/game (master|✚1…) $ makelove appimage
Loading config from default path 'makelove.toml'
Found conf.lua
Guessed löve version from löve config file: 11.4
Building targets: appimage
Assembling game directory..
Warning: Pattern '*/devmode' does not match any files
Created ../makelove-build/love/What-a-Mess.love
>> Building target appimage
Downloading https://github.com/love2d/love/releases/download/11.4/love-11.4-x86_64.AppImage..
Extracting source AppImage '/tmp/tmp8fh6bx5a.AppImage'..
Fusing ../makelove-build/appimage/squashfs-root/bin/love and ../makelove-build/love/What-a-Mess.love into ../makelove-build/appimage/squashfs-root/bin/What-a-Mess
Copying ../icon.png to ../makelove-build/appimage/squashfs-root/What-a-Mess.png
Creating new AppImage..
Created ../makelove-build/appimage/What-a-Mess.AppImage
Removing AppDir..
Target appimage complete
~/d/l/l/game (master|✚1…) $ git restore conf.lua
~/d/l/l/game (master|…) $ makelove appimage
Loading config from default path 'makelove.toml'
Found conf.lua
Guessed löve version from löve config file: 11.3
Building targets: appimage
Assembling game directory..
Warning: Pattern '*/devmode' does not match any files
Created ../makelove-build/love/What-a-Mess.love
>> Building target appimage
Downloading https://github.com/pfirsich/love-appimages/releases/download/v3/love-11.3-x86_64.AppImage..
Extracting source AppImage '/tmp/tmpslqnnm0o.AppImage'..
Copying ../makelove-build/love/What-a-Mess.love to ../makelove-build/appimage/squashfs-root/usr/bin
Copying ../icon.png to ../makelove-build/appimage/squashfs-root/What-a-Mess.png
Creating new AppImage..
Created ../makelove-build/appimage/What-a-Mess.AppImage
Removing AppDir..
Target appimage complete