guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#45132] [PATCH 2/2] gnu: renpy: Use system fribidi and drop generate


From: Leo Prikler
Subject: [bug#45132] [PATCH 2/2] gnu: renpy: Use system fribidi and drop generated sources.
Date: Wed, 9 Dec 2020 15:56:52 +0100

* gnu/packages/patches/renpy-use-system-fribidi.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it here.
* gnu/packages/game-development.scm (renpy)[source]<patches> Use it here.
<modules>: Add (guix build utils).
<snippet>: Drop generated sources and fribidi sources.
(arguments)[phases]: Add fix-include-paths.
(inputs): Add fribidi.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/game-development.scm             | 20 +++++++-
 .../patches/renpy-use-system-fribidi.patch    | 48 +++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/renpy-use-system-fribidi.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 90df6f3966..b0af8f29b5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1568,6 +1568,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/rct-add-missing-headers.patch           \
   %D%/packages/patches/readline-link-ncurses.patch             \
   %D%/packages/patches/readline-6.2-CVE-2014-2524.patch                \
+  %D%/packages/patches/renpy-use-system-fribidi.patch          \
   %D%/packages/patches/reposurgeon-add-missing-docbook-files.patch     \
   %D%/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch     \
   %D%/packages/patches/ri-li-modernize_cpp.patch               \
diff --git a/gnu/packages/game-development.scm 
b/gnu/packages/game-development.scm
index 7b0b1cb83d..832b782f3c 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1119,7 +1119,17 @@ developed mainly for Ren'py.")
        (method url-fetch)
        (uri (string-append "https://www.renpy.org/dl/"; version
                            "/renpy-" version "-source.tar.bz2"))
-       (sha256 (base32 
"1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))))
+       (sha256 (base32 "1anr5cfbvbsbik4v4rvrkdkciwhg700k4lydfbs4n85raimz9mw4"))
+       (modules '((guix build utils)))
+       (patches
+        (search-patches
+         "renpy-use-system-fribidi.patch"))
+       (snippet
+        '(with-directory-excursion "module"
+           ;; drop generated sources
+           (delete-file-recursively "gen")
+           ;; drop fribidi sources
+           (delete-file-recursively "fribidi-src")))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f ; Ren'py doesn't seem to package tests
@@ -1132,6 +1142,13 @@ developed mainly for Ren'py.")
                (("xdg-open")
                 (which "xdg-open")))
              #t))
+         (add-after 'unpack 'fix-include-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "module/setup.py"
+               (("/usr/include/fribidi")
+                (string-append (assoc-ref inputs "fribidi")
+                               "/include/fribidi")))
+             #t))
          (add-after 'set-paths 'set-build-vars
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "RENPY_CYTHON"
@@ -1169,6 +1186,7 @@ developed mainly for Ren'py.")
     (inputs
      `(("ffmpeg" ,ffmpeg)
        ("freetype" ,freetype)
+       ("fribidi" ,fribidi)
        ("glew" ,glew)
        ("libpng" ,libpng)
        ("python2-pygame" ,python2-pygame-sdl2)
diff --git a/gnu/packages/patches/renpy-use-system-fribidi.patch 
b/gnu/packages/patches/renpy-use-system-fribidi.patch
new file mode 100644
index 0000000000..a6d22eb7e5
--- /dev/null
+++ b/gnu/packages/patches/renpy-use-system-fribidi.patch
@@ -0,0 +1,48 @@
+Index: renpy-7.3.5-source/module/renpybidicore.c
+===================================================================
+--- renpy-7.3.5-source.orig/module/renpybidicore.c
++++ renpy-7.3.5-source/module/renpybidicore.c
+@@ -1,5 +1,5 @@
+ #include <Python.h>
+-#include <fribidi-src/lib/fribidi.h>
++#include <fribidi.h>
+ #include <stdlib.h>
+
+ #ifndef alloca
+Index: renpy-7.3.5-source/module/setup.py
+===================================================================
+--- renpy-7.3.5-source.orig/module/setup.py
++++ renpy-7.3.5-source/module/setup.py
+@@ -119,30 +119,13 @@ cython(
+     sdl + [ png, 'z', 'm' ])
+
+ FRIBIDI_SOURCES = """
+-fribidi-src/lib/fribidi.c
+-fribidi-src/lib/fribidi-arabic.c
+-fribidi-src/lib/fribidi-bidi.c
+-fribidi-src/lib/fribidi-bidi-types.c
+-fribidi-src/lib/fribidi-deprecated.c
+-fribidi-src/lib/fribidi-joining.c
+-fribidi-src/lib/fribidi-joining-types.c
+-fribidi-src/lib/fribidi-mem.c
+-fribidi-src/lib/fribidi-mirroring.c
+-fribidi-src/lib/fribidi-run.c
+-fribidi-src/lib/fribidi-shape.c
+ renpybidicore.c
+ """.split()
+ cython(
+     "_renpybidi",
+     FRIBIDI_SOURCES,
+-    includes=[
+-        BASE + "/fribidi-src/",
+-        BASE + "/fribidi-src/lib/",
+-        ],
+-    define_macros=[
+-        ("FRIBIDI_ENTRY", ""),
+-        ("HAVE_CONFIG_H", "1"),
+-        ])
++    includes=["/usr/include/fribidi"],
++    libs=["fribidi"])
+
+
+ cython("_renpysteam", language="c++", compile_if=steam_sdk, 
libs=["steam_api"])
-- 
2.29.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]