[PATCH] gnu: paulxstretch: Fix paths

  • Open
  • quality assurance status badge
Details
3 participants
  • Sughosha
  • 宋文武
  • Ludovic Courtès
Owner
unassigned
Submitted by
Sughosha
Severity
normal
S
S
Sughosha wrote on 30 Nov 2022 16:04
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
wJriO_lL55pzPPL83h0IDGRTN8jXx6wdLuUXn0RxEHXJlnHa2GdixQiM8QRAnhn7Y4TwBsEcQLiXc48_W7-kP1KYx9R6TaAva1QvFC4KP2s=@proton.me
* gnu/packages/music.scm (paulxstretch): Fix paths.
[arguments]: Add phase fix-paths.
[inputs]: Add dconf and glib:bin.
---
gnu/packages/music.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index b69ad2e517..eb15a9f825 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -2481,6 +2481,20 @@ (define-public paulxstretch
(list #:tests? #f ;no test suite
#:phases
#~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-paths
+ (lambda _
+ (substitute* "deps/juce/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h"
+ (("/usr/include/freetype2")
+ (string-append #$freetype "/include/freetype")))
+ (substitute* "deps/juce/modules/juce_graphics/native/juce_linux_Fonts.cpp"
+ (("/etc/fonts")
+ (string-append #$fontconfig "/etc/fonts")))
+ (substitute* "deps/juce/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp"
+ (("/usr/bin/dconf")
+ (string-append #$dconf "/bin/dconf"))
+ (("/usr/bin/gsettings")
+ (string-append (ungexp glib "bin")
+ "/bin/gsettings")))))
(replace 'install
(lambda _
(let* ((bin (string-append #$output "/bin"))
@@ -2507,6 +2521,8 @@ (define-public paulxstretch
(native-inputs (list pkg-config))
(inputs (list alsa-lib
curl
+ dconf
+ `(,glib "bin")
fftwf
freetype
jack-1
--
2.38.1
L
L
Ludovic Courtès wrote on 5 Jan 22:48 +0100
(name . Sughosha)(address . Sughosha@proton.me)(address . 59725@debbugs.gnu.org)
871qo83b6e.fsf@gnu.org
Hi Sughosha,

Apologies for the delay!

Sughosha <Sughosha@proton.me> skribis:

Toggle quote (4 lines)
> * gnu/packages/music.scm (paulxstretch): Fix paths.
> [arguments]: Add phase fix-paths.
> [inputs]: Add dconf and glib:bin.

That’s a welcome fix.

Toggle quote (16 lines)
> #~(modify-phases %standard-phases
> + (add-after 'unpack 'fix-paths
> + (lambda _
> + (substitute* "deps/juce/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h"
> + (("/usr/include/freetype2")
> + (string-append #$freetype "/include/freetype")))
> + (substitute* "deps/juce/modules/juce_graphics/native/juce_linux_Fonts.cpp"
> + (("/etc/fonts")
> + (string-append #$fontconfig "/etc/fonts")))
> + (substitute* "deps/juce/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp"
> + (("/usr/bin/dconf")
> + (string-append #$dconf "/bin/dconf"))
> + (("/usr/bin/gsettings")
> + (string-append (ungexp glib "bin")
> + "/bin/gsettings")))))

Could you avoid direct references to packages like #$freetype and
instead use ‘search-input-file’ and ‘search-input-directory’?

(search-input-directory inputs "/etc/fonts")
(search-input-file inputs "/bin/gsettings")

There are examples in the repo on how to use them.

Could you send a v2 of the patch to 59725@debbugs.gnu.org?

Thanks in advance,
Ludo’.
S
S
Sughosha wrote on 6 Jan 14:27 +0100
[PATCH v2] gnu: paulxstretch: Fix paths.
(name . 59725@debbugs.gnu.org)(address . 59725@debbugs.gnu.org)
nwZtzlZ5wUYt32ueZDjLnJjEM7ytEUzeIG7v4p92VsKaIuekQt1AmNR32GcZVq6lCGj9-LQ7-MpWcuor_IqXsnn5L5ry7Auc6g4GyGk6ExI=@proton.me
This method seems more precise, since if the file or directory does not exist, build fails.

* gnu/packages/music.scm (paulxstretch): Fix paths.
[arguments]: Add fix-paths phase.
[inputs]: Add dconf and glib:bin.
---
gnu/packages/music.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 5be767a138..bdd856396d 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -2481,6 +2481,23 @@ (define-public paulxstretch
(list #:tests? #f ;no test suite
#:phases
#~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute*
+ "deps/juce/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h"
+ (("/usr/include/freetype2")
+ (search-input-directory inputs "/include/freetype2")))
+ (substitute*
+ "deps/juce/modules/juce_graphics/native/juce_linux_Fonts.cpp"
+ (("/etc/fonts")
+ (search-input-directory inputs "/etc/fonts")))
+ (substitute*
+ "deps/juce/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp"
+ (("/usr/bin/dconf")
+ (search-input-file inputs "/bin/dconf"))
+ (("/usr/bin/gsettings")
+ (search-input-file inputs "/bin/gsettings")))))
+
(replace 'install
(lambda _
(let* ((bin (string-append #$output "/bin"))
@@ -2507,8 +2524,11 @@ (define-public paulxstretch
(native-inputs (list pkg-config))
(inputs (list alsa-lib
curl
+ dconf
fftwf
+ fontconfig
freetype
+ `(,glib "bin")
jack-1
libx11
libxcursor
--
2.38.1
宋文武 wrote on 31 Jan 06:51 +0100
Re: bug#59725: [PATCH] gnu: paulxstretch: Fix paths
(name . Sughosha)(address . Sughosha@proton.me)(name . 59725@debbugs.gnu.org)(address . 59725@debbugs.gnu.org)
87edrbz1yu.fsf_-_@envs.net
Sughosha <Sughosha@proton.me> writes:

Toggle quote (6 lines)
> This method seems more precise, since if the file or directory does not exist, build fails.
>
> * gnu/packages/music.scm (paulxstretch): Fix paths.
> [arguments]: Add fix-paths phase.
> [inputs]: Add dconf and glib:bin.

Hello, paulxstretch will "Segmentation fault" with or without this
patch. I think that's due to "DynamicLibrary" usages in juce, also it's
better to package juce standalone to get rid of the bundled one from
paulxstretch.
S
S
Sughosha wrote 2 days ago
(name . 59725@debbugs.gnu.org)(address . 59725@debbugs.gnu.org)(name . 宋文武)(address . iyzsong@envs.net)
N0L62FEu4OFEuLpzl8yXh3NUGIVDTPFYxJYEn3rW5AT2SmbZmB9zVV9QmZ6sP24clodkcmSXlIMyFwryr6ETDXnGuReQ9ahKC4hgw-3xTPE=@proton.me
宋文武 <iyzsong@envs.net> wrote:

Toggle quote (5 lines)
> Hello, paulxstretch will "Segmentation fault" with or without this
> patch. I think that's due to "DynamicLibrary" usages in juce, also it's
> better to package juce standalone to get rid of the bundled one from
> paulxstretch.

I don't know why paulxstretch gives "Segmentation fault" error. If I build
it locally (not as a guix package) inside a guix development shell, I don't
get this error. But anyways, even though the executable binary fails to
start, at least the vst plugin works well.
?