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 fd1b62d216

- 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`.
This commit is contained in:
termux-pacman-bot
2025-06-07 08:40:24 +00:00
parent 108e89a70c
commit 3ff11e7e2d

View File

@@ -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