Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Haiku port?!

A topic by kallisti05 created Nov 25, 2022 Views: 527 Replies: 8
Viewing posts 1 to 6

Whooooo.  McPixel 3 runs on Haiku.

I can help polish the port up if you're looking for assistance @sos.  We could toss it into a installable package (distributed in a zip manually) and could provide the steps to help you do it.

(1 edit)

Scratch that, McPixel 3 crashes on Haiku.        If y'all need any help or support, reach out.   alex   :at:   terarocket.io


It looks like you're statically linking libSDL2 into mcpixel.     We have some patches for our official port of 2.0.x fixing various upstream bugs you might need...

https://github.com/haikuports/haikuports/blob/master/media-libs/libsdl2/patches/

What version of Haiku was this port compiled with?

It looks like they're statically linking to their own SDL2 (which is fine).  However, they're not getting any of our various un-upstreamed bugfixes.

How do I link against the package version of libSDL2? I couldn't get it to find the library!

(3 edits)

There are standard development tools available for this.
You need the development sdl2 package installed though.

```
pkgman install libsdl2 libsdl2_devel
```

now, libsdl2 shows up in the standard pkg-config...

```

$ pkg-config sdl2 --libs

-L/packages/libsdl2-2.0.20-3/.self/develop/lib -lSDL2

```


And static...

```

$ pkg-config sdl2 --libs --static

-L/packages/libsdl2-2.0.20-3/.self/develop/lib -lSDL2 -ltextencoding -ldevice -lgame -lmedia -lbe -lroot -lGL -lm -Wl,--no-undefined -lSDL2
```


You can even make an operating system package with SDL2 dependencies:

```
cd ~
ls mcpixel3_haiku_x64   # bin gfx scr etc

cat .PackageInfo

name  mcpixel3
version 1.7-1  (whatever)
architecture x86_64
summary  "save the world"
description  "saving the world, one McPixel at a time"
vendor "Devolver Digital"
packager "[email protected]"
copyrights {"(C) 2012-2023 Devolver Digital"}
licenses  {"Closed"}
provides {
  cmd:mcpixel
}
requires {
  haiku >= r1beta4
  lib:libSDL2
}

package create -b -I /boot/system/apps/McPixel McPixel.hpkg
package add -C mcpixel3_haiku_x64 McPixel.hpkg *
```

Perhaps some additions to FindSDL2.cmake (if present) might also be needed if not statically linking?

Something like this:

SET(SDL2_SEARCH_PATHS
  ~/Library/Frameworks
  /Library/Frameworks
  /usr/local
  /usr
  /sw # Fink
  /opt/local # DarwinPorts
  /opt/csw # Blastwave
  /opt
  /boot/system/lib # Haiku
)

FIND_PATH(SDL2_INCLUDE_DIR SDL.h
  HINTS
  $ENV{SDL2DIR}
  PATH_SUFFIXES include/SDL2 include headers/SDL2 headers/x86/SDL2    # Last two are for Haiku
  PATHS ${SDL2_SEARCH_PATHS}
)

Source

( 1)

This is gold! Thank you! 

I'll get all of this sorted as soon as I can!

Happy to provide some entertainment for Haiku users! And love the OS, feels so snappy! Gonna be my go-to install for old machines! (Need to set it up on my EEE PC)

No problem.  Haiku uses hpkg as it's native software distribution format.  You can package up a hpkg in the zip and people who purchase McPixel 3 can just copy the McPixel3.hpkg (or whatever) into /boot/system/packages (system wide), /home/config/packages (per-user) to install it.  If the user is missing libsdl2 (if you do it shared), then the OS will ask to install it.

If you're statically linking it though, you really shouldn't need libsdl2 in theory as a dependency.  Anyway, hpkg or just zipping the artifacts up, either way will work.

Thanks for supporting Haiku!!   If you have any technical questions the forum is generally full of help.  https://discuss.haiku-os.org