Skip to content

Commit 3be76da

Browse files
authored
etlegacy-unwrapped: fix Darwin build (#361063)
2 parents d2f5c28 + 59a78fb commit 3be76da

File tree

1 file changed

+47
-24
lines changed

1 file changed

+47
-24
lines changed

pkgs/by-name/et/etlegacy-unwrapped/package.nix

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
{ lib
2-
, stdenv
3-
, writeShellApplication
4-
, fetchFromGitHub
5-
, cjson
6-
, cmake
7-
, git
8-
, makeBinaryWrapper
9-
, unzip
10-
, curl
11-
, freetype
12-
, glew
13-
, libjpeg
14-
, libogg
15-
, libpng
16-
, libtheora
17-
, lua5_4
18-
, minizip
19-
, openal
20-
, SDL2
21-
, sqlite
22-
, zlib
1+
{
2+
lib,
3+
stdenv,
4+
writeShellApplication,
5+
fetchFromGitHub,
6+
fetchpatch,
7+
cjson,
8+
cmake,
9+
git,
10+
makeBinaryWrapper,
11+
unzip,
12+
curl,
13+
freetype,
14+
glew,
15+
libjpeg,
16+
libogg,
17+
libpng,
18+
libtheora,
19+
lua5_4,
20+
minizip,
21+
openal,
22+
SDL2,
23+
sqlite,
24+
zlib,
2325
}:
2426
let
2527
version = "2.83.1";
@@ -44,6 +46,16 @@ stdenv.mkDerivation {
4446
hash = "sha256-k1H3irA9UVOICY3keKGVJMtBczW/b5ObyNvB7fGAcFA=";
4547
};
4648

49+
patches = lib.optionals stdenv.hostPlatform.isDarwin [
50+
# Fix compilation on Darwin archs
51+
# Reported upstream at https://github.com/etlegacy/etlegacy/pull/3005
52+
# Remove this patch when the PR is merged
53+
(fetchpatch {
54+
url = "https://github.com/etlegacy/etlegacy/commit/2767d15c67fe0680178d9cc85ed4cf2ad1d88ad0.patch?full_index=1";
55+
hash = "sha256-rGfNIWb9zohk1QJLrYg9nqw6sMvXM0IbIl9kvYXRBuk=";
56+
})
57+
];
58+
4759
nativeBuildInputs = [
4860
cjson
4961
cmake
@@ -79,10 +91,19 @@ stdenv.mkDerivation {
7991

8092
cmakeFlags = [
8193
"-DCROSS_COMPILE32=0"
94+
"-DCMAKE_BUILD_TYPE=Release"
8295
"-DBUILD_SERVER=1"
8396
"-DBUILD_CLIENT=1"
97+
"-DBUNDLED_ZLIB=0"
98+
"-DBUNDLED_CJSON=0"
8499
"-DBUNDLED_JPEG=0"
85100
"-DBUNDLED_LIBS=0"
101+
"-DBUNDLED_FREETYPE=0"
102+
"-DBUNDLED_OGG_VORBIS=0"
103+
"-DBUNDLED_OPENAL=0"
104+
"-DBUNDLED_PNG=0"
105+
"-DBUNDLED_THEORA=0"
106+
"-DBUNDLED_MINIZIP=0"
86107
"-DINSTALL_EXTRA=0"
87108
"-DINSTALL_OMNIBOT=0"
88109
"-DINSTALL_GEOIP=0"
@@ -103,7 +124,9 @@ stdenv.mkDerivation {
103124
for the popular online FPS game Wolfenstein: Enemy Territory - whose
104125
gameplay is still considered unmatched by many, despite its great age.
105126
'';
106-
maintainers = with lib.maintainers; [ ashleyghooper drupol ];
107-
platforms = lib.platforms.linux;
127+
maintainers = with lib.maintainers; [
128+
ashleyghooper
129+
drupol
130+
];
108131
};
109132
}

0 commit comments

Comments
 (0)