depot/third_party/nixpkgs/pkgs/by-name/te/techmino/ccloader.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

44 lines
950 B
Nix

{ lib
, stdenv
, fetchFromGitHub
, libcoldclear
, luajit
}:
stdenv.mkDerivation rec {
pname = "ccloader";
version = "11.4.2";
src = fetchFromGitHub {
owner = "26F-Studio";
repo = "cold_clear_ai_love2d_wrapper";
rev = version;
hash = "sha256-zfTSMWqjFrAKW5m+9q3K2Je8bbSyhC6pC/vPAWDGCNg=";
};
buildInputs = [ libcoldclear luajit ];
buildPhase = ''
runHook preBuild
gcc -shared cold_clear_wrapper.c -lcold_clear -lluajit-${luajit.luaversion} -o CCLoader.so
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib/lua/${luajit.luaversion}
mv CCLoader.so $out/lib/lua/${luajit.luaversion}
runHook postInstall
'';
meta = with lib; {
description = "Luajit wrapper for Cold Clear, a Tetris AI";
homepage = "https://github.com/26F-Studio/cold_clear_ai_love2d_wrapper";
license = licenses.mpl20;
maintainers = with maintainers; [ chayleaf ];
};
}