-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1028 from yvt/patch/nix
Add Nix flake
- Loading branch information
Showing
10 changed files
with
194 additions
and
1 deletion.
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
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
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,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"; | ||
}; | ||
}); | ||
} |
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,8 @@ | ||
# Flake's devShell for non-flake-enabled nix instances | ||
let | ||
compat = builtins.fetchGit { | ||
url = "https://github.com/edolstra/flake-compat.git"; | ||
rev = "b4a34015c698c7793d592d66adbab377907a2be8"; | ||
}; | ||
in | ||
(import compat {src = ./.;}).shellNix.default |