[PATCH] gnu: paulxstretch: Fix paths

  • Done
  • quality assurance status badge
Details
4 participants
  • Sughosha
  • ???
  • Ludovic Courtès
  • Maxim Cournoyer
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 2023 22:48
(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 2023 14:27
[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
?
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 on 6 Feb 2023 23:49
(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.
M
M
Maxim Cournoyer wrote on 21 Mar 2023 14:40
(name . Sughosha)(address . Sughosha@proton.me)(name . 59725@debbugs.gnu.org)(address . 59725-done@debbugs.gnu.org)
87ttyeql2y.fsf_-_@gmail.com
Hi,

Sughosha <Sughosha@proton.me> writes:

Toggle quote (2 lines)
> This method seems more precise, since if the file or directory does not exist, build fails.

It also allows Guix users to rewrite package inputs, contrary to the
previous approach which would have hard-coded the references to the
package variables in a definitive way.

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

I've modified the commit message like so:

Toggle snippet (6 lines)
gnu: paulxstretch: Patch paths.

* gnu/packages/music.scm (paulxstretch) [arguments]: Add patch-paths phase.
[inputs]: Add dconf, fontconfig and glib:bin.

Capitalizing the sentence following the ':', removing the hanging indent
in the GNU Changelog commit message, and adding the missing fontconfig.

Toggle quote (45 lines)
> ---
> gnu/packages/music.scm | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> 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

Applied, after breaking some long lines to fit under 80 chars.

As others reported, there is still the segfault when running the binary,
but at least this probably brings us closer to something that fully works.

Let's open other issues for the remaining problems found.

--
Thanks,
Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 59725@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 59725
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch