Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] openttd: packs as options
@ 2024-11-12 11:11 Emru1
  2024-11-12 11:12 ` [PR PATCH] [Updated] " Emru1
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Emru1 @ 2024-11-12 11:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

There is a new pull request by Emru1 against master on the void-packages repository

https://github.com/Emru1/void-packages openttd_opts
https://github.com/void-linux/void-packages/pull/53017

openttd: packs as options
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, amd64-glibc


I've moved resource packs behind vopts.
Also I provided option to build only dedicated server.
Furthermore I've disabled tests that required resource packs to be present during testing.

A patch file from https://github.com/void-linux/void-packages/pull/53017.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openttd_opts-53017.patch --]
[-- Type: text/x-diff, Size: 5542 bytes --]

From 1d961705b49f969cd518d49a45ba086c4c3c1d5e Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Tue, 12 Nov 2024 09:55:28 +0100
Subject: [PATCH] openttd: packs as options

---
 .../openttd/patches/remove-gfx-tests.patch    | 13 ++++
 srcpkgs/openttd/template                      | 72 ++++++++++++-------
 2 files changed, 60 insertions(+), 25 deletions(-)
 create mode 100644 srcpkgs/openttd/patches/remove-gfx-tests.patch

diff --git a/srcpkgs/openttd/patches/remove-gfx-tests.patch b/srcpkgs/openttd/patches/remove-gfx-tests.patch
new file mode 100644
index 00000000000000..b84d23d873ebad
--- /dev/null
+++ b/srcpkgs/openttd/patches/remove-gfx-tests.patch
@@ -0,0 +1,13 @@
+--- a/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:13.378582909 +0100
++++ b/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:33.430682642 +0100
+@@ -15,10 +15,3 @@
+             DEPENDS
+             ${CMAKE_BINARY_DIR}/regression/regression.cfg
+     )
+-
+-    # Create a new target which runs the regression
+-    # Subdirectory targets will add themselves as dependencies
+-    add_custom_target(regression)
+-
+-    add_subdirectory(regression)
+-    add_subdirectory(stationlist)
diff --git a/srcpkgs/openttd/template b/srcpkgs/openttd/template
index 9f253a3b10a9e7..39a9c8b3b203cd 100644
--- a/srcpkgs/openttd/template
+++ b/srcpkgs/openttd/template
@@ -15,46 +15,68 @@ configure_args="
  -DCMAKE_INSTALL_BINDIR=bin
  -DCMAKE_INSTALL_DATADIR=/usr/share
  -DCMAKE_INSTALL_DOCDIR=share/doc/openttd
+ $(vopt_bool dedicated OPTION_DEDICATED)
 "
 
+build_options="gfx sfx msx dedicated"
+build_options_default="gfx sfx msx"
+desc_option_gfx="Include OpenGFX graphics pack"
+desc_option_sfx="Include OpenSFX sounds pack"
+desc_option_msx="Include OpenMSX music pack"
+desc_option_dedicated="Build dedicated server only, without GUI"
+
 hostmakedepends="pkg-config unzip tar"
-makedepends="SDL2-devel libcurl-devel freetype-devel fontconfig-devel
- harfbuzz-devel icu-devel libpng-devel liblzma-devel fluidsynth-devel"
-depends="hicolor-icon-theme fluidsynth soundfont-fluid"
+makedepends="$(vopt_if dedicated '' 'SDL2-devel freetype-devel fontconfig-devel
+ harfbuzz-devel icu-devel libpng-devel fluidsynth-devel') libcurl-devel
+ liblzma-devel"
+makedepends="libcurl-devel $(vopt_if dedicated '' 'libpng-devel')"
+depends="$(vopt_if dedicated '' 'hicolor-icon-theme fluidsynth
+ soundfont-fluid')"
 short_desc="Open Source version of Transport Tycoon Deluxe"
 maintainer="Emil Tomczyk <emru@emru.xyz>"
 license="GPL-2.0-only, Zlib"
 homepage="https://www.openttd.org/"
 distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
- https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip
- https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip
- https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip"
+ $(vopt_if gfx https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip)
+ $(vopt_if sfx https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip)
+ $(vopt_if msx https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip)"
 checksum="2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
- 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
- e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
- 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762"
+ $(vopt_if gfx 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846)
+ $(vopt_if sfx e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759)
+ $(vopt_if msx 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762)"
 
 post_extract() {
-	bsdtar xf opengfx-${_gfxver}.tar
-	bsdtar xf opensfx-${_sfxver}.tar
-	bsdtar xf openmsx-${_msxver}.tar
-	rm opengfx-${_gfxver}.tar
-	rm opensfx-${_sfxver}.tar
-	rm openmsx-${_msxver}.tar
+	$(vopt_if gfx "bsdtar xf opengfx-${_gfxver}.tar")
+	$(vopt_if sfx "bsdtar xf opensfx-${_sfxver}.tar")
+	$(vopt_if msx "bsdtar xf openmsx-${_msxver}.tar")
+	$(vopt_if gfx "rm opengfx-${_gfxver}.tar")
+	$(vopt_if sfx "rm opensfx-${_sfxver}.tar")
+	$(vopt_if msx "rm openmsx-${_msxver}.tar")
 }
 
 post_build() {
-	cp ../opengfx-${_gfxver}/*.grf build/baseset
-	cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
-	cp ../opensfx-${_sfxver}/opensfx.* build/baseset
-	cp -r ../openmsx-${_msxver} build/baseset
+	$(vopt_if gfx "cp ../opengfx-${_gfxver}/*.grf build/baseset")
+	$(vopt_if gfx "cp ../opengfx-${_gfxver}/opengfx.obg build/baseset")
+	$(vopt_if sfx "cp ../opensfx-${_sfxver}/opensfx.* build/baseset")
+	$(vopt_if msx "cp -r ../openmsx-${_msxver} build/baseset")
 }
 
 post_install() {
-	vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
-	vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
-	vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
-	vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
-	vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
-	vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	if $(vopt_if gfx 'true' 'false')
+	then
+		vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
+		vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
+	fi
+
+	if $(vopt_if sfx 'true' 'false')
+	then
+		vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
+		vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
+	fi
+
+	if $(vopt_if msx 'true' 'false')
+	then
+		vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
+		vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	fi
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
@ 2024-11-12 11:12 ` Emru1
  2024-11-12 11:19 ` Emru1
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-12 11:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

There is an updated pull request by Emru1 against master on the void-packages repository

https://github.com/Emru1/void-packages openttd_opts
https://github.com/void-linux/void-packages/pull/53017

openttd: packs as options
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, amd64-glibc


I've moved resource packs behind vopts.
Also I provided option to build only dedicated server.
Furthermore I've disabled tests that required resource packs to be present during testing.

A patch file from https://github.com/void-linux/void-packages/pull/53017.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openttd_opts-53017.patch --]
[-- Type: text/x-diff, Size: 5687 bytes --]

From 971e4f0c48a9d437eb2cd4e44258cb679be6a094 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Tue, 12 Nov 2024 09:55:28 +0100
Subject: [PATCH] openttd: packs as options

---
 .../openttd/patches/remove-gfx-tests.patch    | 13 ++++
 srcpkgs/openttd/template                      | 74 ++++++++++++-------
 2 files changed, 61 insertions(+), 26 deletions(-)
 create mode 100644 srcpkgs/openttd/patches/remove-gfx-tests.patch

diff --git a/srcpkgs/openttd/patches/remove-gfx-tests.patch b/srcpkgs/openttd/patches/remove-gfx-tests.patch
new file mode 100644
index 00000000000000..b84d23d873ebad
--- /dev/null
+++ b/srcpkgs/openttd/patches/remove-gfx-tests.patch
@@ -0,0 +1,13 @@
+--- a/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:13.378582909 +0100
++++ b/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:33.430682642 +0100
+@@ -15,10 +15,3 @@
+             DEPENDS
+             ${CMAKE_BINARY_DIR}/regression/regression.cfg
+     )
+-
+-    # Create a new target which runs the regression
+-    # Subdirectory targets will add themselves as dependencies
+-    add_custom_target(regression)
+-
+-    add_subdirectory(regression)
+-    add_subdirectory(stationlist)
diff --git a/srcpkgs/openttd/template b/srcpkgs/openttd/template
index 9f253a3b10a9e7..d6a91f1a72442f 100644
--- a/srcpkgs/openttd/template
+++ b/srcpkgs/openttd/template
@@ -1,7 +1,7 @@
 # Template file for 'openttd'
 pkgname=openttd
 version=14.1
-revision=1
+revision=2
 _gfxver=7.1
 _sfxver=1.0.3
 _msxver=0.4.2
@@ -15,46 +15,68 @@ configure_args="
  -DCMAKE_INSTALL_BINDIR=bin
  -DCMAKE_INSTALL_DATADIR=/usr/share
  -DCMAKE_INSTALL_DOCDIR=share/doc/openttd
+ $(vopt_bool dedicated OPTION_DEDICATED)
 "
 
+build_options="gfx sfx msx dedicated"
+build_options_default="gfx sfx msx"
+desc_option_gfx="Include OpenGFX graphics pack"
+desc_option_sfx="Include OpenSFX sounds pack"
+desc_option_msx="Include OpenMSX music pack"
+desc_option_dedicated="Build dedicated server only, without GUI"
+
 hostmakedepends="pkg-config unzip tar"
-makedepends="SDL2-devel libcurl-devel freetype-devel fontconfig-devel
- harfbuzz-devel icu-devel libpng-devel liblzma-devel fluidsynth-devel"
-depends="hicolor-icon-theme fluidsynth soundfont-fluid"
+makedepends="$(vopt_if dedicated '' 'SDL2-devel freetype-devel fontconfig-devel
+ harfbuzz-devel icu-devel libpng-devel fluidsynth-devel') libcurl-devel
+ liblzma-devel"
+makedepends="libcurl-devel $(vopt_if dedicated '' 'libpng-devel')"
+depends="$(vopt_if dedicated '' 'hicolor-icon-theme fluidsynth
+ soundfont-fluid')"
 short_desc="Open Source version of Transport Tycoon Deluxe"
 maintainer="Emil Tomczyk <emru@emru.xyz>"
 license="GPL-2.0-only, Zlib"
 homepage="https://www.openttd.org/"
 distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
- https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip
- https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip
- https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip"
+ $(vopt_if gfx https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip)
+ $(vopt_if sfx https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip)
+ $(vopt_if msx https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip)"
 checksum="2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
- 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
- e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
- 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762"
+ $(vopt_if gfx 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846)
+ $(vopt_if sfx e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759)
+ $(vopt_if msx 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762)"
 
 post_extract() {
-	bsdtar xf opengfx-${_gfxver}.tar
-	bsdtar xf opensfx-${_sfxver}.tar
-	bsdtar xf openmsx-${_msxver}.tar
-	rm opengfx-${_gfxver}.tar
-	rm opensfx-${_sfxver}.tar
-	rm openmsx-${_msxver}.tar
+	$(vopt_if gfx "bsdtar xf opengfx-${_gfxver}.tar")
+	$(vopt_if sfx "bsdtar xf opensfx-${_sfxver}.tar")
+	$(vopt_if msx "bsdtar xf openmsx-${_msxver}.tar")
+	$(vopt_if gfx "rm opengfx-${_gfxver}.tar")
+	$(vopt_if sfx "rm opensfx-${_sfxver}.tar")
+	$(vopt_if msx "rm openmsx-${_msxver}.tar")
 }
 
 post_build() {
-	cp ../opengfx-${_gfxver}/*.grf build/baseset
-	cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
-	cp ../opensfx-${_sfxver}/opensfx.* build/baseset
-	cp -r ../openmsx-${_msxver} build/baseset
+	$(vopt_if gfx "cp ../opengfx-${_gfxver}/*.grf build/baseset")
+	$(vopt_if gfx "cp ../opengfx-${_gfxver}/opengfx.obg build/baseset")
+	$(vopt_if sfx "cp ../opensfx-${_sfxver}/opensfx.* build/baseset")
+	$(vopt_if msx "cp -r ../openmsx-${_msxver} build/baseset")
 }
 
 post_install() {
-	vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
-	vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
-	vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
-	vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
-	vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
-	vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	if $(vopt_if gfx 'true' 'false')
+	then
+		vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
+		vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
+	fi
+
+	if $(vopt_if sfx 'true' 'false')
+	then
+		vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
+		vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
+	fi
+
+	if $(vopt_if msx 'true' 'false')
+	then
+		vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
+		vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	fi
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
  2024-11-12 11:12 ` [PR PATCH] [Updated] " Emru1
@ 2024-11-12 11:19 ` Emru1
  2024-11-12 11:41 ` [PR REVIEW] " ahesford
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-12 11:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

There is an updated pull request by Emru1 against master on the void-packages repository

https://github.com/Emru1/void-packages openttd_opts
https://github.com/void-linux/void-packages/pull/53017

openttd: packs as options
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, amd64-glibc


I've moved resource packs behind vopts, as they are not obligatory to run OpenTTD.
Also I provided option to build only dedicated server.
Furthermore I've disabled tests that required resource packs to be present during testing.

A patch file from https://github.com/void-linux/void-packages/pull/53017.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openttd_opts-53017.patch --]
[-- Type: text/x-diff, Size: 5619 bytes --]

From e0f8899604e30d4587ebe1c012c0eeb0368fd680 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Tue, 12 Nov 2024 09:55:28 +0100
Subject: [PATCH] openttd: packs as options

---
 .../openttd/patches/remove-gfx-tests.patch    | 13 ++++
 srcpkgs/openttd/template                      | 73 ++++++++++++-------
 2 files changed, 60 insertions(+), 26 deletions(-)
 create mode 100644 srcpkgs/openttd/patches/remove-gfx-tests.patch

diff --git a/srcpkgs/openttd/patches/remove-gfx-tests.patch b/srcpkgs/openttd/patches/remove-gfx-tests.patch
new file mode 100644
index 00000000000000..b84d23d873ebad
--- /dev/null
+++ b/srcpkgs/openttd/patches/remove-gfx-tests.patch
@@ -0,0 +1,13 @@
+--- a/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:13.378582909 +0100
++++ b/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:33.430682642 +0100
+@@ -15,10 +15,3 @@
+             DEPENDS
+             ${CMAKE_BINARY_DIR}/regression/regression.cfg
+     )
+-
+-    # Create a new target which runs the regression
+-    # Subdirectory targets will add themselves as dependencies
+-    add_custom_target(regression)
+-
+-    add_subdirectory(regression)
+-    add_subdirectory(stationlist)
diff --git a/srcpkgs/openttd/template b/srcpkgs/openttd/template
index 9f253a3b10a9e7..5bc53051f03125 100644
--- a/srcpkgs/openttd/template
+++ b/srcpkgs/openttd/template
@@ -1,7 +1,7 @@
 # Template file for 'openttd'
 pkgname=openttd
 version=14.1
-revision=1
+revision=2
 _gfxver=7.1
 _sfxver=1.0.3
 _msxver=0.4.2
@@ -15,46 +15,67 @@ configure_args="
  -DCMAKE_INSTALL_BINDIR=bin
  -DCMAKE_INSTALL_DATADIR=/usr/share
  -DCMAKE_INSTALL_DOCDIR=share/doc/openttd
+ $(vopt_bool dedicated OPTION_DEDICATED)
 "
 
+build_options="gfx sfx msx dedicated"
+build_options_default="gfx sfx msx"
+desc_option_gfx="Include OpenGFX graphics pack"
+desc_option_sfx="Include OpenSFX sounds pack"
+desc_option_msx="Include OpenMSX music pack"
+desc_option_dedicated="Build dedicated server only, without GUI"
+
 hostmakedepends="pkg-config unzip tar"
-makedepends="SDL2-devel libcurl-devel freetype-devel fontconfig-devel
- harfbuzz-devel icu-devel libpng-devel liblzma-devel fluidsynth-devel"
-depends="hicolor-icon-theme fluidsynth soundfont-fluid"
+makedepends="$(vopt_if dedicated '' 'SDL2-devel freetype-devel fontconfig-devel
+ harfbuzz-devel icu-devel libpng-devel fluidsynth-devel') libcurl-devel
+ liblzma-devel"
+depends="$(vopt_if dedicated '' 'hicolor-icon-theme fluidsynth
+ soundfont-fluid')"
 short_desc="Open Source version of Transport Tycoon Deluxe"
 maintainer="Emil Tomczyk <emru@emru.xyz>"
 license="GPL-2.0-only, Zlib"
 homepage="https://www.openttd.org/"
 distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
- https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip
- https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip
- https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip"
+ $(vopt_if gfx https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip)
+ $(vopt_if sfx https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip)
+ $(vopt_if msx https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip)"
 checksum="2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
- 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
- e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
- 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762"
+ $(vopt_if gfx 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846)
+ $(vopt_if sfx e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759)
+ $(vopt_if msx 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762)"
 
 post_extract() {
-	bsdtar xf opengfx-${_gfxver}.tar
-	bsdtar xf opensfx-${_sfxver}.tar
-	bsdtar xf openmsx-${_msxver}.tar
-	rm opengfx-${_gfxver}.tar
-	rm opensfx-${_sfxver}.tar
-	rm openmsx-${_msxver}.tar
+	$(vopt_if gfx "bsdtar xf opengfx-${_gfxver}.tar")
+	$(vopt_if sfx "bsdtar xf opensfx-${_sfxver}.tar")
+	$(vopt_if msx "bsdtar xf openmsx-${_msxver}.tar")
+	$(vopt_if gfx "rm opengfx-${_gfxver}.tar")
+	$(vopt_if sfx "rm opensfx-${_sfxver}.tar")
+	$(vopt_if msx "rm openmsx-${_msxver}.tar")
 }
 
 post_build() {
-	cp ../opengfx-${_gfxver}/*.grf build/baseset
-	cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
-	cp ../opensfx-${_sfxver}/opensfx.* build/baseset
-	cp -r ../openmsx-${_msxver} build/baseset
+	$(vopt_if gfx "cp ../opengfx-${_gfxver}/*.grf build/baseset")
+	$(vopt_if gfx "cp ../opengfx-${_gfxver}/opengfx.obg build/baseset")
+	$(vopt_if sfx "cp ../opensfx-${_sfxver}/opensfx.* build/baseset")
+	$(vopt_if msx "cp -r ../openmsx-${_msxver} build/baseset")
 }
 
 post_install() {
-	vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
-	vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
-	vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
-	vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
-	vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
-	vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	if $(vopt_if gfx 'true' 'false')
+	then
+		vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
+		vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
+	fi
+
+	if $(vopt_if sfx 'true' 'false')
+	then
+		vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
+		vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
+	fi
+
+	if $(vopt_if msx 'true' 'false')
+	then
+		vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
+		vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	fi
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
  2024-11-12 11:12 ` [PR PATCH] [Updated] " Emru1
  2024-11-12 11:19 ` Emru1
@ 2024-11-12 11:41 ` ahesford
  2024-11-12 11:41 ` ahesford
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ahesford @ 2024-11-12 11:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1837951731

Comment:
I don't think I like conditional distfiles; they will break helpers like `xgensum`.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (2 preceding siblings ...)
  2024-11-12 11:41 ` [PR REVIEW] " ahesford
@ 2024-11-12 11:41 ` ahesford
  2024-11-12 11:45 ` Emru1
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ahesford @ 2024-11-12 11:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1837955124

Comment:
The `vopt` expansion helpers are for string interpolation. For other control flow, you should be testing the `$build_option_*` variables directly. See other templates that use build options for examples.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (3 preceding siblings ...)
  2024-11-12 11:41 ` ahesford
@ 2024-11-12 11:45 ` Emru1
  2024-11-12 12:17 ` [PR PATCH] [Updated] " Emru1
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-12 11:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

New review comment by Emru1 on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1837963244

Comment:
I was also thinking about moving resource packs to separate packages, many other distros do it. Would it be better in this case?

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (4 preceding siblings ...)
  2024-11-12 11:45 ` Emru1
@ 2024-11-12 12:17 ` Emru1
  2024-11-13  0:10 ` [PR REVIEW] " ahesford
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-12 12:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

There is an updated pull request by Emru1 against master on the void-packages repository

https://github.com/Emru1/void-packages openttd_opts
https://github.com/void-linux/void-packages/pull/53017

openttd: packs as options
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, amd64-glibc


I've moved resource packs behind vopts, as they are not obligatory to run OpenTTD.
Also I provided option to build only dedicated server.
Furthermore I've disabled tests that required resource packs to be present during testing.

A patch file from https://github.com/void-linux/void-packages/pull/53017.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openttd_opts-53017.patch --]
[-- Type: text/x-diff, Size: 5687 bytes --]

From f6312f57fb7d957ad57e2a8a79de54e603702526 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Tue, 12 Nov 2024 09:55:28 +0100
Subject: [PATCH] openttd: packs as options

---
 .../openttd/patches/remove-gfx-tests.patch    | 13 +++
 srcpkgs/openttd/template                      | 88 +++++++++++++------
 2 files changed, 75 insertions(+), 26 deletions(-)
 create mode 100644 srcpkgs/openttd/patches/remove-gfx-tests.patch

diff --git a/srcpkgs/openttd/patches/remove-gfx-tests.patch b/srcpkgs/openttd/patches/remove-gfx-tests.patch
new file mode 100644
index 00000000000000..b84d23d873ebad
--- /dev/null
+++ b/srcpkgs/openttd/patches/remove-gfx-tests.patch
@@ -0,0 +1,13 @@
+--- a/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:13.378582909 +0100
++++ b/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:33.430682642 +0100
+@@ -15,10 +15,3 @@
+             DEPENDS
+             ${CMAKE_BINARY_DIR}/regression/regression.cfg
+     )
+-
+-    # Create a new target which runs the regression
+-    # Subdirectory targets will add themselves as dependencies
+-    add_custom_target(regression)
+-
+-    add_subdirectory(regression)
+-    add_subdirectory(stationlist)
diff --git a/srcpkgs/openttd/template b/srcpkgs/openttd/template
index 9f253a3b10a9e7..f47484cf991488 100644
--- a/srcpkgs/openttd/template
+++ b/srcpkgs/openttd/template
@@ -1,7 +1,7 @@
 # Template file for 'openttd'
 pkgname=openttd
 version=14.1
-revision=1
+revision=2
 _gfxver=7.1
 _sfxver=1.0.3
 _msxver=0.4.2
@@ -15,46 +15,82 @@ configure_args="
  -DCMAKE_INSTALL_BINDIR=bin
  -DCMAKE_INSTALL_DATADIR=/usr/share
  -DCMAKE_INSTALL_DOCDIR=share/doc/openttd
+ $(vopt_bool dedicated OPTION_DEDICATED)
 "
 
+build_options="gfx sfx msx dedicated"
+build_options_default="gfx sfx msx"
+desc_option_gfx="Include OpenGFX graphics pack"
+desc_option_sfx="Include OpenSFX sounds pack"
+desc_option_msx="Include OpenMSX music pack"
+desc_option_dedicated="Build dedicated server only, without GUI"
+
 hostmakedepends="pkg-config unzip tar"
-makedepends="SDL2-devel libcurl-devel freetype-devel fontconfig-devel
- harfbuzz-devel icu-devel libpng-devel liblzma-devel fluidsynth-devel"
-depends="hicolor-icon-theme fluidsynth soundfont-fluid"
+makedepends="$(vopt_if dedicated '' 'SDL2-devel freetype-devel fontconfig-devel
+ harfbuzz-devel icu-devel libpng-devel fluidsynth-devel') libcurl-devel
+ liblzma-devel"
+depends="$(vopt_if dedicated '' 'hicolor-icon-theme fluidsynth
+ soundfont-fluid')"
 short_desc="Open Source version of Transport Tycoon Deluxe"
 maintainer="Emil Tomczyk <emru@emru.xyz>"
 license="GPL-2.0-only, Zlib"
 homepage="https://www.openttd.org/"
 distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
- https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip
- https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip
- https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip"
+ $(vopt_if gfx https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip)
+ $(vopt_if sfx https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip)
+ $(vopt_if msx https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip)"
 checksum="2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
- 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
- e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
- 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762"
+ $(vopt_if gfx 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846)
+ $(vopt_if sfx e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759)
+ $(vopt_if msx 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762)"
 
 post_extract() {
-	bsdtar xf opengfx-${_gfxver}.tar
-	bsdtar xf opensfx-${_sfxver}.tar
-	bsdtar xf openmsx-${_msxver}.tar
-	rm opengfx-${_gfxver}.tar
-	rm opensfx-${_sfxver}.tar
-	rm openmsx-${_msxver}.tar
+	if [ $build_option_gfx ]; then
+		bsdtar xf opengfx-${_gfxver}.tar
+		rm opengfx-${_gfxver}.tar
+	fi
+
+	if [ "$build_option_sfx" ]; then
+		bsdtar xf opensfx-${_sfxver}.tar
+		rm opensfx-${_sfxver}.tar
+	fi
+
+	if [ "$build_option_msx" ]; then
+		bsdtar xf openmsx-${_msxver}.tar
+		rm openmsx-${_msxver}.tar
+	fi
+
 }
 
 post_build() {
-	cp ../opengfx-${_gfxver}/*.grf build/baseset
-	cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
-	cp ../opensfx-${_sfxver}/opensfx.* build/baseset
-	cp -r ../openmsx-${_msxver} build/baseset
+	if [ "$build_option_gfx" ]; then
+		cp ../opengfx-${_gfxver}/*.grf build/baseset
+		cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
+	fi
+
+	if [ "$build_option_sfx" ]; then
+		cp ../opensfx-${_sfxver}/opensfx.* build/baseset
+	fi
+
+	if [ "$build_option_msx" ]; then
+		cp -r ../openmsx-${_msxver} build/baseset
+	fi
 }
 
 post_install() {
-	vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
-	vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
-	vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
-	vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
-	vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
-	vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	if [ "$build_option_gfx" ]; then
+		vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
+		vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
+	fi
+
+	if [ "$build_option_sfx" ]; then
+		vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
+		vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
+	fi
+
+	if [ "$build_option_msx" ]; then
+		vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
+		vdoc ../openmsx-${_msxver}/readme.txt README-msx
+	fi
+
 }

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (5 preceding siblings ...)
  2024-11-12 12:17 ` [PR PATCH] [Updated] " Emru1
@ 2024-11-13  0:10 ` ahesford
  2024-11-13  8:35 ` Emru1
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ahesford @ 2024-11-13  0:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1839048612

Comment:
Given that they are entirely separate distfiles, breaking them out as separate packages seems like a reasonable option. That is a much better experience for people who might wish to choose their own resources than forcing them to build a custom package.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (6 preceding siblings ...)
  2024-11-13  0:10 ` [PR REVIEW] " ahesford
@ 2024-11-13  8:35 ` Emru1
  2024-11-13 13:41 ` [PR PATCH] [Updated] " Emru1
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-13  8:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

New review comment by Emru1 on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1839743392

Comment:
Then I'll do so, leaving here option for building only dedicated server

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (7 preceding siblings ...)
  2024-11-13  8:35 ` Emru1
@ 2024-11-13 13:41 ` Emru1
  2024-11-13 13:46 ` Emru1
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-13 13:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

There is an updated pull request by Emru1 against master on the void-packages repository

https://github.com/Emru1/void-packages openttd_opts
https://github.com/void-linux/void-packages/pull/53017

openttd: packs as options
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, amd64-glibc


I've moved resource packs behind vopts, as they are not obligatory to run OpenTTD.
Also I provided option to build only dedicated server.
Furthermore I've disabled tests that required resource packs to be present during testing.

A patch file from https://github.com/void-linux/void-packages/pull/53017.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openttd_opts-53017.patch --]
[-- Type: text/x-diff, Size: 8221 bytes --]

From f38fa0db509d210712264948552dedf3059eaba0 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:39:37 +0100
Subject: [PATCH 1/4] New package: openttd-opengfx-7.1

---
 srcpkgs/openttd-opengfx/template | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 srcpkgs/openttd-opengfx/template

diff --git a/srcpkgs/openttd-opengfx/template b/srcpkgs/openttd-opengfx/template
new file mode 100644
index 00000000000000..6e47a011971b70
--- /dev/null
+++ b/srcpkgs/openttd-opengfx/template
@@ -0,0 +1,20 @@
+# Template file for 'openttd-opengfx'
+pkgname=openttd-opengfx
+version=7.1
+revision=1
+short_desc="Free graphics pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="GPL-2.0-only"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/opengfx-releases/${version}/opengfx-${version}-all.zip"
+checksum=928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf opengfx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy opengfx-${version} usr/share/openttd/baseset
+}

From ffb76af2c099bc32fd666b9ea6b848734d26eebf Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:39:47 +0100
Subject: [PATCH 2/4] New package: openttd-opensfx-1.0.3

---
 srcpkgs/openttd-opensfx/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/openttd-opensfx/template

diff --git a/srcpkgs/openttd-opensfx/template b/srcpkgs/openttd-opensfx/template
new file mode 100644
index 00000000000000..bac65e0b45835f
--- /dev/null
+++ b/srcpkgs/openttd-opensfx/template
@@ -0,0 +1,24 @@
+# Template file for 'openttd-opensfx'
+pkgname=openttd-opensfx
+version=1.0.3
+revision=1
+short_desc="Free sounds pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="CC-BY-SA-3.0 AND GPL-2.0-only AND CDDL-1.0"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/opensfx-releases/${version}/opensfx-${version}-all.zip"
+checksum=e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf opensfx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy opensfx-${version} usr/share/openttd/baseset
+}
+
+post_install() {
+	vlicense opensfx-${version}/license.txt
+}

From ebcfa1bdd3d5b38738904b492d4ec8da9516cd96 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:39:50 +0100
Subject: [PATCH 3/4] New package: openttd-openmsx-0.4.2

---
 srcpkgs/openttd-openmsx/template | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 srcpkgs/openttd-openmsx/template

diff --git a/srcpkgs/openttd-openmsx/template b/srcpkgs/openttd-openmsx/template
new file mode 100644
index 00000000000000..f8a352fdddbfd9
--- /dev/null
+++ b/srcpkgs/openttd-openmsx/template
@@ -0,0 +1,20 @@
+# Template file for 'openttd-openmsx'
+pkgname=openttd-openmsx
+version=0.4.2
+revision=1
+short_desc="Free music pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="GPL-2.0-only"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/openmsx-releases/${version}/openmsx-${version}-all.zip"
+checksum=5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf openmsx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy openmsx-${version} usr/share/openttd/baseset
+}

From 653b071abd209c2df598d58f0d4ab72796d990c0 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:40:35 +0100
Subject: [PATCH 4/4] openttd: moved resources to separate packages

Also added dedicated option
---
 srcpkgs/openttd/INSTALL.msg                   |  3 ++
 .../openttd/patches/remove-gfx-tests.patch    | 13 +++++
 srcpkgs/openttd/template                      | 52 +++++--------------
 3 files changed, 28 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/openttd/INSTALL.msg
 create mode 100644 srcpkgs/openttd/patches/remove-gfx-tests.patch

diff --git a/srcpkgs/openttd/INSTALL.msg b/srcpkgs/openttd/INSTALL.msg
new file mode 100644
index 00000000000000..3997471edd5c8f
--- /dev/null
+++ b/srcpkgs/openttd/INSTALL.msg
@@ -0,0 +1,3 @@
+OpenGFX, OpenSFX and OpenMSX have been moved to separate packages.
+Please install openttd-opengfx, openttd-opensfx and openttd-openmsx
+packages respectively if you need them.
diff --git a/srcpkgs/openttd/patches/remove-gfx-tests.patch b/srcpkgs/openttd/patches/remove-gfx-tests.patch
new file mode 100644
index 00000000000000..b84d23d873ebad
--- /dev/null
+++ b/srcpkgs/openttd/patches/remove-gfx-tests.patch
@@ -0,0 +1,13 @@
+--- a/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:13.378582909 +0100
++++ b/openttd-14.1/regression/CMakeLists.txt	2024-11-12 10:12:33.430682642 +0100
+@@ -15,10 +15,3 @@
+             DEPENDS
+             ${CMAKE_BINARY_DIR}/regression/regression.cfg
+     )
+-
+-    # Create a new target which runs the regression
+-    # Subdirectory targets will add themselves as dependencies
+-    add_custom_target(regression)
+-
+-    add_subdirectory(regression)
+-    add_subdirectory(stationlist)
diff --git a/srcpkgs/openttd/template b/srcpkgs/openttd/template
index 9f253a3b10a9e7..29d94f858612d6 100644
--- a/srcpkgs/openttd/template
+++ b/srcpkgs/openttd/template
@@ -1,10 +1,7 @@
 # Template file for 'openttd'
 pkgname=openttd
 version=14.1
-revision=1
-_gfxver=7.1
-_sfxver=1.0.3
-_msxver=0.4.2
+revision=2
 create_wrksrc=yes
 build_wrksrc=openttd-$version
 build_style=cmake
@@ -15,46 +12,21 @@ configure_args="
  -DCMAKE_INSTALL_BINDIR=bin
  -DCMAKE_INSTALL_DATADIR=/usr/share
  -DCMAKE_INSTALL_DOCDIR=share/doc/openttd
+ $(vopt_bool dedicated OPTION_DEDICATED)
 "
 
+build_options="dedicated"
+desc_option_dedicated="Build dedicated server only, without GUI"
+
 hostmakedepends="pkg-config unzip tar"
-makedepends="SDL2-devel libcurl-devel freetype-devel fontconfig-devel
- harfbuzz-devel icu-devel libpng-devel liblzma-devel fluidsynth-devel"
-depends="hicolor-icon-theme fluidsynth soundfont-fluid"
+makedepends="$(vopt_if dedicated '' 'SDL2-devel freetype-devel fontconfig-devel
+ harfbuzz-devel icu-devel libpng-devel fluidsynth-devel') libcurl-devel
+ liblzma-devel"
+depends="$(vopt_if dedicated '' 'hicolor-icon-theme fluidsynth
+ soundfont-fluid')"
 short_desc="Open Source version of Transport Tycoon Deluxe"
 maintainer="Emil Tomczyk <emru@emru.xyz>"
 license="GPL-2.0-only, Zlib"
 homepage="https://www.openttd.org/"
-distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
- https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip
- https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip
- https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip"
-checksum="2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
- 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
- e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
- 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762"
-
-post_extract() {
-	bsdtar xf opengfx-${_gfxver}.tar
-	bsdtar xf opensfx-${_sfxver}.tar
-	bsdtar xf openmsx-${_msxver}.tar
-	rm opengfx-${_gfxver}.tar
-	rm opensfx-${_sfxver}.tar
-	rm openmsx-${_msxver}.tar
-}
-
-post_build() {
-	cp ../opengfx-${_gfxver}/*.grf build/baseset
-	cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
-	cp ../opensfx-${_sfxver}/opensfx.* build/baseset
-	cp -r ../openmsx-${_msxver} build/baseset
-}
-
-post_install() {
-	vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
-	vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
-	vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
-	vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
-	vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
-	vdoc ../openmsx-${_msxver}/readme.txt README-msx
-}
+distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz"
+checksum=2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] openttd: packs as options
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (8 preceding siblings ...)
  2024-11-13 13:41 ` [PR PATCH] [Updated] " Emru1
@ 2024-11-13 13:46 ` Emru1
  2024-11-14  9:00 ` openttd: packs in separate packages Emru1
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-13 13:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

There is an updated pull request by Emru1 against master on the void-packages repository

https://github.com/Emru1/void-packages openttd_opts
https://github.com/void-linux/void-packages/pull/53017

openttd: packs as options
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, amd64-glibc


I've moved resource packs behind vopts, as they are not obligatory to run OpenTTD.
Also I provided option to build only dedicated server.
Furthermore I've disabled tests that required resource packs to be present during testing.

A patch file from https://github.com/void-linux/void-packages/pull/53017.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openttd_opts-53017.patch --]
[-- Type: text/x-diff, Size: 8232 bytes --]

From f38fa0db509d210712264948552dedf3059eaba0 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:39:37 +0100
Subject: [PATCH 1/4] New package: openttd-opengfx-7.1

---
 srcpkgs/openttd-opengfx/template | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 srcpkgs/openttd-opengfx/template

diff --git a/srcpkgs/openttd-opengfx/template b/srcpkgs/openttd-opengfx/template
new file mode 100644
index 00000000000000..6e47a011971b70
--- /dev/null
+++ b/srcpkgs/openttd-opengfx/template
@@ -0,0 +1,20 @@
+# Template file for 'openttd-opengfx'
+pkgname=openttd-opengfx
+version=7.1
+revision=1
+short_desc="Free graphics pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="GPL-2.0-only"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/opengfx-releases/${version}/opengfx-${version}-all.zip"
+checksum=928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf opengfx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy opengfx-${version} usr/share/openttd/baseset
+}

From ffb76af2c099bc32fd666b9ea6b848734d26eebf Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:39:47 +0100
Subject: [PATCH 2/4] New package: openttd-opensfx-1.0.3

---
 srcpkgs/openttd-opensfx/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/openttd-opensfx/template

diff --git a/srcpkgs/openttd-opensfx/template b/srcpkgs/openttd-opensfx/template
new file mode 100644
index 00000000000000..bac65e0b45835f
--- /dev/null
+++ b/srcpkgs/openttd-opensfx/template
@@ -0,0 +1,24 @@
+# Template file for 'openttd-opensfx'
+pkgname=openttd-opensfx
+version=1.0.3
+revision=1
+short_desc="Free sounds pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="CC-BY-SA-3.0 AND GPL-2.0-only AND CDDL-1.0"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/opensfx-releases/${version}/opensfx-${version}-all.zip"
+checksum=e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf opensfx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy opensfx-${version} usr/share/openttd/baseset
+}
+
+post_install() {
+	vlicense opensfx-${version}/license.txt
+}

From ebcfa1bdd3d5b38738904b492d4ec8da9516cd96 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:39:50 +0100
Subject: [PATCH 3/4] New package: openttd-openmsx-0.4.2

---
 srcpkgs/openttd-openmsx/template | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 srcpkgs/openttd-openmsx/template

diff --git a/srcpkgs/openttd-openmsx/template b/srcpkgs/openttd-openmsx/template
new file mode 100644
index 00000000000000..f8a352fdddbfd9
--- /dev/null
+++ b/srcpkgs/openttd-openmsx/template
@@ -0,0 +1,20 @@
+# Template file for 'openttd-openmsx'
+pkgname=openttd-openmsx
+version=0.4.2
+revision=1
+short_desc="Free music pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="GPL-2.0-only"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/openmsx-releases/${version}/openmsx-${version}-all.zip"
+checksum=5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf openmsx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy openmsx-${version} usr/share/openttd/baseset
+}

From d1ae7c2fca15c1be41abea178521359685335cb0 Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:40:35 +0100
Subject: [PATCH 4/4] openttd: moved resources to separate packages

Also added dedicated option
---
 srcpkgs/openttd/INSTALL.msg                   |  3 ++
 .../openttd/patches/remove-gfx-tests.patch    | 13 +++++
 srcpkgs/openttd/template                      | 54 +++++--------------
 3 files changed, 28 insertions(+), 42 deletions(-)
 create mode 100644 srcpkgs/openttd/INSTALL.msg
 create mode 100644 srcpkgs/openttd/patches/remove-gfx-tests.patch

diff --git a/srcpkgs/openttd/INSTALL.msg b/srcpkgs/openttd/INSTALL.msg
new file mode 100644
index 00000000000000..3997471edd5c8f
--- /dev/null
+++ b/srcpkgs/openttd/INSTALL.msg
@@ -0,0 +1,3 @@
+OpenGFX, OpenSFX and OpenMSX have been moved to separate packages.
+Please install openttd-opengfx, openttd-opensfx and openttd-openmsx
+packages respectively if you need them.
diff --git a/srcpkgs/openttd/patches/remove-gfx-tests.patch b/srcpkgs/openttd/patches/remove-gfx-tests.patch
new file mode 100644
index 00000000000000..77c299d35e609b
--- /dev/null
+++ b/srcpkgs/openttd/patches/remove-gfx-tests.patch
@@ -0,0 +1,13 @@
+--- a/regression/CMakeLists.txt	2024-11-12 10:12:13.378582909 +0100
++++ b/regression/CMakeLists.txt	2024-11-12 10:12:33.430682642 +0100
+@@ -15,10 +15,3 @@
+             DEPENDS
+             ${CMAKE_BINARY_DIR}/regression/regression.cfg
+     )
+-
+-    # Create a new target which runs the regression
+-    # Subdirectory targets will add themselves as dependencies
+-    add_custom_target(regression)
+-
+-    add_subdirectory(regression)
+-    add_subdirectory(stationlist)
diff --git a/srcpkgs/openttd/template b/srcpkgs/openttd/template
index 9f253a3b10a9e7..9e23432d83daff 100644
--- a/srcpkgs/openttd/template
+++ b/srcpkgs/openttd/template
@@ -1,12 +1,7 @@
 # Template file for 'openttd'
 pkgname=openttd
 version=14.1
-revision=1
-_gfxver=7.1
-_sfxver=1.0.3
-_msxver=0.4.2
-create_wrksrc=yes
-build_wrksrc=openttd-$version
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="
@@ -15,46 +10,21 @@ configure_args="
  -DCMAKE_INSTALL_BINDIR=bin
  -DCMAKE_INSTALL_DATADIR=/usr/share
  -DCMAKE_INSTALL_DOCDIR=share/doc/openttd
+ $(vopt_bool dedicated OPTION_DEDICATED)
 "
 
+build_options="dedicated"
+desc_option_dedicated="Build dedicated server only, without GUI"
+
 hostmakedepends="pkg-config unzip tar"
-makedepends="SDL2-devel libcurl-devel freetype-devel fontconfig-devel
- harfbuzz-devel icu-devel libpng-devel liblzma-devel fluidsynth-devel"
-depends="hicolor-icon-theme fluidsynth soundfont-fluid"
+makedepends="$(vopt_if dedicated '' 'SDL2-devel freetype-devel fontconfig-devel
+ harfbuzz-devel icu-devel libpng-devel fluidsynth-devel') libcurl-devel
+ liblzma-devel"
+depends="$(vopt_if dedicated '' 'hicolor-icon-theme fluidsynth
+ soundfont-fluid')"
 short_desc="Open Source version of Transport Tycoon Deluxe"
 maintainer="Emil Tomczyk <emru@emru.xyz>"
 license="GPL-2.0-only, Zlib"
 homepage="https://www.openttd.org/"
-distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
- https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip
- https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip
- https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip"
-checksum="2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
- 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
- e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
- 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762"
-
-post_extract() {
-	bsdtar xf opengfx-${_gfxver}.tar
-	bsdtar xf opensfx-${_sfxver}.tar
-	bsdtar xf openmsx-${_msxver}.tar
-	rm opengfx-${_gfxver}.tar
-	rm opensfx-${_sfxver}.tar
-	rm openmsx-${_msxver}.tar
-}
-
-post_build() {
-	cp ../opengfx-${_gfxver}/*.grf build/baseset
-	cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
-	cp ../opensfx-${_sfxver}/opensfx.* build/baseset
-	cp -r ../openmsx-${_msxver} build/baseset
-}
-
-post_install() {
-	vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
-	vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
-	vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
-	vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
-	vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
-	vdoc ../openmsx-${_msxver}/readme.txt README-msx
-}
+distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz"
+checksum=2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: openttd: packs in separate packages
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (9 preceding siblings ...)
  2024-11-13 13:46 ` Emru1
@ 2024-11-14  9:00 ` Emru1
  2024-11-14 11:37 ` [PR REVIEW] " ahesford
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-14  9:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

New comment by Emru1 on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#issuecomment-2475772505

Comment:
@ahesford please check it now

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs in separate packages
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (10 preceding siblings ...)
  2024-11-14  9:00 ` openttd: packs in separate packages Emru1
@ 2024-11-14 11:37 ` ahesford
  2024-11-16 14:17 ` [PR PATCH] [Updated] " Emru1
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ahesford @ 2024-11-14 11:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1842062013

Comment:
This can just be done in `do_install` rather than in a separate function.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR PATCH] [Updated] openttd: packs in separate packages
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (11 preceding siblings ...)
  2024-11-14 11:37 ` [PR REVIEW] " ahesford
@ 2024-11-16 14:17 ` Emru1
  2024-11-16 14:17 ` Emru1
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-16 14:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

There is an updated pull request by Emru1 against master on the void-packages repository

https://github.com/Emru1/void-packages openttd_opts
https://github.com/void-linux/void-packages/pull/53017

openttd: packs in separate packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, amd64-glibc


~~I've moved resource packs behind vopts, as they are not obligatory to run OpenTTD.~~
Resource packs have been moved to separate packages.
Also I provided option to build only dedicated server.
Furthermore I've disabled tests that required resource packs to be present during testing.

A patch file from https://github.com/void-linux/void-packages/pull/53017.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openttd_opts-53017.patch --]
[-- Type: text/x-diff, Size: 7769 bytes --]

From 8518b9229234a2f3a05b5f2718e5fd6910722a0e Mon Sep 17 00:00:00 2001
From: Emil Tomczyk <emru@emru.xyz>
Date: Wed, 13 Nov 2024 14:40:35 +0100
Subject: [PATCH] openttd: moved resources to separate packages

Also added dedicated option to build without graphics

New package: openttd-opengfx-7.1

New package: openttd-opensfx-1.0.3

New package: openttd-openmsx-0.4.2
---
 srcpkgs/openttd-opengfx/template              | 20 +++++++
 srcpkgs/openttd-openmsx/template              | 20 +++++++
 srcpkgs/openttd-opensfx/template              | 24 +++++++++
 srcpkgs/openttd/INSTALL.msg                   |  6 +++
 .../openttd/patches/remove-gfx-tests.patch    | 13 +++++
 srcpkgs/openttd/template                      | 54 +++++--------------
 6 files changed, 95 insertions(+), 42 deletions(-)
 create mode 100644 srcpkgs/openttd-opengfx/template
 create mode 100644 srcpkgs/openttd-openmsx/template
 create mode 100644 srcpkgs/openttd-opensfx/template
 create mode 100644 srcpkgs/openttd/INSTALL.msg
 create mode 100644 srcpkgs/openttd/patches/remove-gfx-tests.patch

diff --git a/srcpkgs/openttd-opengfx/template b/srcpkgs/openttd-opengfx/template
new file mode 100644
index 00000000000000..6e47a011971b70
--- /dev/null
+++ b/srcpkgs/openttd-opengfx/template
@@ -0,0 +1,20 @@
+# Template file for 'openttd-opengfx'
+pkgname=openttd-opengfx
+version=7.1
+revision=1
+short_desc="Free graphics pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="GPL-2.0-only"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/opengfx-releases/${version}/opengfx-${version}-all.zip"
+checksum=928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf opengfx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy opengfx-${version} usr/share/openttd/baseset
+}
diff --git a/srcpkgs/openttd-openmsx/template b/srcpkgs/openttd-openmsx/template
new file mode 100644
index 00000000000000..f8a352fdddbfd9
--- /dev/null
+++ b/srcpkgs/openttd-openmsx/template
@@ -0,0 +1,20 @@
+# Template file for 'openttd-openmsx'
+pkgname=openttd-openmsx
+version=0.4.2
+revision=1
+short_desc="Free music pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="GPL-2.0-only"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/openmsx-releases/${version}/openmsx-${version}-all.zip"
+checksum=5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf openmsx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy openmsx-${version} usr/share/openttd/baseset
+}
diff --git a/srcpkgs/openttd-opensfx/template b/srcpkgs/openttd-opensfx/template
new file mode 100644
index 00000000000000..4b4d874441826f
--- /dev/null
+++ b/srcpkgs/openttd-opensfx/template
@@ -0,0 +1,24 @@
+# Template file for 'openttd-opensfx'
+pkgname=openttd-opensfx
+version=1.0.3
+revision=1
+short_desc="Free sounds pack for OpenTTD"
+maintainer="Emil Tomczyk <emru@emru.xyz>"
+license="CC-BY-SA-3.0 AND GPL-2.0-only AND CDDL-1.0"
+homepage="https://www.openttd.org/"
+distfiles="https://cdn.openttd.org/opensfx-releases/${version}/opensfx-${version}-all.zip"
+checksum=e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
+conflicts="openttd<=14.1_1"
+
+post_extract() {
+	bsdtar xf opensfx-${version}.tar
+}
+
+do_install() {
+	vmkdir usr/share/openttd/baseset
+	vcopy opensfx-${version} usr/share/openttd/baseset
+}
+
+do_install() {
+	vlicense opensfx-${version}/license.txt
+}
diff --git a/srcpkgs/openttd/INSTALL.msg b/srcpkgs/openttd/INSTALL.msg
new file mode 100644
index 00000000000000..7820b733361aa2
--- /dev/null
+++ b/srcpkgs/openttd/INSTALL.msg
@@ -0,0 +1,6 @@
+OpenGFX, OpenSFX and OpenMSX have been moved to separate packages. Please
+install openttd-opengfx, openttd-opensfx and openttd-openmsx packages
+respectively if you need them.
+
+Now these packages are installed automatically. This would change in the
+future.
diff --git a/srcpkgs/openttd/patches/remove-gfx-tests.patch b/srcpkgs/openttd/patches/remove-gfx-tests.patch
new file mode 100644
index 00000000000000..77c299d35e609b
--- /dev/null
+++ b/srcpkgs/openttd/patches/remove-gfx-tests.patch
@@ -0,0 +1,13 @@
+--- a/regression/CMakeLists.txt	2024-11-12 10:12:13.378582909 +0100
++++ b/regression/CMakeLists.txt	2024-11-12 10:12:33.430682642 +0100
+@@ -15,10 +15,3 @@
+             DEPENDS
+             ${CMAKE_BINARY_DIR}/regression/regression.cfg
+     )
+-
+-    # Create a new target which runs the regression
+-    # Subdirectory targets will add themselves as dependencies
+-    add_custom_target(regression)
+-
+-    add_subdirectory(regression)
+-    add_subdirectory(stationlist)
diff --git a/srcpkgs/openttd/template b/srcpkgs/openttd/template
index 9f253a3b10a9e7..e818312bc3bdad 100644
--- a/srcpkgs/openttd/template
+++ b/srcpkgs/openttd/template
@@ -1,12 +1,7 @@
 # Template file for 'openttd'
 pkgname=openttd
 version=14.1
-revision=1
-_gfxver=7.1
-_sfxver=1.0.3
-_msxver=0.4.2
-create_wrksrc=yes
-build_wrksrc=openttd-$version
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="
@@ -15,46 +10,21 @@ configure_args="
  -DCMAKE_INSTALL_BINDIR=bin
  -DCMAKE_INSTALL_DATADIR=/usr/share
  -DCMAKE_INSTALL_DOCDIR=share/doc/openttd
+ $(vopt_bool dedicated OPTION_DEDICATED)
 "
 
+build_options="dedicated"
+desc_option_dedicated="Build dedicated server only, without GUI"
+
 hostmakedepends="pkg-config unzip tar"
-makedepends="SDL2-devel libcurl-devel freetype-devel fontconfig-devel
- harfbuzz-devel icu-devel libpng-devel liblzma-devel fluidsynth-devel"
-depends="hicolor-icon-theme fluidsynth soundfont-fluid"
+makedepends="$(vopt_if dedicated '' 'SDL2-devel freetype-devel fontconfig-devel
+ harfbuzz-devel icu-devel libpng-devel fluidsynth-devel') libcurl-devel
+ liblzma-devel"
+depends="$(vopt_if dedicated '' 'hicolor-icon-theme fluidsynth
+ soundfont-fluid') openttd-opengfx openttd-opensfx openttd-openmsx"
 short_desc="Open Source version of Transport Tycoon Deluxe"
 maintainer="Emil Tomczyk <emru@emru.xyz>"
 license="GPL-2.0-only, Zlib"
 homepage="https://www.openttd.org/"
-distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
- https://cdn.openttd.org/opengfx-releases/${_gfxver}/opengfx-${_gfxver}-all.zip
- https://cdn.openttd.org/opensfx-releases/${_sfxver}/opensfx-${_sfxver}-all.zip
- https://cdn.openttd.org/openmsx-releases/${_msxver}/openmsx-${_msxver}-all.zip"
-checksum="2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494
- 928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846
- e0a218b7dd9438e701503b0f84c25a97c1c11b7c2f025323fb19d6db16ef3759
- 5a4277a2e62d87f2952ea5020dc20fb2f6ffafdccf9913fbf35ad45ee30ec762"
-
-post_extract() {
-	bsdtar xf opengfx-${_gfxver}.tar
-	bsdtar xf opensfx-${_sfxver}.tar
-	bsdtar xf openmsx-${_msxver}.tar
-	rm opengfx-${_gfxver}.tar
-	rm opensfx-${_sfxver}.tar
-	rm openmsx-${_msxver}.tar
-}
-
-post_build() {
-	cp ../opengfx-${_gfxver}/*.grf build/baseset
-	cp ../opengfx-${_gfxver}/opengfx.obg build/baseset
-	cp ../opensfx-${_sfxver}/opensfx.* build/baseset
-	cp -r ../openmsx-${_msxver} build/baseset
-}
-
-post_install() {
-	vlicense ../opengfx-${_gfxver}/license.txt LICENSE-gfx
-	vlicense ../opensfx-${_sfxver}/license.txt LICENSE-sfx
-	vlicense ../openmsx-${_msxver}/license.txt LICENSE-msx
-	vdoc ../opengfx-${_gfxver}/readme.txt README-gfx
-	vdoc ../opensfx-${_sfxver}/readme.txt README-sfx
-	vdoc ../openmsx-${_msxver}/readme.txt README-msx
-}
+distfiles="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz"
+checksum=2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: openttd: packs in separate packages
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (12 preceding siblings ...)
  2024-11-16 14:17 ` [PR PATCH] [Updated] " Emru1
@ 2024-11-16 14:17 ` Emru1
  2024-11-16 14:58 ` [PR REVIEW] " ahesford
  2024-11-16 14:58 ` ahesford
  15 siblings, 0 replies; 17+ messages in thread
From: Emru1 @ 2024-11-16 14:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

New comment by Emru1 on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#issuecomment-2480589379

Comment:
1. I can't think of any reason
2. I've added it
3. Squashed

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs in separate packages
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (13 preceding siblings ...)
  2024-11-16 14:17 ` Emru1
@ 2024-11-16 14:58 ` ahesford
  2024-11-16 14:58 ` ahesford
  15 siblings, 0 replies; 17+ messages in thread
From: ahesford @ 2024-11-16 14:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1844992770

Comment:
```suggestion
The openttd package automatically installs the add-on packages openttd-opengfx,
openttd-opensfx and openttd-openmsx. This will change in a future update. Mark 
the packages manually installed if you wish to continue using these add-ons.
```

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PR REVIEW] openttd: packs in separate packages
  2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
                   ` (14 preceding siblings ...)
  2024-11-16 14:58 ` [PR REVIEW] " ahesford
@ 2024-11-16 14:58 ` ahesford
  15 siblings, 0 replies; 17+ messages in thread
From: ahesford @ 2024-11-16 14:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/53017#discussion_r1844991976

Comment:
```suggestion
```
These need to be combined.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-11-16 14:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-12 11:11 [PR PATCH] openttd: packs as options Emru1
2024-11-12 11:12 ` [PR PATCH] [Updated] " Emru1
2024-11-12 11:19 ` Emru1
2024-11-12 11:41 ` [PR REVIEW] " ahesford
2024-11-12 11:41 ` ahesford
2024-11-12 11:45 ` Emru1
2024-11-12 12:17 ` [PR PATCH] [Updated] " Emru1
2024-11-13  0:10 ` [PR REVIEW] " ahesford
2024-11-13  8:35 ` Emru1
2024-11-13 13:41 ` [PR PATCH] [Updated] " Emru1
2024-11-13 13:46 ` Emru1
2024-11-14  9:00 ` openttd: packs in separate packages Emru1
2024-11-14 11:37 ` [PR REVIEW] " ahesford
2024-11-16 14:17 ` [PR PATCH] [Updated] " Emru1
2024-11-16 14:17 ` Emru1
2024-11-16 14:58 ` [PR REVIEW] " ahesford
2024-11-16 14:58 ` ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).