From patchwork Sat Nov 20 07:54:47 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: 34702 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 0AB5027BBE3; Sat, 20 Nov 2021 08:14:15 +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 7C1C027BBE1 for ; Sat, 20 Nov 2021 08:14:14 +0000 (GMT) Received: from localhost ([::1]:59420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moLVl-00025V-Dn for patchwork@mira.cbaines.net; Sat, 20 Nov 2021 03:14:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moLVb-00025G-K1 for guix-patches@gnu.org; Sat, 20 Nov 2021 03:14:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moLVb-0000Ey-Bt for guix-patches@gnu.org; Sat, 20 Nov 2021 03:14:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moLVa-000654-QE for guix-patches@gnu.org; Sat, 20 Nov 2021 03:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51996] [PATCH] gnu: Add xfoil. Resent-From: Foo Chuan Wei Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Nov 2021 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51996 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51996@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163739603423349 (code B ref -1); Sat, 20 Nov 2021 08:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Nov 2021 08:13:54 +0000 Received: from localhost ([127.0.0.1]:41578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moLVL-00064M-5B for submit@debbugs.gnu.org; Sat, 20 Nov 2021 03:13:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:32820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moLVH-00064D-Cs for submit@debbugs.gnu.org; Sat, 20 Nov 2021 03:13:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moLVH-00023b-8d for guix-patches@gnu.org; Sat, 20 Nov 2021 03:13:43 -0500 Received: from [2a01:111:f400:feab::80b] (port=53206 helo=APC01-SG2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moLVE-00086e-HV for guix-patches@gnu.org; Sat, 20 Nov 2021 03:13:43 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=igUxCs4Xbwcc8jOK+LarIH5zKH6YfDKeZD9GT7+ewe1YyXlVYfgq/pvWu8rz2/UpYIbS3/exBhhAG+9ZQP5yqWnuNpnnKiQKLY9CGC0fmZIBKLplXqflg3ZA7gUck1kuSC6jv3s4nc10lyDRahjB2yCVDlQn6zlyaSRz8/28/nglD3kiriGgW95HlltpSib3f173AFlxcIM9aW5aswviUwtJKz40tWb5mcghJ+ykIwA7Oq4KRv/1ilVNMRxKRhHvPmF3IBLUzgjfvVgj/XrQMhTIQkGQpEXP7BZGEA2MaauGMgLwwKA0YNyufuXXMXEeSAKY7USBhiL0nFYnXzZ61g== 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=OziheuPCKnyM5nlMw+I4U7XRfpmUrXGfjr2VhywGvnc=; b=DygwdqxqlIz8zJZB5GoVDXbvvhBTHhBSA5LLsy9dpZ6U9SzBVo2QsRUg7ZcjCVRW4SXlNV0v76SXkJH2DxrZyfYMkXYiT2iKbKpPIQAw7WFzsNItkLudajioTGmKthW+Z6WnZHZRZTCfC2Sz27yZ3SD+NjiU8uIyQfTsctDLPqL5oPNFiTOCvIoZe6zrB5XVYsbJaiwjOqEjcBkaPJGhTyJvKB/UDXPPdNloyaoxAdr9mZSTSsH2Z1yslntsV7KtFmIhcSsf7RGaIRLjZNRmNYY2TLmpULfrpdlg1JkuYI1JSuj1XucNZzj4UJak+aTgtL2cA1OcJC4BvH4kco7qZg== 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=OziheuPCKnyM5nlMw+I4U7XRfpmUrXGfjr2VhywGvnc=; b=uMeZ6w+c7fp5PV1OYqMLkuU6tWCcTEhpezhgWGiMIfZBRow3cqQLf1N+ys9jRj5o5/ZV1ctJxXF0vYhCGmBTCjRGCJKtM2SRpU0cBCDnH5C10K0Nj7hrTl3GzRtzdfASo7c4E95pXRLLwmf15b/szD+6TAzNrIsTbQmnoUTTrfGkQhsPa0roNO5G7VXZWKKI+kmpoqmfdZczStZmuCqudSrdDmkpNVtlC0njOjAb9nxkrnqUxdJRdMLTbh1Xh+BOBqzEFcXKH6roKjV3pozOJnQh0Fj2Fq9upSSMDEwV20tw7O244njBIA2lM0RPRknUf/PD25WfNMtEHdyVSu5gcQ== Received: from PU1PR01MB2155.apcprd01.prod.exchangelabs.com (2603:1096:803:1c::21) by PSBPR01MB3766.apcprd01.prod.exchangelabs.com (2603:1096:301:e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21; Sat, 20 Nov 2021 08:08:30 +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; Sat, 20 Nov 2021 08:08:28 +0000 Date: Sat, 20 Nov 2021 07:54:47 +0000 From: Foo Chuan Wei Message-ID: Mail-Followup-To: guix-patches@gnu.org Content-Disposition: inline X-TMN: [xHFc66+k3pT5KI9wrbqnGj874C91jbQK] X-ClientProxiedBy: HK2PR04CA0059.apcprd04.prod.outlook.com (2603:1096:202:14::27) To PU1PR01MB2155.apcprd01.prod.exchangelabs.com (2603:1096:803:1c::21) X-Microsoft-Original-Message-ID: <20211120075447.2gowe5ln52mjwf5x@main> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from main (61.6.253.166) by HK2PR04CA0059.apcprd04.prod.outlook.com (2603:1096:202:14::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Sat, 20 Nov 2021 08:08:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73b749db-f988-40d9-9082-08d9abfceec2 X-MS-TrafficTypeDiagnostic: PSBPR01MB3766: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SaENnN+RU3eblCwIaFvoWfnlFMxUwYrav8kDlC0bTfBUpikn4SE0c5ttEotDzHD0OqF152IE/ALYnJ3l0GIvCwSctxm68Z6jzi1mfVgOSyT8lkjvv30XrzAf4x/+KP103bkshW75wgYPRNPgl1AxZaQ2pb5riAFoP3v1BG3DAv5V91qawdEND46MgXX2g1CsnoW97v8hUT+nNKRY2ORV0iIi3epzEpzuJ9qpqp0QKyRet4+zHP7VYbocejKSXS95zjnhQ1vlHHLDtsNlIdNrmHJ5+Tqjl5LxqecvawUG0s6XRvn8D/q/mUxHFhEKrYDT+e3xPNURrVSZ4nzP+b1JPDeWmLmz4bywVSQNicTmA3lLY71hrXaAKuo+X5cQAOMHKTMsif6iTl0EtrhSqdWx+FgK3yVMJJc1xSsF4HgexPeM5y9Q+S7c9FxEHAhruQUAlXdXuG0txWjUp9G8Q6rGLGhFWSBer1Nn7Fq0v+2Z4zctd2rOLhf7/rSxd5G1gVMLr1A0susVr3p17Yo0JuCdXnVG5uPiG2Gj+vb9mM9vfh4I0XPJGen6yf8fL6ZPOA0uWaQGtFm7y/LnGCmcyx7mvnPUGwkNnpQScZF0E8+E7FLtT3kGxmFKbojmduuBjUuO9sBXZ1d1Swv71cd1Q8cE5rh2mwIqS4eS4S4M8vHcmJI= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AQ7VQbpP5z/CgjyaILOz5XNPLsIXSQgtUnWfTS7C6v0oyaX7G+AcP0J+2FOePSEJCH7cXcNzV58t0QazZT0JXq794kipI6fogskIPi8GUAVECH/dV6q096GasXdHU9ntG39tqC49d+g5I+MnyeX8sDeHeb+Uq3jow5xAVF3ZYDbDmxhnbbEE7PiUX1B5fO+5H1cYa0fy49XCG1CPtXSGny1SvcQP5NeSwErLd53D7Jj4F6YjGret9REbETbInAHWYImBNGV1c77Z59ODVxBohAnfArzQJxume0YL0bxYjDBJdnMaJC4ZEU8sB4uT8hIloo6JgEgkewipZ3A3WLXkObCZx6/weXkQYF/2pCXYa9Gw+67xzDn/KPde6nzUBxi2bJBN6dD9YUUS1dJKph4CoJvpVBaWKDq8GioJ12JVkOij3rlVBTwClCYSzoGyivt3TVjF3SG1qBeFzKEtmnJ0v4pqgbJ52nvPWpNerVs9Fyvwj7C6z3asaDMjAJtkqFxvHeU6WTmyUjHjx8zUPeJ0H+8S7lAQlMKmExLCCEQ/pYw12r8oLdxjq9DGFZM1YM7jhOISz3UVmhN/pj5Efrt2O2Vq5FFzpX/jL8NEe165HCRi17OnL3CCqqAhhO7s1g1B6HVMFDoINdHzUeTs0sqa9h/1g/FB31KObBddf891vbUhPX1egxZnkVJpboBIuwpp X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-5c337.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 73b749db-f988-40d9-9082-08d9abfceec2 X-MS-Exchange-CrossTenant-AuthSource: PU1PR01MB2155.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2021 08:08:28.1569 (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: PSBPR01MB3766 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:111:f400:feab::80b (failed) Received-SPF: pass client-ip=2a01:111:f400:feab::80b; envelope-from=chuanwei.foo@hotmail.com; helo=APC01-SG2-obe.outbound.protection.outlook.com X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URI_DOTEDU=1.997 autolearn=no autolearn_force=no X-Spam_action: no action 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. --- gnu/packages/engineering.scm | 97 ++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) base-commit: 70a88dac11d3cb47c1058ed65d3970fe27517c77 diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 50f265f085..d933dffe6e 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,102 @@ 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)) + (native-inputs + `(("gfortran" ,gfortran) + ("libx11" ,libx11))) + (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")