lol
1{ lib
2, stdenv
3, gccStdenv
4, autoreconfHook
5, autoconf-archive
6, pkg-config
7, fetchurl
8, fetchFromGitHub
9, openal
10, libtool
11, enet
12, SDL2
13, curl
14, gettext
15, libiconv
16}:
17
18let
19 pname = "7kaa";
20 version = "2.15.5";
21
22 musicVersion = lib.versions.majorMinor version;
23 music = stdenv.mkDerivation {
24 pname = "7kaa-music";
25 version = musicVersion;
26
27 src = fetchurl {
28 url = "https://www.7kfans.com/downloads/7kaa-music-${musicVersion}.tar.bz2";
29 hash = "sha256-sNdntuJXGaFPXzSpN0SoAi17wkr2YnW+5U38eIaVwcM=";
30 };
31
32 installPhase = ''
33 mkdir -p $out
34 cp -r * $out/
35 '';
36
37 meta.license = lib.licenses.unfree;
38 };
39in
40gccStdenv.mkDerivation rec {
41 inherit pname version;
42
43 src = fetchFromGitHub {
44 owner = "the3dfxdude";
45 repo = pname;
46 rev = "v${version}";
47 hash = "sha256-Z6TsR6L6vwpzoKTj6xJ6HKy4DxcUBWmYBFi/a9pQBD8=";
48 };
49
50 nativeBuildInputs = [ autoreconfHook autoconf-archive pkg-config ];
51
52 buildInputs = [ openal enet SDL2 curl gettext libiconv ];
53
54 preAutoreconf = ''
55 autoupdate
56 '';
57
58 hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ];
59
60 postInstall = ''
61 mkdir $out/share/7kaa/MUSIC
62 cp -R ${music}/MUSIC $out/share/7kaa/
63 cp ${music}/COPYING-Music.txt $out/share/7kaa/MUSIC
64 cp ${music}/COPYING-Music.txt $out/share/doc/7kaa
65 '';
66
67 # Multiplayer is auto-disabled for non-x86 system
68
69 meta = with lib; {
70 homepage = "https://www.7kfans.com";
71 description = "GPL release of the Seven Kingdoms with multiplayer (available only on x86 platforms)";
72 license = licenses.gpl2Only;
73 platforms = platforms.x86_64 ++ platforms.aarch64;
74 maintainers = with maintainers; [ _1000101 ];
75 };
76}