# Maintainer: KokaKiwi pkgname=dwarfs pkgver=0.9.9 pkgrel=2 pkgdesc="A fast high compression read-only file system" url='https://github.com/mhx/dwarfs' arch=('x86_64' 'aarch64') license=('GPL-3.0-only') depends=( 'fuse3' 'openssl' 'boost-libs' 'jemalloc' 'xxhash' 'fmt' 'lz4' 'xz' 'zstd' 'brotli' 'libarchive' 'flac' 'libunwind' 'google-glog' 'fmt' 'gflags' 'double-conversion' ) makedepends=( 'cmake' 'ruby-ronn' 'python' 'python-mistletoe' 'boost' 'libevent' 'libdwarf' 'chrono-date' 'utf8cpp' 'range-v3' 'gtest' ) source=("$pkgname-$pkgver.tar.xz::https://github.com/mhx/dwarfs/releases/download/v$pkgver/dwarfs-$pkgver.tar.xz" 0001-makepkg-Disable-faulty-test.patch) sha256sums=('f4638e589d5ae7038ca9461470a938d7bb755b1eae6533502a4f87f97c59c7f4' '4288b9e93c32d4645ac585d2b30ceb4b79d45f9f33348009c7b3c5af3147442c') b2sums=('c8f98b737d86444a6a074f7de2704edb94c86bd80e4024d021d4887240f9e1a5b52187ca2e82257427b2392d4afc7c7081985d5b5cc5d8b593f7221c4bc12126' '9a9f8b111480b16072737b37aa344595c5f595dbc2d602028d22d153721f94ee7d261b8a00d9b92aff35bb1664cf0e291e6291f6e64cefdee0d51f6618896a7e') prepare() { cd "$pkgname-$pkgver" patch -Np1 -i "$srcdir/0001-makepkg-Disable-faulty-test.patch" } build() { # Setting up release flags manually here so we get to use `CMAKE_BUILD_TYPE=None` # and keep makepkg-defined flags for build # cf. https://wiki.archlinux.org/title/CMake_package_guidelines#Fixing_the_automatic_optimization_flag_override export CFLAGS="$CFLAGS -DNDEBUG" export CXXFLAGS="$CXXFLAGS -DNDEBUG" # Disable ccache here since makepkg already handly this cmake -B build -S "$pkgname-$pkgver" \ -W no-dev \ -D CMAKE_INSTALL_PREFIX=/usr \ -D CMAKE_BUILD_TYPE=None \ -D WITH_TESTS=ON \ -D PREFER_SYSTEM_ZSTD=ON \ -D PREFER_SYSTEM_XXHASH=ON \ -D PREFER_SYSTEM_LIBFMT=ON \ -D PREFER_SYSTEM_GTEST=ON \ -D DISABLE_CCACHE=ON \ -D DISABLE_MOLD=ON cmake --build build } check() { #TODO: Find a way to either load the `fuse` module for the tests or disable the tests only when `fuse` module is not # loaded # Also wtf with perfmon test?? cmake --build build --target test -- ARGS="-E '(dwarfs/tools_test\..*|dwarfsextract_test\.perfmon)'" } package() { cmake --install build --prefix "$pkgdir/usr" mv "$pkgdir/usr/sbin"/* "$pkgdir/usr/bin" rm -rf "$pkgdir/usr/sbin" install -Dm0644 "$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" }