Bug 256355 - games/jaggedalliance2: update to 0.18.0. Second attempt.
Summary: games/jaggedalliance2: update to 0.18.0. Second attempt.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Neel Chauhan
URL: https://ja2-stracciatella.github.io/2...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-01 20:33 UTC by Pavel Timofeev
Modified: 2021-06-01 21:57 UTC (History)
1 user (show)

See Also:


Attachments
port patch (35.13 KB, patch)
2021-06-01 20:33 UTC, Pavel Timofeev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Timofeev 2021-06-01 20:33:57 UTC
Created attachment 225477 [details]
port patch

This is a second attempt to update games/jaggedalliance2 to 0.18.0. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255399 for the first one.

It uses cmake and cargo (some component written in rust) and has some external dependencies to be downloaded during build process.
So the build process for JA2-Stracciatella is not packaging friendly:
- there are rust crates the project depends on which can't be handled by ports infra. Fortunately those crates are for android build. But I couldn't find any way to tell cargo to skip those dependencies to be downloaded.
patch-rust_stracciatella__c__api_Cargo.toml and patch-rust_stracciatella_Cargo.toml patches are removing not needed crates from Cargo.toml files. Cargo is able to see that and skip them.
- there are dependencies written in C/C++. Current cmake build process provides a way to use packages already installed in your system for some of those dependencies.  But there are new ones appeared in this release which don't have such a way. Those are lua, sol2 and miniaudio. So it always downloads and builds them during build step.
patch-dependencies_lib-lua_CMakeLists.txt and patch-dependencies_lib-sol2_CMakeLists.txt handle lua and sol2 dependencies.
Miniaudio is trickier. We have a port for it. But it's incomplete for ja2 usage. We have bare minimum in our port, while ja2 build wants files from extras  dir of miniaudio project (see https://github.com/mackron/miniaudio). So I added a dirty stuff with GH_TUPLE and pre-patch with REINPLACE to make it sure miniaudio sources are downloaded and it can start building.

If anybody can advice me something I miss, please, do.

I'll try to upstream those patches and rise my concerns in their github.

This port patch also adds more dependencies I found it was looking during configure step.
Comment 1 Neel Chauhan freebsd_committer 2021-06-01 21:57:18 UTC
I tested this in Poudriere, it works. I have also committed this!
Comment 2 commit-hook freebsd_committer 2021-06-01 21:57:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=504b372caa8e07496ecdfb568dcdfe005a430cac

commit 504b372caa8e07496ecdfb568dcdfe005a430cac
Author:     Neel Chauhan <nc@FreeBSD.org>
AuthorDate: 2021-06-01 21:56:16 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2021-06-01 21:56:16 +0000

    games/jaggedalliance2: update to 0.18.0

    Changes: https://ja2-stracciatella.github.io/2021/04/23/release-0.18.0.html

    PR:             256355
    Submitted by:   timp87@gmail.com (maintainer)

 games/jaggedalliance2/Makefile  | 107 +++++++++++++-----------
 games/jaggedalliance2/distinfo  | 180 +++++++++++++++++++++-------------------
 games/jaggedalliance2/pkg-plist |  34 ++++++--
 3 files changed, 180 insertions(+), 141 deletions(-)