From 96f3df23b7f8f133268d3dc698cd0c2ed1f72e58 Mon Sep 17 00:00:00 2001 From: Romain GARBAGE Date: Thu, 20 Nov 2025 10:58:06 +0100 Subject: [PATCH] gnu: dlib: Fix broken package. This is a follow-of of commit 830562e5cdb6c244f39c3168b4649c1144099450. * gnu/packages/machine-learning.scm (dlib)[arguments]: Replace unquote with ungexp. Improve style. Fix failing tests with GCC 14. Change-Id: Ida95405b026893bae26af39cbfc4a0457e2d232c Signed-off-by: Andreas Enge --- gnu/packages/machine-learning.scm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index b53b6c1bd98..35196bf00a5 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -32,6 +32,7 @@ ;;; Copyright © 2025 Lapearldot ;;; Copyright © 2025 Cayetano Santos ;;; Copyright © 2025 Janneke Nieuwenhuizen +;;; Copyright © 2025 Romain Garbage ;;; ;;; This file is part of GNU Guix. ;;; @@ -2031,14 +2032,13 @@ than 8 bits, and at the end only some significant 8 bits are kept.") ;; config.h recommends explicitly enabling or disabling asserts ;; when building as a shared library. By default neither is set. (substitute* "dlib/config.h" - (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS")) - #t)) + (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS")))) (add-after 'disable-asserts 'disable-failing-tests (lambda _ ;; One test times out on MIPS, so we need to disable it. ;; Others are flaky on some platforms. - (let* ((system ,(or (%current-target-system) - (%current-system))) + (let* ((system #$(or (%current-target-system) + (%current-system))) (disabled-tests (cond ((string-prefix? "mips64" system) '("object_detector" ; timeout @@ -2053,6 +2053,17 @@ than 8 bits, and at the end only some significant 8 bits are kept.") (substitute* "dlib/test/makefile" (((string-append "SRC \\+= " test "\\.cpp")) ""))) disabled-tests)))) + (add-before 'configure 'fix-test-build-error-with-gcc-14.3 + (lambda _ + (substitute* "dlib/test/CMakeLists.txt" + ;; Some flags are activated specifically for GCC 14.0 but they + ;; are needed for current GCC version (14.3.0). Let's assume + ;; they are needed for the 14.x branch. + (("14\\.0\\.1") + "14.99") + ;; Tests use deprecated functions from ffmpeg. + (("-Werror\\)") + "-Werror -Wno-error=deprecated-declarations)")))) (replace 'check (lambda _ ;; XXX: This causes a rebuild--however, trying to run the tests