unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#66035] [PATCH] gnu: Add renderdoc.
@ 2023-09-16 16:01 dan
  0 siblings, 0 replies; only message in thread
From: dan @ 2023-09-16 16:01 UTC (permalink / raw)
  To: 66035

* gnu/packages/graphics.scm (renderdoc): New variable.
---
 gnu/packages/graphics.scm | 90 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 89 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 9362666274..002d93f75b 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -32,7 +32,7 @@
 ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
 ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
-;;; Copyright © 2022 dan <i@dan.games>
+;;; Copyright © 2022, 2023 dan <i@dan.games>
 ;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2023 David Thompson <dthompson2@worcester.edu>
 ;;; Copyright © 2023 Eric Bavier <bavier@posteo.net>
@@ -101,6 +101,7 @@ (define-module (gnu packages graphics)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages pciutils)
+  #:use-module (gnu packages pcre)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages photo)
@@ -2851,3 +2852,90 @@ (define-public gpaint
 It features cut-and-paste for irregular regions or polygons.")
     (home-page "https://www.gnu.org/software/gpaint/")
     (license license:gpl3+)))
+
+(define %swig-for-renderdoc-version
+  "renderdoc-modified-7")
+
+(define swig-for-renderdoc
+  (origin
+    (method url-fetch)
+    (uri (string-append "https://github.com/baldurk/swig/archive/refs/tags/"
+                        %swig-for-renderdoc-version ".tar.gz"))
+    (sha256 (base32
+             "19sb4vik8kgy9pxjfam8qc8i52iraj2971p1hrzh850fvl0nibg7"))))
+
+(define-public renderdoc
+  (package
+    (name "renderdoc")
+    (version "1.28")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/baldurk/renderdoc.git")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "1rny39s1b48bgv8x2871ylkzk1f9llvrskb809c6gcawnfazzivb"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:tests? #f
+           #:configure-flags #~(list (string-append "-DVULKAN_LAYER_FOLDER="
+                                      #$output
+                                      "/share/vulkan/implicit_layer.d"))
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'unpack-additional-sources
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (let ((sh (search-input-file inputs "/bin/sh")))
+                              (invoke "tar" "xvf"
+                                      #$swig-for-renderdoc)
+                              (rename-file (string-append "swig-"
+                                            #$%swig-for-renderdoc-version)
+                                           "swig")
+                              (substitute* "qrenderdoc/CMakeLists.txt"
+                                (("URL \\$\\{RENDERDOC_SWIG_PACKAGE\\}")
+                                 "SOURCE_DIR ${CMAKE_SOURCE_DIR}/swig")
+                                (("CONFIGURE_COMMAND\\s.*")
+                                 "CONFIGURE_COMMAND \"\"\n")
+                                (("^\\s+COMMAND CC.*")
+                                 ""))
+                              (substitute* "swig/Makefile.in"
+                                (("/bin/sh")
+                                 sh))
+                              (chdir "swig")
+                              (invoke sh "autogen.sh")
+                              (chdir ".."))))
+                        (add-after 'configure 'configure-swig
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (let ((build-dir (getcwd))
+                                  (sh (search-input-file inputs "/bin/sh")))
+                              (chdir "../source/swig")
+                              (apply invoke sh "./configure"
+                                     (list "CC=gcc"
+                                           "CXX=g++"
+                                           "CFLAGS=-fPIC"
+                                           "CXXFLAGS=-fPIC"
+                                           (string-append "SHELL=" sh)
+                                           "--with-pcre=yes"
+                                           (string-append "--prefix="
+                                                          build-dir)))
+                              (chdir "../../build")))))))
+    (inputs (list libx11
+                  libxcb
+                  xcb-util-keysyms
+                  mesa
+                  qtbase-5
+                  qtsvg-5
+                  qtx11extras))
+    (native-inputs (list autoconf
+                         automake
+                         bison
+                         (list pcre "bin")
+                         pkg-config
+                         python))
+    (home-page "https://renderdoc.org")
+    (synopsis "Graphics debugging tool")
+    (description
+     "RenderDoc is a frame-capture based graphics debugger, currently
+available for Vulkan, D3D11, D3D12, OpenGL, and OpenGL ES development on
+Windows, Linux, Android, and Nintendo Switch™.")
+    (license license:expat)))

base-commit: 04fad62acdcffa50c18528ce71f015907b9eb558
-- 
2.41.0





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-16 16:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-16 16:01 [bug#66035] [PATCH] gnu: Add renderdoc dan

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).