summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul A. Patience <paul@apatience.com>2022-06-06 19:57:17 +0000
committerGuix Patches Tester <>2022-06-06 20:59:34 +0100
commit24ead77c1d2c9ed4138fb2b4af43208ccfa5c64a (patch)
tree2461a5f7b1c978def8100820accaf744f72ee29a
parent11a3abc6467d2a1bd24d3e87d8af0bf586a936d3 (diff)
downloadguix-patches-24ead77c1d2c9ed4138fb2b4af43208ccfa5c64a.tar
guix-patches-24ead77c1d2c9ed4138fb2b4af43208ccfa5c64a.tar.gz
gnu: Add f3d.series-12583
* gnu/packages/graphics.scm (f3d): New variable.
-rw-r--r--gnu/packages/graphics.scm110
1 files changed, 110 insertions, 0 deletions
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 64286bf68d..3b81f57e60 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -30,6 +30,7 @@
;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2054,3 +2055,112 @@ and build scripts for the OpenXR loader.")
such as VR and AR on mobile, PC/desktop, and any other device. Monado aims to be
a complete and conforming implementation of the OpenXR API made by Khronos.")
(license license:boost1.0)))
+
+(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 "d80fd4558f1851a31d13dfbb62d7648b7b2d36f8")
+ (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 "11lj63rfhqp0zwifl2d3rlp7cfbxgr2jb3j7pqh8lhsr2pa94f6s"))))
+ (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))))