bcb2f287e1
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
44 lines
950 B
Nix
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 ];
|
|
};
|
|
}
|