unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#47355] ekho use new method to fix datadir
@ 2021-03-24  1:07 qblade via Guix-patches via
  2021-10-06 10:47 ` 宋文武
  0 siblings, 1 reply; 2+ messages in thread
From: qblade via Guix-patches via @ 2021-03-24  1:07 UTC (permalink / raw)
  To: 47355

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

I discussed with the developers of this project. It is not recommended to use environment variables to specify the datadir, so I switched to hard-coded paths.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-ekho-use-new-method-to-fix-datadir.patch --]
[-- Type: text/x-patch; name=0001-gnu-ekho-use-new-method-to-fix-datadir.patch, Size: 1487 bytes --]

From cd6371f4a903a2eda0824f31cbccb1da757ebe34 Mon Sep 17 00:00:00 2001
From: qblade <qblade@protonmail.com>
Date: Tue, 23 Mar 2021 13:03:54 +0000
Subject: [PATCH] gnu: ekho: use new method to fix datadir

* gnu/packages/speech.scm (ekho): use new method to fix datadir
---
 gnu/packages/speech.scm | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/speech.scm b/gnu/packages/speech.scm
index 687a3c10cf..cd0e3f80e2 100644
--- a/gnu/packages/speech.scm
+++ b/gnu/packages/speech.scm
@@ -576,10 +576,20 @@ control.")
        ("libsndfile" ,libsndfile)
        ("pulseaudio" ,pulseaudio)))
     (build-system gnu-build-system)
-    (native-search-paths
-     (list (search-path-specification
-            (variable "EKHO_DATA_PATH")
-            (files '("share/ekho-data")))))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'fix-datadir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let*
+                 ((datadir
+                   (string-append
+                    (assoc-ref outputs "out") "/share/ekho-data")))
+               (substitute* "src/ekho_dict.cpp"
+                 (("/usr/local/share/ekho-data")
+                  datadir)
+                 (("/usr/share/ekho-data")
+                  datadir))))))))
     (home-page "https://eguidedog.net/ekho.php")
     (synopsis "Chinese text-to-speech software")
     (description
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [bug#47355] ekho use new method to fix datadir
  2021-03-24  1:07 [bug#47355] ekho use new method to fix datadir qblade via Guix-patches via
@ 2021-10-06 10:47 ` 宋文武
  0 siblings, 0 replies; 2+ messages in thread
From: 宋文武 @ 2021-10-06 10:47 UTC (permalink / raw)
  To: qblade; +Cc: 47355

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

qblade <qblade@protonmail.com> writes:

> I discussed with the developers of this project. It is not recommended
> to use environment variables to specify the datadir, so I switched to
> hard-coded paths.

Hello, I see that while the environment variable EKHO_DATA_PATH is
working fine, hard-coded it may be better.  Also there is a
`-DEKHO_DATA_PATH='"$(datadir)/ekho-data"'` in its Makefile.am, which
should work out-of-the-box without any flags, envs or patching, but it
doesn't...  I'll raise an issue on ekho later for this.

In the meanwhile, we can use this, which is a little better than
patching:

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ekho.diff --]
[-- Type: text/x-patch, Size: 875 bytes --]

diff --git a/gnu/packages/speech.scm b/gnu/packages/speech.scm
index cbc46b32b4..10a4f3fa76 100644
--- a/gnu/packages/speech.scm
+++ b/gnu/packages/speech.scm
@@ -579,10 +579,12 @@ control.")
        ("libsndfile" ,libsndfile)
        ("pulseaudio" ,pulseaudio)))
     (build-system gnu-build-system)
-    (native-search-paths
-     (list (search-path-specification
-            (variable "EKHO_DATA_PATH")
-            (files '("share/ekho-data")))))
+    (arguments
+     '(#:configure-flags
+       (let* ((datadir (string-append (assoc-ref %outputs "out") "/share"))
+              (ekhodatadir (string-append datadir "/ekho-data")))
+         (list (simple-format #f "CXXFLAGS=-DEKHO_DATA_PATH='\"~a\"'"
+                              ekhodatadir)))))
     (home-page "https://eguidedog.net/ekho.php")
     (synopsis "Chinese text-to-speech software")
     (description

[-- Attachment #3: Type: text/plain, Size: 29 bytes --]


What do you think?  Thanks!

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-06 10:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24  1:07 [bug#47355] ekho use new method to fix datadir qblade via Guix-patches via
2021-10-06 10:47 ` 宋文武

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