diff options
author | absrdspc | 2021-04-19 23:22:09 +0300 |
---|---|---|
committer | absrdspc | 2021-04-20 00:04:55 +0300 |
commit | 45d360e3f64f6047bfd1c8300f3f47095a5a675d (patch) | |
tree | ab7f26758a17cdaa6d78de94b9b458598e50da36 | |
parent | e63721a5d0433bf1389514ad1011248d4277e94b (diff) | |
download | aur-45d360e3f64f6047bfd1c8300f3f47095a5a675d.tar.gz |
Fix tests (conditional assets location)
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rw-r--r-- | etc.patch | 17 |
3 files changed, 29 insertions, 8 deletions
@@ -18,9 +18,11 @@ pkgbase = arc_unpacker-git source = arc_unpacker-git::git+https://github.com/vn-tools/arc_unpacker.git source = catch.hpp::https://raw.githubusercontent.com/catchorg/Catch2/v2.13.4/single_include/catch2/catch.hpp source = lcg.patch + source = etc.patch sha256sums = SKIP sha256sums = 6e0fa3dd160891a01c1f3b34e8bcd6e0140abe08eca022e390027f27dec2050b sha256sums = 37f3c1f1969ec9ed537a5cff79e3eb712fb2f317fcf99508eaa8bb250104a003 + sha256sums = e8c02f338aca81df79f6d5c0e302322abd776b2aeb36eb0a57ee93335c0da216 pkgname = arc_unpacker-git @@ -14,10 +14,12 @@ provides=('arc_unpacker-git' 'arc_unpacker') conflicts=('arc_unpacker') source=("$pkgname::git+https://github.com/vn-tools/arc_unpacker.git" 'catch.hpp::https://raw.githubusercontent.com/catchorg/Catch2/v2.13.4/single_include/catch2/catch.hpp' - 'lcg.patch') + 'lcg.patch' + 'etc.patch') sha256sums=('SKIP' '6e0fa3dd160891a01c1f3b34e8bcd6e0140abe08eca022e390027f27dec2050b' - '37f3c1f1969ec9ed537a5cff79e3eb712fb2f317fcf99508eaa8bb250104a003') + '37f3c1f1969ec9ed537a5cff79e3eb712fb2f317fcf99508eaa8bb250104a003' + 'e8c02f338aca81df79f6d5c0e302322abd776b2aeb36eb0a57ee93335c0da216') pkgver() { cd "$pkgname" @@ -26,13 +28,13 @@ pkgver() { prepare() { cd "$pkgname" - # FIX sources path + # fix sources path sed -i "s|\/\.\.\/|\/|g" CMakeLists.txt - # FIX etc/ path - sed -i "s|program\_path\.parent()|io\:\:path(\"/usr/share/${_pkgname}\")|g" src/io/program_path.cc - # FIX logic_error + # fix etc/ path + git apply "$srcdir/etc.patch" + # fix logic_error git apply "$srcdir/lcg.patch" - # FIX tests + # fix tests cp "$srcdir/catch.hpp" tests/test_support/catch.h } @@ -44,7 +46,7 @@ build() { check() { cd "$pkgname" - ./run_tests + env _ARC_UNPACKER_TESTS=1 ./run_tests } package() { diff --git a/etc.patch b/etc.patch new file mode 100644 index 000000000000..1bfecee33a47 --- /dev/null +++ b/etc.patch @@ -0,0 +1,17 @@ +diff --git a/src/io/program_path.cc b/src/io/program_path.cc +index c268c776..8907c3e4 100644 +--- a/src/io/program_path.cc ++++ b/src/io/program_path.cc +@@ -38,7 +38,11 @@ io::path io::get_program_path() + + io::path io::get_assets_dir_path() + { +- auto dir = program_path.parent(); ++ io::path dir; ++ if (std::getenv("_ARC_UNPACKER_TESTS")) ++ dir = program_path; ++ else ++ dir = io::path("/usr/share/arc_unpacker"); + do + { + const auto path = dir / "etc"; |