From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QCujI0h5jmGmHQAAgWs5BA (envelope-from ) for ; Fri, 12 Nov 2021 15:25:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yPBKH0h5jmGvTQAA1q6Kng (envelope-from ) for ; Fri, 12 Nov 2021 14:25:12 +0000 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 F402CB898 for ; Fri, 12 Nov 2021 15:25:11 +0100 (CET) Received: from localhost ([::1]:55698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlXUN-000528-3Q for larch@yhetil.org; Fri, 12 Nov 2021 09:25:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlXUE-00050M-Si for guix-patches@gnu.org; Fri, 12 Nov 2021 09:25:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlXUE-00014b-KI for guix-patches@gnu.org; Fri, 12 Nov 2021 09:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlXUE-0001Mq-B9 for guix-patches@gnu.org; Fri, 12 Nov 2021 09:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51319] [PATCH v2 1/2] build-system/julia: Enable Julia Pkg to find installed packages Resent-From: Jean-Baptiste Volatier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Nov 2021 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51319 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51319@debbugs.gnu.org, efraim@flashner.co.il Cc: Jean-Baptiste Volatier Received: via spool by 51319-submit@debbugs.gnu.org id=B51319.16367270555170 (code B ref 51319); Fri, 12 Nov 2021 14:25:02 +0000 Received: (at 51319) by debbugs.gnu.org; 12 Nov 2021 14:24:15 +0000 Received: from localhost ([127.0.0.1]:43775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlXTR-0001LI-CS for submit@debbugs.gnu.org; Fri, 12 Nov 2021 09:24:15 -0500 Received: from mail-4322.protonmail.ch ([185.70.43.22]:64443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlXTK-0001KU-4Q for 51319@debbugs.gnu.org; Fri, 12 Nov 2021 09:24:12 -0500 Date: Fri, 12 Nov 2021 14:23:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1636727035; bh=KYLi3pdQqxYwVIaH2Ah8I01SimyA2IYghLFaCuv3PfU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=njKgw9Wcz78I7w/ewYdxcObr7LPue/0pO0RfQ3Q0/i1YcAA07g20qtnOHC43BdCHc IrrRiNt3wbj4Dz514flhi0LtCHubf2pSjp/3UwdQGMhhxJrk504GAlElyal5OupbqJ 5AKzop5eNZj7HrvkqmaAK0PGLPIHITKG/ECUg5BaZ+LgrBwySvKpV3zTyNqBgU388c jJTuLV1WkmX5yZRq2epiW6xvqKGPvqJJ/XiGcOD2Unvlu72bUO90Ge502mvZ9dzblR GIL6hpRQ3PBMIueaRoZvcRRYRL6IJdVbZXAkHy96pzX96twobk8nxNtz4DyOe29DiM AOqvVW0rf+sFg== Message-ID: <20211112142328.28400-2-jbv@pm.me> In-Reply-To: <20211112142328.28400-1-jbv@pm.me> References: <20211021130952.14696-1-jbv@pm.me> <20211021130952.14696-2-jbv@pm.me> <20211112142328.28400-1-jbv@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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" Reply-to: Jean-Baptiste Volatier X-ACL-Warn: , Jean-Baptiste Volatier via Guix-patches From: Jean-Baptiste Volatier via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636727112; h=from:from:sender:sender:reply-to: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: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=KYLi3pdQqxYwVIaH2Ah8I01SimyA2IYghLFaCuv3PfU=; b=KK96UWzwcjKgB+sah15TVWvz4xI27eontuo59JQBj/MG16ejRUpc5STnGc9Cj4v7oCCNsX Qu1djB2LkT7JKXew6lZcuuTQWjR368heNzxgOMRBotRQDey1AEluF1Jg1RSVwEFKODvVmy U1BNTj5n5i51h449tc8c+Y3HofYcwNsBw793GQ/8cJ1Fup1lDGBlUkQZSGCHAq49ZTX6Fx pUg+POjwITW09Asku8Iyci0ZnIThuhYQLeuyO3dq2BQWdFvqb9uroClj2P2qrsv/NmDumd zMel9PxA6V5GNAQtHooWcn//NXE3ZY9/1qwPv6bA/FK+TltTTml8X7kE9dYaWA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636727112; a=rsa-sha256; cv=none; b=erJ4cGCjMpIoOAdC2pRfRTc7K4CvTqnMkoTY7ebdLfNxFmpggBn0QF8/LLfpEH+f39IR4q yMOS8mwp8BPPUe/0qrnFOtY4GeY81444jlCpPeSeqJpTWnLyoURsQd0WPQORcx5Pio0gx/ /ApxKwlP0nTWzjuyHFGDsSXexwtHmj4haVx3BxjLZsfXVYCVcvSP/zWkdrz4//YE2kuwEL 4uyFd0m+rSB59WpEav7TmOykrXbVSyeH5DL8gozI6pE0218nNwTxbZyBZlph+7II1oah4d 9+0ytvXC+SanE0FEH5C6QlHtKzeRHN+tAyDn6QayWJ9iwwYgNX7dnyg2OwwKXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=pm.me header.s=protonmail header.b=njKgw9Wc; 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" X-Migadu-Spam-Score: -1.83 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=pm.me header.s=protonmail header.b=njKgw9Wc; 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" X-Migadu-Queue-Id: F402CB898 X-Spam-Score: -1.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: fuxR91C8N3BI * guix/build/julia-build-system.scm (link-depot): New phase. Julia built-in package manager (Pkg) looks for packages in JULIA_DEPOT_PATH/packages/PACKAGENAME/XXXX where XXXX is a string encoding package UUID and SHA1 of files. The link-depot phase creates a link at the correct location to allow Pkg to find packages that were already installed by Guix. (%package-path): modified package path from packages/ to loadpath/ (project.toml->uuid): retrive package uuid from TOML file * gnu/packages/julia-xyz.scm: correct paths to reflect change of %package-path modify order of phases as link-depot needs to run on an unmodified src directory add package-name-uuid keyword argument to packages without Project.toml file. * gnu/packages/julia.scm: correct paths to reflect change of %package-path modify order of phases as link-depot needs to run on an unmodified src directory --- gnu/packages/julia-jll.scm | 138 +++++++++++++++--------------- gnu/packages/julia-xyz.scm | 69 ++++++++------- gnu/packages/julia.scm | 2 +- guix/build-system/julia.scm | 5 +- guix/build/julia-build-system.scm | 49 +++++++++-- 5 files changed, 155 insertions(+), 108 deletions(-) diff --git a/gnu/packages/julia-jll.scm b/gnu/packages/julia-jll.scm index 51643819ae..d8cf5b9eaf 100644 --- a/gnu/packages/julia-jll.scm +++ b/gnu/packages/julia-jll.scm @@ -77,7 +77,7 @@ (define-public julia-bzip2-jll '(#:tests? #f ; No runtests.jl #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -117,7 +117,7 @@ (define-public julia-cairo-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -163,7 +163,7 @@ (define-public julia-compilersupportlibraries-jll `(#:tests? #f ; no runtests.jl #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -205,7 +205,7 @@ (define-public julia-expat-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -243,7 +243,7 @@ (define-public julia-ffmpeg-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -292,7 +292,7 @@ (define-public julia-fontconfig-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -335,7 +335,7 @@ (define-public julia-freetype2-jll '(#:tests? #f ; No runtests.jl #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -377,7 +377,7 @@ (define-public julia-fribidi-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -413,7 +413,7 @@ (define-public julia-gettext-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -454,7 +454,7 @@ (define-public julia-glfw-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -497,7 +497,7 @@ (define-public julia-glib-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -541,7 +541,7 @@ (define-public julia-gr-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -590,7 +590,7 @@ (define-public julia-gumbo-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (let ((gumbo (string-append (assoc-ref inputs "gumbo-parser")= ))) (for-each @@ -630,7 +630,7 @@ (define-public julia-imagemagick-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -672,7 +672,7 @@ (define-public julia-jllwrappers '(#:tests? #f #:phases (modify-phases %standard-phases - (add-after 'unpack 'custom-override-path + (add-after 'link-depot 'custom-override-path (lambda* (#:key inputs #:allow-other-keys) ;; Make @generate_wrapper_header take an optional argument th= at ;; guix packagers can pass to override the default "override" @@ -718,7 +718,7 @@ (define-public julia-jpegturbo-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -754,7 +754,7 @@ (define-public julia-lame-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -790,7 +790,7 @@ (define-public julia-libass-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -830,7 +830,7 @@ (define-public julia-libfdk-aac-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -866,7 +866,7 @@ (define-public julia-libffi-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -903,7 +903,7 @@ (define-public julia-libgcrypt-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -942,7 +942,7 @@ (define-public julia-libglvnd-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -980,7 +980,7 @@ (define-public julia-libgpg-error-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1018,7 +1018,7 @@ (define-public julia-libiconv-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1056,7 +1056,7 @@ (define-public julia-libmount-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1095,7 +1095,7 @@ (define-public julia-libpng-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1133,7 +1133,7 @@ (define-public julia-libsass-jll `(#:tests? #f ; no runtests.jl #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1175,7 +1175,7 @@ (define-public julia-libtiff-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1214,7 +1214,7 @@ (define-public julia-libuuid-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1252,7 +1252,7 @@ (define-public julia-libvorbis-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1290,7 +1290,7 @@ (define-public julia-lzo-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1328,7 +1328,7 @@ (define-public julia-mbedtls-jll '(#:tests? #f ; No runtests.jl #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1366,7 +1366,7 @@ (define-public julia-ogg-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1403,7 +1403,7 @@ (define-public julia-openspecfun-jll `(#:tests? #f ; no runtests.jl #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1446,7 +1446,7 @@ (define-public julia-openssl-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1482,7 +1482,7 @@ (define-public julia-opus-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1518,7 +1518,7 @@ (define-public julia-pcre-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1556,7 +1556,7 @@ (define-public julia-pixman-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1594,7 +1594,7 @@ (define-public julia-qt5base-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1645,7 +1645,7 @@ (define-public julia-wayland-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1684,7 +1684,7 @@ (define-public julia-wayland-protocols-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1721,7 +1721,7 @@ (define-public julia-x264-jll `(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (let ((libx264 (assoc-ref inputs "libx264"))) (map @@ -1762,7 +1762,7 @@ (define-public julia-x265-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1798,7 +1798,7 @@ (define-public julia-xkbcommon-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1838,7 +1838,7 @@ (define-public julia-xml2-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1878,7 +1878,7 @@ (define-public julia-xorg-libpthread-stubs-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1915,7 +1915,7 @@ (define-public julia-xorg-libx11-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1953,7 +1953,7 @@ (define-public julia-xorg-libxau-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -1989,7 +1989,7 @@ (define-public julia-xorg-libxcb-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2029,7 +2029,7 @@ (define-public julia-xorg-libxcursor-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2067,7 +2067,7 @@ (define-public julia-xorg-libxdmcp-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2103,7 +2103,7 @@ (define-public julia-xorg-libxext-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2140,7 +2140,7 @@ (define-public julia-xorg-libxfixes-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2177,7 +2177,7 @@ (define-public julia-xorg-libxi-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2215,7 +2215,7 @@ (define-public julia-xorg-libxinerama-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2252,7 +2252,7 @@ (define-public julia-xorg-libxkbfile-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2289,7 +2289,7 @@ (define-public julia-xorg-libxrandr-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2327,7 +2327,7 @@ (define-public julia-xorg-libxrender-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2364,7 +2364,7 @@ (define-public julia-xorg-xcb-util-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2401,7 +2401,7 @@ (define-public julia-xorg-xcb-util-image-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2438,7 +2438,7 @@ (define-public julia-xorg-xcb-util-keysyms-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2475,7 +2475,7 @@ (define-public julia-xorg-xcb-util-renderutil-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2512,7 +2512,7 @@ (define-public julia-xorg-xcb-util-wm-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2549,7 +2549,7 @@ (define-public julia-xorg-xkbcomp-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2586,7 +2586,7 @@ (define-public julia-xorg-xkeyboard-config-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2623,7 +2623,7 @@ (define-public julia-xorg-xtrans-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2659,7 +2659,7 @@ (define-public julia-xslt-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2702,7 +2702,7 @@ (define-public julia-zlib-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) @@ -2740,7 +2740,7 @@ (define-public julia-zstd-jll '(#:tests? #f ; no runtests #:phases (modify-phases %standard-phases - (add-after 'unpack 'override-binary-path + (add-after 'link-depot 'override-binary-path (lambda* (#:key inputs #:allow-other-keys) (map (lambda (wrapper) diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm index 93fadf318c..73768317b8 100644 --- a/gnu/packages/julia-xyz.scm +++ b/gnu/packages/julia-xyz.scm @@ -410,7 +410,8 @@ (define-public julia-bufferedstreams ;; https://travis-ci.org/BioJulia/BufferedStreams.jl/jobs/491050182 (arguments '(#:tests? #f - #:julia-package-name "BufferedStreams")) + #:julia-package-name "BufferedStreams" + #:julia-package-uuid "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d")) (propagated-inputs `(("julia-compat" ,julia-compat))) (home-page "https://github.com/BioJulia/BufferedStreams.jl") (synopsis "Fast composable IO streams") @@ -778,12 +779,12 @@ (define-public julia-configurations (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'fix-tests + (add-after 'link-depot 'fix-tests (lambda _ (substitute* "test/runtests.jl" (("option.toml") "test/option.toml")) #t)) - (add-after 'unpack 'dont-use-exproniconlite + (add-after 'link-depot 'dont-use-exproniconlite (lambda _ (substitute* '("Project.toml" "src/Configurations.jl" @@ -919,7 +920,7 @@ (define-public julia-dataframes (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-failing-test + (add-after 'link-depot 'skip-failing-test (lambda _ ;; Tests with non-standard colors. (substitute* "test/show.jl" @@ -1022,7 +1023,7 @@ (define-public julia-datavalues `(#:tests? #f ; Tests need upgrading with newer Julia version. #:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-known-failing-tests + (add-after 'link-depot 'skip-known-failing-tests (lambda _ ;; See upstream report: ;; https://github.com/queryverse/DataValues.jl/issues/83 @@ -1100,7 +1101,7 @@ (define-public julia-distances (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-flakey-tests + (add-after 'link-depot 'skip-flakey-tests (lambda _ ;; Some combination of these tests fail nondeterministically ;; each of the times this package is built. @@ -1166,14 +1167,14 @@ (define-public julia-documenter (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'patch-source + (add-after 'link-depot 'patch-source (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/Deps.jl" (("pip install") (string-append (assoc-ref inputs "python") "/bin/pip install"))) #t)) - (add-after 'unpack 'remove-javascript-downloads + (add-after 'link-depot 'remove-javascript-downloads (lambda _ (substitute* "src/Writers/HTMLWriter.jl" (("cdnjs.cloudflare.com") "example.com")) @@ -1352,7 +1353,7 @@ (define-public julia-dualnumbers (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'adjust-test-suite + (add-after 'link-depot 'adjust-test-suite (lambda _ (substitute* "test/runtests.jl" ;; Seems to not play nicely with SpecialFunctions @@ -1386,7 +1387,7 @@ (define-public julia-ellipsisnotation (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'adjust-test-suite + (add-after 'link-depot 'adjust-test-suite (lambda _ (substitute* "test/runtests.jl" ;; Seems to not play nicely with Julia-1.6. @@ -1438,7 +1439,7 @@ (define-public julia-expronicon (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-network-tests + (add-after 'link-depot 'skip-network-tests (lambda _ (substitute* "test/runtests.jl" ;; This test tries to access the Julia package registry. @@ -1517,7 +1518,7 @@ (define-public julia-fileio `(#:phases (modify-phases %standard-phases (delete 'reset-gzip-timestamps) - (add-after 'unpack 'skip-network-tests + (add-after 'link-depot 'skip-network-tests (lambda _ ;; These tests try to download audio/video files. (substitute* "test/query.jl" @@ -1677,7 +1678,7 @@ (define-public julia-fixedpointnumbers (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'disable-failing-test + (add-after 'link-depot 'disable-failing-test (lambda* (#:key outputs #:allow-other-keys) (substitute* "test/fixed.jl" ;; A deprecation warning is not thrown @@ -1764,7 +1765,7 @@ (define-public julia-functionwrappers (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'adjust-tests + (add-after 'link-depot 'adjust-tests (lambda _ (substitute* "test/runtests.jl" (("testset \\\"Abstract.*" all) @@ -1817,7 +1818,7 @@ (define-public julia-fuzzycompletions (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-failing-test + (add-after 'link-depot 'skip-failing-test (lambda _ (substitute* "test/runtests.jl" ((".*RPLE.*") ""))))))) @@ -1844,7 +1845,7 @@ (define-public julia-genericlinearalgebra (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'adjust-test-suite + (add-after 'link-depot 'adjust-test-suite (lambda _ (substitute* "test/runtests.jl" ((".*lapack.*") ""))))))) @@ -1875,7 +1876,7 @@ (define-public julia-genericschur (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'adjust-test-suite + (add-after 'link-depot 'adjust-test-suite (lambda _ (substitute* "test/complex.jl" ;; expected Array{Int32,1}, got a value of type Array{Int64= ,1} @@ -1912,13 +1913,13 @@ (define-public julia-geometrybasics (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'remove-earcut + (add-after 'link-depot 'remove-earcut (lambda _ (substitute* '("Project.toml" "src/GeometryBasics.jl") ((".*EarCut.*") "")) #t)) - (add-after 'unpack 'skip-incompatible-test + (add-after 'link-depot 'skip-incompatible-test (lambda _ (substitute* "test/runtests.jl" (("@testset.*MetaT and heterogeneous data.*" all) @@ -2268,7 +2269,7 @@ (define-public julia-imagemagick (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-failing-test + (add-after 'link-depot 'skip-failing-test (lambda _ ;; These tests try to download from the imagemagick.org (substitute* "test/runtests.jl" @@ -2465,7 +2466,7 @@ (define-public julia-infinity (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'remove-timezones.jl + (add-after 'link-depot 'remove-timezones.jl (lambda _ (substitute* "test/runtests.jl" (("using TimeZones.*") "") @@ -2864,7 +2865,7 @@ (define-public julia-matrixfactorizations (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-failing-test + (add-after 'link-depot 'skip-failing-test (lambda _ ;; Tests with math functions are hard. (substitute* "test/test_ul.jl" @@ -2981,7 +2982,8 @@ (define-public julia-media (build-system julia-build-system) ;; Package without Project.toml (arguments - '(#:julia-package-name "Media")) + '(#:julia-package-name "Media" + #:julia-package-uuid "e89f7d12-3494-54d1-8411-f7d8b9ae1f27")) (propagated-inputs `(("julia-macrotools" ,julia-macrotools))) (home-page "https://github.com/JunoLab/Media.jl") @@ -3202,7 +3204,7 @@ (define-public julia-nnlib (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-cuda-tests + (add-after 'link-depot 'skip-cuda-tests (lambda _ (substitute* "test/runtests.jl" (("using CUDA") "") @@ -3238,7 +3240,8 @@ (define-public julia-optimtestproblems (base32 "10h47x5ws42pkqjccimaz0yxfvz41w0yazq6inamfk4lg5g2g3d9")))= ) (build-system julia-build-system) (arguments - `(#:julia-package-name "OptimTestProblems")) + `(#:julia-package-name "OptimTestProblems" + #:julia-package-uuid "cec144fc-5a64-5bc6-99fb-dde8f63e154c")) (home-page "https://github.com/JuliaNLSolvers/OptimTestProblems.jl") (synopsis "Collection of optimization test problems") (description "The purpose of this package is to provide test problems = for @@ -3528,7 +3531,7 @@ (define-public julia-prettytables (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-color-tests + (add-after 'link-depot 'skip-color-tests (lambda _ (substitute* "test/text_backend.jl" ((".*colors\\.jl.*") "")) @@ -3567,7 +3570,7 @@ (define-public julia-pycall ((guix build python-build-system) #:prefix python:)) #:phases (modify-phases %standard-phases - (add-after 'unpack 'remove-conda + (add-after 'link-depot 'remove-conda (lambda _ (substitute* "Project.toml" ((".*Conda.*") "")) @@ -3577,7 +3580,7 @@ (define-public julia-pycall (substitute* "deps/depsutils.jl" (("Conda.PYTHONDIR") "\"/\"")) #t)) - (add-after 'unpack 'set-python + (add-after 'link-depot 'set-python (lambda* (#:key inputs outputs #:allow-other-keys) (let ((python (assoc-ref inputs "python"))) (setenv "PYCALL_JL_RUNTIME_PYTHON" @@ -3690,7 +3693,7 @@ (define-public julia-quadmath (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'hardcode-libmath-location + (add-after 'link-depot 'hardcode-libmath-location (lambda* (#:key inputs #:allow-other-keys) (let ((gcclib (assoc-ref inputs "gcc:lib"))) (substitute* "src/Quadmath.jl" @@ -4082,7 +4085,8 @@ (define-public julia-safetestsets (base32 "1fb1dfdmiw2ggx60hf70954xlps0r48fcb3k3dvxynlz7ylphp96")= ))) (build-system julia-build-system) (arguments - `(#:julia-package-name "SafeTestsets")) + `(#:julia-package-name "SafeTestsets" + #:julia-package-uuid "1bc83da4-3b8d-516f-aca4-4fe02f6d838f")) (native-inputs `(("julia-staticarrays" ,julia-staticarrays))) (home-page "https://github.com/YingboMa/SafeTestsets.jl") @@ -4308,7 +4312,7 @@ (define-public julia-stackviews (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'skip-doctest + (add-after 'link-depot 'skip-doctest (lambda _ (substitute* "test/runtests.jl" ((".*doctest.*") "")) @@ -4811,6 +4815,7 @@ (define-public julia-uris (build-system julia-build-system) (arguments '(#:julia-package-name "URIs" ;required to run tests + #:julia-package-uuid "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" #:phases (modify-phases %standard-phases (add-before 'check 'change-dir @@ -4818,7 +4823,7 @@ (define-public julia-uris (lambda* (#:key source outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (chdir - (string-append out "/share/julia/packages/URIs/test"))) + (string-append out "/share/julia/loadpath/URIs/test"))) #t))))) ;; required for tests (inputs `(("julia-json" ,julia-json))) diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index fe31e545c9..8bf2c8e25e 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm @@ -670,7 +670,7 @@ (define-public julia (native-search-paths (list (search-path-specification (variable "JULIA_LOAD_PATH") - (files (list "share/julia/packages/"))) + (files (list "share/julia/loadpath/"))) (search-path-specification (variable "JULIA_DEPOT_PATH") (files (list "share/julia/"))))) diff --git a/guix/build-system/julia.scm b/guix/build-system/julia.scm index 63cb7cd864..8ceac090c7 100644 --- a/guix/build-system/julia.scm +++ b/guix/build-system/julia.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2019 Nicol=C3=B2 Balzarotti +;;; Copyright =C2=A9 2021 Jean-Baptiste Volatier ;;; ;;; This file is part of GNU Guix. ;;; @@ -83,6 +84,7 @@ (define* (julia-build store name inputs (system (%current-system)) (guile #f) (julia-package-name #f) + (julia-package-uuid #f) (imported-modules %julia-build-system-modules) (modules '((guix build julia-build-system) (guix build utils)))) @@ -105,7 +107,8 @@ (define builder #:search-paths ',(map search-path-specification->sexp search-paths) #:inputs %build-inputs - #:julia-package-name ,julia-package-name))) + #:julia-package-name ,julia-package-name + #:julia-package-uuid ,julia-package-uuid))) (define guile-for-build (match guile diff --git a/guix/build/julia-build-system.scm b/guix/build/julia-build-sys= tem.scm index d74acf2a05..a23f241ba6 100644 --- a/guix/build/julia-build-system.scm +++ b/guix/build/julia-build-system.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2019, 2020 Nicol=C3=B2 Balzarotti +;;; Copyright =C2=A9 2021 Jean-Baptiste Volatier ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,10 +21,13 @@ (define-module (guix build julia-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module (guix build utils) + #:use-module (rnrs io ports) #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (ice-9 rdelim) + #:use-module (ice-9 popen) #:export (%standard-phases + %package-path julia-create-package-toml julia-build)) @@ -37,7 +41,7 @@ (define (invoke-julia code) (invoke "julia" "-e" code)) ;; subpath where we store the package content -(define %package-path "/share/julia/packages/") +(define %package-path "/share/julia/loadpath/") (define (project.toml->name file) "Look for Julia package name in the TOML file FILE (usually named @@ -51,6 +55,18 @@ (define (project.toml->name file) (if m (match:substring m 1) (loop (read-line in 'concat))))))))) +(define (project.toml->uuid file) + "Look for Julia package uuid in the TOML file FILE (usually named +Project.toml)." + (call-with-input-file file + (lambda (in) + (let loop ((line (read-line in 'concat))) + (if (eof-object? line) + #f + (let ((m (string-match "uuid\\s*=3D\\s*\"(.*)\"" line))) + (if m (match:substring m 1) + (loop (read-line in 'concat))))))))) + (define* (install #:key source inputs outputs julia-package-name #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -73,7 +89,7 @@ (define* (precompile #:key source inputs outputs julia-pa= ckage-name (setenv "JULIA_DEPOT_PATH" builddir) ;; Add new package dir to the load path. (setenv "JULIA_LOAD_PATH" - (string-append builddir "packages/" ":" + (string-append builddir "loadpath/" ":" (or (getenv "JULIA_LOAD_PATH") ""))) ;; Actual precompilation: @@ -97,15 +113,36 @@ (define* (check #:key tests? source inputs outputs jul= ia-package-name (setenv "SOURCE_DATE_EPOCH" "1") (setenv "JULIA_DEPOT_PATH" builddir) (setenv "JULIA_LOAD_PATH" - (string-append builddir "packages/" ":" + (string-append builddir "loadpath/" ":" (or (getenv "JULIA_LOAD_PATH") ""))) (setenv "HOME" "/tmp") (invoke "julia" "--depwarn=3Dyes" - (string-append builddir "packages/" + (string-append builddir "loadpath/" package "/test/runtests.jl")))) #t) +(define* (link-depot #:key source inputs outputs julia-package-name julia-= package-uuid + #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (package-name (or + julia-package-name + (project.toml->name "Project.toml"))) + (package-dir (string-append out %package-path package-name)) + (uuid (or julia-package-uuid (project.toml->uuid "Project.toml"))= ) + (pipe (open-pipe* OPEN_READ "julia" "-e" + (format #f "using Pkg; +println(Base.version_slug(Base.UUID(\"~a\"), + Base.SHA1(Pkg.GitTools.tree_hash(\".\"))))" uuid= ))) + (slug (string-trim-right (get-string-all pipe)))) + ;; When installing a package, julia looks first at in the JULIA_DEPOT_= PATH + ;; for a path like packages/PACKAGE/XXXX + ;; Where XXXX is a slug encoding the package UUID and SHA1 of the file= s + ;; Here we create a link with the correct path to enable julia to find= the package + (mkdir-p (string-append out "/share/julia/packages/" package-name)) + (symlink package-dir (string-append out "/share/julia/packages/" packa= ge-name "/" slug))) + #t) + (define (julia-create-package-toml outputs source name uuid version deps) @@ -138,6 +175,7 @@ (define %standard-phases (delete 'check) ; tests must be run after installation (replace 'install install) (add-after 'install 'precompile precompile) + (add-after 'unpack 'link-depot link-depot) (add-after 'install 'check check) ;; TODO: In the future we could add a "system-image-generation" phase ;; where we use PackageCompiler.jl to speed up package loading times @@ -146,11 +184,12 @@ (define %standard-phases (delete 'patch-usr-bin-file) (delete 'build))) -(define* (julia-build #:key inputs julia-package-name +(define* (julia-build #:key inputs julia-package-name julia-package-uuid (phases %standard-phases) #:allow-other-keys #:rest args) "Build the given Julia package, applying all of PHASES in order." (apply gnu:gnu-build #:inputs inputs #:phases phases #:julia-package-name julia-package-name + #:julia-package-uuid julia-package-uuid args)) -- 2.33.1