2018-07-15 10:11:02 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, SDL2, boost, fltk, rustPlatform }:
|
|
|
|
with rustPlatform;
|
|
|
|
let
|
|
|
|
version = "0.16.1";
|
2017-02-15 03:00:28 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ja2-stracciatella";
|
|
|
|
repo = "ja2-stracciatella";
|
|
|
|
rev = "v${version}";
|
2018-07-15 10:11:02 +00: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 = buildRustPackage {
|
|
|
|
name = "libstracciatella-${version}";
|
|
|
|
inherit version;
|
|
|
|
src = libstracciatellaSrc;
|
2019-05-25 11:03:08 +00:00
|
|
|
cargoSha256 = "0a1pc8wyvgmna0a5cbpv3mh0h4nzjxlm887ymcq00cy1ciq5nmj4";
|
2018-07-15 10:11:02 +00:00
|
|
|
doCheck = false;
|
2017-02-15 03:00:28 +00:00
|
|
|
};
|
2018-07-15 10:11:02 +00:00
|
|
|
in
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "ja2-stracciatella";
|
2018-07-15 10:11:02 +00:00
|
|
|
inherit src;
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
buildInputs = [ cmake SDL2 fltk boost ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./remove-rust-buildstep.patch
|
|
|
|
];
|
|
|
|
preConfigure = ''
|
2018-10-07 10:46:15 +00:00
|
|
|
sed -i -e 's|rust-stracciatella|${libstracciatella}/lib/libstracciatella.so|g' CMakeLists.txt
|
2018-07-15 10:11:02 +00:00
|
|
|
cmakeFlagsArray+=("-DEXTRA_DATA_DIR=$out/share/ja2")
|
|
|
|
'';
|
|
|
|
|
2017-02-15 03:00:28 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
meta = {
|
|
|
|
description = "Jagged Alliance 2, with community fixes";
|
|
|
|
license = "SFI Source Code license agreement";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = https://ja2-stracciatella.github.io/;
|
2017-02-15 03:00:28 +00:00
|
|
|
};
|
|
|
|
}
|