2024-06-20 14:57:18 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, gitUpdater }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ctrtool";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jakcron";
|
|
|
|
repo = "Project_CTR";
|
2020-11-24 20:58:05 +00:00
|
|
|
rev = "ctrtool-v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
sha256 = "wjU/DJHrAHE3MSB7vy+swUDVPzw0Jrv4ymOjhfr0BBk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/ctrtool";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
preBuild = ''
|
|
|
|
make -j $NIX_BUILD_CORES deps
|
|
|
|
'';
|
|
|
|
|
|
|
|
# workaround for https://github.com/3DSGuy/Project_CTR/issues/145
|
|
|
|
env.NIX_CFLAGS_COMPILE = "-O0";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = "
|
|
|
|
mkdir $out/bin -p
|
2024-06-20 14:57:18 +00:00
|
|
|
cp bin/ctrtool${stdenv.hostPlatform.extensions.executable} $out/bin/
|
2020-04-24 23:36:52 +00:00
|
|
|
";
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
passthru.updateScript = gitUpdater { rev-prefix = "ctrtool-v"; };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool to extract data from a 3ds rom";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.marius851000 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "ctrtool";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|