[PATCH] gnu: surf: Add 'dmenu' and 'xprop' to 'inputs'.

  • Done
  • quality assurance status badge
Details
5 participants
  • Danny Milosavljevic
  • Kei Kebreau
  • Leo Famulari
  • Ludovic Courtès
  • Mekeor Melire
Owner
unassigned
Submitted by
Mekeor Melire
Severity
normal
M
M
Mekeor Melire wrote on 6 Mar 2017 02:55
(address . guix-patches@gnu.org)
87mvczch1w.fsf@gmail.com
This is meant to fix bug#25759 “Should 'surf' depend on 'xprop' and
'dmenu'?“:


I'm not sure if we really want this patch to be merged because there was
not much of a discussion on this proposal on the mailing list.

Also, I hope I'm sending it to the right mailing-list. I'm quite
confused by all the mailing-lists and bug-trackers.
From 4f11e27908987cc8d607809785726fceadc0535f Mon Sep 17 00:00:00 2001
From: Mekeor Melire <mekeor.melire@gmail.com>
Date: Mon, 6 Mar 2017 02:36:47 +0100
Subject: [PATCH] gnu: surf: Add 'dmenu' and 'xprop' to 'inputs'.

* gnu/packages/suckless.scm (surf)[inputs]: Add dmenu and xprop.
---
gnu/packages/suckless.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index e30a0883a..c845a0c72 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -257,9 +257,11 @@ drawing.")
(modify-phases %standard-phases
(delete 'configure))))
(inputs
- `(("glib-networking" ,glib-networking)
+ `(("dmenu" ,dmenu)
+ ("glib-networking" ,glib-networking)
("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
- ("webkitgtk" ,webkitgtk/gtk+-2)))
+ ("webkitgtk" ,webkitgtk/gtk+-2)
+ ("xprop" ,xprop)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(home-page "http://surf.suckless.org/")
--
2.12.0
--
mekeor ~ EDD3 DFFA 76F6 11C0 145F 9A99 AC85 BAD8 A2F8 C868
D
D
Danny Milosavljevic wrote on 6 Mar 2017 03:09
(name . Mekeor Melire)(address . mekeor.melire@gmail.com)(address . 25991@debbugs.gnu.org)
20170306030908.2599fc96@scratchpost.org
Hi,

On Mon, 06 Mar 2017 02:55:01 +0100
Mekeor Melire <mekeor.melire@gmail.com> wrote:

Toggle quote (8 lines)
> This is meant to fix bug#25759 “Should 'surf' depend on 'xprop' and
> 'dmenu'?“:
>
> https://lists.gnu.org/archive/html/bug-guix/2017-02/msg00054.html
>
> I'm not sure if we really want this patch to be merged because there was
> not much of a discussion on this proposal on the mailing list.

It's not finished. http://git.suckless.org/surf/tree/config.def.h#n38invokes xprop and dmenu - and these places would have to be substituted by store references, like:

(substitute* "tree/config.def.h"
(("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop"))
(("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu")))

I'm not sure whether Guix will retain the store references on the next GC, though.
K
K
Kei Kebreau wrote on 6 Mar 2017 04:20
(name . Mekeor Melire)(address . mekeor.melire@gmail.com)(address . 25991@debbugs.gnu.org)
87zigzgkgm.fsf@openmailbox.org
Mekeor Melire <mekeor.melire@gmail.com> writes:

Toggle quote (9 lines)
> This is meant to fix bug#25759 “Should 'surf' depend on 'xprop' and
> 'dmenu'?“:
>
> https://lists.gnu.org/archive/html/bug-guix/2017-02/msg00054.html
>
> I'm not sure if we really want this patch to be merged because there was
> not much of a discussion on this proposal on the mailing list.
>

This patch concerns basic functionality of the software, so I don't
think we'll hear objections.

Toggle quote (4 lines)
> Also, I hope I'm sending it to the right mailing-list. I'm quite
> confused by all the mailing-lists and bug-trackers.
>

I'm seeing this in my debbugs interface, so you must be doing something
correctly.

Toggle quote (29 lines)
>>From 4f11e27908987cc8d607809785726fceadc0535f Mon Sep 17 00:00:00 2001
> From: Mekeor Melire <mekeor.melire@gmail.com>
> Date: Mon, 6 Mar 2017 02:36:47 +0100
> Subject: [PATCH] gnu: surf: Add 'dmenu' and 'xprop' to 'inputs'.
>
> * gnu/packages/suckless.scm (surf)[inputs]: Add dmenu and xprop.
> ---
> gnu/packages/suckless.scm | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
> index e30a0883a..c845a0c72 100644
> --- a/gnu/packages/suckless.scm
> +++ b/gnu/packages/suckless.scm
> @@ -257,9 +257,11 @@ drawing.")
> (modify-phases %standard-phases
> (delete 'configure))))
> (inputs
> - `(("glib-networking" ,glib-networking)
> + `(("dmenu" ,dmenu)
> + ("glib-networking" ,glib-networking)
> ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
> - ("webkitgtk" ,webkitgtk/gtk+-2)))
> + ("webkitgtk" ,webkitgtk/gtk+-2)
> + ("xprop" ,xprop)))
> (native-inputs
> `(("pkg-config" ,pkg-config)))
> (home-page "http://surf.suckless.org/")

This patch doesn't work as-is, but it's halfway done. The next step
would be to replace the "dmenu" and "xprop" instances in surf's source
code with the path to the two binaries you just included. For example:

(let ((libc (assoc-ref inputs "libc")))
(substitute* "lib/nscd.c"
(("/usr/sbin/nscd")
(string-append libc "/sbin/nscd"))))

This code was taken from line 296 of gnu/packages/admin.scm in the Guix
source tree.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAli81WkACgkQ5qXuPBlG
eg0coxAArKyuWrtaXXRfrvsWLaiItIuWQAv4X/hR4pwisQ9vCqAEdvozaOP0GkKp
M5fUP1oBLHSIJpBUISVZ8DdLHafpgK+y7iAC3MMryhfK0qLxizFPqKVE6ZTl4eTE
hykYknRIr4EKyM5qquycFlymiPekRcid6n18oN9y/KFmIC61sm9Sdf7F2g12httV
05zEDJIHDZ/zfgql5e8Rpm32cnFbrXJ6lIXu3H2+r4inl+IX6HfLikt0l2U6KOux
SjSsVpXs3+2vg2M9R8wxYnLXHQ+A/a4/8lORfabT/nspZmoAmKWI1I6/x0CioZpK
9sHIoTlCxuAPeNI8jw7HK+Wr3QiWtJM/myGsWsG2R7w0W6c//sHVlcfis8hbNIu1
YaUNJAIoJ7p2GxKxMrqHVBQM7bTrDvYdSVCVielkDvqSmmavtuFYH6NSe/ks07S5
p8LMTSnqCp3r3zhU2ppnKrUA7f8j9JREFDU65tuEdKUwHB3S75YHJqSPmTCWIhla
yVX2zyW3RUP22Tx5bxC8TTD/b+9SOeDST/krJw0OPvIcDFR/HpV8+uEekezj9A1t
CLVeN1pjBpOkJODTzTvy/6swMPML0oCvKF06Tmt0ARbbJ5KbffdwbkmJIs/ZiNvZ
5CdvYk3Ob8CVU/w+IvCARXq3m9b/0JE5zfPt3AzQic61pIyS/i0=
=uGDP
-----END PGP SIGNATURE-----

K
K
Kei Kebreau wrote on 6 Mar 2017 04:23
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87wpc3gkaj.fsf@openmailbox.org
Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (24 lines)
> Hi,
>
> On Mon, 06 Mar 2017 02:55:01 +0100
> Mekeor Melire <mekeor.melire@gmail.com> wrote:
>
>> This is meant to fix bug#25759 “Should 'surf' depend on 'xprop' and
>> 'dmenu'?“:
>>
>> https://lists.gnu.org/archive/html/bug-guix/2017-02/msg00054.html
>>
>> I'm not sure if we really want this patch to be merged because there was
>> not much of a discussion on this proposal on the mailing list.
>
> It's not finished. http://git.suckless.org/surf/tree/config.def.h#n38
> invokes xprop and dmenu - and these places would have to be
> substituted by store references, like:
>
> (substitute* "tree/config.def.h"
> (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop"))
> (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu")))
>
> I'm not sure whether Guix will retain the store references on the next
> GC, though.

I'm sure Guix does, considering we use this trick for all sorts of
packages, including important ones like shadow.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAli81kUACgkQ5qXuPBlG
eg2qtBAAuHYBZOUBbkLQklBryOXVdm4tWAj66fxsijMyCFHnjkMw09XRcEAvchuN
VT/0pTtexLcMy0nRwq+Au0g29a3xle+MK+WHckjYCuqFomFJsGS/lG2RNnU6dir8
5kIBk58UV58DC3PV7PQ0asS4oNOsRFWOmaRwIwH3R/h2TP78nqLKN3LFBHe27pqB
yyEVYKMlcERWGnVTn1/W9Bx3t6DCRgRJ0FPDpsm5P7BV4Kl87yHlS77ol5idzV70
FIsxAztvYJgaDfWOBglDdSDYdC9T83OF0a4xVkcw+gD0LvGSG9ryv4pu2C4ydiCY
w/bO256CDNzFGGdhOgSt2JWaE0wMVQ/E8E3lJ5bdevxNao/ppwFUoHh/LRS1Biiv
nAQDk2wRX2XUzfkVwq0IKVeMtnXgi2ixZOFvApzJTDPOpj6oNuqyGwyInJcZgOwf
fBUBoPrKMa3srCGUx+TYsmpRHL4MPK2Nkzh8zzvfR50+AgX+9KZ8vDYmyhi0XxzY
J4KgKY+YjUkKrid0BoA2YAD0UyCd2ho6gVpbwvKMt3yjQMEOGyiA2B9i8SoAVlsj
fCDE6hRw4a2mMBicgguJjlippgfzzLc2T2XjusDk3FBXx70dykC89irafhI0jnOq
Sn9SKqq1mfxygHk5MOweV/lGPnJ90Ni6JgnIcQWKAfBmfBAjB/8=
=mevo
-----END PGP SIGNATURE-----

L
L
Leo Famulari wrote on 6 Mar 2017 19:38
(name . Kei Kebreau)(address . kei@openmailbox.org)
20170306183828.GC2185@jasmine
On Sun, Mar 05, 2017 at 10:23:48PM -0500, Kei Kebreau wrote:
Toggle quote (15 lines)
> Danny Milosavljevic <dannym@scratchpost.org> writes:
> > It's not finished. http://git.suckless.org/surf/tree/config.def.h#n38
> > invokes xprop and dmenu - and these places would have to be
> > substituted by store references, like:
> >
> > (substitute* "tree/config.def.h"
> > (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop"))
> > (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu")))
> >
> > I'm not sure whether Guix will retain the store references on the next
> > GC, though.
>
> I'm sure Guix does, considering we use this trick for all sorts of
> packages, including important ones like shadow.

Basically, after building the package, Guix scans the built output for
store references. That is, strings like '/gnu/store/cabba9e...-foo-1.0/'.

If it finds them, they are recorded in a database in $localstatedir.

If the store references are obscured somehow [0], this method fails and
things break.

So, as long as 'tree/config.def.h' is included in the built output of
surf as plaintext, everything should work.

[0] For example, in cases like these:
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAli9rKQACgkQJkb6MLrK
fwh+1g//Q66IYJxpclsspLAXbFHBmz0tO+Ia8Zh1sdEY1QDNLHXm1qBLfO4DLBTW
yXwt1u6pnIN0z40w+yohMDDmaOJkVN+xQCDU6gg8pY/p3+Bt7z+Rn2aMJ4nFAkjr
L4q/CqKTjNjSINaAXb4vTSUaklwfbHJVYnxQjQM6znJIYB3ppz0Y/SockMrEo6jW
T9tuML7hpfgAevmzMaKlc8K7LzQbj3yKiglZagdyOeC9PHbnPCraFGhSPdxz5lgH
I0JnKnTGsq5KTM75mnr93lwg5eARqJS72a6nI+OEAHDOO6LRMPwmo+HWdNyoW3Lb
5zvs7d4EzaXBMishI4n/JmJXBltn6lAmLb74QE6khrtmYz7+J5xHxw+h9fLYUZJS
Z72Y/wdLygt2+MjEFUXj/jSS/U2EvSwI9fYhmYheGe0Ze4eV/ngi4k4O4ydJudPy
RydVN3ygT/sg1RhT1RW1mbfwewxMNe4kUDDcfKLNG9K2/rWkuLwxf3CzgtwzcTt8
X+vvTc3rveBmN+RpBMambKO7bW/lMT0mLeHVn8hyqRWFajyW6CZs/QrwaI/Ov++k
Xpk6Jk01U+msAZeTAheMXUbQUvBb44o6HJQgJwC5173OmGm/G5Uz4xuldb5yI8W1
m3QjCJ8foQ9FebT4MyTW+dYQG4g6DsUiyR1CwxyBU6nx6QIvVew=
=xvKB
-----END PGP SIGNATURE-----


M
M
Mekeor Melire wrote on 6 Mar 2017 20:07
(name . Kei Kebreau)(address . kei@openmailbox.org)
8737eqb4vy.fsf@gmail.com
Hello Guix.

I'm sorry, I was too careless about this. The new, revised patch is
attached inline at the end.

Kei Kebreau <kei@openmailbox.org> writes:

Toggle quote (6 lines)
> Danny Milosavljevic <dannym@scratchpost.org> writes:
>
>> (substitute* "tree/config.def.h"
>> (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop"))
>> (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu")))

--
mekeor ~ EDD3 DFFA 76F6 11C0 145F 9A99 AC85 BAD8 A2F8 C868
From bb7b07e301305ce7f1d113b10d27e7d4130989c5 Mon Sep 17 00:00:00 2001
From: Mekeor Melire <mekeor.melire@gmail.com>
Date: Mon, 6 Mar 2017 02:36:47 +0100
Subject: [PATCH] gnu: surf: Add 'dmenu' and 'xprop' to 'inputs'.

* gnu/packages/suckless.scm (surf)[inputs]: Add dmenu and xprop.
---
gnu/packages/suckless.scm | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

Toggle diff (30 lines)
diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index e30a0883a..33eb69ffb 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -255,11 +255,20 @@ drawing.")
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
- (delete 'configure))))
+ (delete 'configure)
+ ;; Use the right file name for dmenu and xprop.
+ (add-before 'build 'set-dmenu-and-xprop-file-name
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "tree/config.def.h"
+ (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu"))
+ (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop")))
+ #t)))))
(inputs
- `(("glib-networking" ,glib-networking)
+ `(("dmenu" ,dmenu)
+ ("glib-networking" ,glib-networking)
("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
- ("webkitgtk" ,webkitgtk/gtk+-2)))
+ ("webkitgtk" ,webkitgtk/gtk+-2)
+ ("xprop" ,xprop)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(home-page "http://surf.suckless.org/")
--
2.12.0
K
K
Kei Kebreau wrote on 7 Mar 2017 06:36
(name . Mekeor Melire)(address . mekeor.melire@gmail.com)
87r329hcmy.fsf@openmailbox.org
Mekeor Melire <mekeor.melire@gmail.com> writes:

Toggle quote (41 lines)
> Hello Guix.
>
> I'm sorry, I was too careless about this. The new, revised patch is
> attached inline at the end.
>
> Kei Kebreau <kei@openmailbox.org> writes:
>
>> Danny Milosavljevic <dannym@scratchpost.org> writes:
>>
>>> (substitute* "tree/config.def.h"
>>> (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop"))
>>> (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu")))
>
> --
> mekeor ~ EDD3 DFFA 76F6 11C0 145F 9A99 AC85 BAD8 A2F8 C868
>
>>From bb7b07e301305ce7f1d113b10d27e7d4130989c5 Mon Sep 17 00:00:00 2001
> From: Mekeor Melire <mekeor.melire@gmail.com>
> Date: Mon, 6 Mar 2017 02:36:47 +0100
> Subject: [PATCH] gnu: surf: Add 'dmenu' and 'xprop' to 'inputs'.
>
> * gnu/packages/suckless.scm (surf)[inputs]: Add dmenu and xprop.
> ---
> gnu/packages/suckless.scm | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
> index e30a0883a..33eb69ffb 100644
> --- a/gnu/packages/suckless.scm
> +++ b/gnu/packages/suckless.scm
> @@ -255,11 +255,20 @@ drawing.")
> (string-append "PREFIX=" %output))
> #:phases
> (modify-phases %standard-phases
> - (delete 'configure))))
> + (delete 'configure)
> + ;; Use the right file name for dmenu and xprop.
> + (add-before 'build 'set-dmenu-and-xprop-file-name
> + (lambda* (#:key inputs #:allow-other-keys)
> + (substitute* "tree/config.def.h"

It turns out we only needed "config.def.h" here.

Toggle quote (15 lines)
> + (("dmenu") (string-append (assoc-ref inputs "dmenu") "/bin/dmenu"))
> + (("xprop") (string-append (assoc-ref inputs "xprop") "/bin/xprop")))
> + #t)))))
> (inputs
> - `(("glib-networking" ,glib-networking)
> + `(("dmenu" ,dmenu)
> + ("glib-networking" ,glib-networking)
> ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
> - ("webkitgtk" ,webkitgtk/gtk+-2)))
> + ("webkitgtk" ,webkitgtk/gtk+-2)
> + ("xprop" ,xprop)))
> (native-inputs
> `(("pkg-config" ,pkg-config)))
> (home-page "http://surf.suckless.org/")

Works like a charm.
Pushed to master as 45321beb7d6cc92ff20ef1811bcc8119bb822ed9 with info
added about the new phase.

Thanks for the patch!
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAli+RsUACgkQ5qXuPBlG
eg1mSg/9HfmLo/GwrXSFZnxdBtFigQau+qRuWiLOyefw2fYoM6r1iHsqPKMh/cP4
mjuugdIadRWl8yA18IGfXKDcH7SleGB+FQNJk24JyksrU49hfSM1EMlLNRUndrKn
ogfi8FTih52+baYEkdfATfQziXW3VUa9OOHWAkxYDWuDWYko7JnvBp4ut1CKoGnL
UAs8+jqNjsSDWZZHbm526g6J476GuDkayYa5CmrQqmtKRbNIZ+Gc2Pfcjfs4q2w/
Qr4oZJ7hucvr8HpFTVm+u32Y/jSuK5Fx0dfpjHeASJ0G7PPCT0Xl7Fq/a9Aksb9G
9ED7H/Ir7U2E7uNPlumV72Kc5TN/g/fCMtMcNzPnGLdfCg77A548IpKbB/CO9jOE
wyuVlB1ORPZpdtCx3JzEKW5zZ/1HjDGu9LjEgWrTgLE3HtdCUo/9Op3cVpNFzSUS
C5rKVEAwd4owuTxu7sR5LOXSXOzd9uwINiC01u5SaRKq3l4kIyb1WB4wvS5q1haq
t/PeD10jkd1foYzBRdoS+TgO0bnzDfKoKT9y+tNrjia8BtCVxALDLPheYYdBSt0N
Mv/gx0r4+c4x/yexIwAqa6Hqj/4eisnAcN9sOMp8SraeUDwoQ+tWu1CRO7afvEKa
zYQYBQydDQahOyuK3n8CcDWTbngqMEiEmyp4EqA88jJ9cXzj2dA=
=6KLV
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 7 Mar 2017 18:04
control message for bug #25991
(address . control@debbugs.gnu.org)
87efy99fwy.fsf@gnu.org
tags 25991 fixed
close 25991
?