-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aee7eaa
commit 08c610a
Showing
6 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
openttd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- a/src/core/random_func.cpp | ||
+++ b/src/core/random_func.cpp | ||
@@ -26,7 +26,7 @@ | ||
# include <bcrypt.h> | ||
#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) | ||
// No includes required. | ||
-#elif defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 25))) | ||
+#elif defined(__linux__) | ||
# include <sys/random.h> | ||
#elif defined(__EMSCRIPTEN__) | ||
# include <emscripten.h> | ||
@@ -100,7 +100,7 @@ | ||
#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) | ||
arc4random_buf(buf.data(), buf.size()); | ||
return; | ||
-#elif defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 25))) | ||
+#elif defined(__linux__) | ||
auto res = getrandom(buf.data(), buf.size(), 0); | ||
if (res > 0 && static_cast<size_t>(res) == buf.size()) return; | ||
#elif defined(__EMSCRIPTEN__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Patch-Source: https://git.alpinelinux.org/aports/tree/testing/openttd/no-sse4.patch?id=631059433ebe8b46a288746a64d4ab1699be1558 | ||
this sets the sources to use sse4 instructions, which is above our baseline. | ||
it also enables sse4 on pure-x86 with our builds, so best to disable | ||
--- a/cmake/FindSSE.cmake | ||
+++ b/cmake/FindSSE.cmake | ||
@@ -12,6 +12,7 @@ | ||
#include <xmmintrin.h> | ||
#include <smmintrin.h> | ||
#include <tmmintrin.h> | ||
- int main() { return 0; }" | ||
+ # die! | ||
+ int main() { *(int *)0 = 0; }" | ||
SSE_FOUND | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- a/cmake/CompileFlags.cmake | ||
+++ b/cmake/CompileFlags.cmake | ||
@@ -30,7 +30,6 @@ | ||
# it does not appear to support the $<> tags. | ||
add_compile_options( | ||
"$<$<CONFIG:Debug>:-D_DEBUG>" | ||
- "$<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>" # FORTIFY_SOURCE should only be used in non-debug builds (requires -O1+) | ||
) | ||
if(MINGW) | ||
add_link_options( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
pkgname = "openttd" | ||
pkgver = "14.1" | ||
pkgrel = 0 | ||
build_style = "cmake" | ||
hostmakedepends = ["cmake", "ninja", "pkgconf"] | ||
makedepends = [ | ||
"fluidsynth-devel", | ||
"fontconfig-devel", | ||
"freetype-devel", | ||
"harfbuzz-devel", | ||
"libcurl-devel", | ||
"libpng-devel", | ||
"lzo-devel", | ||
"icu-devel", | ||
"sdl-devel", | ||
"xz-devel", | ||
"zlib-ng-devel", | ||
] | ||
pkgdesc = "Simulation game based upon Transport Tycoon Deluxe" | ||
maintainer = "breakgimme <[email protected]>" | ||
license = "GPL-2.0-or-later" | ||
url = "https://openttd.org" | ||
source = f"https://cdn.openttd.org/openttd-releases/{pkgver}/openttd-{pkgver}-source.tar.xz" | ||
sha256 = "2c14c8f01f44148c4f2c88c169a30abcdb002eb128a92b9adb76baa76b013494" | ||
# SetBitIterator tests (src/tests/bitmath_func.cpp) fail with int enabled (and the game crashes when the tests are skipped) | ||
hardening = ["!int"] | ||
# can't cross compile due to https://github.com/OpenTTD/OpenTTD/issues/8249 | ||
options = ["!cross"] | ||
|
||
|
||
def check(self): | ||
self.do("./build/openttd_test") | ||
|
||
|
||
@subpackage("openttd-locale") | ||
def _(self): | ||
self.install_if = [self.parent, "base-locale"] | ||
return ["usr/share/games/openttd/lang/*[!english]*.lng"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
url = "https://cdn.openttd.org/openttd-releases/latest.yaml" | ||
pattern = r"version:\s*([\d.]+)" |