[bug#77949,v3,1/5] gnu: Add utf8proc-bootstrap.

Message ID 0998501bad053ba20daae94993a9f64120e114ab.1745959369.git.johnkhootf@gmail.com
State New
Headers
Series [bug#77949,v3,1/5] gnu: Add utf8proc-bootstrap. |

Commit Message

John Khoo April 29, 2025, 8:42 p.m. UTC
  * gnu/packages/textutils.scm (utf8proc-bootstrap): New variable.
* gnu/packages/julia.scm (julia): Change utf8proc dependency to
  utf8proc-bootstrap to break dependency loop.

Change-Id: Ie2e0c4a83aa9b478b125a390f162c1c69613cd9b
---
 gnu/packages/julia.scm     |  3 ++-
 gnu/packages/textutils.scm | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)


base-commit: 94e7afbb557d3f2709072bf2bf58618293ca7fbd
  

Patch

diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm
index 9668b3fd1e..9a4b38f74e 100644
--- a/gnu/packages/julia.scm
+++ b/gnu/packages/julia.scm
@@ -8,6 +8,7 @@ 
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Akira Kyle <akira@akirakyle.com>
+;;; Copyright © 2025 John Khoo <johnkhootf@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -526,7 +527,7 @@  (define-public julia
        ("p7zip" ,p7zip)
        ("pcre2" ,pcre2)
        ("suitesparse" ,suitesparse)
-       ("utf8proc" ,utf8proc-2.7.0)
+       ("utf8proc" ,utf8proc-bootstrap) ; Julia used for tests
        ("wget" ,wget)
        ("which" ,which)
        ("zlib" ,zlib)
diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index c886b009be..5fc21eb7ea 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -33,6 +33,7 @@ 
 ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2024, 2025 Ashish SHUKLA <ashish.is@lostca.se>
 ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2025 John Khoo <johnkhootf@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -76,6 +77,7 @@  (define-module (gnu packages textutils)
   #:use-module (gnu packages golang-crypto)
   #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages java)
+  #:use-module (gnu packages julia)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
@@ -166,6 +168,38 @@  (define-public enca
 libenca and several charset conversion libraries and tools.")
     (license license:gpl2)))
 
+;; Bootstrap variant of utf8proc, which breaks the dependency cycle between julia
+;; and utf8proc by disabling tests and removing its native-inputs.
+(define-public utf8proc-bootstrap
+  (hidden-package
+    (package
+      (name "utf8proc-bootstrap")
+      (version "2.10.0")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/JuliaStrings/utf8proc")
+               (commit (string-append "v" version))))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1n1k67x39sk8xnza4w1xkbgbvgb1g7w2a7j2qrqzqaw1lyilqsy2"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f
+         #:make-flags (list ,(string-append "CC=" (cc-for-target))
+                            (string-append "prefix=" (assoc-ref %outputs "out")))
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           )))
+      (home-page "https://juliastrings.github.io/utf8proc/")
+      (synopsis "C library for processing UTF-8 Unicode data")
+      (description "utf8proc is a small C library that provides Unicode
+  normalization, case-folding, and other operations for data in the UTF-8
+  encoding, supporting Unicode version 16.0.0.")
+      (license license:expat))))
+
 (define-public utf8proc
   (package
     (name "utf8proc")