forked from NotAShelf/rogged
build: migrate from Make to Zig build system + Just
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7585121a5ec8e797adc43ba8e30d4ac86a6a6964
This commit is contained in:
parent
62c030527f
commit
7af642612b
7 changed files with 144 additions and 52 deletions
|
|
@ -1,6 +1,12 @@
|
|||
{stdenv}:
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
zig,
|
||||
raylib,
|
||||
pkg-config,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "sample-c-cpp";
|
||||
pname = "rogged";
|
||||
version = "0.0.1";
|
||||
|
||||
src = builtins.path {
|
||||
|
|
@ -8,5 +14,32 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
name = finalAttrs.pname;
|
||||
};
|
||||
|
||||
makeFlags = ["PREFIX=$(out)"];
|
||||
nativeBuildInputs = [
|
||||
zig
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [raylib];
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
export ZIG_GLOBAL_CACHE_DIR="$TMPDIR/zig-cache"
|
||||
zig build --release=fast
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp zig-out/bin/roguelike $out/bin/
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A turn-based roguelike game";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "roguelike";
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue