From patchwork Wed May 10 17:46:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Smith X-Patchwork-Id: 49919 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4896C27BBED; Wed, 10 May 2023 18:50:35 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id F194E27BBEC for ; Wed, 10 May 2023 18:50:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwnx4-0005Ob-Hm; Wed, 10 May 2023 13:50:10 -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 1pwnww-0005Nm-KP for guix-patches@gnu.org; Wed, 10 May 2023 13:50:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pwnww-0004di-Ai for guix-patches@gnu.org; Wed, 10 May 2023 13:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwnwv-0005Vm-M0 for guix-patches@gnu.org; Wed, 10 May 2023 13:50:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63422] [PATCH 2/3] gnu: libfive: Add Python bindings. Resent-From: Morgan Smith Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 10 May 2023 17:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63422 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63422@debbugs.gnu.org Received: via spool by 63422-submit@debbugs.gnu.org id=B63422.168374095721117 (code B ref 63422); Wed, 10 May 2023 17:50:01 +0000 Received: (at 63422) by debbugs.gnu.org; 10 May 2023 17:49:17 +0000 Received: from localhost ([127.0.0.1]:48977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwnwC-0005UX-F2 for submit@debbugs.gnu.org; Wed, 10 May 2023 13:49:16 -0400 Received: from mail-mw2nam10olkn2105.outbound.protection.outlook.com ([40.92.42.105]:36426 helo=NAM10-MW2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwnw9-0005UF-Sg for 63422@debbugs.gnu.org; Wed, 10 May 2023 13:49:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sy17WeFFHg1qL2s+RlXBsgbjZQ5kLbZoRtW/xMwPQuV/LBx8fseV8UJvmXWtIsUiGG+T+896GH/kmjrm8VK0Cg5nGPx1k/z0nidPnAsm/fXh3NiBYLqW8fPrvAQ5vP+TjyAhvlY769ePx0lR2gJuRz9H8lAiNuKJXm6pdL3FrTt4Beu2vbWDEQSsUpstaP/AoBJIWRfqBs7DG0LA+stEozoDhQzn1LZ5sREme35Uq3/HA78sPleYl6ixBvZZmuMVX+dfUtQ0n7MFd2qV3pGA+mZE3Qw5Ol6XpB4kezEr/Qu94SIGL3UkElW9cFtLscMSKLd8hwd+EnkcmmRIvobehQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nZb2bwMp9rH8wPqIkhmPcIC5bufs0qMotXqU98zIB+4=; b=lbv/8a9FSzXDii/8vVERvG/psqkG8RETSTRFM4w0SVWxSmR0mfgSlzL7mK/UbH5iM0F5BMZ5j/XxHBBqmrLTASmVrQ+HD4QtgEvHPYqsufgK04XXn/atDYO5UvOgPboGd1RxQzvncoX2l3sgHofxfNUryMlcDlWhINjPDDK18eYalnmXRpIPEHp4rJutcd5PkRhnUM7FkQt7uHnLPgDQ2HsTIo8IhWzGsD7MuaS/9LOvEySmq5ubxAodVXUpsJWXFu0M/WbOkVdBGJtwD31cYzdDzv3PF2dffbquJ3kiFFl+WTKonHLEqRgTYOSb/Ry6FZ1o66XBlDzbiAGAxHOHnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nZb2bwMp9rH8wPqIkhmPcIC5bufs0qMotXqU98zIB+4=; b=rohzFNbUgO2fciSw273hBoDu3YXGcPQTWOxGwHVEcbDfJOsHk4tdzqloHZdAF87vHZRo/REXhdq4EVWdG1RwkEt7bhee4ZtYOGFB5me9emBlQYqIaOVli4TX+XLd+piEy5BeZaUCNdsX7DIunMh7pfduu5eFka6+YFlOYJiy38njA3GYyxxRg/SSaIVpq/7P8+wyYbKxuRPwb8h8hcq3sUAyEDzlveKD3xd0/DfcrHqpEb/yOua7OWhjOoL5uDpqtlwdm/uRtJBl2dCeXrqH2Rzf0dhuF1ZZV2toPyS1FOEDIoD8Mseu06ICo0kMBpja/2ulZccxyskSY91PsgfAjA== Received: from DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) by PH7PR03MB7439.namprd03.prod.outlook.com (2603:10b6:510:2e7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.19; Wed, 10 May 2023 17:49:04 +0000 Received: from DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::9a6e:a037:320a:19c6]) by DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::9a6e:a037:320a:19c6%7]) with mapi id 15.20.6340.030; Wed, 10 May 2023 17:49:04 +0000 From: Morgan Smith Date: Wed, 10 May 2023 13:46:18 -0400 Message-ID: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-TMN: [3P9of95xO6iqtIeJP/AsWqoYjdlVLKNq] X-ClientProxiedBy: YQXPR0101CA0025.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:15::38) To DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) X-Microsoft-Original-Message-ID: <134112746a9a38ad31de2e1b54d7059bf133c1bd.1683740776.git.Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR03MB3163:EE_|PH7PR03MB7439:EE_ X-MS-Office365-Filtering-Correlation-Id: e8a28007-ed77-415b-0ced-08db517ed819 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ef3DkLelojgiUnNeM8kxEc2xhgVgkU7Sutdtu0xhoH6ib+RBwbsOkcRantIatD9u2oEBBk6jCzlDlpMJGilMBoHkMnR8g1zUh/ZNbAuLY2IBOtRmNYnNo3VTl8VdX4tv2pX7c1uyX4/LaMivCMsbKV24zrLI3evZyQN/MjaKpG7Dcoeh2R32j0CEzbnTqE3TuCipGxIdW/NYjta49EwmHFcErRs86egFJZeLJPpRe4eDsX/a9Uqlu6+moSWZG4TU5tIFrQSwwkq8Ky28WNxxLNXumeN7c/j7sTUMb3RS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q0gDK/14vVPFI4R+/bTPaKwmfXXQcprcrpHorDp3iz2DPQXJlhy8BjkgiPRaFdKHObEsysFYVqO5VwuKFEPzoIUrpVAhamBN+12FKSdICGWlmYcCiPBj8LNaIf/Wj+rNj9BlT1CStYEnc6Xd7W4HeIrfoLUW7N7AgVFzFAdUL8Tqiytonbvyq3i/Utn7pb8jTU8WN0WJOknOUZ6gufR9aVxIUdN7IbI8/vHMYh8i1DwxQRhtKHq48gbIoHy+eWNb6EcbpHqgrWECesdq8yjoFLRjslnjwTh5P4R7RucPz4EFhwmrM0GqtNkQTUxt+U87i0ajNQ+cKDBZ1oY9QDfeNlo0/fupA3scUiFZE0dv5AtG5uW6aZO+1MdTWCFfGp9kT5rysqSzzAcNhhiVaMH86P56jVBO7ksU5/91QYveEf7ePxwtqdGeKuhrpGarfdwzaCXHp4rQL4rS1W/cecRkBLAToQ4= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8a28007-ed77-415b-0ced-08db517ed819 X-MS-Exchange-CrossTenant-AuthSource: DM5PR03MB3163.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2023 17:49:04.0951 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB7439 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/engineering.scm (libfive) [configure-flags]: Add python site-dir. [phases]: Fix for python as well. : Wrap for python as well. [inputs]: Add python-wrapper. Alphabetize. [description]: Add python. --- gnu/packages/engineering.scm | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 1f7fdf942f..be7e235fcc 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -914,6 +914,14 @@ (define-public libfive ((guix build guile-build-system) #:prefix guile:) (guix build utils)) #:test-target "libfive-test" + #:configure-flags #~(list + (string-append + "-DPYTHON_SITE_PACKAGES_DIR=" + #$output "/lib/python" + #$(version-major+minor + (package-version + (this-package-input "python-wrapper"))) + "/site-packages")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'remove-native-compilation @@ -929,7 +937,10 @@ (define-public libfive (("\\(get-environment-variable \"LIBFIVE_FRAMEWORK_DIR\"\\)" m) (string-append m "\n\"" #$output "/lib/\"")) (("\\(get-environment-variable \"LIBFIVE_STDLIB_DIR\"\\)" m) - (string-append m "\n\"" #$output "/lib/\""))))) + (string-append m "\n\"" #$output "/lib/\""))) + (substitute* "libfive/bind/python/libfive/ffi.py" + (("os.environ.get\\('LIBFIVE_FRAMEWORK_DIR'\\)" m) + (string-append m " or \"" #$output "/lib/\""))))) (add-after 'unpack 'do-not-build-guile-bindings (lambda _ (delete-file "libfive/bind/guile/CMakeLists.txt") @@ -948,22 +959,28 @@ (define-public libfive (scm (string-append #$output "/share/guile/site/" effective-version)) (go (string-append #$output "/lib/guile/" - effective-version "/site-ccache"))) + effective-version "/site-ccache")) + (py (string-append #$output "/lib/python" + #$(version-major+minor + (package-version + (this-package-input "python-wrapper"))) + "/site-packages"))) (wrap-program (string-append #$output "/bin/Studio") `("GUILE_LOAD_PATH" ":" prefix (,scm)) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go))))))))) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go)) + `("GUIX_PYTHONPATH" ":" prefix (,py))))))))) (native-inputs (list pkg-config)) (inputs - (list boost libpng qtbase eigen guile-3.0 bash-minimal)) + (list bash-minimal boost eigen guile-3.0 libpng python-wrapper qtbase)) (home-page "https://libfive.com") (synopsis "Tool for programmatic computer-aided design") (description "Libfive is a tool for programmatic computer-aided design (CAD). In -libfive, solid models are defined as Scheme scripts, and there are no opaque -function calls into the geometry kernel: everything is visible to the user. -Even fundamental, primitive shapes are represented as code in the user-level -language.") +libfive, solid models are defined as Scheme or Python scripts, and there are +no opaque function calls into the geometry kernel: everything is visible to +the user. Even fundamental, primitive shapes are represented as code in the +user-level language.") (license (list license:mpl2.0 ;library license:gpl2+)) ;Guile bindings and GUI