arc_unpacker: Move to catch2 to support aarch64-darwin

catch is ancient and has no support for aarch64-darwin. The following
snippet is an example of what is supported on darwin platforms in catch
(i.e., prior to v2).
```
#ifdef CATCH_PLATFORM_MAC
#if defined(__ppc64__) || defined(__ppc__)
    #define CATCH_TRAP() \
	__asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
	: : : "memory","r0","r3","r4" ) /* NOLINT */
#else
    #define CATCH_TRAP() __asm__("int $3\n" : : /* NOLINT */ )
#endif
```
This commit is contained in:
Vikram Narayanan 2021-11-21 00:32:42 -08:00
parent 77e1b5f81d
commit 7d6b3abe12

View file

@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, boost, libpng, libiconv { lib, stdenv, fetchFromGitHub, cmake, makeWrapper, boost, libpng, libiconv
, libjpeg, zlib, openssl, libwebp, catch }: , libjpeg, zlib, openssl, libwebp, catch2 }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "arc_unpacker"; pname = "arc_unpacker";
@ -15,12 +15,12 @@ stdenv.mkDerivation rec {
sha256 = "1xxrc9nww0rla3yh10z6glv05ax4rynwwbd0cdvkp7gyqzrv97xp"; sha256 = "1xxrc9nww0rla3yh10z6glv05ax4rynwwbd0cdvkp7gyqzrv97xp";
}; };
nativeBuildInputs = [ cmake makeWrapper catch ]; nativeBuildInputs = [ cmake makeWrapper catch2 ];
buildInputs = [ boost libpng libjpeg zlib openssl libwebp ] buildInputs = [ boost libpng libjpeg zlib openssl libwebp ]
++ lib.optionals stdenv.isDarwin [ libiconv ]; ++ lib.optionals stdenv.isDarwin [ libiconv ];
postPatch = '' postPatch = ''
cp ${catch}/include/catch/catch.hpp tests/test_support/catch.h cp ${catch2}/include/catch2/catch.hpp tests/test_support/catch.h
''; '';
checkPhase = '' checkPhase = ''
@ -45,8 +45,8 @@ stdenv.mkDerivation rec {
runHook postInstall runHook postInstall
''; '';
# A few tests fail on aarch64 # A few tests fail on aarch64-linux
doCheck = !stdenv.isAarch64; doCheck = !(stdenv.isLinux && stdenv.isAarch64);
meta = with lib; { meta = with lib; {
description = "A tool to extract files from visual novel archives"; description = "A tool to extract files from visual novel archives";