-
Notifications
You must be signed in to change notification settings - Fork 2
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
Port to SDL 2? #2
Comments
Hi. Short answer; No, there are no plans to port it to SDL2. Longer answer; since it has been 5-10 years since I've looked properly at it, I cannot recall if porting to Gosu was looking to be the better option, nor what SDL2 changes gave me some major headaches. A JavaScript port (yikes) with the Phaser library was starting to look like the saner approach... Very microscopic chance I get a "30th Year Anniversary Surge Action" and do something frantic in the fall, but I wouldn't hold my breath. |
[Kent Dahl]
Longer answer; since it has been 5-10 years since I've looked properly
at it, I cannot recall if porting to Gosu was looking to be the better
option, nor what SDL2 changes gave me some major headaches. A
JavaScript port (*yikes*) with the Phaser library was starting to look
like the saner approach...
I see. In any case, if you do consider a new release, you might want to
also consider the patches used by the Debian package, available via the
'Debian patches' link in <URL: https://tracker.debian.org/magicmaze >.
The game is still used by Debian users. According to collected
statistics (popcon), five computers ran it last week. :)
…--
Happy hacking
Petter Reinholdtsen
|
I looked over the Debian patches;
Put up a preliminary release for reference since the diff from 1.4.x to 1.5.x has a lot of eclectic stuff: https://github.com/kentdahl/magic_maze/releases Tested briefly on MacBook using three Ruby versions:
I'll give it another stab or two over the summer and see if I can do anything sensible. |
[Kent Dahl]
I looked over the Debian patches;
Great to hear. :)
* 10_use_FHS_paths.patch
- the shebang / env change makes sense.
- the FHS paths to assets; I'd have to figure out something clever for
this, or optionally add a '--data-dir=' option perhaps. Not sure how
this is normally handled for Debian packages.
I did a test build without the Debian patches, and then the program
crashed like this:
/usr/lib/ruby/vendor_ruby/magicmaze/engine/sdl/graphics.rb:148:in `load': Couldn't load data/gfx/title.png: Couldn't open data/gfx/title.png (SDL::Error)
from /usr/lib/ruby/vendor_ruby/magicmaze/engine/sdl/graphics.rb:148:in `block in load_background_images'
from /usr/lib/ruby/vendor_ruby/magicmaze/engine/sdl/graphics.rb:147:in `each'
from /usr/lib/ruby/vendor_ruby/magicmaze/engine/sdl/graphics.rb:147:in `load_background_images'
from /usr/lib/ruby/vendor_ruby/magicmaze/engine/sdl/graphics.rb:45:in `initialize'
from /usr/lib/ruby/vendor_ruby/magicmaze/graphics.rb:69:in `new'
from /usr/lib/ruby/vendor_ruby/magicmaze/graphics.rb:69:in `get_graphics'
from /usr/lib/ruby/vendor_ruby/magicmaze/game.rb:57:in `init_graphics'
from /usr/lib/ruby/vendor_ruby/magicmaze/game.rb:42:in `initialize'
from /usr/games/magicmaze:119:in `new'
from /usr/games/magicmaze:119:in `<main>'
There are several different ways to handle this. A simple way is to
look for the files in several places, and use the first one it find,
perhapd first look in data/gfx/ and next in /usr/share/magicmaze/gfx/.
Put up a preliminary release for reference since the diff from 1.4.x
to 1.5.x has a lot of eclectic stuff:
Will this also move to a newer sdl version?
…--
Happy hacking
Petter Reinholdtsen
|
[Petter Reinholdtsen]
For now, I've gone for the I'm testing with local development copy like this:
I was considering this, but thought it too hackish. Then it dawned on me that I cannot seem to find where the game is started in the Debian package git repo, so I wouldn't know where to add the datadir argument there. So a separate
The 1.5.x versions will move to / add a SDL2 version sometime during the summer if I don't run into any major show-stoppers. I've gone through my old |
[Kent Dahl]
I was considering this, but thought it too hackish. Then it dawned on
me that I cannot seem to find where the game is started in the Debian
package git repo, so I wouldn't know where to add the datadir argument
there.
As far as I can tell, the XDG desktop file calls /usr/games/magicmaze
which is a copy of mm.rb from the source.
You might want to move the desktop file upstream and include a Appstream
metainfo XML file too. I can prepare a patch if you are interested.
…--
Happy hacking
Petter Reinholdtsen
|
[Petter Reinholdtsen]
Then making a separate mm.rb script for Debian to copy from makes sense. I'll give it a gander tonight.
Please do, as I'm not sure where to start on that. |
[Petter Reinholdtsen]
Looked closer at the https://salsa.debian.org/debian/magicmaze.git repo and found where the script is copied in the
So the Ruby script is copied in like any binary would, but to The
In
means all the Ruby source code in MagicMaze is copied in for any Ruby program to use. That is why we don't need an explicit include-path for the MagicMaze source code. (The Ruby-SDL dependency is a slightly different ball of wax, but is probably put the same place too.) |
[Kent Dahl]
The `mm.rb` here should be changed to copy the
`start_debian_magicmaze.rb` instead going forward.
OK.
> I have no idea how Ruby normally install its stuff on a system, so I
> did not try to add such mechanism.
In `install` file at:
https://sources.debian.org/src/magicmaze/1.4.3.6%2Bdfsg-4/debian/install
- where you find the line:
In non-ruby source packages, there are normally installation rules
provided by the upstream project (in setup.py, Makefile, CMakeLists.txt,
Makefile.am, configure.ac, etc) copying the files into the appropriate
location for the program at hand. This ensure files end up in the same
place across all Linux distributions. I have no idea if a simliar
approach exist for Ruby packages. For the Debian packaging, files in
debian/* take care of it. In the situation where the installation rules
are provided by the upstream project, it is normally done using the
dh_auto_install script calling the appropriate build rule to install
files.
…--
Happy hacking
Petter Reinholdtsen
|
I've done an initial SDL2 port (#10) and put it in a preliminary release: v1.5.1-alpha0 Most of the stuff mostly works, but a lot is less than ideal and neither as polished or tested as the SDL1 version. (I'd say the port is about 30% complete at this point.) Tested briefly on Mac with:
The main Ruby versions in Debian according to: https://wiki.debian.org/Ruby
I recall that Debian was fairly conservative on taking in new major Ruby version (hence we all used RVM back in my day), but if you have any specific Ruby versions I should prioritize my testing on, that would be good. As far as I can tell, 'bookworm' (Debian 12) is going for Ruby 3.1.2 and 'sid' is on Ruby 3.2.3 P.S.: I noticed the |
[Kent Dahl]
I recall that Debian was fairly conservative on taking in new major
Ruby version (hence we all used RVM back in my day), but if you have
any specific Ruby versions I should prioritize my testing on, that
would be good. As far as I can tell, 'bookworm' (Debian 12) is going
for Ruby 3.1.2 and 'sid' is on Ruby 3.2.3
I do not pay much attention to roby, but in general the version in
unstable/sid is the one to prioritize, as it is the one used to build
the package and the one that will be in the next stable release.
P.S.: I noticed the `icon-not-found` hint on appstream:
https://appstream.debian.org/sid/main/issues/magicmaze.html and then
remembered that for the OLPC XO version we created an SVG icon / logo,
which I've put in `data/gfx/logo.svg` for now. Perhaps that is a
better fit?
Yes, a vector logo is better than a bitmap one.
…--
Happy hacking
Petter Reinholdtsen
|
After a fair amount of testing back and forth, I've put up two official releases:
Stable v1.5.0.0 is old SDL version, but all other updates since 2010, including the latest Debian package-related changes. SDL Upgrade Release v1.5.1 (a.k.a. SUR) is upgraded to SDL2 and has had a major cleanup. So SUR for sid, and Stable for stable, I recon... depending on the priorities on your end. Closing this issue now. Please open a new issue for tracking further changes we'd want related specifically to Debian packaging and what makes sense to put into upstream. (SVG logo, fonts (#14), etc) I've looked at the Salsa repo and put the things I know of in this suggested patch: (P.S.: I've got about a week left now in May before I enter my yearly |
[Kent Dahl]
After a fair amount of testing back and forth, I've put up two
official releases:
Great to hear. :)
So SUR for sid, and Stable for stable, I recon... depending on the
priorities on your end.
I doubt I will get any update past the stable release team, but uploaded
the 1.5.0.0 version to unstable and will wait for it to propagate to
testing to make it possible to provide it as a backport, if someone is
so included. Once this version reaches testing, I plan to upload the
1.5.1 version to unstable for wider testing.
Closing this issue now. Please open a new issue for tracking further
changes we'd want related specifically to Debian packaging and what
makes sense to put into upstream. (SVG logo, fonts (#14), etc)
OK. The only relevant change seem to be the repacking to drop
data/gfx/fraktmod.*.
I've looked at the [Salsa
repo](https://salsa.debian.org/debian/magicmaze.git) and put the
things I know of in this suggested patch:
https://gist.github.com/kentdahl/d7a8204ae599dff9bc09e2debedf2888
Thanks. I will have a new look at it for the 1.5.1 release. I included
most relevant changes in the 1.5.0.0 release, where the build rules were
rewritten.
…--
Happy hacking
Petter Reinholdtsen
|
[Petter Reinholdtsen]
I doubt I will get any update past the stable release team, but
uploaded the 1.5.0.0 version to unstable and will wait for it to
propagate to testing to make it possible to provide it as a backport,
if someone is so included. Once this version reaches testing, I plan
to upload the 1.5.1 version to unstable for wider testing.
I seem to have messed something up with the 1.5.1 upload to experimental
in Debian, as it seem to still use SDL 1.2. Any idea what went wrong?
<URL: https://tracker.debian.org/magicmaze >
…--
Happy hacking
Petter Reinholdtsen
|
I ran it from the source in salsa and I cannot see that it loads old SDL version. Tried these two tagged versions on salsa:
Can you provide more details on how you are seeing it pulling in SDL 1.2? Details from lsof and vmmap on mac:
|
[Kent Dahl]
Can you provide more details on how you are seeing it pulling in SDL
1.2?
The details I got are in <URL: https://bugs.debian.org/1038073 >.
|
Seems to me this is a packaging issue, not a loading issue. If I'm reading this correctly, the Debian package The 2.2.0 version for ruby-sdl does not relate to the SDL version. The gem that wraps SDL2 is an entirely different gem So I am not sure how one would solve this without adding a Debian package for Originally when Magic Maze was added to Debian, the dependency was handled by |
Is there any plan to port the source to SDL 2, ref. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038073 ?
The text was updated successfully, but these errors were encountered: