Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] OpenRCT2: update to 0.3.4, enable tests
@ 2021-07-20  4:24 Skirmisher
  2021-07-20  4:30 ` [PR PATCH] [Updated] " Skirmisher
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Skirmisher @ 2021-07-20  4:24 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Skirmisher/void-packages bump-openrct2-with-tests
https://github.com/void-linux/void-packages/pull/32050

OpenRCT2: update to 0.3.4, enable tests
In the last version, a few of the tests were broken, so I hadn't put in the plumbing for the check step yet. Now the tests all pass, so that's cool.

Also, I removed `/usr/lib/libopenrct2.a`, which only exists to be linked into `openrct2` and `openrct2-cli` and shouldn't have been included in the package itself. (It can also be built as a shared object, but again it's only used to share code between the two binaries, and I'm not going to try to reconcile that with Void policy over 10M of duplicated code.)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bump-openrct2-with-tests-32050.patch --]
[-- Type: text/x-diff, Size: 6094 bytes --]

From 5ba47b113a56d57278734e4baa93930e30a2ceaf Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 19:25:25 -0700
Subject: [PATCH 1/3] OpenRCT2: update to 0.3.4

---
 srcpkgs/OpenRCT2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index b36795aa9f76..2d124e5c25d7 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -4,8 +4,8 @@
 pkgname=OpenRCT2
 _objects_version=1.0.21
 _titles_version=0.1.2c
-version=0.3.3
-revision=2
+version=0.3.4
+revision=1
 build_style=cmake
 configure_args="
  -DOPENRCT2_VERSION_TAG=${version}
@@ -30,7 +30,7 @@ homepage="https://openrct2.io"
 distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
  https://github.com/OpenRCT2/objects/releases/download/v${_objects_version}/objects.zip
  https://github.com/OpenRCT2/title-sequences/releases/download/v${_titles_version}/title-sequences.zip"
-checksum="71f9d1ae8477e1e9881a6f9759bddac71346e8ba42238d22514ae3d872b54fd2
+checksum="755529c797b94279e683b77ffbcfcfe901cca2fff817431632a23019ac95c6ca
  b081f885311f9afebc41d9dd4a68b7db4cf736eb815c04e307e1a426f08cfa35
  5284333fa501270835b5f0cf420cb52155742335f5658d7889ea35d136b52517"
 skip_extraction="objects.zip title-sequences.zip"

From 59cb17ae5e6a034c121ebb90d130a45c5e05e3c7 Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 19:32:21 -0700
Subject: [PATCH 2/3] OpenRCT2: enable tests

---
 srcpkgs/OpenRCT2/template | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index 2d124e5c25d7..6f962d745e72 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -4,6 +4,7 @@
 pkgname=OpenRCT2
 _objects_version=1.0.21
 _titles_version=0.1.2c
+_replays_version=0.0.43
 version=0.3.4
 revision=1
 build_style=cmake
@@ -11,6 +12,7 @@ configure_args="
  -DOPENRCT2_VERSION_TAG=${version}
  -DDOWNLOAD_TITLE_SEQUENCES=0
  -DDOWNLOAD_OBJECTS=0
+ -DDOWNLOAD_REPLAYS=0
  -DDISABLE_DISCORD_RPC=1
  -DDISABLE_GOOGLE_BENCHMARK=1
  $(vopt_if multiplayer '' '-DDISABLE_NETWORK=1')
@@ -21,6 +23,7 @@ makedepends="SDL2-devel fontconfig-devel freetype-devel libzip-devel
  libpng-devel speexdsp-devel icu-devel zlib-devel json-c++
  $(vopt_if multiplayer 'libcurl-devel openssl-devel')
  $(vopt_if scripting duktape-devel)"
+checkdepends="gtest-devel"
 depends="zenity"
 short_desc="Open source re-implementation of RollerCoaster Tycoon 2"
 maintainer="klardotsh <josh@klar.sh>"
@@ -33,7 +36,7 @@ distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
 checksum="755529c797b94279e683b77ffbcfcfe901cca2fff817431632a23019ac95c6ca
  b081f885311f9afebc41d9dd4a68b7db4cf736eb815c04e307e1a426f08cfa35
  5284333fa501270835b5f0cf420cb52155742335f5658d7889ea35d136b52517"
-skip_extraction="objects.zip title-sequences.zip"
+skip_extraction="objects.zip title-sequences.zip replays.zip"
 
 replaces="OpenRCT2-data>=0"
 
@@ -53,16 +56,32 @@ if [ "$CROSS_BUILD" ]; then
 	CXXFLAGS+=" -DHAVE_IMMINTRIN_H=false -DSDL_DISABLE_IMMINTRIN_H=1"
 fi
 
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
-	fi
-}
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DWITH_TESTS=1 -DSYSTEM_GTEST=1"
+	distfiles+=" https://github.com/OpenRCT2/replays/releases/download/v${_replays_version}/replays.zip"
+	checksum+=" 43ba763ee6950a51aa96b26f3007c18b6e2ed09b6003601df6b014d5642c08d8"
+fi
 
 post_extract() {
 	_srcdir="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
+	_builddir="${build_wrksrc:+$build_wrksrc/}${cmake_builddir:=build}"
 	unzip -qd data/object "${_srcdir}/objects.zip"
 	unzip -qd data/sequence "${_srcdir}/title-sequences.zip"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		mkdir -p "${_builddir}/testdata"
+		unzip -qd "${_builddir}/testdata/replays" "${_srcdir}/replays.zip"
+		# other testdata needs to be in builddir for tests to work
+		cp -a test/tests/testdata "${_builddir}/"
+		# CMakeLists seems to assume `install` is run before `check`, and so
+		# doesn't actually make the `data` symlink in time
+		ln -rs data "${_builddir}/data"
+	fi
 
 	vsed -i CMakeLists.txt -e "s; -Werror;;"
 }
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
+	fi
+}

From 85bad7693aa1a664550cf631cb97f8e27243ee1d Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 21:03:57 -0700
Subject: [PATCH 3/3] OpenRCT2: exclude internal static library from pkg

---
 srcpkgs/OpenRCT2/template | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index 6f962d745e72..5cafac8e5176 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -29,7 +29,7 @@ short_desc="Open source re-implementation of RollerCoaster Tycoon 2"
 maintainer="klardotsh <josh@klar.sh>"
 license="GPL-3.0-or-later, CC-BY-SA-4.0"
 homepage="https://openrct2.io"
-# use title-sequences.zip to match CMakeLists instruction
+# download objects and title sequences ourselves, instead of letting cmake do it
 distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
  https://github.com/OpenRCT2/objects/releases/download/v${_objects_version}/objects.zip
  https://github.com/OpenRCT2/title-sequences/releases/download/v${_titles_version}/title-sequences.zip"
@@ -58,6 +58,7 @@ fi
 
 if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DWITH_TESTS=1 -DSYSTEM_GTEST=1"
+	# download replays, used in tests
 	distfiles+=" https://github.com/OpenRCT2/replays/releases/download/v${_replays_version}/replays.zip"
 	checksum+=" 43ba763ee6950a51aa96b26f3007c18b6e2ed09b6003601df6b014d5642c08d8"
 fi
@@ -85,3 +86,8 @@ pre_configure() {
 		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
 	fi
 }
+
+post_install() {
+	# remove useless static lib
+	rm -f "${DESTDIR}/usr/lib/libopenrct2.a"
+}

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

* Re: [PR PATCH] [Updated] OpenRCT2: update to 0.3.4, enable tests
  2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
@ 2021-07-20  4:30 ` Skirmisher
  2021-07-20 15:24 ` [PR REVIEW] " ericonr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Skirmisher @ 2021-07-20  4:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Skirmisher/void-packages bump-openrct2-with-tests
https://github.com/void-linux/void-packages/pull/32050

OpenRCT2: update to 0.3.4, enable tests
In the last version, a few of the tests were broken, so I hadn't put in the plumbing for the check step yet. Now the tests all pass, so that's cool.

Also, I removed `/usr/lib/libopenrct2.a`, which only exists to be linked into `openrct2` and `openrct2-cli` and shouldn't have been included in the package itself. (It can also be built as a shared object, but again it's only used to share code between the two binaries, and I'm not going to try to reconcile that with Void policy over 10M of duplicated code.)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bump-openrct2-with-tests-32050.patch --]
[-- Type: text/x-diff, Size: 6076 bytes --]

From 5ba47b113a56d57278734e4baa93930e30a2ceaf Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 19:25:25 -0700
Subject: [PATCH 1/3] OpenRCT2: update to 0.3.4

---
 srcpkgs/OpenRCT2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index b36795aa9f76..2d124e5c25d7 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -4,8 +4,8 @@
 pkgname=OpenRCT2
 _objects_version=1.0.21
 _titles_version=0.1.2c
-version=0.3.3
-revision=2
+version=0.3.4
+revision=1
 build_style=cmake
 configure_args="
  -DOPENRCT2_VERSION_TAG=${version}
@@ -30,7 +30,7 @@ homepage="https://openrct2.io"
 distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
  https://github.com/OpenRCT2/objects/releases/download/v${_objects_version}/objects.zip
  https://github.com/OpenRCT2/title-sequences/releases/download/v${_titles_version}/title-sequences.zip"
-checksum="71f9d1ae8477e1e9881a6f9759bddac71346e8ba42238d22514ae3d872b54fd2
+checksum="755529c797b94279e683b77ffbcfcfe901cca2fff817431632a23019ac95c6ca
  b081f885311f9afebc41d9dd4a68b7db4cf736eb815c04e307e1a426f08cfa35
  5284333fa501270835b5f0cf420cb52155742335f5658d7889ea35d136b52517"
 skip_extraction="objects.zip title-sequences.zip"

From 359f29b68c046fdfe45b971bbfe91a43c27cf79a Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 19:32:21 -0700
Subject: [PATCH 2/3] OpenRCT2: enable tests

---
 srcpkgs/OpenRCT2/template | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index 2d124e5c25d7..b54adb1918fa 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -4,6 +4,7 @@
 pkgname=OpenRCT2
 _objects_version=1.0.21
 _titles_version=0.1.2c
+_replays_version=0.0.43
 version=0.3.4
 revision=1
 build_style=cmake
@@ -11,6 +12,7 @@ configure_args="
  -DOPENRCT2_VERSION_TAG=${version}
  -DDOWNLOAD_TITLE_SEQUENCES=0
  -DDOWNLOAD_OBJECTS=0
+ -DDOWNLOAD_REPLAYS=0
  -DDISABLE_DISCORD_RPC=1
  -DDISABLE_GOOGLE_BENCHMARK=1
  $(vopt_if multiplayer '' '-DDISABLE_NETWORK=1')
@@ -22,6 +24,7 @@ makedepends="SDL2-devel fontconfig-devel freetype-devel libzip-devel
  $(vopt_if multiplayer 'libcurl-devel openssl-devel')
  $(vopt_if scripting duktape-devel)"
 depends="zenity"
+checkdepends="gtest-devel"
 short_desc="Open source re-implementation of RollerCoaster Tycoon 2"
 maintainer="klardotsh <josh@klar.sh>"
 license="GPL-3.0-or-later, CC-BY-SA-4.0"
@@ -33,7 +36,7 @@ distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
 checksum="755529c797b94279e683b77ffbcfcfe901cca2fff817431632a23019ac95c6ca
  b081f885311f9afebc41d9dd4a68b7db4cf736eb815c04e307e1a426f08cfa35
  5284333fa501270835b5f0cf420cb52155742335f5658d7889ea35d136b52517"
-skip_extraction="objects.zip title-sequences.zip"
+skip_extraction="objects.zip title-sequences.zip replays.zip"
 
 replaces="OpenRCT2-data>=0"
 
@@ -53,16 +56,32 @@ if [ "$CROSS_BUILD" ]; then
 	CXXFLAGS+=" -DHAVE_IMMINTRIN_H=false -DSDL_DISABLE_IMMINTRIN_H=1"
 fi
 
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
-	fi
-}
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DWITH_TESTS=1 -DSYSTEM_GTEST=1"
+	distfiles+=" https://github.com/OpenRCT2/replays/releases/download/v${_replays_version}/replays.zip"
+	checksum+=" 43ba763ee6950a51aa96b26f3007c18b6e2ed09b6003601df6b014d5642c08d8"
+fi
 
 post_extract() {
 	_srcdir="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
+	_builddir="${build_wrksrc:+$build_wrksrc/}${cmake_builddir:=build}"
 	unzip -qd data/object "${_srcdir}/objects.zip"
 	unzip -qd data/sequence "${_srcdir}/title-sequences.zip"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		mkdir -p "${_builddir}/testdata"
+		unzip -qd "${_builddir}/testdata/replays" "${_srcdir}/replays.zip"
+		# other testdata needs to be in builddir for tests to work
+		cp -a test/tests/testdata "${_builddir}/"
+		# CMakeLists seems to assume `install` is run before `check`, and so
+		# doesn't actually make the `data` symlink in time
+		ln -rs data "${_builddir}/data"
+	fi
 
 	vsed -i CMakeLists.txt -e "s; -Werror;;"
 }
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
+	fi
+}

From 5be6a8fc87e43e0110df56a329ad6e73fa15fe55 Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 21:03:57 -0700
Subject: [PATCH 3/3] OpenRCT2: exclude internal static library from pkg

---
 srcpkgs/OpenRCT2/template | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index b54adb1918fa..355e6f72a427 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -29,7 +29,7 @@ short_desc="Open source re-implementation of RollerCoaster Tycoon 2"
 maintainer="klardotsh <josh@klar.sh>"
 license="GPL-3.0-or-later, CC-BY-SA-4.0"
 homepage="https://openrct2.io"
-# use title-sequences.zip to match CMakeLists instruction
+# download objects and title sequences ourselves, instead of letting cmake do it
 distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
  https://github.com/OpenRCT2/objects/releases/download/v${_objects_version}/objects.zip
  https://github.com/OpenRCT2/title-sequences/releases/download/v${_titles_version}/title-sequences.zip"
@@ -58,6 +58,7 @@ fi
 
 if [ "$XBPS_CHECK_PKGS" ]; then
 	configure_args+=" -DWITH_TESTS=1 -DSYSTEM_GTEST=1"
+	# download replays, used in tests
 	distfiles+=" https://github.com/OpenRCT2/replays/releases/download/v${_replays_version}/replays.zip"
 	checksum+=" 43ba763ee6950a51aa96b26f3007c18b6e2ed09b6003601df6b014d5642c08d8"
 fi
@@ -85,3 +86,8 @@ pre_configure() {
 		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
 	fi
 }
+
+post_install() {
+	# remove useless static lib
+	rm -f "${DESTDIR}/usr/lib/libopenrct2.a"
+}

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

* Re: [PR REVIEW] OpenRCT2: update to 0.3.4, enable tests
  2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
  2021-07-20  4:30 ` [PR PATCH] [Updated] " Skirmisher
@ 2021-07-20 15:24 ` ericonr
  2021-07-20 15:24 ` ericonr
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2021-07-20 15:24 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/32050#discussion_r673225610

Comment:
Arguably this should be named `post_patch`.

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

* Re: [PR REVIEW] OpenRCT2: update to 0.3.4, enable tests
  2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
  2021-07-20  4:30 ` [PR PATCH] [Updated] " Skirmisher
  2021-07-20 15:24 ` [PR REVIEW] " ericonr
@ 2021-07-20 15:24 ` ericonr
  2021-07-20 18:15 ` [PR PATCH] [Updated] " Skirmisher
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2021-07-20 15:24 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/32050#discussion_r673225926

Comment:
I prefer not having `-f`, so we can remove the command if they stop installing it.

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

* Re: [PR PATCH] [Updated] OpenRCT2: update to 0.3.4, enable tests
  2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
                   ` (2 preceding siblings ...)
  2021-07-20 15:24 ` ericonr
@ 2021-07-20 18:15 ` Skirmisher
  2021-07-20 18:19 ` Skirmisher
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Skirmisher @ 2021-07-20 18:15 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Skirmisher/void-packages bump-openrct2-with-tests
https://github.com/void-linux/void-packages/pull/32050

OpenRCT2: update to 0.3.4, enable tests
In the last version, a few of the tests were broken, so I hadn't put in the plumbing for the check step yet. Now the tests all pass, so that's cool.

Also, I removed `/usr/lib/libopenrct2.a`, which only exists to be linked into `openrct2` and `openrct2-cli` and shouldn't have been included in the package itself. (It can also be built as a shared object, but again it's only used to share code between the two binaries, and I'm not going to try to reconcile that with Void policy over 10M of duplicated code.)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bump-openrct2-with-tests-32050.patch --]
[-- Type: text/x-diff, Size: 3689 bytes --]

From 68eb5899618ed18c15916105dafd5d458837aa0f Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 19:25:25 -0700
Subject: [PATCH] OpenRCT2: update to 0.3.4, enable tests, misc changes

- Exclude the internally-used static libray from the package
- Change pre_configure to post_patch
---
 srcpkgs/OpenRCT2/template | 43 ++++++++++++++++++++++++++++++---------
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index b36795aa9f76..86b2abf205c3 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -4,13 +4,15 @@
 pkgname=OpenRCT2
 _objects_version=1.0.21
 _titles_version=0.1.2c
-version=0.3.3
-revision=2
+_replays_version=0.0.43
+version=0.3.4
+revision=1
 build_style=cmake
 configure_args="
  -DOPENRCT2_VERSION_TAG=${version}
  -DDOWNLOAD_TITLE_SEQUENCES=0
  -DDOWNLOAD_OBJECTS=0
+ -DDOWNLOAD_REPLAYS=0
  -DDISABLE_DISCORD_RPC=1
  -DDISABLE_GOOGLE_BENCHMARK=1
  $(vopt_if multiplayer '' '-DDISABLE_NETWORK=1')
@@ -22,18 +24,19 @@ makedepends="SDL2-devel fontconfig-devel freetype-devel libzip-devel
  $(vopt_if multiplayer 'libcurl-devel openssl-devel')
  $(vopt_if scripting duktape-devel)"
 depends="zenity"
+checkdepends="gtest-devel"
 short_desc="Open source re-implementation of RollerCoaster Tycoon 2"
 maintainer="klardotsh <josh@klar.sh>"
 license="GPL-3.0-or-later, CC-BY-SA-4.0"
 homepage="https://openrct2.io"
-# use title-sequences.zip to match CMakeLists instruction
+# download objects and title sequences ourselves, instead of letting cmake do it
 distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
  https://github.com/OpenRCT2/objects/releases/download/v${_objects_version}/objects.zip
  https://github.com/OpenRCT2/title-sequences/releases/download/v${_titles_version}/title-sequences.zip"
-checksum="71f9d1ae8477e1e9881a6f9759bddac71346e8ba42238d22514ae3d872b54fd2
+checksum="755529c797b94279e683b77ffbcfcfe901cca2fff817431632a23019ac95c6ca
  b081f885311f9afebc41d9dd4a68b7db4cf736eb815c04e307e1a426f08cfa35
  5284333fa501270835b5f0cf420cb52155742335f5658d7889ea35d136b52517"
-skip_extraction="objects.zip title-sequences.zip"
+skip_extraction="objects.zip title-sequences.zip replays.zip"
 
 replaces="OpenRCT2-data>=0"
 
@@ -53,16 +56,36 @@ if [ "$CROSS_BUILD" ]; then
 	CXXFLAGS+=" -DHAVE_IMMINTRIN_H=false -DSDL_DISABLE_IMMINTRIN_H=1"
 fi
 
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
-	fi
-}
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DWITH_TESTS=1 -DSYSTEM_GTEST=1"
+	# download replays, used in tests
+	distfiles+=" https://github.com/OpenRCT2/replays/releases/download/v${_replays_version}/replays.zip"
+	checksum+=" 43ba763ee6950a51aa96b26f3007c18b6e2ed09b6003601df6b014d5642c08d8"
+fi
 
 post_extract() {
 	_srcdir="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
+	_builddir="${build_wrksrc:+$build_wrksrc/}${cmake_builddir:=build}"
 	unzip -qd data/object "${_srcdir}/objects.zip"
 	unzip -qd data/sequence "${_srcdir}/title-sequences.zip"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		unzip -qd test/tests/testdata/replays "${_srcdir}/replays.zip"
+		# CMakeLists seems to assume `install` is run before `check`, and so
+		# doesn't actually make the `data`/`testdata` symlinks in time
+		mkdir -p "${_builddir}"
+		ln -rs data testdata "${_builddir}/"
+	fi
 
 	vsed -i CMakeLists.txt -e "s; -Werror;;"
 }
+
+post_patch() {
+	if [ "$CROSS_BUILD" ]; then
+		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
+	fi
+}
+
+post_install() {
+	# remove useless static lib
+	rm "${DESTDIR}/usr/lib/libopenrct2.a"
+}

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

* Re: [PR PATCH] [Updated] OpenRCT2: update to 0.3.4, enable tests
  2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
                   ` (3 preceding siblings ...)
  2021-07-20 18:15 ` [PR PATCH] [Updated] " Skirmisher
@ 2021-07-20 18:19 ` Skirmisher
  2021-07-20 18:26 ` Skirmisher
  2021-07-20 19:01 ` [PR PATCH] [Merged]: " ericonr
  6 siblings, 0 replies; 8+ messages in thread
From: Skirmisher @ 2021-07-20 18:19 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Skirmisher/void-packages bump-openrct2-with-tests
https://github.com/void-linux/void-packages/pull/32050

OpenRCT2: update to 0.3.4, enable tests
In the last version, a few of the tests were broken, so I hadn't put in the plumbing for the check step yet. Now the tests all pass, so that's cool.

Also, I removed `/usr/lib/libopenrct2.a`, which only exists to be linked into `openrct2` and `openrct2-cli` and shouldn't have been included in the package itself. (It can also be built as a shared object, but again it's only used to share code between the two binaries, and I'm not going to try to reconcile that with Void policy over 10M of duplicated code.)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bump-openrct2-with-tests-32050.patch --]
[-- Type: text/x-diff, Size: 3690 bytes --]

From 0e9efa21e0aa0b9862776a6e3cfe9d20ffbd53cb Mon Sep 17 00:00:00 2001
From: Will Springer <skirmisher@protonmail.com>
Date: Mon, 19 Jul 2021 19:25:25 -0700
Subject: [PATCH] OpenRCT2: update to 0.3.4, enable tests, misc changes

- Exclude the internally-used static library from the package
- Change pre_configure to post_patch
---
 srcpkgs/OpenRCT2/template | 43 ++++++++++++++++++++++++++++++---------
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/OpenRCT2/template b/srcpkgs/OpenRCT2/template
index b36795aa9f76..86b2abf205c3 100644
--- a/srcpkgs/OpenRCT2/template
+++ b/srcpkgs/OpenRCT2/template
@@ -4,13 +4,15 @@
 pkgname=OpenRCT2
 _objects_version=1.0.21
 _titles_version=0.1.2c
-version=0.3.3
-revision=2
+_replays_version=0.0.43
+version=0.3.4
+revision=1
 build_style=cmake
 configure_args="
  -DOPENRCT2_VERSION_TAG=${version}
  -DDOWNLOAD_TITLE_SEQUENCES=0
  -DDOWNLOAD_OBJECTS=0
+ -DDOWNLOAD_REPLAYS=0
  -DDISABLE_DISCORD_RPC=1
  -DDISABLE_GOOGLE_BENCHMARK=1
  $(vopt_if multiplayer '' '-DDISABLE_NETWORK=1')
@@ -22,18 +24,19 @@ makedepends="SDL2-devel fontconfig-devel freetype-devel libzip-devel
  $(vopt_if multiplayer 'libcurl-devel openssl-devel')
  $(vopt_if scripting duktape-devel)"
 depends="zenity"
+checkdepends="gtest-devel"
 short_desc="Open source re-implementation of RollerCoaster Tycoon 2"
 maintainer="klardotsh <josh@klar.sh>"
 license="GPL-3.0-or-later, CC-BY-SA-4.0"
 homepage="https://openrct2.io"
-# use title-sequences.zip to match CMakeLists instruction
+# download objects and title sequences ourselves, instead of letting cmake do it
 distfiles="https://github.com/OpenRCT2/OpenRCT2/archive/v${version}.tar.gz
  https://github.com/OpenRCT2/objects/releases/download/v${_objects_version}/objects.zip
  https://github.com/OpenRCT2/title-sequences/releases/download/v${_titles_version}/title-sequences.zip"
-checksum="71f9d1ae8477e1e9881a6f9759bddac71346e8ba42238d22514ae3d872b54fd2
+checksum="755529c797b94279e683b77ffbcfcfe901cca2fff817431632a23019ac95c6ca
  b081f885311f9afebc41d9dd4a68b7db4cf736eb815c04e307e1a426f08cfa35
  5284333fa501270835b5f0cf420cb52155742335f5658d7889ea35d136b52517"
-skip_extraction="objects.zip title-sequences.zip"
+skip_extraction="objects.zip title-sequences.zip replays.zip"
 
 replaces="OpenRCT2-data>=0"
 
@@ -53,16 +56,36 @@ if [ "$CROSS_BUILD" ]; then
 	CXXFLAGS+=" -DHAVE_IMMINTRIN_H=false -DSDL_DISABLE_IMMINTRIN_H=1"
 fi
 
-pre_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
-	fi
-}
+if [ "$XBPS_CHECK_PKGS" ]; then
+	configure_args+=" -DWITH_TESTS=1 -DSYSTEM_GTEST=1"
+	# download replays, used in tests
+	distfiles+=" https://github.com/OpenRCT2/replays/releases/download/v${_replays_version}/replays.zip"
+	checksum+=" 43ba763ee6950a51aa96b26f3007c18b6e2ed09b6003601df6b014d5642c08d8"
+fi
 
 post_extract() {
 	_srcdir="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
+	_builddir="${build_wrksrc:+$build_wrksrc/}${cmake_builddir:=build}"
 	unzip -qd data/object "${_srcdir}/objects.zip"
 	unzip -qd data/sequence "${_srcdir}/title-sequences.zip"
+	if [ "$XBPS_CHECK_PKGS" ]; then
+		unzip -qd test/tests/testdata/replays "${_srcdir}/replays.zip"
+		# CMakeLists seems to assume `install` is run before `check`, and so
+		# doesn't actually make the `data`/`testdata` symlinks in time
+		mkdir -p "${_builddir}"
+		ln -rs data testdata "${_builddir}/"
+	fi
 
 	vsed -i CMakeLists.txt -e "s; -Werror;;"
 }
+
+post_patch() {
+	if [ "$CROSS_BUILD" ]; then
+		sed -i -e 's#COMMAND ./openrct2#COMMAND openrct2#g' CMakeLists.txt
+	fi
+}
+
+post_install() {
+	# remove useless static lib
+	rm "${DESTDIR}/usr/lib/libopenrct2.a"
+}

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

* Re: OpenRCT2: update to 0.3.4, enable tests
  2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
                   ` (4 preceding siblings ...)
  2021-07-20 18:19 ` Skirmisher
@ 2021-07-20 18:26 ` Skirmisher
  2021-07-20 19:01 ` [PR PATCH] [Merged]: " ericonr
  6 siblings, 0 replies; 8+ messages in thread
From: Skirmisher @ 2021-07-20 18:26 UTC (permalink / raw)
  To: ml

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

New comment by Skirmisher on void-packages repository

https://github.com/void-linux/void-packages/pull/32050#issuecomment-883603252

Comment:
> I think if upstream builds its own library as static, it doesn't go against distro policy to leave it like that.

Right, but I was referring to if we built the library as dynamic (which is what happens in my Fedora copr package, because of Fedora's default cmake flags). The executables would be much smaller by sharing code, but the library is unversioned and, again, is of no use to anyone else.

Anyway, the template should be good to go now.

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

* Re: [PR PATCH] [Merged]: OpenRCT2: update to 0.3.4, enable tests
  2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
                   ` (5 preceding siblings ...)
  2021-07-20 18:26 ` Skirmisher
@ 2021-07-20 19:01 ` ericonr
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2021-07-20 19:01 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

OpenRCT2: update to 0.3.4, enable tests
https://github.com/void-linux/void-packages/pull/32050

Description:
In the last version, a few of the tests were broken, so I hadn't put in the plumbing for the check step yet. Now the tests all pass, so that's cool.

Also, I removed `/usr/lib/libopenrct2.a`, which only exists to be linked into `openrct2` and `openrct2-cli` and shouldn't have been included in the package itself. (It can also be built as a shared object, but again it's only used to share code between the two binaries, and I'm not going to try to reconcile that with Void policy over 10M of duplicated code.)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

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

end of thread, other threads:[~2021-07-20 19:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20  4:24 [PR PATCH] OpenRCT2: update to 0.3.4, enable tests Skirmisher
2021-07-20  4:30 ` [PR PATCH] [Updated] " Skirmisher
2021-07-20 15:24 ` [PR REVIEW] " ericonr
2021-07-20 15:24 ` ericonr
2021-07-20 18:15 ` [PR PATCH] [Updated] " Skirmisher
2021-07-20 18:19 ` Skirmisher
2021-07-20 18:26 ` Skirmisher
2021-07-20 19:01 ` [PR PATCH] [Merged]: " ericonr

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).