nixpkgs/pkgs/by-name/th/theforceengine/package.nix

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

65 lines
1.5 KiB
Nix
Raw Normal View History

2023-02-09 05:19:55 +03:00
{ lib
, stdenv
, fetchFromGitHub
, SDL2
2023-09-26 05:43:21 +03:00
, SDL2_image
2023-02-09 05:19:55 +03:00
, rtaudio
, rtmidi
, glew
, alsa-lib
, cmake
, pkg-config
2024-07-20 22:14:20 +03:00
, zenity
2023-02-09 05:19:55 +03:00
}:
2024-07-20 22:14:20 +03:00
let
# package depends on SDL2main static library
SDL2' = SDL2.override {
withStatic = true;
};
in
2023-02-09 05:19:55 +03:00
stdenv.mkDerivation rec {
pname = "theforceengine";
2024-07-20 22:14:20 +03:00
version = "1.10.000";
2023-02-09 05:19:55 +03:00
src = fetchFromGitHub {
owner = "luciusDXL";
repo = "TheForceEngine";
rev = "v${version}";
2024-07-20 22:14:20 +03:00
hash = "sha256-oEcjHb6HY5qxKuPoNBuobPbdi39hUUWtKSb7FbAfEpc=";
2023-02-09 05:19:55 +03:00
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
2024-07-20 22:14:20 +03:00
SDL2'
2023-09-26 05:43:21 +03:00
SDL2_image
2023-02-09 05:19:55 +03:00
rtaudio
rtmidi
glew
alsa-lib
];
prePatch = ''
# use nix store path instead of hardcoded /usr/share for support data
substituteInPlace TheForceEngine/TFE_FileSystem/paths-posix.cpp \
2024-07-20 22:14:20 +03:00
--replace-fail "/usr/share" "$out/share"
# use zenity from nix store
substituteInPlace TheForceEngine/TFE_Ui/portable-file-dialogs.h \
--replace-fail "check_program(\"zenity\")" "check_program(\"${lib.getExe zenity}\")" \
--replace-fail "flags(flag::has_zenity) ? \"zenity\"" "flags(flag::has_zenity) ? \"${lib.getExe zenity}\""
2023-02-09 05:19:55 +03:00
'';
meta = with lib; {
description = "Modern \"Jedi Engine\" replacement supporting Dark Forces, mods, and in the future, Outlaws";
mainProgram = "theforceengine";
2023-02-09 05:19:55 +03:00
homepage = "https://theforceengine.github.io";
license = licenses.gpl2Only;
maintainers = with maintainers; [ devusb ];
platforms = [ "x86_64-linux" ];
};
}