From 3ff11e7e2dd7d0750a20889aab04dd587d073504 Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Sat, 7 Jun 2025 08:40:24 +0000 Subject: [PATCH] fix(main/jsoncpp): remove "`json_reader.cpp.o`" properly - Similar to https://github.com/termux/termux-packages/pull/24897, but `jsoncpp` instead of `qt6-qtbase` - Fixes this error that might occur sometimes when some projects attempt to import `jsoncpp` through CMake: ``` CMake Error at /data/data/com.termux/files/usr/lib/cmake/jsoncpp/jsoncpp-targets.cmake:94 (message): The imported target "jsoncpp_object" references the file "/data/data/com.termux/files/usr/lib/objects-Release/jsoncpp_object/json_reader.cpp.o" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained "/data/data/com.termux/files/usr/lib/cmake/jsoncpp/jsoncpp-targets.cmake" but not all the files it references. Call Stack (most recent call first): /data/data/com.termux/files/usr/lib/cmake/jsoncpp/jsoncppConfig.cmake:30 (include) src/cmake/FindJsonCpp.cmake:68 (find_package) src/CMakeLists.txt:129 (find_package) -- Configuring incomplete, errors occurred! ``` - Replaces https://github.com/termux/termux-packages/commit/fd1b62d216d0085c386f84bb68cf6130a56890e8 - Found while attempting to compile this software: https://github.com/KhronosGroup/OpenXR-SDK-Source - @truboxl wants to remove the unconventional "`lib/objects-*/*/*.c*.o`" files that have begun appearing in some packages, and after some time, I believe I have found a way to do so without causing `CMake Error` to happen - using `-DBUILD_OBJECT_LIBS=OFF` appears to be capable of removing these files, but without causing the `CMake Error`. --- packages/jsoncpp/build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/jsoncpp/build.sh b/packages/jsoncpp/build.sh index 52c9d92d5b..422f1a0be6 100644 --- a/packages/jsoncpp/build.sh +++ b/packages/jsoncpp/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="C++ library for interacting with JSON" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=1.9.6 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=f93b6dd7ce796b13d02c108bc9f79812245a82e577581c4c9aabe57075c90ea2 TERMUX_PKG_AUTO_UPDATE=true @@ -11,12 +12,10 @@ TERMUX_PKG_BREAKS="jsoncpp-dev" TERMUX_PKG_REPLACES="jsoncpp-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBUILD_SHARED_LIBS=ON +-DBUILD_OBJECT_LIBS=OFF -DJSONCPP_WITH_TESTS=OFF -DCCACHE_FOUND=OFF " -TERMUX_PKG_RM_AFTER_INSTALL=" -lib/objects-* -" termux_step_post_get_source() { # Do not forget to bump revision of reverse dependencies and rebuild them