Troubleshooting the Haikuporter recipe for OpenXcom

Hey there everyone. I just recently installed Haiku nightly on an old Core2Duo machine, and have been looking for something to help learn about the system and possibly contribute. I’m not really a serious programmer, but the build recipies in Haikuporter looked like a good place to start, since some of them have gone unmaintained for a while.

I’ve been trying to get the recipe for OpenXcom 1.0 working, since it’s been listed on the OpenXcom page as a legit port while not being updated since 2014.

I created a new directory in my local copy of the ports tree, copied over the existing recipe/etc. files, then renamed the directory and recipe to “openxcom-fixed” (I’ll change that if I can get it working).

I figured maybe it might be as simple as fixing the web link to the proper source code archive, so I changed the SOURCE_URI and CHECKSUM_SHA256 entries to the current correct location. Then, I started troubleshooting the build to see what other config lines/files need to be changed. I got the archve to download and the checksum to match, but after that, running the recipe results in the following:

~> haikuporter -S openxcom-fixed
Checking if any package-infos need to be updated …
updating dependency infos of openxcom-fixed
Looking for stale dependency-infos …

games-strategy::openxcom-fixed
/boot/home/haikuports/games-strategy/openxcom-fixed/openxcom-fixed.recipe

Skipping download of source for v1.0.tar.gz
Skipping checksum validation of v1.0.tar.gz
Skipping unpack of v1.0.tar.gz
fatal: ambiguous argument ‘ORIGIN’: unknown revision or path not in the working tree.
Use ‘–’ to separate paths from revisions, like this:
‘git […] – […]’
Command ‘[‘git’, ‘reset’, ‘–hard’, ‘ORIGIN’]’ returned non-zero exit status 128

Does this mean that the directory structure of the archive is something unexpected, or is the problem in a different config file? For reference, here’s what I currently have in my recipe file:

SUMMARY=“Open-source clone of the original X-Com”
DESCRIPTION=“OpenXcom is an open-source clone of the original UFO: Enemy
Unknown (X-Com: UFO Defense in USA), licensed under the GPL and written in
C++ / SDL. It was originally founded by SupSuper in February 2010, and has
since grown into a small development team surrounded by a very supporting
community.”
HOMEPAGE=“http://openxcom.org/
COPYRIGHT=“2010-2014 OpenXcom Developers”
LICENSE=“GNU GPL v3”
REVISION=“1”
SOURCE_URI=“https://github.com/SupSuper/OpenXcom/archive/v1.0.tar.gz
CHECKSUM_SHA256=“45acb280010a01d60506b1c5f2951ae501c012cc6161aac470bd15c1e6981246”
SOURCE_DIR=“OpenXcom-fixed”
PATCHES=“openxcom-fixed.patchset”
ADDITIONAL_FILES=“openxcom.rdef”

ARCHITECTURES=“!x86_gcc2 ?x86_64 ?x86”
SECONDARY_ARCHITECTURES=“x86”

PROVIDES="
openxcom = $portVersion
app:OpenXcom
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libgl$secondaryArchSuffix
lib:libglu$secondaryArchSuffix
lib:libsdl$secondaryArchSuffix
lib:libsdl_gfx$secondaryArchSuffix
lib:libsdl_image$secondaryArchSuffix
lib:libsdl_mixer$secondaryArchSuffix
lib:libyaml_cpp$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libgl$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
devel:libsdl$secondaryArchSuffix
devel:libsdl_gfx$secondaryArchSuffix
devel:libsdl_image$secondaryArchSuffix
devel:libsdl_mixer$secondaryArchSuffix
devel:libyaml_cpp$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"

GLOBAL_WRITABLE_FILES="
settings/OpenXcom directory keep-old
"
BUILD()
{
cmake .
make $jobArgs
}

INSTALL()
{
mkdir -p $appsDir
mkdir -p $settingsDir
cp $sourceDir/bin/openxcom $appsDir/OpenXcom
cp -r $sourceDir/bin/data $settingsDir/OpenXcom
addResourcesToBinaries $portDir/additional-files/openxcom.rdef $appsDir/OpenXcom
addAppDeskbarSymlink $appsDir/OpenXcom OpenXcom
}

1 Like

SOURCE_DIR should be “OpenXcom-1.0”. Why OpenXcom-fixed?

Since it’s still OpenXcom v1.0, you can just increase the REVISION in the recipe and update the SOURCE_URI and CHECKSUM_SHA256, since they apparently moved the hosted source.

Then the fun begins, trying to get it to compile… :slight_smile:

And instead -fixed prefix you should use feature branches. There are very nice guides for absolutely beginners on the net or you can get help on the Haiku IRC channel.

Getting used to the replying system in the forum, so here’s a combined answer as it suggests:

My longer-term goal is to port the current nightly builds of openxcom, which likely would need a different name. So, I’m trying to see what I need to change to put together a new recipe.

The source_uri and checksum_sha256 are already updated. I’m pretty sure I’ve messed with the version # already, but I’ll give it another shot. And yes, compiling should be fun. :sweat_smile:

I’ll look into feature branches. I’m currently going through the guides, and couldn’t find the error message there or with a Google search, so I thought I’d try here and see if I was doing something obviously wrong. I’ll try the IRC channel in the future if it’s a better place to go for questions like this.

Yes, but the SOURCE_DIR depends on what’s in the archive you’re extracting. You should name it accordingly to what’s in the archive you downloaded.

2 Likes

Gotcha. That makes sense.

Since you still download the v1.0 source tar ball, the SOURCE_DIR should stay “OpenXcom-$portVersion” (or OpenXcom-1.0" if you’re working with a new renamed recipe).

Did you actually duplicate and rename the openxcom-1.0.patchset file. Otherwise it won’t be found, obviously.

I did. When combined with the SOURCE_DIR change to “OpenXcom-1.0”, I’m now past the first error. Now, it’s complaining about a missing dependency info file:

Skipping download of source for v1.0.tar.gz
Validating checksum of v1.0.tar.gz
Unpacking source of v1.0.tar.gz
Initialized empty Git repository in /boot/home/haikuports/games-strategy/openxcom-fixed/work-fixed/sources/OpenXcom-1.0/.git/
Applying patchset “/boot/home/haikuports/games-strategy/openxcom-fixed/patches/openxcom-fixed.patchset” …
Applying: Added Haiku support
[Errno -2147459069] No such file or directory: u’/boot/home/haikuports/repository/openxcom_source-fixed.DependencyInfo’

Searching through the repository directory, I couldn’t find a DependancyInfo file for the previous version of OpenXcom either. I assume this is a file generated by the build process? I can’t find a reference to it in the patchset or the HaikuPorter tutorials.

I’m not quite sure what’s triggering that, either. Most of the time a “haikuporter openxcom_x86 -c” to clean up does the trick. If it doesn’t, maybe removing “repository/recipeCache/” works…?
I hope others can shed more light here.

Excuse me, but why are you using the -fixed postfix?
If it is a git master,then it should be called openxcom-20180514.

It’s still based off of the 1.0 release from 2012, and I want to have the original recipe available to build alongside it so I can both compare and recopy anything I bork too badly. I wouldn’t have the postfix on anything I upload back; I would copy over the work to the original openxcom recipe/patchset/etc and upload that with a newer revision number in the recipe. However, if I can get it working, I would then try to port the newer nightly builds, and those I would rename to something like what you suggest.

Check this out then:



Be warned, our yaml-cpp port is still broken.

Oh, and this is the Haiku main forum, with porting question why don’t you go to the HaikuPorts Issues page?

I didn’t realize someone else was already working on this. The original porter (lich?) hadn’t updated the recipe in a couple of years, and I couldn’t find anything with a Google search. In the future, I’ll search/post there first.

I’m not working on it, I did it right now just for you.

Btw, here is a possible solution for yaml_cpp:

1 Like

Thanks! I’ll take a look and see what I can do with that, then move further questions about this project over to the HaikuPorts Issues page.

My recipe should be ok now, made some small changes here and there. It needs however the yaml_cpp changes, so that recipe needs to be merged first to get it to work or even built.
Are you care enough to take my recipe and patchset, wait some days till my yaml changes gets merged, and create a PR for openxcom? I’m too lazy to make it and i hope you can make the recipe yet better, cleaner, snappier. THAT would be great!

Sounds great, although if you’ll forgive the newbie question: what is a PR?

PR is a Pull Request in git scene.

Got you. I would be happy to do that, since the only Git stuff I’ve done before is clone a repo. I’ve set up a Github account, and am going through the starting tutorials.