project-aster/vendored-nix/eastl/default.nix

49 lines
984 B
Nix

{ stdenv, fetchFromGitHub, cmake, ninja, eabase }:
let buildFolder = "out/"; in
stdenv.mkDerivation {
pname = "eastl";
version = "3.21.23";
src = fetchFromGitHub {
owner = "electronicarts";
repo = "EASTL";
rev = "3.21.23";
sha256 = "sha256-8imixecWN/FOHY/9IxkIMbkxK7NXZ0TecZ4/SvOqf14=";
};
nativeBuildInputs = [
cmake
ninja
];
patches = [
./fix-cmake-install.patch
];
configurePhase = ''
runHook preConfigure
mkdir -p ${buildFolder}
pushd ${buildFolder}
cmake .. -GNinja -DEASTL_BUILD_TESTS:BOOL=OFF -DEASTL_BUILD_BENCHMARK:BOOL=OFF -DCMAKE_PREFIX_PATH=${eabase}
popd
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
pushd ${buildFolder}
cmake --build . --config Release
popd
runHook postBuild
'';
installPhase = ''
runHook preInstall
pushd ${buildFolder}
cmake --install . --prefix $out
rm $out/lib64/libEASTL.a
popd
runHook postInstall
'';
}