unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Paul A. Patience" <paul@apatience.com>
To: "55819@debbugs.gnu.org" <55819@debbugs.gnu.org>
Subject: [bug#55819] [PATCH v3] gnu: Add f3d.
Date: Thu, 14 Jul 2022 17:06:31 +0000	[thread overview]
Message-ID: <FA5kZUe4R1C6dhGsdUQN1WONrIwssPQyO7IW3nAgitOqPoJGoX4ee5zcCXKsH3ZvXFMLtHejIUuMls9cHbvf986lHM4ZXTvoADxH4QVXZMc=@apatience.com> (raw)
In-Reply-To: <20220606105824.901227-1-paul@apatience.com>

[-- Attachment #1: Type: text/plain, Size: 31 bytes --]

Updated to the latest commit.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-vtk-Enable-the-RenderingExternal-module.patch --]
[-- Type: text/x-patch; name=0001-gnu-vtk-Enable-the-RenderingExternal-module.patch, Size: 1111 bytes --]

From 588a8323e624caf46a94cf2eebf77dc3f5e16cec Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul@apatience.com>
Date: Mon, 6 Jun 2022 06:29:18 -0400
Subject: [PATCH v3 1/2] gnu: vtk: Enable the RenderingExternal module.

* gnu/packages/image-processing.scm (vtk)[arguments]<#:configure-flags>:
Add -DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES.
---
 gnu/packages/image-processing.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index bcb1d7a2f6..ccf9ac1b00 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -358,6 +358,7 @@ (define-public vtk
                            "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
                            "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
                            "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"
+                           "-DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES" ; For F3D
                            "-DVTK_WRAP_PYTHON=ON"
                            "-DVTK_PYTHON_VERSION:STRING=3"
                            )
-- 
2.36.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-f3d.patch --]
[-- Type: text/x-patch; name=0002-gnu-Add-f3d.patch, Size: 5810 bytes --]

From f80bd6d46185b544271154a83ca42056f4e4f7ad Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul@apatience.com>
Date: Mon, 6 Jun 2022 06:33:27 -0400
Subject: [PATCH v3 2/2] gnu: Add f3d.

* gnu/packages/graphics.scm (f3d): New variable.
---
 gnu/packages/graphics.scm | 110 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index c193be1efb..0ccb79e665 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -31,6 +31,7 @@
 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
+;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2120,3 +2121,112 @@ (define-public azpainter
 @end itemize
 ")
     (license license:gpl3+)))
+
+(define-public f3d
+  ;; There have been many improvements since the last tagged version (1.2.1,
+  ;; released in December 2021), including support for the Alembic file
+  ;; format.
+  (let ((commit "9cc79b65ed750b178f58012dbba091aa24722dab")
+        (revision "0"))
+    (package
+      (name "f3d")
+      (version (git-version "1.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/f3d-app/f3d")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "041gqi2wfny2br4j68vhifg0bd18kbl0qsaallkz7yywk47njxfi"))))
+      (build-system cmake-build-system)
+      (arguments
+       (list
+        ;; Many tests require files supplied by git-lfs.
+        ;; Also, some tests segfault (after an exception?) but the tested
+        ;; behavior, i.e., when the program is run manually, does not (for
+        ;; example, TestNonExistentConfigFile and TestInvalidConfigFile).
+        ;; Upstream is aware of occasionally flaky tests (see
+        ;; https://github.com/f3d-app/f3d/issues/92) but the tests run in CI
+        ;; seem to be passing.
+        ;; Anyway, the program runs and is able to open at least STL files
+        ;; without issue.
+        #:tests? #f
+        #:configure-flags
+        #~(list "-DBUILD_TESTING=OFF"
+                "-DF3D_MODULE_ALEMBIC=ON"
+                "-DF3D_MODULE_ASSIMP=ON"
+                "-DF3D_MODULE_OCCT=ON"
+                ;; Prefer Guix's versioned documentation directory to F3D's
+                ;; unversioned one.
+                (string-append "-DCMAKE_INSTALL_DOCDIR=" #$output
+                               "/share/doc/" #$name "-" #$version))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'adjust-titles-and-descriptions
+              (lambda _
+                (substitute* '("CMakeLists.txt"
+                               "resources/f3d.desktop.in"
+                               "resources/io.github.f3d_app.f3d.metainfo.xml")
+                  (("A fast and minimalist 3D viewer")
+                   "Fast and minimalistic 3D viewer"))
+                (substitute* "resources/io.github.f3d_app.f3d.metainfo.xml"
+                  (("it is minimalist,")
+                   "it is minimalistic,")
+                  (("arguments in the command line\\.")
+                   "arguments on the command line."))
+                ;; Keep the title bar short.
+                (substitute* "application/F3DConfig.h.in"
+                  (("AppTitle = \"@PROJECT_DESCRIPTION@\";")
+                   "AppTitle = \"F3D\";"))))
+            (add-after 'unpack 'fix-typos
+              (lambda _
+                (substitute* '("application/F3DOptionsParser.cxx"
+                               "application/F3DStarter.cxx"
+                               "cmake/testing.cmake"
+                               "library/testing/TestSDKHelpers.h")
+                  (("does not exists")
+                   "does not exist"))))
+            ;; Skip checking for the relative-to-executable configuration file
+            ;; (located in ../../argv[0]) when the user configuration file
+            ;; doesn't exist, because the check fails and prints a warning
+            ;; message upon each invocation of the program.
+            ;; Besides, the usefulness of this configuration file is unclear
+            ;; because F3D reads /etc/f3d/config.json as a fallback system
+            ;; configuration file.
+            (add-after 'unpack 'ignore-binary-config-file-dir
+              (lambda _
+                (substitute* "application/F3DOptionsParser.cxx"
+                  (("^ +filePath = .*->GetBinaryConfigFileDirectory\\(\\) .*")
+                   "")))))))
+      (inputs
+       (list alembic
+             assimp
+             double-conversion
+             eigen
+             expat
+             fontconfig
+             freetype
+             glew
+             hdf5
+             imath
+             jsoncpp
+             libjpeg-turbo
+             libpng
+             libtiff
+             libx11
+             lz4
+             netcdf
+             opencascade-occt
+             vtk
+             zlib))
+      (home-page "https://f3d-app.github.io/f3d/")
+      (synopsis "Fast and minimalistic 3D viewer")
+      (description "F3D (pronounced @samp{/fɛd/}) is a VTK-based 3D viewer
+following the KISS principle, so it is minimalistic, efficient, has no GUI,
+has simple interaction mechanisms and is fully controllable using arguments on
+the command line.  It supports a range of file formats (including animated
+glTF, STL, STEP, PLY, OBJ, FBX), and provides numerous rendering and texturing
+options.")
+      (license license:bsd-3))))
-- 
2.36.1


  parent reply	other threads:[~2022-07-14 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 10:58 [bug#55819] [PATCH 0/2] gnu: Add f3d Paul A. Patience
2022-06-06 11:01 ` [bug#55819] [PATCH 1/2] gnu: vtk: Enable the RenderingExternal module Paul A. Patience
2022-06-06 11:01   ` [bug#55819] [PATCH 2/2] gnu: Add f3d Paul A. Patience
2022-06-06 19:57 ` [bug#55819] [PATCH v2 0/2] " Paul A. Patience
2022-06-06 19:57   ` [bug#55819] [PATCH v2 1/2] gnu: vtk: Enable the RenderingExternal module Paul A. Patience
2022-06-06 19:57   ` [bug#55819] [PATCH v2 2/2] gnu: Add f3d Paul A. Patience
2022-07-14 17:06 ` Paul A. Patience [this message]
2022-08-11  9:02   ` [bug#55819] [PATCH 0/2] " 宋文武 via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='FA5kZUe4R1C6dhGsdUQN1WONrIwssPQyO7IW3nAgitOqPoJGoX4ee5zcCXKsH3ZvXFMLtHejIUuMls9cHbvf986lHM4ZXTvoADxH4QVXZMc=@apatience.com' \
    --to=paul@apatience.com \
    --cc=55819@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).