unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Prikler <leo.prikler@student.tugraz.at>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: 41778-done@debbugs.gnu.org
Subject: [bug#41778] [PATCH 0/3] Add ppsspp
Date: Tue, 30 Jun 2020 23:31:13 +0200	[thread overview]
Message-ID: <00d0e783bc3dde4e96fcee56f02ac6e12bb15743.camel@student.tugraz.at> (raw)
In-Reply-To: <87ftaciob4.fsf@nicolasgoaziou.fr>

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

Am Dienstag, den 30.06.2020, 17:08 +0200 schrieb Nicolas Goaziou:
> Well, I still think dropping the note is appropriate, but I won't
> fight
> over it. Let me know if you find something that suits you better.
Don't get me wrong, I agree on dropping the note, but I didn't want to
resend the patch just to delete it (since deletion is a rather trivial
operation, simpler even than forming partial sentences to full ones in
comments).  Either way, I do have a better phrasing now, which I'll
attach.

> I applied your patches. I tweaked comments. In particular comments
> starting with two semicolons are full sentences and are supposed to
> start with a capital and end with a full stop.
Thanks you!  I managed to unbundle some more sources today and also
cleaned up my comments as I did so.

Regards, Leo

[-- Attachment #2: 0001-gnu-spirv-cross-Improve-description.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

From 8d44bfdd8bfc0d9595ff1ecbc5fd5f00a5d1f4c5 Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Tue, 30 Jun 2020 11:41:36 +0200
Subject: [PATCH 1/2] gnu: spirv-cross: Improve description.

* gnu/packages/vulkan.scm (spirv-cross)[description]: Simplify.
---
 gnu/packages/vulkan.scm | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 2e640f502c..fe37b59e26 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -144,13 +144,7 @@ parser,disassembler, validator, and optimizer for SPIR-V.")
     (synopsis "Parser for and converter of SPIR-V to other shader languages")
     (description
      "SPIRV-Cross tries hard to emit readable and clean output from the
-SPIR-V.  The goal is to emit GLSL or MSL that looks like it was written by
-a human and not awkward IR/assembly-like code.
-
-NOTE: Individual features are expected to be mostly complete, but it is
-possible that certain obscure GLSL features are not yet supported.  However,
-most missing features are expected to be ``trivial'' improvements at this
-stage.")
+SPIR-V, aiming to emit GLSL or MSL that looks like human-written code.")
     (license license:asl2.0)))
 
 (define-public glslang
-- 
2.27.0


[-- Attachment #3: 0002-gnu-ppsspp-Unbundle-more-sources.patch --]
[-- Type: text/x-patch, Size: 6990 bytes --]

From 655b614f643eeaac570dde3d999bb6fd29f55af6 Mon Sep 17 00:00:00 2001
From: Leo Prikler <leo.prikler@student.tugraz.at>
Date: Tue, 30 Jun 2020 19:34:38 +0200
Subject: [PATCH 2/2] gnu: ppsspp: Unbundle more sources.

* gnu/packages/emulators (ppsspp)[source]: Update unbundling snippet.
[inputs]: Add cityhash, libzip, vulkan-headers, vulkan-loader, xxhash.
[arguments]<#:configure-flags>: Add -DUSE_SYSTEM_LIBZIP=ON.
Update comments accordingly.
---
 gnu/packages/emulators.scm | 79 ++++++++++++++++++++++++++++++--------
 1 file changed, 64 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 8b39517e3f..8a9ca428a9 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -48,6 +48,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages digest)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages fonts)
   #:use-module (gnu packages fontutils)
@@ -1858,25 +1859,69 @@ framework based on QEMU.")
        (modules '((guix build utils)))
        (snippet
         `(begin
-           ;; Unbundle sources.
-           (substitute* (list "Common/Vulkan/VulkanContext.cpp"
-                              "ext/native/thin3d/vulkan_utils.cpp"
-                              "GPU/Common/ShaderCommon.cpp"
-                              "GPU/Common/ShaderTranslation.cpp"
-                              "SDL/SDLMain.cpp")
+           ;; The following is quite a heavy-handed way of unbundling PPSSPP.
+           ;; There are still a number of external sources, that we don't
+           ;; remove here.  Some may be packaged, others are not.
+           ;; First, we patch existing sources to include the right headers.
+           (substitute* (append (list "ext/native/thin3d/vulkan_utils.cpp"
+                                      "ext/native/thin3d/thin3d_vulkan.cpp")
+                                (find-files "Common" ".*\\.(h|cpp)")
+                                (find-files "Core" ".*\\.(h|cpp)")
+                                (find-files "GPU" ".*\\.(h|cpp)")
+                                (find-files "SDL" ".*\\.(h|cpp)")
+                                (find-files "UI" ".*\\.(h|cpp)"))
+             ;; These headers are all hard-coded in the original source.
+             (("ext/cityhash/") "")
              (("ext/glslang/") "")
-             (("ext/SPIRV-Cross/") "spirv_cross/"))
-           ;; Patch CMakeLists.
+             (("ext/SPIRV-Cross/") "spirv_cross/")
+             (("ext/vulkan/") "vulkan/")
+             (("ext/xxhash.h") "xxhash.h")
+             ;; These definitions do not actually exist in the Vulkan headers,
+             ;; but PPSSPP defines them in ext/vulkan.
+             (("VK_FORMAT_BEGIN_RANGE") "VK_FORMAT_UNDEFINED")
+             (("VK_FORMAT_END_RANGE") "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"))
+           ;; Next, we patch CMakeLists.
            (substitute* "CMakeLists.txt"
+             ;; Drop unnecessary includes and targets.
              (("include_directories\\(ext/glslang\\)") "")
+             (("include_directories\\(ext/xxhash\\)") "")
+             (("include_directories\\(ext/cityhash\\)") "")
+             (("set_target_properties\\(cityhash .*\\)") "")
+             ;; Fix linking to GLEW.
+             (("TARGET Ext::GLEW") "true")
+             (("target_link_libraries\\(native Ext::GLEW\\)")
+              "find_package(GLEW)\ntarget_link_libraries(native GLEW::GLEW)")
+             (("Ext::Snappy") "snappy")
+             ;; Don't search for cityhash/xxhash, we already have them.
+             (("add_library\\((city|xx)hash STATIC") "if()\nendif(")
+             (("ext/xxhash\\.[ch]") "")
+             (("ext/native/ext/cityhash/.*\\.(cpp|h)") "")
+             ;; Link all of spirv-cross.
              (("spirv-cross-glsl" all)
               (string-append all
                              " spirv-cross-core spirv-cross-cpp"
                              " spirv-cross-reflect spirv-cross-util")))
            (substitute* "ext/CMakeLists.txt"
+             (("add_subdirectory\\(glew\\)") "")
              (("add_subdirectory\\(glslang\\)") "")
+             (("add_subdirectory\\(snappy\\)") "")
              (("add_subdirectory\\(SPIRV-Cross-build\\)") ""))
-           (delete-file-recursively "ext/cmake")
+           ;; Finally, we can delete the bundled sources.
+           (for-each delete-file-recursively
+                     '("ext/cmake"
+                       "ext/glew"
+                       "ext/glslang" "ext/glslang-build"
+                       "ext/native/ext/cityhash"
+                       "ext/native/ext/libpng17"
+                       "ext/native/ext/libzip"
+                       "ext/snappy"
+                       "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
+                       "ext/vulkan"
+                       "ext/xxhash.c"
+                       "ext/xxhash.h"
+                       "ext/zlib"))
+           ;; Since we are not including git as an input, PPSSPP is confused
+           ;; about its version.  Let's fix that here.
            (substitute* "git-version.cmake"
              (("unknown") ,version))))))
     (build-system cmake-build-system)
@@ -1884,16 +1929,21 @@ framework based on QEMU.")
      `(("pkg-config" ,pkg-config)
        ("python" ,python)))
     (inputs
-     `(("ffmpeg" ,ffmpeg)
+     `(("cityhash" ,cityhash)
+       ("ffmpeg" ,ffmpeg)
        ("glew" ,glew)
        ("glslang" ,glslang)
        ("libpng" ,libpng)
+       ("libzip" ,libzip)
        ("mesa" ,mesa)
        ("sdl2" ,sdl2)
        ("snappy" ,snappy)
        ("spirv-cross" ,spirv-cross)
+       ("vulkan-headers" ,vulkan-headers)
+       ("vulkan-loader" ,vulkan-loader)
+       ("xxhash" ,xxhash)
        ("zlib" ,zlib)
-       ;; TODO: unbundle builds.
+       ;; TODO: unbundle armips.
        ("armips-source" ,(package-source armips))
        ("lang"
         ,(origin
@@ -1915,15 +1965,14 @@ framework based on QEMU.")
      `(#:out-of-source? #f
        #:configure-flags (list "-DUSE_DISCORD=OFF"
                                "-DUSE_SYSTEM_FFMPEG=ON"
-                               ;; For testing.
+                               "-DUSE_SYSTEM_LIBZIP=ON"
+                               ;; for testing
                                "-DUNITTEST=ON" "-DHEADLESS=ON")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'add-external-sources
            (lambda* (#:key inputs #:allow-other-keys)
-             ;; TODO: unbundle builds.  Not only should we not copy these
-             ;; sources in, we should also remove as much from "ext/" as we
-             ;; can.
+             ;; TODO: unbundle armips.
              (copy-recursively (assoc-ref inputs "armips-source")
                                "ext/armips")
              ;; Some tests are externalised, so we add them here.
-- 
2.27.0


  reply	other threads:[~2020-06-30 21:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 21:40 [bug#41778] [PATCH WIP 0/2] Add ppsspp Leo Prikler
2020-06-09 21:47 ` [bug#41778] [PATCH 1/2] gnu: Add armips Leo Prikler
2020-06-09 21:47   ` [bug#41778] [PATCH 2/2] gnu: Add ppsspp Leo Prikler
2020-06-29 10:02 ` [bug#41778] [PATCH 0/3] " Leo Prikler
2020-06-29 10:06   ` [bug#41778] [PATCH 1/3] gnu: Add armips Leo Prikler
2020-06-29 10:06   ` [bug#41778] [PATCH 2/3] gnu: add spirv-cross Leo Prikler
2020-06-29 10:06   ` [bug#41778] [PATCH 3/3] gnu: Add ppsspp Leo Prikler
2020-06-29 22:02   ` [bug#41778] [PATCH 0/3] " Nicolas Goaziou
2020-06-29 23:33     ` Leo Prikler
2020-06-30 15:08       ` bug#41778: " Nicolas Goaziou
2020-06-30 21:31         ` Leo Prikler [this message]
2020-07-01 10:15           ` [bug#41778] " Nicolas Goaziou

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=00d0e783bc3dde4e96fcee56f02ac6e12bb15743.camel@student.tugraz.at \
    --to=leo.prikler@student.tugraz.at \
    --cc=41778-done@debbugs.gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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).