2021-05-25 00:44:09 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, boost, libpng, libiconv
|
|
|
|
, libjpeg, zlib, openssl, libwebp, catch }:
|
2020-09-03 18:14:26 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-25 00:44:09 +02:00
|
|
|
pname = "arc_unpacker";
|
|
|
|
version = "unstable-2021-05-17";
|
2020-09-03 18:14:26 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vn-tools";
|
|
|
|
repo = "arc_unpacker";
|
|
|
|
# Since the latest release (0.11) doesn't build, we've opened an upstream
|
|
|
|
# issue in https://github.com/vn-tools/arc_unpacker/issues/187 to ask if a
|
|
|
|
# a new release is upcoming
|
2021-05-25 00:44:09 +02:00
|
|
|
rev = "9c2781fcf3ead7641e873b65899f6abeeabb2fc8";
|
|
|
|
sha256 = "1xxrc9nww0rla3yh10z6glv05ax4rynwwbd0cdvkp7gyqzrv97xp";
|
2020-09-03 18:14:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake makeWrapper catch ];
|
2021-05-25 00:44:09 +02:00
|
|
|
buildInputs = [ boost libpng libjpeg zlib openssl libwebp ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv ];
|
2021-05-15 13:15:34 +02:00
|
|
|
|
2020-09-03 18:14:26 +02:00
|
|
|
postPatch = ''
|
|
|
|
cp ${catch}/include/catch/catch.hpp tests/test_support/catch.h
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
2021-05-15 14:59:32 +02:00
|
|
|
runHook preCheck
|
|
|
|
|
2020-09-03 18:14:26 +02:00
|
|
|
pushd ..
|
|
|
|
./build/run_tests
|
|
|
|
popd
|
2021-05-15 14:59:32 +02:00
|
|
|
|
|
|
|
runHook postCheck
|
2020-09-03 18:14:26 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-05-15 14:59:32 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-09-03 18:14:26 +02: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-15 14:59:32 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-09-03 18:14:26 +02:00
|
|
|
'';
|
|
|
|
|
2021-05-25 00:44:09 +02:00
|
|
|
# A few tests fail on aarch64
|
|
|
|
doCheck = !stdenv.isAarch64;
|
2020-09-03 18:14:26 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-09-03 18:14:26 +02:00
|
|
|
description = "A tool to extract files from visual novel archives";
|
|
|
|
homepage = "https://github.com/vn-tools/arc_unpacker";
|
2021-05-15 14:59:32 +02:00
|
|
|
license = licenses.gpl3Plus;
|
2020-09-03 18:14:26 +02:00
|
|
|
maintainers = with maintainers; [ midchildan ];
|
2021-05-25 00:44:09 +02:00
|
|
|
platforms = platforms.all;
|
2020-09-03 18:14:26 +02:00
|
|
|
};
|
|
|
|
}
|