all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Prikler <leo.prikler@student.tugraz.at>
To: 45132@debbugs.gnu.org
Subject: [bug#45132] [PATCH v2 2/2] gnu: renpy: Use system fribidi and drop generated sources.
Date: Thu, 10 Dec 2020 20:03:12 +0100	[thread overview]
Message-ID: <20201210190312.19632-2-leo.prikler@student.tugraz.at> (raw)
In-Reply-To: <20201210190312.19632-1-leo.prikler@student.tugraz.at>

* 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             | 21 +++++++-
 .../patches/renpy-use-system-fribidi.patch    | 52 +++++++++++++++++++
 3 files changed, 73 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 557f02f564..21f7f7e880 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1120,7 +1120,18 @@ 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")
+           #t))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f ; Ren'py doesn't seem to package tests
@@ -1133,6 +1144,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"
@@ -1170,6 +1188,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..1437274bcc
--- /dev/null
+++ b/gnu/packages/patches/renpy-use-system-fribidi.patch
@@ -0,0 +1,52 @@
+See also [Arch] and [Gentoo] for similar patches in other distros.
+[Arch] https://github.com/archlinux/svntogit-community/blob/packages/renpy/trunk/renpy-system-fribidi.patch
+[Gentoo] https://gitweb.gentoo.org/repo/gentoo.git/tree/games-engines/renpy/files/renpy-7.3.5-use-system-fribidi.patch
+
+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	other threads:[~2020-12-10 19:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 14:55 [bug#45132] [PATCH 0/2] QC Ren'py package Leo Prikler
2020-12-09 14:56 ` [bug#45132] [PATCH 1/2] gnu: pygame-sdl2-for-renpy: Drop generated sources in snippet Leo Prikler
2020-12-09 14:56   ` [bug#45132] [PATCH 2/2] gnu: renpy: Use system fribidi and drop generated sources Leo Prikler
2020-12-10 11:09 ` [bug#45132] [PATCH 0/2] QC Ren'py package Nicolas Goaziou
2020-12-10 12:28   ` Leo Prikler
2020-12-10 19:03 ` [bug#45132] [PATCH v2 1/2] gnu: pygame-sdl2-for-renpy: Drop generated sources in snippet Leo Prikler
2020-12-10 19:03   ` Leo Prikler [this message]
2020-12-12 20:16   ` bug#45132: " 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201210190312.19632-2-leo.prikler@student.tugraz.at \
    --to=leo.prikler@student.tugraz.at \
    --cc=45132@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.