From patchwork Sun Nov 21 10:40:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Foo Chuan Wei X-Patchwork-Id: 34717 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 18B3327BBE3; Sun, 21 Nov 2021 10:42:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8A6EB27BBE1 for ; Sun, 21 Nov 2021 10:42:16 +0000 (GMT) Received: from localhost ([::1]:47276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mokIZ-0002Gk-P7 for patchwork@mira.cbaines.net; Sun, 21 Nov 2021 05:42:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mokIN-0002GZ-Ls for guix-patches@gnu.org; Sun, 21 Nov 2021 05:42:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mokIM-0001Md-0j for guix-patches@gnu.org; Sun, 21 Nov 2021 05:42:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mokIL-00032C-U1 for guix-patches@gnu.org; Sun, 21 Nov 2021 05:42:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51996] [PATCH v2] gnu: Add xfoil. References: In-Reply-To: Resent-From: Foo Chuan Wei Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 21 Nov 2021 10:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51996 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51996@debbugs.gnu.org Received: via spool by 51996-submit@debbugs.gnu.org id=B51996.163749126311584 (code B ref 51996); Sun, 21 Nov 2021 10:42:01 +0000 Received: (at 51996) by debbugs.gnu.org; 21 Nov 2021 10:41:03 +0000 Received: from localhost ([127.0.0.1]:44311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mokHO-00030m-Q2 for submit@debbugs.gnu.org; Sun, 21 Nov 2021 05:41:03 -0500 Received: from mail-oln040092255028.outbound.protection.outlook.com ([40.92.255.28]:3776 helo=APC01-HK2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mokHN-00030A-Al for 51996@debbugs.gnu.org; Sun, 21 Nov 2021 05:41:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SRwVnCH3H5eGp5VzGd8mu9RRSEhqMKSbsJ9nqjkMCTblnhqmy6bBO266mGnwZm9X+5W/Uhdlur1BF8stmKMte1lF+sLwV4rHDfT2e5lGhAy6B7C8UGpo6n9tuuEJAUfvvVUuLTAwB1U3XZqutwAE3ZdKkvYw8wGjVfzGPTlz1bo6ZokmVv8grqxdzG6zF7wzhYGJPXNfNZN6YQTJ9DI6GjnkUHB6wpWM5RGZW95YtrOSWnHWwZolX8KxEDuHH7XX5bvma/2Be8OnCTEC9hfm03lpd7XzwAHku7jv7+j/NgF9jtHDkto43RjLDug0JZTdGDlmOubYWTtAtI7wRxhYsg== 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=eg9fDUqk8rbGIW6xcpYV7c1Jnz67E6+qaQ8m1qi7aCs=; b=cAY6QVTVjH0UKaMEfuMPfh4ejtLcajjBVXL0pqRennpTAGm+etkEnh9Iiy9QfQBKvXi/vIefn5vx0fX4Qm2WpldD038+O6To36h87ZqejL/zdBe7WjjiBdCMqbLDj66Dg4KDxDtEPivTNyZgkJif/+Jwjb4V+1eg4LFauNzjvBE8pYImKpcnOIdQtfpOGwkTzUbBnVtLfiaH9Vmayr6RjD0ruq8mqMqFANA2FkL+j7Ri75UuZqyBiA7SGbiCXKc0cFzfy52PT1QRbU+0/tv+cuxLwQYjlxqrHKxSUVihVMfS0YZrw38ye2x2oj6RQZ21PlKCQDe1DI1vWi1fFj4LJg== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eg9fDUqk8rbGIW6xcpYV7c1Jnz67E6+qaQ8m1qi7aCs=; b=P/PPHoINkG5UakIT0Du9qYKq4nKymtYCORYHkjYPPKKi8yqIjc1ooPCQ/X6awKkJYZGzXkrq4Uw6RhVnfKHIrK75JmHWKy8w8MmzHUso9vg5BtcS1gJPQE70ZTy8ruNdpyKy30myEKt5ZLp3mbC7r4AHhXB3l8uiBkl6Y1ADX+uMbOABwHEEocwJQwNqaP7Qt1mK96QzvCOPxYk8zl1Wt1dUb0mUtgOpqtAOVX2wZeIHxqKnSEnIByQluJxzP5w+v6jJJkwP0c9MKbNATZmqOkTuCnwuXRwXvQwEbZFeQvUphT7bufmdH+GU24Gc3wPM/3T/2dpkj+NluKqlcYgv2A== Received: from PU1PR01MB2155.apcprd01.prod.exchangelabs.com (2603:1096:803:1c::21) by PS2PR01MB2279.apcprd01.prod.exchangelabs.com (2603:1096:300:3c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21; Sun, 21 Nov 2021 10:40:53 +0000 Received: from PU1PR01MB2155.apcprd01.prod.exchangelabs.com ([fe80::258d:e124:fd3a:40ee]) by PU1PR01MB2155.apcprd01.prod.exchangelabs.com ([fe80::258d:e124:fd3a:40ee%7]) with mapi id 15.20.4713.024; Sun, 21 Nov 2021 10:40:53 +0000 Date: Sun, 21 Nov 2021 10:40:50 +0000 From: Foo Chuan Wei Message-ID: Content-Disposition: inline X-TMN: [4l5/8UVoiyQDUypC+PHxyur4IQaalDsGRTUfQVqXbak=] X-ClientProxiedBy: HK2PR03CA0045.apcprd03.prod.outlook.com (2603:1096:202:17::15) To PU1PR01MB2155.apcprd01.prod.exchangelabs.com (2603:1096:803:1c::21) X-Microsoft-Original-Message-ID: <20211121104050.metx4w3olpjsfqbs@main> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from main (118.103.255.110) by HK2PR03CA0045.apcprd03.prod.outlook.com (2603:1096:202:17::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.11 via Frontend Transport; Sun, 21 Nov 2021 10:40:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 51255121-d6c2-4469-62c2-08d9acdb6480 X-MS-TrafficTypeDiagnostic: PS2PR01MB2279: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xDp48HgX4wyALEwavX8JxT6Gh6RseGw9/NC8gCp3yJD+IyeEpWtSNdnuSrCVfI7R3QRRcZ66Q+MyjSzXH4UHAqRj+SziSaqFwIn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LiHUgF9HIp+Fzlmsa6RLxQHRsFuBLlkS71X7G3Bsdmw+ETzY8NwPOsShjnC+MP0ag3wkwNnBUp441vsORDs2qw8nsNyZ9HZIOKFZRRZeKjbALuRd5fuF8lJW8kFLQTfmWsAnDApioUbBSs2bh73e0YvkxnFwFJhPYzT+UICNsS+dytkBNlumQCf00dgUTQb/vLqRmNY1JyOko57G+7BT3iG+ET/N3FgEHHT5SsLHFWe5EkUovP26BgY666Imri6hgLr0IA== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-5c337.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 51255121-d6c2-4469-62c2-08d9acdb6480 X-MS-Exchange-CrossTenant-AuthSource: PU1PR01MB2155.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2021 10:40:53.5515 (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: PS2PR01MB2279 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/engineering.scm (xfoil): New variable. --- Changes relative to PATCH v1: * Move libx11 from native-inputs to inputs. gnu/packages/engineering.scm | 98 ++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) base-commit: 9bfbba8af5b7efb952292c8b7d5e9ee57300c2bc diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 50f265f085..fdbbf2edf7 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -25,6 +25,7 @@ ;;; Copyright © 2021 Gerd Heber ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 Ivan Gankevich +;;; Copyright © 2021 Foo Chuan Wei ;;; ;;; This file is part of GNU Guix. ;;; @@ -2847,6 +2848,103 @@ hot-patching the machine code of the standard C library in the memory of a process.") (license license:bsd-2)))) +(define-public xfoil + (package + (name "xfoil") + (version "6.99") + (source + (origin + (method url-fetch) + (uri (string-append "https://web.mit.edu/drela/Public/web/xfoil/xfoil" + version ".tgz")) + (sha256 + (base32 + "0h5y5v0qlyvi4qc943x394npz4779i8f52iksxshxkjj7xj500jw")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'edit-files + (lambda* (#:key outputs #:allow-other-keys) + ;; The instructions in orrs/README say that orrs/bin/osmap.f + ;; should be edited, but that file is never used by XFOIL. + ;; Instead, it is osrc/osmap.f that is used. + (substitute* "osrc/osmap.f" + (("^[ ]{6}DATA OSFILE / '/var/local/codes/orrs/osmap.dat' /") + (let ((replacement (string-append (make-string 6 #\space) + "DATA OSFILE / '" + (assoc-ref outputs "out") + "/share/xfoil/osmap.dat' /"))) + ;; In fixed form Fortran, lines cannot exceed 72 columns. + ;; The Guix store path exceeds this limit. + (string-append + (substring replacement 0 72) "\n" + (make-string 5 #\space) "&" (substring replacement 72))))) + (substitute* "orrs/bin/Makefile_DP" + (("^FC = ifort") + "FC = gfortran") + (("^FLG = -O -r8") + "FLG = -O2 -fdefault-real-8")) + (substitute* "plotlib/Makefile" + (("^include ./config.make") + "include ./config.make.gfortranDP")) + (substitute* "bin/Makefile_gfortran" + (("^BINDIR = /home/codes/bin/") + (string-append "BINDIR = " (assoc-ref outputs "out") "/bin")) + (("^CC = cc") + "CC = gcc") + (("^CFLAGS = -O -DUNDERSCORE") + "CFLAGS = -O2 -DUNDERSCORE") + (("^FFLAGS = -O \\$\\(CHK\\) \\$\\(DBL\\)") + "FFLAGS = -O2 $(CHK) $(DBL)") + (("^FFLOPT = -O \\$\\(CHK\\) \\$\\(DBL\\)") + "FFLOPT = -O2 $(CHK) $(DBL)") + ;; Separate the build stage from the install stage. + (("\\$\\(INSTALLCMD\\) xfoil \\$\\(BINDIR\\)") "") + (("\\$\\(INSTALLCMD\\) pxplot \\$\\(BINDIR\\)") "") + (("\\$\\(INSTALLCMD\\) pplot \\$\\(BINDIR\\)") "")))) + (replace 'build + (lambda _ + (invoke "make" "-C" "orrs/bin" "-f" "Makefile_DP" "osgen") + (with-directory-excursion "orrs" + (invoke "bin/osgen" "osmaps_ns.lst")) + (invoke "make" "-C" "plotlib") + (invoke "make" "-C" "bin" "-f" "Makefile_gfortran"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin-dir (string-append out "/bin")) + (data-dir (string-append out "/share/xfoil")) + (doc-dir (string-append out "/share/doc/xfoil"))) + (mkdir-p bin-dir) + (invoke "make" "-C" "bin" "-f" "Makefile_gfortran" "install") + (mkdir-p data-dir) + (install-file "orrs/osmap.dat" data-dir) + (mkdir-p doc-dir) + (install-file "xfoil_doc.txt" doc-dir))))) + #:tests? #f)) + (inputs + `(("libx11" ,libx11))) + (native-inputs + `(("gfortran" ,gfortran))) + (home-page "https://web.mit.edu/drela/Public/web/xfoil/") + (synopsis "Program for the design and analysis of subsonic airfoils") + (description + "XFOIL is an interactive program for the design and analysis of subsonic +isolated airfoils. It consists of a collection of menu-driven routines which +perform various useful functions such as: +@itemize +@item Viscous (or inviscid) analysis of an existing airfoil +@item Airfoil design and redesign by interactive modification of surface speed + distributions +@item Airfoil redesign by interactive modification of geometric parameters +@item Blending of airfoils +@item Writing and reading of airfoil coordinates and polar save files +@item Plotting of geometry, pressure distributions, and multiple polars +@end itemize") + (license license:gpl2+))) + (define-public libigl (package (name "libigl")