From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +JQRFtCZ/mbIfgAAqHPOHw:P1 (envelope-from ) for ; Thu, 03 Oct 2024 13:19:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +JQRFtCZ/mbIfgAAqHPOHw (envelope-from ) for ; Thu, 03 Oct 2024 15:19:12 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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=1727961552; a=rsa-sha256; cv=none; b=h9avOUUlk8G643RMbHcTmEB8hVnbfjRFaZWfUliVa69I6oJ+IY+lRpEBFL0K3Qa802ckVY FORtS3eFYMy3FL7a3j3RbrIYmdfIjJFys2lZJ/iS7qx2/9fZ/UTwEsz8TVsIuJHcruxAMo 4lXtkSijVO3uV6b9O5FklQ8bTfvve/YDB1Uz10k0o/qWOFADSYiRXAEdaGs828WcH4sK8r 7bLy3nlHZbf9iobTAiuiQSDHKpQeLr2T721KgNkx8PAAFycBKGO60MwZsSt2GEiReydux6 9OMhU0EJXcQsab7py8z5hCiGDvOmqtRftrjSBmCmcQ9fOYqCBDcDZ7djvez1+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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=1727961552; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=Q5dqxj6LkAVeTdD5yor8oWHBHpd7rq2DYf+K3IGITC8=; b=Bp/DUi39XAj3Q3fxdUCKjZT8l4iKw1Gb5HU9fUFniK1tB+UX5PWIYr9Ftjn8RH+9kCCxY4 HOfrhcfxUUBBmPfJ20kcjgChH8l/injAq4u7HPSp3qmgBNCYvCRd8ix68dCE7dHcbOLgTI 5gzs6XdidjRUX9fjxiuuC1gnFlTodMJ1SmF/8ZM/mYH/XAy/3og8jXMTkqpgqGAr4kxCuw WeecFz3zI8PvG0DCT2HIg8acRd2OPchPsHB9eMN0vjKGLELOZMnxZ3aLznesjTdKGVlEmg YwfgIDQlgKaAymCokkSRd7FnYi+/dXXjBsmRSmVuIveE8DWau2+KSqWv4ZrTeQ== 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 033A763933 for ; Thu, 03 Oct 2024 15:19:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swLj3-000772-50; Thu, 03 Oct 2024 09:18:37 -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 1swLiz-00076i-Ge for help-guix@gnu.org; Thu, 03 Oct 2024 09:18:33 -0400 Received: from hera.aquilenet.fr ([2a0c:e300::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swLix-0004l2-RQ for help-guix@gnu.org; Thu, 03 Oct 2024 09:18:33 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8AA53E09; Thu, 3 Oct 2024 15:18:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f5KdhtfiNW_G; Thu, 3 Oct 2024 15:18:13 +0200 (CEST) Received: from jurong (sauterelle.math.u-bordeaux1.fr [147.210.16.128]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D423531F; Thu, 3 Oct 2024 15:18:12 +0200 (CEST) Date: Thu, 3 Oct 2024 15:18:07 +0200 From: Andreas Enge To: Aristide Doussot Cc: help-guix@gnu.org Subject: Re: Add path to a guix package into CMakeLists.txt Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=2a0c:e300::1; envelope-from=andreas@enge.fr; helo=hera.aquilenet.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 0.92 X-Spam-Score: 0.92 X-Migadu-Queue-Id: 033A763933 X-Migadu-Scanner: mx12.migadu.com X-TUID: bpIEJkOypkFf Hello Aristide, Am Mon, Sep 30, 2024 at 05:44:26PM +0200 schrieb Aristide Doussot: > into the already installed guix version of aocommon, in my case it would be > "include_directories(/gnu/store/1wiw8m5yjcr26pcqhzbh7bw5ghvbaw90-aocommon-0.0.0-1.7329a07/include/)" > However I don't think other users installing the package would mandatorily > have "/gnu/store/1wiw8m5yjcr26pcqhzbh7bw5ghvbaw90-aocommon-0.0.0-1.7329a07" > as their path to their installed guix version of aocommon. My question is > therefore : is there a way to ask guix to find this path based on the name > of the dependency and use it in my substitute* command on the CMakeLists > file ? this is indeed quite a common action. For instance, I do something like this in the package vinci in gnu/packages/maths.scm: (modify-phases %standard-phases (replace 'configure ;; register the lrs location in the config file (lambda* (#:key inputs #:allow-other-keys) (let* ((lrs (assoc-ref inputs "lrslib")) (lrsexec (string-append lrs "/bin/lrs"))) (substitute* "vinci.h" (("#define LRS_EXEC \"lrs\"") (string-append "#define LRS_EXEC \"" lrsexec "\"")))) #t)) So the function defining the phase needs to take the keyword parameter "inputs", and this is set to the inputs of the package. Then (assoc-ref inputs "lrslib") resolves to /gnu/store/...-lrslib-..., the store path corresponding to the input package. However, this is an "old style" package; for instance, phases do not end with #t anymore. I do not know whether one would do differently with the modern gexp style approach. In any case, I hope you can already continue in this direction. Andreas