fix(x11/opensubdiv): correct absolute paths in provided CMake files

- Context: similar to https://github.com/termux/termux-packages/pull/24956. This might be helpful for a future nested dependency of Blender.

- Fixes this error when some projects import `opensubdiv` through CMake, by preventing the generation of a malformed path `/data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib` in `OpenSubdivConfig.cmake`:

```
CMake Error at /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:11 (message):
  File or directory
  /data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib
  referenced by variable OpenSubdiv_LIB_DIR does not exist !
Call Stack (most recent call first):
  /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:28 (set_and_check)
  cmake/defaults/Packages.cmake:225 (find_package)
  CMakeLists.txt:23 (include)

-- Configuring incomplete, errors occurred!
```

- Copied and pasted from https://github.com/PixarAnimationStudios/OpenSubdiv/pull/1315
This commit is contained in:
termux-pacman-bot
2025-06-06 08:41:54 +00:00
parent 724a6a3319
commit b674eae39a
2 changed files with 30 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ TERMUX_PKG_LICENSE="custom"
TERMUX_PKG_LICENSE_FILE="LICENSE.txt, NOTICE.txt"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="3.6.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/PixarAnimationStudios/OpenSubdiv/archive/refs/tags/v${TERMUX_PKG_VERSION//./_}.tar.gz
TERMUX_PKG_SHA256=bebfd61ab6657a4f4ff27845fb66a167d00395783bfbd253254d87447ed1d879
TERMUX_PKG_AUTO_UPDATE=true

View File

@@ -0,0 +1,29 @@
This is https://github.com/PixarAnimationStudios/OpenSubdiv/pull/1315
It was developed for another non-FHS-compliant distro, NixOS, and also works for Termux.
From 19b2bac39aa075fe231259e519d13aed6ee373bf Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Sat, 12 Aug 2023 20:55:50 +0700
Subject: [PATCH] respect GNU install dirs
CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR are allowed to be
absolute, so they shouldn't be concatenated to absolute paths. Instead,
use CMAKE_INSTALL_FULL_LIBDIR and CMAKE_INSTALL_FULL_INCLUDEDIR, which
are known to be absolute.
---
opensubdiv-config.cmake.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/opensubdiv-config.cmake.in b/opensubdiv-config.cmake.in
index 08a005aaf..c08753796 100644
--- a/opensubdiv-config.cmake.in
+++ b/opensubdiv-config.cmake.in
@@ -1,6 +1,6 @@
@PACKAGE_INIT@
-set_and_check(OpenSubdiv_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
-set_and_check(OpenSubdiv_LIB_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
+set_and_check(OpenSubdiv_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
+set_and_check(OpenSubdiv_LIB_DIR "@CMAKE_INSTALL_FULL_LIBDIR@")
include("${CMAKE_CURRENT_LIST_DIR}/OpenSubdivTargets.cmake")