From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uMe8EwXC7GS3dwEA9RJhRA:P1 (envelope-from ) for ; Mon, 28 Aug 2023 17:49:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uMe8EwXC7GS3dwEA9RJhRA (envelope-from ) for ; Mon, 28 Aug 2023 17:49:25 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E50744A387 for ; Mon, 28 Aug 2023 17:49:24 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=pIqpPg9u; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693237765; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=WrEUEE4BszyllQUtOv0Lo1rJLaAwMp0xG4pWfEOpqPg=; b=mO7liWqBzF8ogfkOPdwqa7QBfMlzbKHq2Y8rMl4ZlbZ/05oKyAvT6FiA3TFMLK5VsF6qFi VvgKUSPOmqmXW8ELofpsHXvQt+P77nXa2u+r6flF1iZNKjMjFnYkllwCf1kcjIQfUr9LZA p+hsGYPbBC5cpDc8p8haHGPwW8gsrAz8cJeLZuMng7tw+h6LJcMHGynKxwMkO4ct8pbsdw Z+351+S15Ezv6PsqQy+pDrOd7n5bhXFKv4910ZRivbMP88494xOHNsndfn7ItNf9A9dG06 EmvnQQFE7oijqik3+z5ShxfqrlHXWTyHRWHbXyRv1zyxi/p0Lthe9j8WH9Qi8Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693237765; a=rsa-sha256; cv=none; b=vBAGfn6pG8+Nfj+kzAvd1DfkKWl221AY1CEEd8Xrpjf9IXZf3Ye8kcFyzRq+1VUkJ5mO2a Ub3MPq8kRbFkBQtwrJ993hdur9k8w0+omBq3KZwtpdOyyofIe/BIWVu2eH2vvkKv+P5Orp ofXFGOVZi5MaGReE9D+DZLwKE8htWm6QFqggWAoMJ/AmrypESFrLy5dQNT4/Fbr8LfSTA3 LsNyxlZkD35QCOxYrJN1Uc/71drIckUJNFajW9A6iOjH2VIWFJZ9w9tXqs7+mm3UsdSx7C Kj+sk+7dyD4vdhPSG3pACris/e14rQQkRCVVUDvQlxGv1RfnpEO3B35YIhgmYQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=pIqpPg9u; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaeU5-0005xy-7a; Mon, 28 Aug 2023 11:48:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qaeU3-0005x5-R5 for guix-patches@gnu.org; Mon, 28 Aug 2023 11:48:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qaeU3-00049W-Ij for guix-patches@gnu.org; Mon, 28 Aug 2023 11:48:55 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qaeU9-0001AT-VF for guix-patches@gnu.org; Mon, 28 Aug 2023 11:49:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60571] [PATCH v2 3/4] gnu: Add icu4c-for-skia. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Aug 2023 15:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60571 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Nicolas Graves Cc: 60571@debbugs.gnu.org Received: via spool by 60571-submit@debbugs.gnu.org id=B60571.16932377134396 (code B ref 60571); Mon, 28 Aug 2023 15:49:01 +0000 Received: (at 60571) by debbugs.gnu.org; 28 Aug 2023 15:48:33 +0000 Received: from localhost ([127.0.0.1]:48830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaeTg-00018m-HA for submit@debbugs.gnu.org; Mon, 28 Aug 2023 11:48:33 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:49191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaeTe-00017y-FL for 60571@debbugs.gnu.org; Mon, 28 Aug 2023 11:48:31 -0400 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3a85b1b7574so2398326b6e.2 for <60571@debbugs.gnu.org>; Mon, 28 Aug 2023 08:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693237698; x=1693842498; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=WrEUEE4BszyllQUtOv0Lo1rJLaAwMp0xG4pWfEOpqPg=; b=pIqpPg9ueXIG7qXpSeLAYRbsuFvpSilW35X4WfahVIE5K0Og/f6O4p0CjkL7/WbLoc WZlrBmxazGW2llFoNLuzpjq8e5n5mWyZro0uJpVxUnz0Wd2d4cpt1lvJeyKiV9xzpHyl 07A4ppbQjfjsR5dejaYjSt0wdoA8+78ULJUK/9ff4tAwvwGpt6I96UWk+v3p5cpPGI+R ISvK/sYVYUc0CH/4iSroR4hYpkbyZoTN+JibG/P5mG+7VNjYdhzE/KWsu4fscS+7uIPN z6LVeMWQCAAgKlSOMZyADMqfPOPeHUQ8swFUXvyUqQM2I2g6OuRaiyiLkx7AoiPw9JEu Qkiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693237698; x=1693842498; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WrEUEE4BszyllQUtOv0Lo1rJLaAwMp0xG4pWfEOpqPg=; b=LTlKOpyMu/Iduc5gv6NOWi1dXMGb4XyveRYynTp6CSHxbEOPtetDztegxrlh9ciO/A 2XBVPbP1HjNUx8tdgt3UitCt9WaJMPtGoOvpo77Qv6xiVaEznWY2fUq94dwIWj8SLzNs 3RldNumZXJPOthTp7aWJ/KNwrUywv10EBLxVMt82UDv7/qOS1B6NJqDWAs/dlOZJaEBH i9byVw8t4wGUYd1AqKeAbPFGvbKWDAKp99kUNWPyO2AhCBqjvmpc+/Sq8362Nzyb/ykB /tfcEZF1gMJo5sGiTdf/XnrfjzL99BfjEfR1xltIrwCEdhfGGAyJ7nSQ5rHXDH7mKFSq SbxA== X-Gm-Message-State: AOJu0Yz607wdlDVgGU11tgbyydILIxZdUG98JS3iYXL14oq2wbFDE5bZ FW/4XfHgG9kugyh743ZD66NMFMtt23U= X-Google-Smtp-Source: AGHT+IHBWv2agMGMsJ9D5B1YgMOj1cHfdF5iPD1JQBEwyfVZIW6HwkKZTMLdfjhFAwKF4u4FQJBRCg== X-Received: by 2002:a05:6358:2806:b0:139:9dda:8344 with SMTP id k6-20020a056358280600b001399dda8344mr29569056rwb.19.1693237696296; Mon, 28 Aug 2023 08:48:16 -0700 (PDT) Received: from hurd (dsl-10-132-204.b2b2c.ca. [72.10.132.204]) by smtp.gmail.com with ESMTPSA id r8-20020ac85e88000000b0040ff1b4b400sm2385022qtx.73.2023.08.28.08.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 08:48:15 -0700 (PDT) From: Maxim Cournoyer References: <28d93ea0e4bda4dbbc9a653cfefb7e569b827ada.1693140822.git.ngraves@ngraves.fr> Date: Mon, 28 Aug 2023 11:48:14 -0400 In-Reply-To: <28d93ea0e4bda4dbbc9a653cfefb7e569b827ada.1693140822.git.ngraves@ngraves.fr> (Nicolas Graves's message of "Sun, 27 Aug 2023 14:53:41 +0200") Message-ID: <874jkjgoch.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.12 X-Spam-Score: -5.12 X-Migadu-Queue-Id: E50744A387 X-Migadu-Scanner: mx1.migadu.com X-TUID: vyb3HgO6VIRV Hello! Nicolas Graves writes: > * gnu/packages/icu4c.scm (icu4c-for-skia): New variable. > --- > gnu/packages/icu4c.scm | 101 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 101 insertions(+) > > diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm > index ba8b4915f2..eef8bd2cd3 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)) > > @@ -240,3 +243,101 @@ (define-public java-icu4j > globalisation support for software applications. This package contains the > Java part.") > (license x11))) > + > +(define-public icu4c-for-skia > + ;; The current version of skia needs commit-precise icu4c > + ;; version for its test-dependencies. I'd reword to use "needs this exact commit". Also, s/test-dependencies/test dependencies/ (no hyphen). > + (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)) nitpick: Conventionally, it's more common to put the inputs after the arguments fields. > + (arguments > + (list > + #:make-flags #~`(,(string-append "DESTDIR=" #$output)) It'd be more readable to use the simpler #~(list (string-append ...)). > + #:configure-flags #~'(;;"--enable-shared=no" "--enable-static=yes" > + "--prefix=" "--exec-prefix=") Please drop the dead code (;; ...). > + #: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) Too long of a line; you can but #:allow-other-keys on its own line. > + (let ((bash (search-input-file inputs "/bin/sh"))) > + ;; Replace bash executable. > + (setenv "CONFIG_SHELL" bash) > + (substitute* "./configure" > + (("`/bin/sh") > + (string-append "`" bash))) Is just setting CONFIG_SHELL not enough? Since '/bin/sh' here is used strictly at build time (in the configure script), you can use simply (which "sh") in your substitution. Otherwise you'd have to (search-input-file (or native-inputs inputs) ...) to not break cross-compilation. > + ;; Make the static library position-independent. > + ;; (substitute* "./icudefs.mk.in" > + ;; (("^CFLAGS = ") > + ;; "CFLAGS = -fPIC ") > + ;; (("^CXXFLAGS = ") > + ;; "CXXFLAGS = -fPIC ")) All commented out? Drop unless needed. > + ;; Update runpath. The comments are a bit terse; I'd expound them to complete sentences with a tad more context. > + (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. Ditto. > + (with-directory-excursion "data" > + `(,invoke "make" "clean" ,@make-flags)) It'd be cleaner to use 'apply' here, e.g. (apply invoke "make" "clean" make-flags) > + ;; Set prefix and exec-prefix. > + (substitute* "./runConfigureICU" > + (("^OPTS=") > + (string-append > + "OPTS=\"" (string-join configure-flags " ") "\""))) Mentioning in passage, you could also use (format #f "OPTS=\"~a\"" (string-join ...)), or even the more advanced (ice-9 format). > + ;; Configure for common data. > + (setenv "ICU_DATA_FILTER_FILE" > + (string-append (getcwd) "/../filters/common.json")) > + (invoke "./runConfigureICU" "Linux/gcc" > + "--disable-layout" "--disable-tests"))) I'm confused here; we re-run the configure script post installation? How does that work? If that's really needed it needs a proper explanatory comment. > + (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) Please use 'apply', as explained above. > + (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") > + "")))))))))) The rest looks good! It's seems a tricky package, well done! Could you please send a v2 with the above suggestions/comments taken into account? -- Thanks, Maxim