From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1587092-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 6635E15803E
	for <garchives@archives.gentoo.org>; Thu,  4 Jan 2024 21:08:27 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 4A8162BC014;
	Thu,  4 Jan 2024 21:08:26 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 200292BC014
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Jan 2024 21:08:26 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 46330343082
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Jan 2024 21:08:25 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9774DAE5
	for <gentoo-commits@lists.gentoo.org>; Thu,  4 Jan 2024 21:08:23 +0000 (UTC)
From: "Conrad Kostecki" <conikost@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" <conikost@gentoo.org>
Message-ID: <1704402489.ca9c069f8fa8b9d2d52db549f8116c2b12df1c6c.conikost@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: games-simulation/openrct2/, games-simulation/openrct2/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: games-simulation/openrct2/files/openrct2-0.4.7-musl.patch games-simulation/openrct2/openrct2-0.4.7.ebuild
X-VCS-Directories: games-simulation/openrct2/ games-simulation/openrct2/files/
X-VCS-Committer: conikost
X-VCS-Committer-Name: Conrad Kostecki
X-VCS-Revision: ca9c069f8fa8b9d2d52db549f8116c2b12df1c6c
X-VCS-Branch: master
Date: Thu,  4 Jan 2024 21:08:23 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: c59f6011-d364-4d4c-a9d4-e1eefa4f6ede
X-Archives-Hash: afeff9a98c758d87816ba5254fdf9800

commit:     ca9c069f8fa8b9d2d52db549f8116c2b12df1c6c
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  4 21:06:55 2024 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Thu Jan  4 21:08:09 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca9c069f

games-simulation/openrct2: fix musl build

Closes: https://bugs.gentoo.org/906989
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 .../openrct2/files/openrct2-0.4.7-musl.patch       | 55 ++++++++++++++++++++++
 games-simulation/openrct2/openrct2-0.4.7.ebuild    |  1 +
 2 files changed, 56 insertions(+)

diff --git a/games-simulation/openrct2/files/openrct2-0.4.7-musl.patch b/games-simulation/openrct2/files/openrct2-0.4.7-musl.patch
new file mode 100644
index 000000000000..1096bc018ff2
--- /dev/null
+++ b/games-simulation/openrct2/files/openrct2-0.4.7-musl.patch
@@ -0,0 +1,55 @@
+From 010c19ba61a3180dab6350aadc578414ad0c0051 Mon Sep 17 00:00:00 2001
+From: Conrad Kostecki <conikost@gentoo.org>
+Date: Mon, 1 Jan 2024 20:34:19 +0100
+Subject: [PATCH 1/2] src/openrct2/core/FileStream.cpp: drop ftello64, fseeko64
+
+The static usage definition of ftello64 and friends is not correct.
+While this currently works on glibc, this breaks on musl, as musl
+already is LFS aware. The solution is to drop this and add instead
+'-D_FILE_OFFSET_BITS=64' to the build system.
+
+Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
+---
+ src/openrct2/core/FileStream.cpp | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/openrct2/core/FileStream.cpp b/src/openrct2/core/FileStream.cpp
+index 90a7f7a366cc..6fd7b7b1b42c 100644
+--- a/src/openrct2/core/FileStream.cpp
++++ b/src/openrct2/core/FileStream.cpp
+@@ -21,11 +21,6 @@
+ #    include <io.h>
+ #endif
+ 
+-#if defined(__linux__) && !defined(__ANDROID__)
+-#    define ftello ftello64
+-#    define fseeko fseeko64
+-#endif
+-
+ #ifdef _MSC_VER
+ #    define ftello _ftelli64
+ #    define fseeko _fseeki64
+
+From 7c638c786527a26a3e83d155ca8ff4d55f01347f Mon Sep 17 00:00:00 2001
+From: Conrad Kostecki <conikost@gentoo.org>
+Date: Mon, 1 Jan 2024 20:23:24 +0100
+Subject: [PATCH 2/2] CMakeLists.txt: add D_FILE_OFFSET_BITS=64
+
+Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
+Signed-off-by: Conrad Kostecki <conrad@kostecki.com>
+---
+ src/openrct2/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/openrct2/CMakeLists.txt b/src/openrct2/CMakeLists.txt
+index 367939c9622c..55882a1097d3 100644
+--- a/src/openrct2/CMakeLists.txt
++++ b/src/openrct2/CMakeLists.txt
+@@ -265,3 +265,7 @@ else ()
+     # Dummy target to ease invocation
+     add_custom_target(${PROJECT_NAME}-headers-check)
+ endif ()
++
++if (UNIX)
++    add_definitions(-D_FILE_OFFSET_BITS=64)
++endif ()

diff --git a/games-simulation/openrct2/openrct2-0.4.7.ebuild b/games-simulation/openrct2/openrct2-0.4.7.ebuild
index 46212d45c869..068fbd3cb2e5 100644
--- a/games-simulation/openrct2/openrct2-0.4.7.ebuild
+++ b/games-simulation/openrct2/openrct2-0.4.7.ebuild
@@ -79,6 +79,7 @@ BDEPEND="
 PATCHES=(
 	"${FILESDIR}/${PN}-0.4.0-include-additional-paths.patch"
 	"${FILESDIR}/${PN}-0.4.1-gtest-1.10.patch"
+	"${FILESDIR}/${PN}-0.4.7-musl.patch"
 )
 
 src_unpack() {