Server application for collaborative production of 3D assets and animations.
(define-module (vfx packages autodesk)

  #:use-module (gnu packages)
  #:use-module (gnu packages cmake)
  #:use-module (gnu packages boost)
  #:use-module (gnu packages tbb)

  #:use-module (gnu packages slang)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages stb)
  #:use-module (gnu packages check)
  #:use-module (gnu packages cpp)
  
  #:use-module (gnu packages python)

  #:use-module (vfx packages base)
  #:use-module (vfx packages lucasfilm)
  #:use-module (vfx packages pixar)
  
  #:use-module (gnu packages vulkan)
  #:use-module (gnu packages gl)

  #:use-module (gnu packages image)
  #:use-module (gnu packages image-processing)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages graphics)

  #:use-module (guix)
  #:use-module (guix build-system cmake)
  #:use-module ((guix licenses) #:prefix licenses:))

(define-public tinygltf
  (package
    (name "tinygltf")
    (version "2.8.2")
    (source
      (origin
        (method url-fetch)
        (uri
	      (string-append "https://github.com/syoyo/tinygltf"
                             "/archive/refs/tags/v" version ".tar.gz"))
        (sha256
	 (base32 "08wshy2xnyfla3gpprqd753sc8d9n5dz0i8mk6w818y588jkckhm"))
	(patches (search-patches "vfx/patches/tinygltf-fix-install.patch"))))
    (build-system cmake-build-system)
    (arguments
      '(#:tests? #f))
    (home-page "https://github.com/syoyo/tinygltf")
    (synopsis "Header only C++ tiny glTF library")
    (description "TinyGLTF is a header only C++11 glTF 2.0
https://github.com/KhronosGroup/glTF library.")
    (license licenses:expat)))

(define-public tinyobjloader
  (package
    (name "tinyobjloader")
    (version "1.0.6")
    (source
      (origin
        (method url-fetch)
        (uri
	      (string-append "https://github.com/tinyobjloader/tinyobjloader"
                             "/archive/refs/tags/v" version ".tar.gz"))
        (sha256
	 (base32 "0hf3siyayps5j46pw0nn42rk63jpvcg5bpikv16raq8p436q5vhr"))))
    (build-system cmake-build-system)
    (arguments
      '(#:tests? #f))
    (home-page "https://github.com/tinyobjloader/tinyobjloader")
    (synopsis "Tiny but powerful wavefront obj loader")
    (description "Tiny but powerful single file wavefront obj loader written
in C++03. No dependency except for C++ STL. It can parse over 10M polygons
with moderate memory and time.")
    (license licenses:expat)))

(define-public usd-for-aurora
  (package
    (inherit usd)
    (name "usd")
    (version "22.08")
    (source (origin
                (method url-fetch)
                (uri (string-append "https://github.com/autodesk-forks/USD/"
                                      "archive/refs/tags/v" version "-Aurora-v22.11.tar.gz"))
                (sha256 (base32 "1bma37dj2sxwdgp1bsnbhywigx8kqwn2gzp2jjg5lf5rbd3jcj7k"))
		(patches (search-patches "vfx/patches/usd-fix-hgiinterop-vulkan.patch"))))))

(define-public aurora
  (package
    (name "aurora")
    (version "22.11")
    (source
      (origin
        (method url-fetch)
        (uri
 	      (string-append "https://github.com/Autodesk/Aurora/archive/refs/tags/"
	  	             "v" version ".tar.gz"))
        (sha256
         (base32 "018hcjr4agmsdmhmrnf2lzhrg3gfzqra080agxk7b63aqsqwlpf6"))

	(patches (search-patches "vfx/patches/aurora-skip-py-install.patch"
				 "vfx/patches/aurora-compiler-low-check.patch"))))

    (build-system cmake-build-system)

    ;; use latest CMake (3.24 or higher needed)
    (arguments `(#:cmake ,cmake))

    (inputs (list
	     python
	     boost
	     tbb-2020
	     opensubdiv-3.5
	     vulkan-headers
	     vulkan-loader
	     shaderc
	     glslang
	     mesa
	     slang
	     glm
	     stb-image
	     materialx
	     glew
	     zlib
	     libpng
	     openexr-2
             opencolorio-2.2
             openimageio-2.4
	     googletest
	     cxxopts
	     tinygltf
	     tinyobjloader
	     usd-for-aurora))
    (home-page "https://github.com/Autodesk/Aurora")
    (synopsis "Autodesk's real-time GPU path tracing renderer")
    (description "Aurora is a real-time path tracing renderer that leverages GPU
hardware ray tracing. As a real-time renderer, it is intended to support rapid
design iteration in a real-time viewport, which differs from a \"final frame\"
production renderer like Autodesk Arnold.")
    (license licenses:asl2.0)))