Bug 256355

Summary: games/jaggedalliance2: update to 0.18.0. Second attempt.
Product: Ports & Packages Reporter: Pavel Timofeev <timp87>
Component: Individual Port(s)Assignee: Neel Chauhan <nc>
Status: Closed FIXED    
Severity: Affects Only Me CC: nc
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://ja2-stracciatella.github.io/2021/04/23/release-0.18.0.html
Attachments:
Description Flags
port patch none

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 freebsd_triage 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 freebsd_triage 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(-)