New comment by r-ricci on void-packages repository https://github.com/void-linux/void-packages/pull/41188#issuecomment-1564990586 Comment: I made some changes (r-ricci@e2a7b5e6d35fce78859286aaad9d15d2d63770ab) on my branch: ```diff diff --git a/common/shlibs b/common/shlibs index d56441a56b..96cb0a43e7 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2283,10 +2283,10 @@ libsfml-system.so.2.5 SFML-2.5.0_1 libsfml-window.so.2.5 SFML-2.5.0_1 libsfml-audio.so.2.5 SFML-2.5.0_1 libsfml-graphics.so.2.5 SFML-2.5.0_1 -libclamav.so.11 clamav-1.0.0_1 -libclamunrar.so.11 clamav-1.0.0_1 -libclamunrar_iface.so.11 clamav-1.0.0_1 -libfreshclam.so.2 clamav-0.103.1_2 +libclamav.so.12 clamav-1.1.0_1 +libclamunrar.so.12 clamav-1.1.0_1 +libclamunrar_iface.so.12 clamav-1.1.0_1 +libfreshclam.so.3 clamav-1.1.0_1 libqca-qt5.so.2 qca-qt5-2.1.3_1 libqt5keychain.so.1 qtkeychain-qt5-0.7.0_1 libphonon4qt5.so.4 phonon-qt5-4.8.3_1 diff --git a/srcpkgs/clamav/files/link-fts.patch b/srcpkgs/clamav/files/link-fts.patch new file mode 100644 index 0000000000..fe88e99c01 --- /dev/null +++ b/srcpkgs/clamav/files/link-fts.patch @@ -0,0 +1,12 @@ +diff --git a/clamonacc/CMakeLists.txt b/clamonacc/CMakeLists.txt +index e95e6d0..928b60a 100644 +--- a/clamonacc/CMakeLists.txt ++++ b/clamonacc/CMakeLists.txt +@@ -47,6 +47,7 @@ set_target_properties( clamonacc PROPERTIES COMPILE_FLAGS "${WARNCFLAGS}" ) + + target_link_libraries( clamonacc + PRIVATE ++ fts + ClamAV::libclamav + ClamAV::common + CURL::libcurl ) diff --git a/srcpkgs/clamav/template b/srcpkgs/clamav/template index 32c5ed3c3e..00a381d508 100644 --- a/srcpkgs/clamav/template +++ b/srcpkgs/clamav/template @@ -1,8 +1,9 @@ # Template file for 'clamav' pkgname=clamav -version=1.0.1 +version=1.1.0 revision=1 build_style=cmake +build_helper="qemu" configure_args="-DAPP_CONFIG_DIRECTORY=/etc -DDATABASE_DIRECTORY=/var/lib/_clamav -DENABLE_JSON_SHARED=ON @@ -26,21 +27,30 @@ short_desc="Clam Anti-Virus scanner" maintainer="Jan Christian Grünhage " license="GPL-2.0-only" homepage="https://www.clamav.net/" +changelog="https://raw.githubusercontent.com/Cisco-Talos/clamav/main/NEWS.md" distfiles="https://www.clamav.net/downloads/production/clamav-${version}.tar.gz" -checksum=0872dc1b82ff4cd7e8e4323faf5ee41a1f66ae80865d05429085b946355d86ee +checksum=a30020d99cd467fa5ea0efbd6f4f182efebf62a9fc62fc4a3a7b2cc3f55e6b74 _clamav_homedir="/var/lib/_${pkgname}" _clamav_descr="ClamAV user" system_accounts="_clamav" -CPPFLAGS="-Wno-unused-local-typedefs" if [ "$CROSS_BUILD" ]; then configure_args+=" -DDISABLE_MPOOL=1" fi if [ "$XBPS_TARGET_LIBC" = "musl" ]; then makedepends+=" musl-fts-devel" - LDFLAGS="-lfts" + configure_args+=" -DHAVE_SYSTEM_LFS_FTS=ON" fi +post_patch() { + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + # for some reason CFLAGS="-lfts" doesn't work + # and we can't use a regular patch because + # it won't build on glibc + patch -Np1 < "${FILESDIR}/link-fts.patch" + fi +} + post_install() { vsv clamd vsv freshclam ``` Now it builds on both glibc and musl. `build_helper="qemu"` makes cmake happy when cross-compiling, but then I get a link-time error which I don't know how to fix.