GemRB 0.9.3 port + questions about haikuports/recipes

Hello, I installed Beta 5 and have been trying updating some haikuports recipes. I managed to make a working recipe for GemRB 0.9.3, which seems to compile and run fine… well, mostly


Running at 1280x1024 with Icewind Dale datafiles

There’s a python script in the source, “extend2da.py”, which is also provided as a command by the Haiku package the recipe makes. Cmake doesn’t seem to find/handle this script properly in the build process or something, I’m circumventing that by moving & replacing stuff around during the build process (in the recipe’s BUILD() block) since I don’t know the proper way to fix it.

Even with this workaround, the script file doesn’t work as a command anyway, it cannot find python I guess shrugs
extend2dacmderr

I made a Dropbox folder with the recipe + additional files needed and the pre-built packages.

So… questions

  • Any idea how to fix that build issue in a cleaner way?
  • How would one submit an updated recipe to the haikuports github? You just make a commit or there’s something more about it?
  • Should a hacky recipe like this even be submitted to haikuports?
  • For the game’s icon I’ve recolored zumi’s Ruby icon but I vaguely remember GemRB had its own HVIF icon once, does anybody have that one lying around?

For one, cmd:python doesn’t exist anymore, try to set this to cmd:python3.

Yeah, done it already, that’s one of the first things I had to fix when making the new recipe, build would fail way earlier otherwise

EDIT: Or maybe you mean that the python script is trying to use python instead of python3? That’s entirely possible, I’m pretty sure that script isn’t being processed during build or something

I’ve had some success converting old python code to python3 with this

Grab it before it is deprecated

2 Likes

Did a quick check, using python3 in the script works and the game (demo?) launches.

A few things could be done by using sed, and a small change to find SDL2 can be done so you don’t need to use the hardcoded paths for it (which will fail as on 32bit those can be found in “/boot/system/develop/headers/x86/SDL2/”

In there recipe sed for python3

PATCH()
{
	sed -i 's,\/usr/bin/python,\/usr/bin/python3,g' admin/extend2da.py
}

small patch to detect SDL2 (not checked in 32bit)

diff --git a/cmake/modules/FindSDL2_mixer.cmake b/cmake/modules/FindSDL2_mixer.cmake
index def6a4a..044cf25 100644
--- a/cmake/modules/FindSDL2_mixer.cmake
+++ b/cmake/modules/FindSDL2_mixer.cmake
@@ -37,7 +37,7 @@ find_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h
   HINTS
     ENV SDLMIXERDIR
     ENV SDLDIR
-  PATH_SUFFIXES include/SDL2 include/SDL include
+  PATH_SUFFIXES include/SDL2 include/SDL include SDL2
   PATHS
     ~/Library/Frameworks/
     /Library/Frameworks/

I “think” that should do it :slight_smile:

1 Like

Arght … didn’t check upfront, seems we already have a recipe for gemrb in “games-engines/gemrb”?

A couple of old ones, I used them as a base for this one. I can confirm with the sed command the script works fine as a command.

When you’re talking about changing the sdl paths you mean something like this, right?
sdlheaders

You can remove those 2 lines all together, shouldn’t be needed with the patch, I just used:

	cmake .. \
		$cmakeDirArgs \
		-Wno-dev \
		-DCMAKE_BUILD_TYPE=Release \
		-DDATA_DIR=$dataDir/gemrb \
		-DMAN_DIR=$manDir/man6 \
		-DSYSCONF_DIR=$settingsDir/gemrb \
		-DDOC_DIR=$documentationDir/gemrb
1 Like

Alright, thank you for the help, I’ve updated packages and recipe in the Dropbox folder so the game compiles and the script can be executed as intended. I didn’t integrate the SDL patch as simply copy/pasting it makes git worry about patch version or smth so I guess I’d have to remake it locally using diff.

Feel free to improve upon the recipe and put it on haikuports if/when it’s appropriate :slight_smile:

1 Like

Was already strugling the first time I tried to grab the files :slight_smile: Feel free to create a PR for this, can’t do it all for you, but I’m willing to help (and I’m sure there are plenty in the haikuports team that can assist) :slight_smile:

1 Like