dotfiles/home/pkgs/techmino/ccloader.nix
2023-04-10 19:21:20 +07:00

37 lines
856 B
Nix

{ lib
, stdenv
, fetchFromGitHub
, libcoldclear
, luajit
}:
stdenv.mkDerivation rec {
pname = "ccloader";
version = "11.4.1";
src = fetchFromGitHub {
owner = "26F-Studio";
repo = "cold_clear_ai_love2d_wrapper";
rev = version;
hash = "sha256-zfTSMWqjFrAKW5m+9q3K2Je8bbSyhC6pC/vPAWDGCNg=";
};
buildInputs = [ libcoldclear luajit ];
buildPhase = ''
gcc -shared cold_clear_wrapper.c -lcold_clear -lluajit-${luajit.luaversion} -o CCLoader.so
'';
installPhase = ''
mkdir -p $out/lib/lua/${luajit.luaversion}
mv CCLoader.so $out/lib/lua/${luajit.luaversion}
'';
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 ];
};
}