From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id ANfXLR6tM2fNcQAAqHPOHw:P1 (envelope-from ) for ; Tue, 12 Nov 2024 19:31:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id ANfXLR6tM2fNcQAAqHPOHw (envelope-from ) for ; Tue, 12 Nov 2024 20:31:42 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=flake.de header.s=2019 header.b=E7yiDrq0; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731439902; a=rsa-sha256; cv=none; b=HdwTNwQSWJBgL3AxyraajnNjkCDiRn1eTCsw+o3tkE913iOeDw3OWZn2freRWbP1jLVfnU DwFjiophuCpeCWXLmKmfzWjUBS3O1fjWlEGc2MtDhZZuiJ6Iz9w6uCJDTbx+jrlZwBL9n8 n0Av56iL1g/x7OsUZWpktF2bAFvSgVBBH38PfS+UXEz5DiqUmykvzh6eTSnmYWkM4L1bc3 VPKO0+u8yUjBuQRI7RuzA2PuLl8Pn2AGOLcI+hfMQZKyvamn/BcWPnaWMgwQ3FfOJFfpwD ZVm9O9hkRSM0SF7cujx/Wfpf8DSNJDPxL6NwfhQL/29J3Mv2rTSlNTZkSXgl4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=flake.de header.s=2019 header.b=E7yiDrq0; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731439902; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=h5Nvi7L2P5bzHV+Drezuo9/5lE9GANhDPNDxGoMVrek=; b=pOOxcQScF7urt7xc4PVZ9D3sdPv5zSeUMu73j0j3Ru7/aGmCxNLIWT/NcJgHxEqcCzVeav FI9rrb5zzxTUj1CKqjsYLFwWtwFZRYawxVb1otdbS+8rh+2PhXWG8JQw+J/bhszDt4SXlJ c4Z2aBzq8eCzt0oni7VpjWpYW5XfTnm4kxA/YaAVp03cEsN/MnvK0mfPNPqr1LPg8R/cL8 IamAoEjP8iDnAkZOf9yC9uUZbJGo32TALWdRELeLsgOkDFTzDhVdDLjvwo3cmyQQzzNd3Z Ly+tyV3deKU0ciQUeVsXAzDElIUyEqe3WXiUAQr6N11at4jKLSP7l+OmY6bJZQ== 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 7F00F85E8B for ; Tue, 12 Nov 2024 20:31:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAwbZ-0003NK-6c; Tue, 12 Nov 2024 14:31:13 -0500 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 1tAwbU-0003Lp-46 for help-guix@gnu.org; Tue, 12 Nov 2024 14:31:08 -0500 Received: from donut1.nuthost.de ([138.201.204.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAwbN-0001n3-Uj for help-guix@gnu.org; Tue, 12 Nov 2024 14:31:06 -0500 Received: from nutbook9 (unknown [87.122.20.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by donut1.nuthost.de (Postfix) with ESMTPSA id 0DE051C0E25; Tue, 12 Nov 2024 20:30:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flake.de; s=2019; t=1731439850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h5Nvi7L2P5bzHV+Drezuo9/5lE9GANhDPNDxGoMVrek=; b=E7yiDrq0EZiThN/c4k4U4hmMtGgjgksRa87YnyevH7EobISIBv9iOaSeh3F3KdsDuPNBPf Hp4eVeCUeK9y3Mu75MdvrPcQueBDtvkspjWL7w8bA5SxQs/KSUhegt3TdKWiYyXD8AnKPj kgkpQ+r1y7fZgpzouS3b6t04Ghz5JLCaaIKu+NeRZebSyPlMBj6+8gDgm1OmLqVVvsOr5h BGiEVSEpx1LpeHO0+FVAV8r2LvGLBRqFwsmQtFQ5pTTmiEYXYP0avPzxUX/uDwp9bMGtC+ SL6EinSExIlhAzpZvfmS9v+prFYWCZQhoGNzxxyKnVS/iNK68xxHUdUMs3Z9Mw== From: Julian Flake To: Aristide Doussot Cc: help-guix@gnu.org Subject: Re: Add external data to a package In-Reply-To: <96ca3ac8-5954-4ecf-8be2-345dab200bb5@obspm.fr> (Aristide Doussot's message of "Tue, 12 Nov 2024 17:14:15 +0100") References: <96ca3ac8-5954-4ecf-8be2-345dab200bb5@obspm.fr> User-Agent: mu4e 1.12.7; emacs 29.4 Date: Tue, 12 Nov 2024 20:30:40 +0100 Message-ID: <87ldxos10f.fsf@flake.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=138.201.204.23; envelope-from=julian@flake.de; helo=donut1.nuthost.de X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.34 X-Spam-Score: -3.34 X-Migadu-Queue-Id: 7F00F85E8B X-Migadu-Scanner: mx10.migadu.com X-TUID: E/1Lf5I6EwHt Hi, not really sure if this is, what you asked for, but I solved it by=20 defining an additional package (let's call it "extension package"=20 or "wsrt-measures") for the extension file(s), similar to what you=20 already do. I would unpack the data in the extension package=20 already. Then I add that extension package to the inputs of the=20 package to extend. In your 'install-file lambda*, you can then=20 refer to the extension file(s) via (string-append (assoc-ref=20 inputs "wsrt-measures") "/path/to/file/s"). Maybe there are better ways, I'm also interested in. Best Regards, nutcase On Tue, Nov 12 2024, Aristide Doussot wrote: > Hello, > > =C2=A0=C2=A0=C2=A0 I am new to Guix and want to add data from an external= =20 > source to > my package build. More precisely, I am trying to install the=20 > library > casacore and need to add data in its subdirectory > share/casacore/data. I can download these data as tar via=20 > ftp. For > now, my code looks like this : > > " > (defineWSRT_Measures > (origin > (method url-fetch) > (uri "[...not sure I can disclose...]/WSRT_Measures.ztar") > (sha256 > (base32 "1d9qlcmkpsnw8wm7sidp17iwd2d771nsgjwwp568886g5f239a8k")) > ) > ) > (define-public casacore > (package > (name "casacore") > (version "3.5.0") > (source > (origin > (method git-fetch) > (uri (git-reference > (url "https://github.com/casacore/casacore.git") > (recursive? #t) > (commit "v3.5.0"))) > (file-name (git-file-name name version)) > (sha256 (base32=20 > "0zw70slc3681mnadg169avjg7d3jwn1x49xn0022207blcig8g2l")))) > (inputs > (listfftwf fftw openblas boost gcc-toolchain git gsl lapack > gfortran-toolchain readline flex bison cfitsio wcslib python > python-numpy > )) > (build-system cmake-build-system) > (arguments (list > #:configure-flags #~(list"-DHELLO_WHO=3DGuix""-DBUILD_DYSCO=3DON") > #:build-type "Release" > #:tests? #f;; some test are failing due to lack of data that are > downloable via ftp for now testing is disable > #:parallel-build? #t;; TODO : check if it makes a difference in > building time > #:phases > #~(modify-phases %standard-phases > (add-after 'install'install-data > (lambda* (#:key inputs outputs #:allow-other-keys) > (let*( > (out (assoc-ref outputs "out")) > (data (list-ref(find-files "/gnu/store""WSRT_Measures.ztar")0)) > (share-dir (string-append out "/share/casacore/data/")) > ) > (mkdir-p share-dir) > (invoke "tar""-xzf"data "-C"share-dir) > #t)))) > )) > (home-page "http://casacore.github.io/casacore/") > (synopsis "") > (description "A suite of C++ libraries for radio astronomy data > processing.") > (license license:gpl2+))) > > " > > > And it seems to work but I am sure there are far better ways to=20 > do > this than my "take the first element of an overall find-files on > /gnu/store/". Can someone teach me these better ways ? > > Thanks, > Aristide Doussot