2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, makeWrapper
|
|
|
|
, boost
|
|
|
|
, libpng
|
|
|
|
, libiconv
|
|
|
|
, libjpeg
|
|
|
|
, zlib
|
|
|
|
, openssl
|
|
|
|
, libwebp
|
|
|
|
, catch2
|
|
|
|
}:
|
2020-11-15 13:44:38 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation {
|
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
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "failing_tests.patch";
|
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/failing_tests.patch?h=arc_unpacker-git&id=bda1ad9f69e6802e703b2e6913d71a36d76cfef9";
|
|
|
|
hash = "sha256-bClACsf/+SktyLAPtt7EcSqprkw8JVIi1ZLpcJcv9IE=";
|
|
|
|
})
|
|
|
|
];
|
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
|
2023-02-16 17:41:37 +00:00
|
|
|
sed '1i#include <limits>' -i src/dec/eagls/pak_archive_decoder.cc # gcc12
|
2020-11-15 13:44:38 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
catch2
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
libiconv
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libwebp
|
|
|
|
openssl
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|