+
+(define-public openctm
+ (let ((revision 603))
+ ;; Previous versions don't compile, they need to link libGL and libGLU.
+ ;; Fixed in this revision.
+ (package
+ (name "openctm")
+ (version (string-append "1.0.3." (number->string revision)))
+ (source
+ (origin
+ (method svn-fetch)
+ (uri (svn-reference
+ (url "https://svn.code.sf.net/p/openctm/code/trunk")
+ (revision revision)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32 "01wb70m48xh5gwhv60a5brv4sxl0i0rh038w32cgnlxn5x86s9f1"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("mesa" ,mesa)
+ ("glu" ,glu)
+ ("glut" ,freeglut)
+ ("gtk" ,gtk+-2)))
+ (arguments
+ `(#:tests? #f ;no tests
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (rename-file "Makefile.linux" "Makefile")
+ (let ((out (assoc-ref outputs "out")))
+ ;; Create output directories.
+ (mkdir-p (string-append out "/lib"))
+ (mkdir-p (string-append out "/include"))
+ (mkdir-p (string-append out "/bin"))
+ ;; Fix rpath.
+ (substitute* "tools/Makefile.linux"
+ (("-rpath,\\.")
+ (string-append "-rpath," out "/lib/"))
+ (("/usr/local")
+ out))
+ ;; Set right output.
+ (substitute* "Makefile"
+ (("/usr/lib")
+ (string-append out "/lib"))
+ (("\\/usr\\/local")
+ out))
+ #t))))))
+ (synopsis "3D triangle mesh format and related tools and libraries")
+ (description "OpenCTM is a file format, a software library and a tool set
+for compression of 3D triangle meshes. The geometry is compressed to a
+fraction of comparable file formats (3DS, STL, COLLADA...), and the format is
+accessible through a simple API")
+ (license license:zlib)
+ (home-page "http://openctm.sourceforge.net/"))))
+
+(define-public lib3ds
+ (package
+ (name "lib3ds")
+ (version "1.3.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://storage.googleapis.com/google-code-archive-downloads"
+ "/v2/code.google.com/lib3ds/lib3ds-" version ".zip"))
+ (sha256
+ (base32 "1qr9arfdkjf7q11xhvxwzmhxqz3nhcjkyb8zzfjpz9jm54q0rc7m"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("unzip" ,unzip)))
+ (home-page "https://code.google.com/archive/p/lib3ds")
+ (synopsis "3DS format file toolkit")
+ (description "Lib3ds is a toolkit for handling the 3DS format for 3D
+model files. Its main goal is to simplify the creation of 3DS import and
+export filters.")
+ (license license:lgpl2.1+)))
+
+(define-public meshlab
+ (package
+ (name "meshlab")
+ (version "2020.06")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/cnr-isti-vclab/meshlab")
+ (commit (string-append "Meshlab-" version))
+ (recursive? #t)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1cgx24wxh2ah5pff51rcrk6x8qcdjpkxcdak7s4cfzmxvjlshydd"))))
+ (build-system cmake-build-system)
+ (inputs
+ `(("qtbase" ,qtbase)
+ ("qtscript" ,qtscript)
+ ("qtxmlpatterns" ,qtxmlpatterns)
+ ("mesa" ,mesa)
+ ("glu" ,glu)
+ ("glew" ,glew)
+ ("muparser" ,muparser)
+ ("gmp" ,gmp)
+ ("eigen" ,eigen)
+ ("libfreenect" ,libfreenect)
+ ("lib3ds" ,lib3ds)
+ ("openctm" ,openctm)
+ ;; FIXME: Compilation fails with system qhull:
+ ;; https://github.com/cnr-isti-vclab/meshlab/issues/678
+ ;; ("qhull" ,qhull)
+ ))
+ (arguments
+ `(#:tests? #f ; Has no tests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'go-to-source-dir
+ (lambda _ (chdir "src") #t))
+ (add-after 'install 'move-files
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((lib (string-append (assoc-ref outputs "out")
+ "/lib")))
+ (rename-file
+ (string-append lib "/meshlab/libmeshlab-common.so")
+ (string-append lib "/libmeshlab-common.so"))
+ #t))))))
+ (synopsis "3D triangular mesh processing and editing software")
+ (home-page "https://www.meshlab.net/")
+ (description "MeshLab is a system for the processing and
+editing of unstructured large 3D triangular meshes. It is aimed to help the
+processing of the typical not-so-small unstructured models arising in 3D
+scanning, providing a set of tools for editing, cleaning, healing, inspecting,
+rendering and converting this kind of meshes. These tools include MeshLab
+proper, a versatile program with a graphical user interface, and meshlabserver,
+a program that can perform mesh processing tasks in batch mode, without a
+GUI.")
+ (license license:gpl3+)))
+
+(define-public poke
+ ;; Upstream has yet to tag any releases.
+ (let ((commit "d33317a46e3b7c48130a471a48cbfea1abab70d8")
+ (revision "0"))
+ (package
+ (name "poke")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://git.savannah.gnu.org/poke.git")
+ (commit commit)
+ (recursive? #t)))
+ (sha256
+ (base32 "1dd0r1x123bqi78lrsk58rvg9c9wka0kywdyzn7g3i4hkh54xb7d"))
+ (file-name (git-file-name name version))))
+ (build-system gnu-build-system)
+ ;; The GUI, which we elide, requires tcl and tk.
+ (native-inputs `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ;; Requires bison 3.6+ but we currently only have 3.5.
+ ;; Bison 3.6 will be available in the next core update.
+ ("bison-3.6" ,bison-3.6)
+ ("clisp" ,clisp)
+ ("dejagnu" ,dejagnu)
+ ("flex" ,flex)
+ ("gettext" ,gettext-minimal)
+ ("help2man" ,help2man)
+ ("libtool" ,libtool)
+ ("perl" ,perl)
+ ("pkg-config" ,pkg-config)
+ ("python-2" ,python-2)
+ ("python-3" ,python-3)
+ ("texinfo" ,texinfo)))
+ ;; FIXME: Enable NBD support by adding `libnbd' (currently unpackaged).
+ ;; FIXME: A "hyperlinks-capable" `libtexststyle' needed for the hserver.
+ (inputs `(("json-c" ,json-c)
+ ("libgc" ,libgc)
+ ("readline" ,readline)))
+ (arguments
+ ;; To build the GUI, add the `--enable-gui' configure flag.
+ ;; To enable the "hyperlink server", add the `--enable-hserver' flag.
+ `(#:configure-flags '("--enable-mi")
+ #:phases (modify-phases %standard-phases
+ ;; This is a non-trivial bootstrap that needs many of the
+ ;; native-inputs and thus must run after `patch-shebangs'.
+ (delete 'bootstrap)
+ (add-after 'patch-source-shebangs 'bootstrap
+ (lambda _
+ (invoke "./bootstrap" "--no-git"
+ "--no-bootstrap-sync"
+ "--gnulib-srcdir=gnulib")
+ #t)))))
+ (home-page "http://jemarch.net/poke.html")
+ (synopsis "Interactive, extensible editor for binary data")
+ (description "GNU poke is an interactive, extensible editor for binary
+ data. Not limited to editing basic entities such as bits and bytes, it
+ provides a full-fledged procedural, interactive programming language designed
+ to describe data structures and to operate on them.")
+ (license license:gpl3+))))