# Copyright 2022-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit cmake DESCRIPTION="C implementation of the Aaru file format" HOMEPAGE="https://www.aaru.app" SRC_URI="https://github.com/aaru-dps/libaaruformat/archive/refs/tags/v1.0.0-beta.4.tar.gz -> ${P}.tar.gz" S="${WORKDIR}/${PN}-1.0.0-beta.4" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~amd64" BDEPEND="virtual/pkgconfig" RDEPEND=" >=dev-libs/xxhash-0.8.4:= >=app-arch/zstd-1.6:= >=media-libs/flac-1.5:= " DEPEND=" >=dev-libs/blake3-1.8.7 >=dev-libs/uthash-2.4.0 ${RDEPEND} " src_prepare() { default rm -rf 3rdparty/{BLAKE3,flac,uthash,xxHash,zstd} tests/lib cp "${FILESDIR}/zstd.cmake" 3rdparty/zstd.cmake || die cp "${FILESDIR}/xxhash.cmake" 3rdparty/xxhash.cmake || die cp "${FILESDIR}/blake3.cmake" 3rdparty/blake3.cmake || die cp "${FILESDIR}/flac.cmake" 3rdparty/flac.cmake || die # hash headers are public API but move them under aaruformat/ # to avoid collisions with other packages mv include/{md5,sha1,sha256}.h include/aaruformat/ || die sed -i -e 's|include/md5\.h|include/aaruformat/md5.h|' \ -e 's|include/sha1\.h|include/aaruformat/sha1.h|' \ -e 's|include/sha256\.h|include/aaruformat/sha256.h|' CMakeLists.txt || die # unbundle uthash sed -i '/3rdparty\/uthash/d' CMakeLists.txt || die sed -i 's/1.0.0-beta.3.2/1.0.0-beta.4/' CMakeLists.txt || die cat >> CMakeLists.txt <<-EOF set_target_properties(aaruformat PROPERTIES VERSION 1.0.0 SOVERSION 1) EOF cmake_prepare } src_configure() { local mycmakeargs=( -DBUILD_SHARED_LIBS=ON -DAARU_BUILD_PACKAGE=ON -DCMAKE_C_VISIBILITY_PRESET=hidden ) cmake_src_configure }