2021-04-10 17:23:57 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, SDL2
|
|
|
|
, SDL2_image
|
|
|
|
, SDL2_mixer
|
|
|
|
, cmake
|
|
|
|
, gtk3-x11
|
|
|
|
, python3
|
|
|
|
, protobuf
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-02-25 19:57:58 +01:00
|
|
|
pname = "cdogs-sdl";
|
2023-08-06 18:36:38 +02:00
|
|
|
version = "1.5.0";
|
2021-04-10 17:23:57 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-02-25 19:57:58 +01:00
|
|
|
repo = pname;
|
2021-04-10 17:23:57 +02:00
|
|
|
owner = "cxong";
|
|
|
|
rev = version;
|
2023-08-06 18:36:38 +02:00
|
|
|
sha256 = "sha256-XSq0TK3ZuLOa8JJnp/Qxt16Ru3p35tq5FOo4+tv+c60=";
|
2021-04-10 17:23:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs src/proto/nanopb/generator/*
|
|
|
|
'';
|
|
|
|
|
2022-05-13 21:33:17 +02:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCDOGS_DATA_DIR=${placeholder "out"}/"
|
|
|
|
"-DCMAKE_C_FLAGS=-Wno-error=array-bounds"
|
|
|
|
];
|
2021-04-10 17:23:57 +02:00
|
|
|
|
2023-02-19 20:23:32 +01:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
2022-12-23 17:57:29 +01:00
|
|
|
# Needed with GCC 12
|
|
|
|
"-Wno-error=stringop-overflow"
|
|
|
|
];
|
|
|
|
|
2021-04-10 17:23:57 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
cmake
|
|
|
|
(python3.withPackages (pp: with pp; [ pp.protobuf setuptools ]))
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
SDL2_image
|
|
|
|
SDL2_mixer
|
|
|
|
gtk3-x11
|
|
|
|
protobuf
|
|
|
|
];
|
|
|
|
|
2023-07-13 05:09:48 +02:00
|
|
|
# inlining failed in call to 'tinydir_open': --param max-inline-insns-single limit reached
|
|
|
|
hardeningDisable = [ "fortify3" ];
|
|
|
|
|
2021-04-10 17:23:57 +02:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://cxong.github.io/cdogs-sdl";
|
|
|
|
description = "Open source classic overhead run-and-gun game";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ nixinator ];
|
|
|
|
platforms = platforms.unix;
|
2021-12-17 17:43:40 +01:00
|
|
|
broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/cdogs-sdl.x86_64-darwin
|
2021-04-10 17:23:57 +02:00
|
|
|
};
|
|
|
|
}
|