summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorabsrdspc2021-04-19 23:22:09 +0300
committerabsrdspc2021-04-20 00:04:55 +0300
commit45d360e3f64f6047bfd1c8300f3f47095a5a675d (patch)
treeab7f26758a17cdaa6d78de94b9b458598e50da36
parente63721a5d0433bf1389514ad1011248d4277e94b (diff)
downloadaur-45d360e3f64f6047bfd1c8300f3f47095a5a675d.tar.gz
Fix tests (conditional assets location)
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD18
-rw-r--r--etc.patch17
3 files changed, 29 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1b8b611dc077..9833d555fcbf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
diff --git a/PKGBUILD b/PKGBUILD
index ebf330fbf5b7..00f2debbdd80 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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";