unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 60571@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#60571] [PATCH 3/4] gnu: Add icu4c-for-skia.
Date: Thu,  5 Jan 2023 13:18:41 +0100	[thread overview]
Message-ID: <20230105121842.18662-3-ngraves@ngraves.fr> (raw)
In-Reply-To: <20230105121842.18662-1-ngraves@ngraves.fr>

* gnu/packages/icu4c.scm (icu4c-for-skia): New variable.
---
 gnu/packages/icu4c.scm | 99 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)

diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 1e4f66d956..05911addcd 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -27,14 +27,17 @@
 
 (define-module (gnu packages icu4c)
   #:use-module (gnu packages)
+  #:use-module (gnu packages cpio)
   #:use-module (gnu packages java)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system gnu))
 
@@ -243,3 +246,99 @@ (define-public java-icu4j
 globalisation support for software applications.  This package contains the
 Java part.")
     (license x11)))
+
+(define-public icu4c-for-skia
+  (let ((commit "a0718d4f121727e30b8d52c7a189ebf5ab52421f")
+        (revision "0"))
+    (package
+      (inherit icu4c)
+      (name "icu4c-for-skia")
+      (version "skia")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://chromium.googlesource.com/chromium/deps/icu.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1qxws2p91f6dmhy7d3967r5ygz06r88pkmpm97px067x0zzdz384"))))
+      (native-inputs (list python cpio pkg-config))
+      (arguments
+       (list
+        #:make-flags #~`(,(string-append "DESTDIR=" #$output))
+        #:configure-flags #~'(;;"--enable-shared=no" "--enable-static=yes"
+                              "--prefix=" "--exec-prefix=")
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'chdir-to-source
+              (lambda _ (chdir "source")))
+            (replace 'configure
+              (lambda* (#:key inputs parallel-build? configure-flags #:allow-other-keys)
+                (let ((bash (search-input-file inputs "/bin/sh")))
+                  ;; Replace bash executable.
+                  (setenv "CONFIG_SHELL" bash)
+                  (substitute* "./configure"
+                    (("`/bin/sh")
+                     (string-append "`" bash)))
+                  ;; Make the static library position-independent.
+                  ;; (substitute* "./icudefs.mk.in"
+                    ;; (("^CFLAGS = ")
+                     ;; "CFLAGS = -fPIC ")
+                    ;; (("^CXXFLAGS = ")
+                     ;; "CXXFLAGS = -fPIC "))
+                  ;; Update runpath.
+                  (substitute* "./icudefs.mk.in"
+                    (("= -L\\$\\(LIBDIR\\)")
+                     (string-append "= -L$(LIBDIR)"
+                                    " -Wl,-rpath=\"" #$output "/lib\"")))
+                  ;; Set prefix and exec-prefix.
+                  (substitute* "./runConfigureICU"
+                    (("^OPTS=")
+                     (string-append "OPTS=\""
+                                    (string-join configure-flags " ")
+                                    "\"")))
+                  ;; Configure.
+                  (invoke "./runConfigureICU" "Linux/gcc"
+                          "--disable-layout" "--disable-tests"))))
+            (add-after 'install 'configure-filtered-data
+              (lambda* (#:key make-flags configure-flags #:allow-other-keys)
+                ;; Cleanup.
+                (with-directory-excursion "data"
+                  `(,invoke "make" "clean" ,@make-flags))
+                ;; Set prefix and exec-prefix.
+                (substitute* "./runConfigureICU"
+                  (("^OPTS=")
+                   (string-append
+                    "OPTS=\"" (string-join configure-flags " ") "\"")))
+                ;; Configure for common data.
+                (setenv "ICU_DATA_FILTER_FILE"
+                        (string-append (getcwd) "/../filters/common.json"))
+                (invoke "./runConfigureICU" "Linux/gcc"
+                        "--disable-layout" "--disable-tests")))
+            (add-after 'configure-filtered-data 'build-filtered-data
+              (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
+                (let ((job-count (if parallel-build?
+                                     (number->string (parallel-job-count))
+                                     "1")))
+                  `(,invoke "make" "-j" ,job-count ,@make-flags)
+                  (setenv "DESTDIR" #$output)
+                  (invoke "bash" "../scripts/copy_data.sh" "common"))))
+            (add-after 'build-filtered-data 'install-scripts-and-data
+              (lambda _
+                (let* ((share (string-append #$output "/share"))
+                       (scripts (string-append share "/scripts"))
+                       (data (string-append share "/data/common")))
+                  ;; Install scripts.
+                  (mkdir-p scripts)
+                  (copy-recursively "../scripts/" scripts)
+                  ;; Install data.
+                  (mkdir-p data)
+                  (copy-recursively "./dataout/common/data/out/tmp" data)
+                  (symlink (string-append data "/icudt69l.dat")
+                           (string-append data "/icudtl.dat")))))
+            (add-before 'check 'disable-failing-uconv-test
+              (lambda _
+                (substitute* "extra/uconv/Makefile.in"
+                  (("check: check-local")
+                   ""))))))))))
-- 
2.38.1





  parent reply	other threads:[~2023-01-05 12:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 10:02 [bug#60571] activating tests for skia 2D graphics library Nicolas Graves via Guix-patches via
2023-01-05 12:18 ` [bug#60571] [PATCH 1/4] gnu: Add spirv-headers-for-skia Nicolas Graves via Guix-patches via
2023-01-05 12:18   ` [bug#60571] [PATCH 2/4] gnu: Add spirv-tools-for-skia Nicolas Graves via Guix-patches via
2023-03-24  3:20     ` [bug#60571] activating tests for skia 2D graphics library Maxim Cournoyer
2023-01-05 12:18   ` Nicolas Graves via Guix-patches via [this message]
2023-01-05 12:18   ` [bug#60571] [PATCH 4/4] gnu: skia: Activate tests Nicolas Graves via Guix-patches via
2023-03-24  3:15   ` [bug#60571] activating tests for skia 2D graphics library Maxim Cournoyer
2023-08-27 12:53 ` [bug#60571] [PATCH v2 1/4] gnu: Add spirv-headers-for-skia Nicolas Graves via Guix-patches via
2023-08-27 12:53   ` [bug#60571] [PATCH v2 2/4] gnu: Add spirv-tools-for-skia Nicolas Graves via Guix-patches via
2023-08-28 15:29     ` Maxim Cournoyer
2023-08-27 12:53   ` [bug#60571] [PATCH v2 3/4] gnu: Add icu4c-for-skia Nicolas Graves via Guix-patches via
2023-08-28 15:48     ` Maxim Cournoyer
2023-08-29 13:37       ` Nicolas Graves via Guix-patches via
2023-08-29 14:46         ` Maxim Cournoyer
2023-08-27 12:53   ` [bug#60571] [PATCH v2 4/4] gnu: skia: Activate tests Nicolas Graves via Guix-patches via
2023-08-28 15:58     ` Maxim Cournoyer
2023-08-28 15:27   ` [bug#60571] [PATCH v2 1/4] gnu: Add spirv-headers-for-skia Maxim Cournoyer
2023-08-29 21:11 ` [bug#60571] [PATCH v3 1/3] gnu: Add icu4c-for-skia Nicolas Graves via Guix-patches via
2023-08-29 21:11   ` [bug#60571] [PATCH v3 2/3] gnu: skia: Activate tests Nicolas Graves via Guix-patches via
2023-08-29 21:11   ` [bug#60571] [PATCH v3 3/3] gnu: skia: Update to 110.0.0f3fb7a Nicolas Graves via Guix-patches via
2023-09-02 13:33     ` [bug#60571] activating tests for skia 2D graphics library Maxim Cournoyer
2023-09-02 16:17     ` Maxim Cournoyer
2023-09-05 15:07 ` [bug#60571] [PATCH v4 1/3] gnu: skia: Update to 110.0.0f3fb7a Nicolas Graves via Guix-patches via
2023-09-05 15:07   ` [bug#60571] [PATCH v4 2/3] gnu: skia: Update to 112.0.6d0b938 Nicolas Graves via Guix-patches via
2023-09-05 15:07   ` [bug#60571] [PATCH v4 3/3] gnu: python-skia-pathops: Update to 0.8.0 Nicolas Graves via Guix-patches via
2023-09-06  1:08     ` bug#60571: " Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230105121842.18662-3-ngraves@ngraves.fr \
    --to=guix-patches@gnu.org \
    --cc=60571@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).