GNU bug report logs - #51996
[PATCH] gnu: Add xfoil.

Previous Next

Package: guix-patches;

Reported by: Foo Chuan Wei <chuanwei.foo <at> hotmail.com>

Date: Sat, 20 Nov 2021 08:14:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51996 in the body.
You can then email your comments to 51996 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#51996; Package guix-patches. (Sat, 20 Nov 2021 08:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Foo Chuan Wei <chuanwei.foo <at> hotmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 20 Nov 2021 08:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Foo Chuan Wei <chuanwei.foo <at> hotmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add xfoil.
Date: Sat, 20 Nov 2021 07:54:47 +0000
* gnu/packages/engineering.scm (xfoil): New variable.
---
 gnu/packages/engineering.scm | 97 ++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

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 <gerd.heber <at> gmail.com>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich <at> spbu.ru>
+;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo <at> hotmail.com>
 ;;;
 ;;; 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")

base-commit: 70a88dac11d3cb47c1058ed65d3970fe27517c77
-- 
2.25.1





Information forwarded to guix-patches <at> gnu.org:
bug#51996; Package guix-patches. (Sun, 21 Nov 2021 10:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 51996 <at> debbugs.gnu.org (full text, mbox):

From: Foo Chuan Wei <chuanwei.foo <at> hotmail.com>
To: 51996 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: Add xfoil.
Date: Sun, 21 Nov 2021 10:40:50 +0000
* 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(+)

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 <gerd.heber <at> gmail.com>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich <at> spbu.ru>
+;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo <at> hotmail.com>
 ;;;
 ;;; 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")

base-commit: 9bfbba8af5b7efb952292c8b7d5e9ee57300c2bc
-- 
2.25.1





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 18 Dec 2021 19:05:02 GMT) Full text and rfc822 format available.

Notification sent to Foo Chuan Wei <chuanwei.foo <at> hotmail.com>:
bug acknowledged by developer. (Sat, 18 Dec 2021 19:05:02 GMT) Full text and rfc822 format available.

Message #13 received at 51996-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Foo Chuan Wei <chuanwei.foo <at> hotmail.com>
Cc: 51996-done <at> debbugs.gnu.org
Subject: Re: bug#51996: [PATCH] gnu: Add xfoil.
Date: Sat, 18 Dec 2021 20:04:48 +0100
[Message part 1 (text/plain, inline)]
Hi,

Foo Chuan Wei <chuanwei.foo <at> hotmail.com> skribis:

> * gnu/packages/engineering.scm (xfoil): New variable.

Applied with the changes below.

Thanks!

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 42f5544a54..e0fe0f354f 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2961,6 +2961,10 @@ (define-public xfoil
              (with-directory-excursion "orrs"
                (invoke "bin/osgen" "osmaps_ns.lst"))
              (invoke "make" "-C" "plotlib")
+             (substitute* "bin/Makefile_gfortran"
+               (("^FFLAGS =(.*)$" _ suffix)
+                (string-append "FFLAGS = -fallow-argument-mismatch "
+                               suffix "\n")))
              (invoke "make" "-C" "bin" "-f" "Makefile_gfortran")))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
@@ -2976,9 +2980,9 @@ (define-public xfoil
                (install-file "xfoil_doc.txt" doc-dir)))))
        #:tests? #f))
     (inputs
-     `(("libx11" ,libx11)))
+     (list libx11))
     (native-inputs
-     `(("gfortran" ,gfortran)))
+     (list gfortran))
     (home-page "https://web.mit.edu/drela/Public/web/xfoil/")
     (synopsis "Program for the design and analysis of subsonic airfoils")
     (description

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 16 Jan 2022 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.