all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#29760] [PATCH] surfraw: hardcode perl during build time
@ 2017-12-17 21:51 Mark Meyer
  2017-12-17 22:01 ` [bug#29760] Future of this patch Mark Meyer
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Mark Meyer @ 2017-12-17 21:51 UTC (permalink / raw)
  To: 29760

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

Hi Guix,
the following patch make surfraw search for perl during build time and
code the path to perl into the surfraw script.

Cheers, Mark

-- 
  Mark Meyer
  mark@ofosos.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-surfraw-Find-path-to-perl.patch --]
[-- Type: text/x-patch; name="0001-gnu-surfraw-Find-path-to-perl.patch", Size: 3786 bytes --]

From dcc195481cb84f295a364c2c7cb023f33899745e Mon Sep 17 00:00:00 2001
From: Mark Meyer <mark@ofosos.org>
Date: Sun, 17 Dec 2017 22:47:15 +0100
Subject: [PATCH] gnu: surfraw: Find path to perl.

* gnu/packages/patches/surfraw-find-perl.patch: New file.
* gnu/packages/web.scm (surfraw)[native-inputs]: Add autoconf, automake.
[package]: Add surfraw-find-perl.patch.
[arguments]: Add 'autoreconf phase.
---
 gnu/packages/patches/surfraw-find-perl.patch | 35 ++++++++++++++++++++++++++++
 gnu/packages/web.scm                         |  9 ++++++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/surfraw-find-perl.patch

diff --git a/gnu/packages/patches/surfraw-find-perl.patch b/gnu/packages/patches/surfraw-find-perl.patch
new file mode 100644
index 000000000..b995ab025
--- /dev/null
+++ b/gnu/packages/patches/surfraw-find-perl.patch
@@ -0,0 +1,35 @@
+diff -Naur surfraw-2.2.9-orig/configure.in surfraw-2.2.9/configure.in
+--- surfraw-2.2.9-orig/configure.in	2013-12-10 18:07:06.000000000 +0100
++++ surfraw-2.2.9/configure.in	2017-12-17 22:19:14.648432687 +0100
+@@ -53,6 +53,8 @@
+ dnl Checks for programs.
+ AC_PROG_INSTALL
+ AC_PROG_AWK
++AC_PATH_PROG([PERL], [perl], [perl])
++AC_SUBST(PERL)
+ 
+ AC_CONFIG_FILES([Makefile surfraw.lsm surfraw.spec elvi/Makefile test/Makefile examples/Makefile])
+ AC_OUTPUT
+diff -Naur surfraw-2.2.9-orig/Makefile.am surfraw-2.2.9/Makefile.am
+--- surfraw-2.2.9-orig/Makefile.am	2013-12-10 18:07:06.000000000 +0100
++++ surfraw-2.2.9/Makefile.am	2017-12-17 22:13:48.205031190 +0100
+@@ -35,6 +35,7 @@
+ 	sed -e 's,@VERSION\@,${VERSION},g; '\
+ 	    -e 's,@ELVIDIR\@,${ELVIDIR},g; '\
+ 	    -e 's,@AWK\@,${AWK},g; '\
++	    -e 's,@PERL\@,${PERL},g; '\
+ 	    -e 's,@sysconfdir\@,${sysconfdir},g ' $? > $@.tmp
+ 	chmod +x $@.tmp
+ 	mv $@.tmp $@
+diff -Naur surfraw-2.2.9-orig/surfraw.IN surfraw-2.2.9/surfraw.IN
+--- surfraw-2.2.9-orig/surfraw.IN	2013-12-10 18:07:06.000000000 +0100
++++ surfraw-2.2.9/surfraw.IN	2017-12-17 22:14:01.613171144 +0100
+@@ -160,7 +160,7 @@
+ 
+ quote_ifs () {
+ 	 if [ -z "$1" ];   then return;  fi
+-     perl -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1"
++     @PERL@ -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1"
+ }
+ 
+ bookmark_file_search () {
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index eb0436cb3..766582ab1 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -4701,11 +4701,15 @@ handling many of the web standards in use today.")
                                   name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1fy4ph5h9kp0jzj1m6pfylxnnmgdk0mmdppw76z9jhna4jndk5xa"))))
+                "1fy4ph5h9kp0jzj1m6pfylxnnmgdk0mmdppw76z9jhna4jndk5xa"))
+              (patches (search-patches "surfraw-find-perl.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'autoreconf ; required for the patch
+           (lambda* _
+             (zero? (system* "autoreconf"))))
          (add-after 'install 'compress-elvi.1sr
            (lambda* (#:key outputs #:allow-other-keys)
              ;; The manpages of the elvis are symlinks to elvi.1sr.gz
@@ -4714,6 +4718,9 @@ handling many of the web standards in use today.")
                     (man (string-append out "/share/man/man1")))
                (with-directory-excursion man
                  (zero? (system* "gzip" "elvi.1sr")))))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)))
     (inputs
      `(("perl" ,perl)
        ("perl-www-opensearch" ,perl-www-opensearch)
-- 
2.15.1


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

* [bug#29760] Future of this patch
  2017-12-17 21:51 [bug#29760] [PATCH] surfraw: hardcode perl during build time Mark Meyer
@ 2017-12-17 22:01 ` Mark Meyer
  2017-12-17 22:06 ` [bug#29760] [PATCH] surfraw: hardcode perl during build time ng0
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Mark Meyer @ 2017-12-17 22:01 UTC (permalink / raw)
  To: 29760

The idea is to upstream this patch in the long run.

-- 
  Mark Meyer
  mark@ofosos.org

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

* [bug#29760] [PATCH] surfraw: hardcode perl during build time
  2017-12-17 21:51 [bug#29760] [PATCH] surfraw: hardcode perl during build time Mark Meyer
  2017-12-17 22:01 ` [bug#29760] Future of this patch Mark Meyer
@ 2017-12-17 22:06 ` ng0
  2017-12-22  8:54 ` Ludovic Courtès
  2018-01-04 17:19 ` [bug#29760] substitute patch Mark Meyer
  3 siblings, 0 replies; 6+ messages in thread
From: ng0 @ 2017-12-17 22:06 UTC (permalink / raw)
  To: Mark Meyer; +Cc: 29760

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

Mark Meyer transcribed 5.7K bytes:
> Hi Guix,
> the following patch make surfraw search for perl during build time and
> code the path to perl into the surfraw script.
> 
> Cheers, Mark
> 
> -- 
>   Mark Meyer
>   mark@ofosos.org

> From dcc195481cb84f295a364c2c7cb023f33899745e Mon Sep 17 00:00:00 2001
> From: Mark Meyer <mark@ofosos.org>
> Date: Sun, 17 Dec 2017 22:47:15 +0100
> Subject: [PATCH] gnu: surfraw: Find path to perl.
> 
> * gnu/packages/patches/surfraw-find-perl.patch: New file.

Could you mention in the patch (or somewhere) that you've sent
this patch upstream for inclusion?
I have some build-system patches waiting in surfraw aswell, but I didn't
think they were really necessary to include in Guix.

The patch looks okay to me, need to run it to give my final okay.
Thanks for the work on it.

> * gnu/packages/web.scm (surfraw)[native-inputs]: Add autoconf, automake.
> [package]: Add surfraw-find-perl.patch.
> [arguments]: Add 'autoreconf phase.
> ---
>  gnu/packages/patches/surfraw-find-perl.patch | 35 ++++++++++++++++++++++++++++
>  gnu/packages/web.scm                         |  9 ++++++-
>  2 files changed, 43 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/packages/patches/surfraw-find-perl.patch
> 
> diff --git a/gnu/packages/patches/surfraw-find-perl.patch b/gnu/packages/patches/surfraw-find-perl.patch
> new file mode 100644
> index 000000000..b995ab025
> --- /dev/null
> +++ b/gnu/packages/patches/surfraw-find-perl.patch
> @@ -0,0 +1,35 @@
> +diff -Naur surfraw-2.2.9-orig/configure.in surfraw-2.2.9/configure.in
> +--- surfraw-2.2.9-orig/configure.in	2013-12-10 18:07:06.000000000 +0100
> ++++ surfraw-2.2.9/configure.in	2017-12-17 22:19:14.648432687 +0100
> +@@ -53,6 +53,8 @@
> + dnl Checks for programs.
> + AC_PROG_INSTALL
> + AC_PROG_AWK
> ++AC_PATH_PROG([PERL], [perl], [perl])
> ++AC_SUBST(PERL)
> + 
> + AC_CONFIG_FILES([Makefile surfraw.lsm surfraw.spec elvi/Makefile test/Makefile examples/Makefile])
> + AC_OUTPUT
> +diff -Naur surfraw-2.2.9-orig/Makefile.am surfraw-2.2.9/Makefile.am
> +--- surfraw-2.2.9-orig/Makefile.am	2013-12-10 18:07:06.000000000 +0100
> ++++ surfraw-2.2.9/Makefile.am	2017-12-17 22:13:48.205031190 +0100
> +@@ -35,6 +35,7 @@
> + 	sed -e 's,@VERSION\@,${VERSION},g; '\
> + 	    -e 's,@ELVIDIR\@,${ELVIDIR},g; '\
> + 	    -e 's,@AWK\@,${AWK},g; '\
> ++	    -e 's,@PERL\@,${PERL},g; '\
> + 	    -e 's,@sysconfdir\@,${sysconfdir},g ' $? > $@.tmp
> + 	chmod +x $@.tmp
> + 	mv $@.tmp $@
> +diff -Naur surfraw-2.2.9-orig/surfraw.IN surfraw-2.2.9/surfraw.IN
> +--- surfraw-2.2.9-orig/surfraw.IN	2013-12-10 18:07:06.000000000 +0100
> ++++ surfraw-2.2.9/surfraw.IN	2017-12-17 22:14:01.613171144 +0100
> +@@ -160,7 +160,7 @@
> + 
> + quote_ifs () {
> + 	 if [ -z "$1" ];   then return;  fi
> +-     perl -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1"
> ++     @PERL@ -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1"
> + }
> + 
> + bookmark_file_search () {
> diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
> index eb0436cb3..766582ab1 100644
> --- a/gnu/packages/web.scm
> +++ b/gnu/packages/web.scm
> @@ -4701,11 +4701,15 @@ handling many of the web standards in use today.")
>                                    name "-" version ".tar.gz"))
>                (sha256
>                 (base32
> -                "1fy4ph5h9kp0jzj1m6pfylxnnmgdk0mmdppw76z9jhna4jndk5xa"))))
> +                "1fy4ph5h9kp0jzj1m6pfylxnnmgdk0mmdppw76z9jhna4jndk5xa"))
> +              (patches (search-patches "surfraw-find-perl.patch"))))
>      (build-system gnu-build-system)
>      (arguments
>       `(#:phases
>         (modify-phases %standard-phases
> +         (add-after 'unpack 'autoreconf ; required for the patch
> +           (lambda* _
> +             (zero? (system* "autoreconf"))))
>           (add-after 'install 'compress-elvi.1sr
>             (lambda* (#:key outputs #:allow-other-keys)
>               ;; The manpages of the elvis are symlinks to elvi.1sr.gz
> @@ -4714,6 +4718,9 @@ handling many of the web standards in use today.")
>                      (man (string-append out "/share/man/man1")))
>                 (with-directory-excursion man
>                   (zero? (system* "gzip" "elvi.1sr")))))))))
> +    (native-inputs
> +     `(("autoconf" ,autoconf)
> +       ("automake" ,automake)))
>      (inputs
>       `(("perl" ,perl)
>         ("perl-www-opensearch" ,perl-www-opensearch)
> -- 
> 2.15.1
> 


-- 
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://c.n0.is/ng0_pubkeys/tree/keys
  WWW: https://n0.is

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#29760] [PATCH] surfraw: hardcode perl during build time
  2017-12-17 21:51 [bug#29760] [PATCH] surfraw: hardcode perl during build time Mark Meyer
  2017-12-17 22:01 ` [bug#29760] Future of this patch Mark Meyer
  2017-12-17 22:06 ` [bug#29760] [PATCH] surfraw: hardcode perl during build time ng0
@ 2017-12-22  8:54 ` Ludovic Courtès
  2018-01-04 17:19 ` [bug#29760] substitute patch Mark Meyer
  3 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2017-12-22  8:54 UTC (permalink / raw)
  To: Mark Meyer; +Cc: 29760

Hi Mark,

Mark Meyer <mark@ofosos.org> skribis:

> From dcc195481cb84f295a364c2c7cb023f33899745e Mon Sep 17 00:00:00 2001
> From: Mark Meyer <mark@ofosos.org>
> Date: Sun, 17 Dec 2017 22:47:15 +0100
> Subject: [PATCH] gnu: surfraw: Find path to perl.
>
> * gnu/packages/patches/surfraw-find-perl.patch: New file.
> * gnu/packages/web.scm (surfraw)[native-inputs]: Add autoconf, automake.
> [package]: Add surfraw-find-perl.patch.
> [arguments]: Add 'autoreconf phase.
> ---
>  gnu/packages/patches/surfraw-find-perl.patch | 35 ++++++++++++++++++++++++++++
>  gnu/packages/web.scm                         |  9 ++++++-
>  2 files changed, 43 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/packages/patches/surfraw-find-perl.patch
>
> diff --git a/gnu/packages/patches/surfraw-find-perl.patch b/gnu/packages/patches/surfraw-find-perl.patch
> new file mode 100644
> index 000000000..b995ab025
> --- /dev/null
> +++ b/gnu/packages/patches/surfraw-find-perl.patch
> @@ -0,0 +1,35 @@
> +diff -Naur surfraw-2.2.9-orig/configure.in surfraw-2.2.9/configure.in
> +--- surfraw-2.2.9-orig/configure.in	2013-12-10 18:07:06.000000000 +0100
> ++++ surfraw-2.2.9/configure.in	2017-12-17 22:19:14.648432687 +0100
> +@@ -53,6 +53,8 @@
> + dnl Checks for programs.
> + AC_PROG_INSTALL
> + AC_PROG_AWK
> ++AC_PATH_PROG([PERL], [perl], [perl])
> ++AC_SUBST(PERL)
> + 
> + AC_CONFIG_FILES([Makefile surfraw.lsm surfraw.spec elvi/Makefile test/Makefile examples/Makefile])
> + AC_OUTPUT
> +diff -Naur surfraw-2.2.9-orig/Makefile.am surfraw-2.2.9/Makefile.am
> +--- surfraw-2.2.9-orig/Makefile.am	2013-12-10 18:07:06.000000000 +0100
> ++++ surfraw-2.2.9/Makefile.am	2017-12-17 22:13:48.205031190 +0100
> +@@ -35,6 +35,7 @@
> + 	sed -e 's,@VERSION\@,${VERSION},g; '\
> + 	    -e 's,@ELVIDIR\@,${ELVIDIR},g; '\
> + 	    -e 's,@AWK\@,${AWK},g; '\
> ++	    -e 's,@PERL\@,${PERL},g; '\
> + 	    -e 's,@sysconfdir\@,${sysconfdir},g ' $? > $@.tmp
> + 	chmod +x $@.tmp
> + 	mv $@.tmp $@
> +diff -Naur surfraw-2.2.9-orig/surfraw.IN surfraw-2.2.9/surfraw.IN
> +--- surfraw-2.2.9-orig/surfraw.IN	2013-12-10 18:07:06.000000000 +0100
> ++++ surfraw-2.2.9/surfraw.IN	2017-12-17 22:14:01.613171144 +0100
> +@@ -160,7 +160,7 @@
> + 
> + quote_ifs () {
> + 	 if [ -z "$1" ];   then return;  fi
> +-     perl -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1"
> ++     @PERL@ -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1"
> + }
> + 
> + bookmark_file_search () {

I think this is the right patch for upstream.

However, for Guix proper, we might be better off simply patching the
relevant file with ‘substitute*’ in a post-install phase for instance.
That way we would avoid the extra dependency on Autoconf/Automake.

How does that sound?

If that’s too cumbersome we can apply this patch.

Thanks,
Ludo’.

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

* [bug#29760] substitute patch
  2017-12-17 21:51 [bug#29760] [PATCH] surfraw: hardcode perl during build time Mark Meyer
                   ` (2 preceding siblings ...)
  2017-12-22  8:54 ` Ludovic Courtès
@ 2018-01-04 17:19 ` Mark Meyer
  2018-01-04 18:37   ` bug#29760: " Leo Famulari
  3 siblings, 1 reply; 6+ messages in thread
From: Mark Meyer @ 2018-01-04 17:19 UTC (permalink / raw)
  To: 29760

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

Hi,
this is a patch with the substitute solution.

Cheers, Mark

-- 
  Mark Meyer
  mark@ofosos.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-surfraw-Point-to-correct-perl-binary.patch --]
[-- Type: text/x-patch; name="0001-gnu-surfraw-Point-to-correct-perl-binary.patch", Size: 1100 bytes --]

From f1b0252ec4b88ef7e9be74c2d954cdbae2ce1a2b Mon Sep 17 00:00:00 2001
From: Mark Meyer <mark@ofosos.org>
Date: Thu, 4 Jan 2018 18:17:38 +0100
Subject: [PATCH] gnu: surfraw: Point to correct perl binary.

* gnu/packages/web.scm (surfraw): Patch standard phases.
---
 gnu/packages/web.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index eb0436cb3..f2ed7c4b7 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -4706,6 +4706,12 @@ handling many of the web standards in use today.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-before 'configure 'patch-perl
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((perl (assoc-ref inputs "perl")))
+               (substitute* "surfraw.IN"
+                 (("perl -e")
+                  (string-append perl "/bin/perl -e"))))))
          (add-after 'install 'compress-elvi.1sr
            (lambda* (#:key outputs #:allow-other-keys)
              ;; The manpages of the elvis are symlinks to elvi.1sr.gz
-- 
2.15.1


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

* bug#29760: substitute patch
  2018-01-04 17:19 ` [bug#29760] substitute patch Mark Meyer
@ 2018-01-04 18:37   ` Leo Famulari
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2018-01-04 18:37 UTC (permalink / raw)
  To: Mark Meyer; +Cc: 29760-done

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

On Thu, Jan 04, 2018 at 06:19:52PM +0100, Mark Meyer wrote:
> Hi,
> this is a patch with the substitute solution.
> 
> Cheers, Mark
> 
> -- 
>   Mark Meyer
>   mark@ofosos.org

> From f1b0252ec4b88ef7e9be74c2d954cdbae2ce1a2b Mon Sep 17 00:00:00 2001
> From: Mark Meyer <mark@ofosos.org>
> Date: Thu, 4 Jan 2018 18:17:38 +0100
> Subject: [PATCH] gnu: surfraw: Point to correct perl binary.
> 
> * gnu/packages/web.scm (surfraw): Patch standard phases.

Thanks! I added some detail to the commit message and made sure the new
phase returns #t, and pushed as
72687ca5d2d8d1dd55b152823a164606fa421d9c.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-01-04 18:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-17 21:51 [bug#29760] [PATCH] surfraw: hardcode perl during build time Mark Meyer
2017-12-17 22:01 ` [bug#29760] Future of this patch Mark Meyer
2017-12-17 22:06 ` [bug#29760] [PATCH] surfraw: hardcode perl during build time ng0
2017-12-22  8:54 ` Ludovic Courtès
2018-01-04 17:19 ` [bug#29760] substitute patch Mark Meyer
2018-01-04 18:37   ` bug#29760: " Leo Famulari

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.