diff --git a/gnu/local.mk b/gnu/local.mk index 1295eb9807..7218e4d4fb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1621,7 +1621,8 @@ dist_patch_DATA = \ %D%/packages/patches/insight-toolkit-fix-build.patch \ %D%/packages/patches/irrlicht-use-system-libs.patch \ %D%/packages/patches/irrlicht-link-against-needed-libs.patch \ - %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ + %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ + %D%/packages/patches/ispell-for-linphone-cmake.patch \ %D%/packages/patches/jamesdsp-fix-bulid-on-pipewire-1.4.0.patch\ %D%/packages/patches/jami-disable-webengine.patch \ %D%/packages/patches/jami-enable-testing.patch \ diff --git a/gnu/packages/aspell.scm b/gnu/packages/aspell.scm index ffb13025f3..8c192b1604 100644 --- a/gnu/packages/aspell.scm +++ b/gnu/packages/aspell.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2021 Sergiu Ivanov ;;; Copyright © 2023 Yovan Naumovski ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2024 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,9 @@ (define-module (gnu packages aspell) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix licenses) #:use-module (guix utils) @@ -438,3 +442,43 @@ dictionaries, including personal ones.") European languages.") (home-page "https://www.cs.hmc.edu/~geoff/ispell.html") (license bsd-3))) + +;;; This is basically ispell but built with CMake, and which provides a CMake +;;; config file. +(define-public ispell-for-linphone + (let ((commit "05574fe160222c3d0b6283c1433c9b087271fad1") + (revision "0")) + (package + (inherit ispell) + (name "ispell-for-linphone") + ;; The version is captured in the ISPELL_VERSION variable in the + ;; CMakeLists.txt file at the root of the project. + (version (git-version "3.4.05" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.linphone.org/BC/public/external/ispell") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0shwbms6y0i18n2qnvjlbwfmzk5rydlp7wbf4dl1rn74r244p132")) + (patches (search-patches "ispell-for-linphone-cmake.patch")))) + (build-system cmake-build-system) + (arguments + (substitute-keyword-arguments (package-arguments ispell) + ((#:modules _ ''()) + '((guix build cmake-build-system) + (guix build utils) + (srfi srfi-26))) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-before 'configure 'really-configure + (assoc-ref %standard-phases 'configure)) + (add-after 'configure 'install-headers + (lambda _ + (let ((include-dir (string-append #$output "/include/ISpell"))) + (with-directory-excursion "../source" + (for-each (cut install-file <> include-dir) + '("config.h" "defhash.h" "ispell.h" + "libispell.h" "local.h"))))))))))))) diff --git a/gnu/packages/patches/ispell-for-linphone-cmake.patch b/gnu/packages/patches/ispell-for-linphone-cmake.patch new file mode 100644 index 0000000000..6785ca4b7e --- /dev/null +++ b/gnu/packages/patches/ispell-for-linphone-cmake.patch @@ -0,0 +1,43 @@ +Retrieved from: https://git.pld-linux.org/?p=packages/bc-ispell.git;a=blob_plain;f=ispell-cmake.patch;hb=HEAD + +--- ispell-05574fe160222c3d0b6283c1433c9b087271fad1/CMakeLists.txt.orig 2023-11-07 11:53:37.000000000 +0100 ++++ ispell-05574fe160222c3d0b6283c1433c9b087271fad1/CMakeLists.txt 2024-03-28 20:53:45.068632010 +0100 +@@ -49,6 +49,26 @@ set(ISPELL_SOURCES + + add_library(${ISPELL_TARGET_NAME} SHARED ${ISPELL_SOURCES}) + ++set(CMAKE_MODULES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${ISPELL_TARGET_NAME}") ++configure_package_config_file("${ISPELL_TARGET_NAME}Config.cmake.in" "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake" ++ INSTALL_DESTINATION "${CMAKE_MODULES_INSTALL_DIR}" ++ NO_SET_AND_CHECK_MACRO ++) ++write_basic_package_version_file("${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}ConfigVersion.cmake" ++ VERSION ${PROJECT_VERSION} ++ COMPATIBILITY AnyNewerVersion ++) ++install(FILES ++ "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake" ++ "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}ConfigVersion.cmake" ++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR} ++) ++ ++install(EXPORT ${ISPELL_TARGET_NAME}LibraryDepends ++ FILE "${ISPELL_TARGET_NAME}LibraryDepends.cmake" ++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR} ++) ++ + install(TARGETS ${ISPELL_TARGET_NAME} + EXPORT ${ISPELL_TARGET_NAME}LibraryDepends + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +--- ispell-05574fe160222c3d0b6283c1433c9b087271fad1/ISpellConfig.cmake.in.orig 2023-11-07 11:53:37.000000000 +0100 ++++ ispell-05574fe160222c3d0b6283c1433c9b087271fad1/ISpellConfig.cmake.in 2024-03-28 21:54:40.692161132 +0100 +@@ -12,7 +12,7 @@ set(ISPELL_LIBRARIES "@ISPELL_TARGET_NAM + get_target_property(ISPELL_INCLUDE_DIRS "@ISPELL_TARGET_NAME@" INTERFACE_INCLUDE_DIRECTORIES) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18.0) +- add_library(@ISpell_TARGET_NAME@::@ISpell_TARGET_NAME@ ALIAS @ISpell_TARGET_NAME@) ++ add_library(@ISPELL_TARGET_NAME@::@ISPELL_TARGET_NAME@ ALIAS @ISPELL_TARGET_NAME@) + endif() + +-check_required_components(@ISpell_TARGET_NAME@) ++check_required_components(@ISPELL_TARGET_NAME@)