guix-mirrors/gnu/packages/patches/prusa-slicer-add-cmake-module.patch
nomike f6b3eca6f3
gnu: prusa-slicer: Update to 2.9.2
* gnu/packages/patches/prusa-slicer-add-cmake-module.patch:
New file.
* gnu/packages/patches/prusa-slicer-fix-tests.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Register new patch, unregister
removed patch.
* gnu/packages/engineering.scm (prusa-slicer): Update to 2.9.2
[source]: Update patches.  Update paths to bundled libraries.  Properly
remove libexpat from target_link_libraries.
[native-inputs]: Replace catch2 by catch2-3.8.
[inputs]: Replace opencascade-occt by opencascade-occt-7.6.1.  Add openssl,
webkitgtk-for-gtk3 and webkitgtk-with-libsoup2 for the new built-in browser
functionality.  Add z3.
[description]: Extend description.

Change-Id: If8c1b23b74e4eba2524276401e4fa468acc14901
Signed-off-by: Andreas Enge <andreas@enge.fr>
2025-08-01 20:57:27 +02:00

49 lines
1.7 KiB
Diff

From 23f1b40dbf6223b4b8af3845efe64b076998b2d7 Mon Sep 17 00:00:00 2001
From: nomike <nomike@nomike.com>
Date: Sat, 12 Jul 2025 03:14:16 +0200
Subject: [PATCH] Add CMake module for finding HidAPI library
---
cmake/modules/FindHidAPI.cmake | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 cmake/modules/FindHidAPI.cmake
diff --git a/cmake/modules/FindHidAPI.cmake b/cmake/modules/FindHidAPI.cmake
new file mode 100644
index 000000000..0fdcecf88
--- /dev/null
+++ b/cmake/modules/FindHidAPI.cmake
@@ -0,0 +1,30 @@
+find_package(PkgConfig)
+pkg_search_module(PC_HIDAPI QUIET hidapi hidapi-libusb)
+
+find_path(HIDAPI_INCLUDE_DIR NAMES hidapi.h
+ HINTS
+ ${PC_HIDAPI_INCLUDEDIR}
+ ${PC_HIDAPI_INCLUDE_DIRS})
+
+find_library(HIDAPI_LIBRARY NAMES hidapi hidapi-libusb
+ HINTS
+ ${PC_HIDAPI_LIBDIR}
+ ${PC_HIDAPI_LIBRARY_DIRS})
+
+if(HIDAPI_INCLUDE_DIR AND EXISTS "${HIDAPI_INCLUDE_DIR}/hidapi.h")
+ file(STRINGS "${HIDAPI_INCLUDE_DIR}/hidapi.h" hidapi_version_major
+ REGEX "^#define[\t ]+HID_API_VERSION_MAJOR[\t ]+[0-9]+")
+ file(STRINGS "${HIDAPI_INCLUDE_DIR}/hidapi.h" hidapi_version_minor
+ REGEX "^#define[\t ]+HID_API_VERSION_MINOR[\t ]+[0-9]+")
+ file(STRINGS "${HIDAPI_INCLUDE_DIR}/hidapi.h" hidapi_version_patch
+ REGEX "^#define[\t ]+HID_API_VERSION_PATCH[\t ]+[0-9]+")
+ string(REGEX REPLACE "[^0-9.]" "" HIDAPI_VERSION_STRING "${hidapi_version_major}.${hidapi_version_minor}.${hidapi_version_patch}")
+ unset(hidapi_version_major)
+ unset(hidapi_version_minor)
+ unset(hidapi_version_patch)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(HidAPI REQUIRED_VARS HIDAPI_LIBRARY HIDAPI_INCLUDE_DIR)
+
+mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)
--
2.50.0