nixpkgs/pkgs/by-name/ca/cadzinho/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
Nix
Raw Normal View History

2024-03-04 21:43:34 +01:00
{ lib, stdenv, fetchFromGitHub, SDL2, SDL2_net, glew, lua5_4, desktopToDarwinBundle }:
2023-10-29 01:12:28 +02:00
stdenv.mkDerivation rec {
pname = "cadzinho";
2024-05-20 14:29:23 +02:00
version = "0.6.0";
2023-10-29 01:12:28 +02:00
src = fetchFromGitHub {
owner = "zecruel";
repo = "CadZinho";
rev = version;
2024-05-20 14:29:23 +02:00
hash = "sha256-AHojy6lYLEyeBaYiIzo6MdQCM3jX5ENNTKgU+PGSD00=";
2023-10-29 01:12:28 +02:00
};
postPatch = ''
2024-03-04 21:43:34 +01:00
substituteInPlace src/gui_config.c --replace-fail "/usr/share/cadzinho" "$out/share/cadzinho"
substituteInPlace Makefile --replace-fail "-lGLEW" "-lGLEW -lSDL2_net"
2023-10-29 01:12:28 +02:00
'';
nativeBuildInputs = lib.optional stdenv.isDarwin desktopToDarwinBundle;
2024-03-04 21:43:34 +01:00
buildInputs = [ SDL2 SDL2_net glew lua5_4 ];
2023-10-29 01:12:28 +02:00
makeFlags = [ "CC:=$(CC)" ];
2024-03-04 21:43:34 +01:00
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"
]);
2023-10-29 01:12:28 +02:00
hardeningDisable = [ "format" ];
installPhase = ''
runHook preInstall
install -Dm755 cadzinho -t $out/bin
install -Dm644 lang/*.lua -t $out/share/cadzinho/lang
cp -r linux/CadZinho/share/* $out/share
runHook postInstall
'';
meta = with lib; {
description = "Minimalist computer aided design (CAD) software";
homepage = "https://github.com/zecruel/CadZinho";
license = licenses.mit;
maintainers = with maintainers; [ sikmir ];
platforms = platforms.unix;
mainProgram = "cadzinho";
};
}