This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
forked from yvt/openspades
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
63 lines (50 loc) · 2.08 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "A compatible client of Ace of Spades 0.75";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) stdenv;
# Non-GPL assets - please see `PakLocation.txt` for the terms of use
# and issue #424 for the situation
devPackage = pkgs.fetchurl {
url = https://github.com/yvt/openspades-paks/releases/download/r33/OpenSpadesDevPackage-r33.zip;
sha256 = "CSfcMjoLOroO6NHWjWtUSwD+ZUdA/q1tH6rTeqx3oq0=";
};
# Google Noto Fonts, licensed under the SIL Open Font License
notoFontPak = pkgs.fetchurl {
url = https://github.com/yvt/openspades/releases/download/v0.1.1b/NotoFonts.pak;
sha256 = "VQYMZNYqNBZ9+01YCcabqqIfck/mU/BRcFZKXpBEX00=";
};
in rec {
packages.default = packages.openspades;
packages.openspades = stdenv.mkDerivation rec {
pname = "openspades";
version = "0.1.5-beta";
src = ./.;
nativeBuildInputs = with pkgs; [ cmake imagemagick unzip zip file ];
buildInputs = with pkgs;
([
freetype SDL2 SDL2_image libGL zlib curl glew opusfile openal libogg
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Cocoa
]);
cmakeFlags = [ "-DOPENSPADES_INSTALL_BINARY=bin" ];
inherit notoFontPak;
# Used by `downloadpak.sh`. Instructs the script to copy the
# development package from this path instead of downloading it.
OPENSPADES_DEVPAK_PATH = devPackage;
postPatch = ''
patchShebangs Resources
'';
postInstall = ''
cp $notoFontPak $out/share/games/openspades/Resources/
'';
NIX_CFLAGS_LINK = "-lopenal";
};
});
}