diff options
| author | Murilo <murilo@disroot.org> | 2025-12-30 13:10:06 -0300 |
|---|---|---|
| committer | John Kehayias <john@guixotic.coop> | 2026-01-14 15:04:30 -0500 |
| commit | 5f974caf64784b0255d55d3d0f656be94f614171 (patch) | |
| tree | ca44b01123f7278a3461478e7129ae0ba381c6ce | |
| parent | 44895f73e73269245a3860981fc33e5e94c2e799 (diff) | |
gnu: iniparser: Update to 4.2.6.
* gnu/packages/samba.scm (iniparser): Update to 4.2.6.
[source]: Update upstream repository URL to GitLab; Add patch.
[build-system]: Switch from gnu-build-system to cmake-build-system.
[arguments]<#:make-flags>: Remove it.
<#:phases>{configure}: Do not replace it.
{build}: Do not replace it.
{install}: Do not replace it.
{patch-runner}: New phase.
{symlink-lib}: New phase.
[native-inputs]: Add pkg-config, doxygen, ruby, unity-test.
[home-page]: Use new GitLab URL.
[license]: Switch from X11 to MIT (expat).
* gnu/packages/patches/iniparser-remove-fetchcontent-usage.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register new patch files.
Change-Id: I3cb60ed6feb56c63c1e978a9d5b0d002f097b6fe
Signed-off-by: John Kehayias <john@guixotic.coop>
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/patches/iniparser-remove-fetchcontent-usage.patch | 57 | ||||
| -rw-r--r-- | gnu/packages/samba.scm | 66 |
3 files changed, 83 insertions, 41 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index eb92804975d..be789230323 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1623,6 +1623,7 @@ dist_patch_DATA = \ %D%/packages/patches/id3lib-UTF16-writing-bug.patch \ %D%/packages/patches/ilmbase-fix-tests.patch \ %D%/packages/patches/inferno-fix-crash.patch \ + %D%/packages/patches/iniparser-remove-fetchcontent-usage.patch \ %D%/packages/patches/inkscape-libxml2.patch \ %D%/packages/patches/instead-use-games-path.patch \ %D%/packages/patches/intltool-perl-compatibility.patch \ diff --git a/gnu/packages/patches/iniparser-remove-fetchcontent-usage.patch b/gnu/packages/patches/iniparser-remove-fetchcontent-usage.patch new file mode 100644 index 00000000000..cd17422e08b --- /dev/null +++ b/gnu/packages/patches/iniparser-remove-fetchcontent-usage.patch @@ -0,0 +1,57 @@ +This patch prevents iniparser from fetching external dependencies on build +phase. +This patch has been taken from nixpkgs' iniparser package: +https://github.com/NixOS/nixpkgs/blob/3497aa5c9457a9d88d71fa93a4a8368816fbeeba/pkgs/by-name/in/iniparser/remove-fetchcontent-usage.patch + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 0735d27..32c5cdb 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -26,16 +26,8 @@ endif() + + set(FETCHCONTENT_QUIET OFF) + +-FetchContent_Declare( +- unity +- GIT_REPOSITORY "https://github.com/throwtheswitch/unity.git" +- GIT_PROGRESS TRUE +- PATCH_COMMAND ${CMAKE_COMMAND} -E copy +- ${CMAKE_CURRENT_LIST_DIR}/unity_config.h ./src/) +- +-FetchContent_MakeAvailable(unity) +-target_compile_definitions(unity PUBLIC UNITY_INCLUDE_CONFIG_H +- UNITY_USE_COMMAND_LINE_ARGS) ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(UNITY REQUIRED unity) + + function(create_test_runner) + set(options) +@@ -52,7 +44,7 @@ function(create_test_runner) + add_custom_command( + OUTPUT test_${TEST_RUNNER_NAME}_runner.c + COMMAND +- ${RUBY_EXECUTABLE} ${unity_SOURCE_DIR}/auto/generate_test_runner.rb ++ @UNITY-GENERATE-TEST-RUNNER@ + ${CMAKE_CURRENT_SOURCE_DIR}/test_${TEST_RUNNER_NAME}.c + test_${TEST_RUNNER_NAME}_runner.c ${CMAKE_CURRENT_LIST_DIR}/unity-config.yml + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/test_${TEST_RUNNER_NAME}.c +@@ -62,10 +54,18 @@ function(create_test_runner) + test_${TEST_RUNNER_NAME}_runner.c) + foreach(TARGET_TYPE ${TARGET_TYPES}) + # if BUILD_STATIC_LIBS=ON shared takes precedence ++ target_include_directories( ++ test_${TEST_RUNNER_NAME} ++ PUBLIC ++ ${UNITY_INCLUDE_DIRS}) ++ target_compile_options( ++ test_${TEST_RUNNER_NAME} ++ PUBLIC ++ ${UNITY_CFLAGS_OTHER}) + target_link_libraries( + test_${TEST_RUNNER_NAME} + ${PROJECT_NAME}-${TARGET_TYPE} +- unity) ++ ${UNITY_LIBRARIES}) + endforeach() + endfunction() + diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index 9162fa2f7e1..338e3f013ae 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2024 Jordan Moore <lockbox@struct.foo> ;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2025 Nicolas Graves <ngraves@ngraves.fr> +;;; Copyright © 2025 Murilo <murilo@disroot.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -55,6 +56,7 @@ #:use-module (gnu packages cups) #:use-module (gnu packages databases) #:use-module (gnu packages docbook) + #:use-module (gnu packages documentation) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) @@ -69,6 +71,7 @@ #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) + #:use-module (gnu packages ruby) #:use-module (gnu packages time) #:use-module (gnu packages tls) #:use-module (gnu packages web) @@ -117,54 +120,35 @@ the Linux kernel CIFS client.") (define-public iniparser (package (name "iniparser") - (version "4.1") + (version "4.2.6") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/ndevilla/iniparser") + (url "https://gitlab.com/iniparser/iniparser") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 - "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5")))) - (build-system gnu-build-system) + "1gi2kxp55095bq2qrdfy0hxiwzpc47413ydj15xvg9nbw3s14pfg")) + (patches (search-patches "iniparser-remove-fetchcontent-usage.patch")))) + (build-system cmake-build-system) (arguments - `(#:make-flags - (list ,(string-append "CC=" (cc-for-target))) - #:phases - (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (substitute* '("Makefile" "test/Makefile") - (("/usr/lib") - (string-append (assoc-ref outputs "out") "/lib"))) - #t)) - (replace 'build - (lambda* (#:key make-flags #:allow-other-keys) - (apply invoke "make" "libiniparser.so.1" - make-flags))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib")) - (inc (string-append out "/include")) - (doc (string-append out "/share/doc/" ,name)) - (html (string-append doc "/html"))) - (define (install dir) - (lambda (file) - (install-file file dir))) - (for-each (install lib) - (find-files "." "^lib.*\\.so")) - (with-directory-excursion lib - (symlink "libiniparser.so.1" "libiniparser.so")) - (for-each (install inc) - (find-files "src" "\\.h$")) - (for-each (install html) - (find-files "html" ".*")) - (for-each (install doc) - '("AUTHORS" "INSTALL" "LICENSE" "README.md")) - #t)))))) - (home-page "https://github.com/ndevilla/iniparser") + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-runner + (lambda _ + (substitute* "test/CMakeLists.txt" + (("@UNITY-GENERATE-TEST-RUNNER@") + (string-append #$(this-package-native-input "unity-test") + "/share/unity-test/generate_test_runner.rb"))))) + (add-after 'install 'symlink-lib + (lambda _ + (for-each (lambda (x) + (symlink x (string-append #$output "/include/" (basename x)))) + (find-files (string-append #$output "/include/iniparser") + ".*\\.h"))))))) + (native-inputs (list pkg-config doxygen ruby unity-test)) + (home-page "https://gitlab.com/iniparser/iniparser") (synopsis "Simple @file{.ini} configuration file parsing library") (description "The iniParser C library reads and writes Windows-style @file{.ini} @@ -174,7 +158,7 @@ are easy to read, write, and modify. The library is small, thread safe, and written in portable ANSI C with no external dependencies.") - (license license:x11))) + (license license:expat))) (define-public nss-wrapper (package |
