3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/games/ja2-stracciatella/default.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

2018-07-15 11:11:02 +01:00
{ stdenv, fetchFromGitHub, cmake, SDL2, boost, fltk, rustPlatform }:
let
version = "0.16.1";
src = fetchFromGitHub {
owner = "ja2-stracciatella";
repo = "ja2-stracciatella";
rev = "v${version}";
2018-07-15 11:11:02 +01:00
sha256 = "1pyn23syg70kiyfbs3pdlq0ixd2bxhncbamnic43rym3dmd52m29";
};
lockfile = ./Cargo.lock;
libstracciatellaSrc = stdenv.mkDerivation {
name = "libstracciatella-${version}-src";
src = "${src}/rust";
installPhase = ''
mkdir -p $out
cp -R ./* $out/
cp ${lockfile} $out/Cargo.lock
'';
};
libstracciatella = rustPlatform.buildRustPackage {
pname = "libstracciatella";
2018-07-15 11:11:02 +01:00
inherit version;
src = libstracciatellaSrc;
cargoSha256 = "15djs4xaz4y1hpfyfqxdgdasxr0b5idy9i5a7c8cmh0jkxjv8bqc";
2018-07-15 11:11:02 +01:00
doCheck = false;
};
2018-07-15 11:11:02 +01:00
in
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
pname = "ja2-stracciatella";
2018-07-15 11:11:02 +01:00
inherit src;
inherit version;
nativeBuildInputs = [ cmake ];
buildInputs = [ SDL2 fltk boost ];
2018-07-15 11:11:02 +01:00
patches = [
./remove-rust-buildstep.patch
];
2018-07-15 11:11:02 +01:00
preConfigure = ''
sed -i -e 's|rust-stracciatella|${libstracciatella}/lib/libstracciatella.so|g' CMakeLists.txt
2018-07-15 11:11:02 +01:00
cmakeFlagsArray+=("-DEXTRA_DATA_DIR=$out/share/ja2")
'';
meta = {
description = "Jagged Alliance 2, with community fixes";
license = "SFI Source Code license agreement";
homepage = "https://ja2-stracciatella.github.io/";
};
}