cadzinho: 0.4.1 → 0.5.0

This commit is contained in:
Nikolay Korotkiy 2024-03-05 00:43:34 +04:00
parent 106b852a30
commit 9525044c7c
No known key found for this signature in database
GPG Key ID: D1DE6D7F693663A5

View File

@ -1,28 +1,34 @@
{ lib, stdenv, fetchFromGitHub, SDL2, glew, lua5_4, desktopToDarwinBundle }:
{ lib, stdenv, fetchFromGitHub, SDL2, SDL2_net, glew, lua5_4, desktopToDarwinBundle }:
stdenv.mkDerivation rec {
pname = "cadzinho";
version = "0.4.1";
version = "0.5.0";
src = fetchFromGitHub {
owner = "zecruel";
repo = "CadZinho";
rev = version;
hash = "sha256-6/sBNxQb52FFO2fWLVs6YDOmJLEbSOA5mwdMdJDjEDM=";
hash = "sha256-s2+k1TcmY3xwxXccHP7au71e0l3Qrso5XxmGGVvyIo0=";
};
postPatch = ''
substituteInPlace src/gui_config.c --replace "/usr/share/cadzinho" "$out/share/cadzinho"
substituteInPlace src/gui_config.c --replace-fail "/usr/share/cadzinho" "$out/share/cadzinho"
substituteInPlace Makefile --replace-fail "-lGLEW" "-lGLEW -lSDL2_net"
'';
nativeBuildInputs = lib.optional stdenv.isDarwin desktopToDarwinBundle;
buildInputs = [ SDL2 glew lua5_4 ];
buildInputs = [ SDL2 SDL2_net glew lua5_4 ];
makeFlags = [ "CC:=$(CC)" ];
# https://github.com/llvm/llvm-project/issues/62254
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-builtin-strrchr";
env.NIX_CFLAGS_COMPILE = toString ([
"-I${SDL2.dev}/include/SDL2"
"-I${SDL2_net.dev}/include/SDL2"
] ++ lib.optionals stdenv.isDarwin [
# https://github.com/llvm/llvm-project/issues/62254
"-fno-builtin-strrchr"
]);
hardeningDisable = [ "format" ];