2021-05-28 09:39:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, boost, libpng, libiconv
|
2021-12-06 16:07:01 +00:00
|
|
|
, libjpeg, zlib, openssl, libwebp, catch2 }:
|
2020-11-15 13:44:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-28 09:39:13 +00:00
|
|
|
pname = "arc_unpacker";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "unstable-2021-08-06";
|
2020-11-15 13:44:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vn-tools";
|
|
|
|
repo = "arc_unpacker";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "456834ecf2e5686813802c37efd829310485c57d";
|
|
|
|
hash = "sha256-STbdWH7Mr3gpOrZvujblYrIIKEWBHzy1/BaNuh4teI8=";
|
2020-11-15 13:44:38 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper catch2 ];
|
2021-05-28 09:39:13 +00:00
|
|
|
buildInputs = [ boost libpng libjpeg zlib openssl libwebp ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-11-15 13:44:38 +00:00
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
cp ${catch2}/include/catch2/catch.hpp tests/test_support/catch.h
|
2020-11-15 13:44:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
2020-11-15 13:44:38 +00:00
|
|
|
pushd ..
|
|
|
|
./build/run_tests
|
|
|
|
popd
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
runHook postCheck
|
2020-11-15 13:44:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-11-15 13:44:38 +00:00
|
|
|
mkdir -p $out/bin $out/share/doc/arc_unpacker $out/libexec/arc_unpacker
|
|
|
|
cp arc_unpacker $out/libexec/arc_unpacker/arc_unpacker
|
|
|
|
cp ../GAMELIST.{htm,js} $out/share/doc/arc_unpacker
|
|
|
|
cp -r ../etc $out/libexec/arc_unpacker
|
|
|
|
makeWrapper $out/libexec/arc_unpacker/arc_unpacker $out/bin/arc_unpacker
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-11-15 13:44:38 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# A few tests fail on aarch64-linux
|
|
|
|
doCheck = !(stdenv.isLinux && stdenv.isAarch64);
|
2020-11-15 13:44:38 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-15 13:44:38 +00:00
|
|
|
description = "A tool to extract files from visual novel archives";
|
|
|
|
homepage = "https://github.com/vn-tools/arc_unpacker";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-11-15 13:44:38 +00:00
|
|
|
maintainers = with maintainers; [ midchildan ];
|
2021-05-28 09:39:13 +00:00
|
|
|
platforms = platforms.all;
|
2020-11-15 13:44:38 +00:00
|
|
|
};
|
|
|
|
}
|