[PATCH] gnu: go-github-com-charmbracelet-bubbletea: Delete examples.

  • Done
  • quality assurance status badge
Details
3 participants
  • Hilton Chain
  • Sharlatan Hellseher
  • Troy Figiel
Owner
unassigned
Submitted by
Troy Figiel
Severity
normal
T
T
Troy Figiel wrote on 11 Feb 01:24 +0100
(address . guix-patches@gnu.org)
87ttmf9tj0.fsf@troyfigiel.com
* gnu/packages/golang.scm (go-github-com-charmbracelet-bubbletea)[source]: Delete examples and tutorials.
---
gnu/packages/golang.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 163691a1e6..d917f02a25 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -10443,7 +10443,10 @@ (define-public go-github-com-charmbracelet-bubbletea
(file-name (git-file-name name version))
(sha256
(base32
- "1105cggi5fwqx69m0vrhgwx6kaw82w4ahn58sj0a81603c4yvrk0"))))
+ "1105cggi5fwqx69m0vrhgwx6kaw82w4ahn58sj0a81603c4yvrk0"))
+ (modules '((guix build utils)))
+ (snippet '(for-each delete-file-recursively
+ '("examples" "tutorials")))))
(build-system go-build-system)
(arguments
`(#:import-path "github.com/charmbracelet/bubbletea"))

base-commit: 9edbb2d7a40c9da7583a1046e39b87633459f656
--
2.42.0
T
T
Troy Figiel wrote on 11 Feb 11:50 +0100
(address . guix-patches@gnu.org)
7a3b964d-36ff-4c10-b83a-be696a6332c6@troyfigiel.com
As a note, quite a few Go packages come with "examples", "tutorials" or
"benchmarks". These prevent us from recursively building or testing all
packages, as they often come with their own go.mod file or require Go
libraries that create cyclical dependencies. These directories are not
needed for the package to work though.

On 2024-02-11 01:24, Troy Figiel wrote:
Toggle quote (23 lines)
> * gnu/packages/golang.scm (go-github-com-charmbracelet-bubbletea)[source]: Delete examples and tutorials.
> ---
> gnu/packages/golang.scm | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
> index 163691a1e6..d917f02a25 100644
> --- a/gnu/packages/golang.scm
> +++ b/gnu/packages/golang.scm
> @@ -10443,7 +10443,10 @@ (define-public go-github-com-charmbracelet-bubbletea
> (file-name (git-file-name name version))
> (sha256
> (base32
> - "1105cggi5fwqx69m0vrhgwx6kaw82w4ahn58sj0a81603c4yvrk0"))))
> + "1105cggi5fwqx69m0vrhgwx6kaw82w4ahn58sj0a81603c4yvrk0"))
> + (modules '((guix build utils)))
> + (snippet '(for-each delete-file-recursively
> + '("examples" "tutorials")))))
> (build-system go-build-system)
> (arguments
> `(#:import-path "github.com/charmbracelet/bubbletea"))
>
> base-commit: 9edbb2d7a40c9da7583a1046e39b87633459f656
T
T
Troy Figiel wrote on 11 Feb 12:26 +0100
(address . 69043@debbugs.gnu.org)
87le7r9r83.fsf@troyfigiel.com
I used the word "delete" here, whereas other patches use "remove". I
wasn't sure which word would be better, but uniformizing would be best
anyway.
H
H
Hilton Chain wrote on 11 Feb 15:24 +0100
(name . Troy Figiel)(address . troy@troyfigiel.com)(address . 69043@debbugs.gnu.org)
87y1brrscw.wl-hako@ultrarare.space
Hi Troy,

On Sun, 11 Feb 2024 18:50:18 +0800,
Troy Figiel wrote:
Toggle quote (32 lines)
>
> As a note, quite a few Go packages come with "examples", "tutorials" or
> "benchmarks". These prevent us from recursively building or testing all
> packages, as they often come with their own go.mod file or require Go
> libraries that create cyclical dependencies. These directories are not
> needed for the package to work though.
>
> On 2024-02-11 01:24, Troy Figiel wrote:
> > * gnu/packages/golang.scm (go-github-com-charmbracelet-bubbletea)[source]: Delete examples and tutorials.
> > ---
> > gnu/packages/golang.scm | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
> > index 163691a1e6..d917f02a25 100644
> > --- a/gnu/packages/golang.scm
> > +++ b/gnu/packages/golang.scm
> > @@ -10443,7 +10443,10 @@ (define-public go-github-com-charmbracelet-bubbletea
> > (file-name (git-file-name name version))
> > (sha256
> > (base32
> > - "1105cggi5fwqx69m0vrhgwx6kaw82w4ahn58sj0a81603c4yvrk0"))))
> > + "1105cggi5fwqx69m0vrhgwx6kaw82w4ahn58sj0a81603c4yvrk0"))
> > + (modules '((guix build utils)))
> > + (snippet '(for-each delete-file-recursively
> > + '("examples" "tutorials")))))
> > (build-system go-build-system)
> > (arguments
> > `(#:import-path "github.com/charmbracelet/bubbletea"))
> >
> > base-commit: 9edbb2d7a40c9da7583a1046e39b87633459f656

Since examples and tutorials are still useful for context like getting source
code with ‘guix build --source go-github-com-charmbracelet-bubbletea’, and when
distributing source code, it makes more sense to have them as well, I'd suggest
deleting them in a separate build phase.

Thanks
T
T
Troy Figiel wrote on 11 Feb 17:44 +0100
(name . Hilton Chain)(address . hako@ultrarare.space)(address . 69043@debbugs.gnu.org)
abb6a15f-ea94-4442-bdc5-2b411e9cba01@troyfigiel.com
Hi,

On 2024-02-11 15:24, Hilton Chain wrote:
Toggle quote (5 lines)
> Since examples and tutorials are still useful for context like getting source
> code with ‘guix build --source go-github-com-charmbracelet-bubbletea’, and when
> distributing source code, it makes more sense to have them as well, I'd suggest
> deleting them in a separate build phase.

Good point, I will add a phase after the unpack phase.

Best wishes,

Troy
T
T
Troy Figiel wrote on 11 Feb 01:24 +0100
[PATCH v2] gnu: go-github-com-charmbracelet-bubbletea: Remove examples.
(address . 69043@debbugs.gnu.org)
87a5o79bpp.fsf@troyfigiel.com
* gnu/packages/golang.scm (go-github-com-charmbracelet-bubbletea): Remove
examples and tutorials.
[arguments]<#:phases>: Add remove-examples phase.
---
gnu/packages/golang.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 163691a1e6..734db8ca30 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -10446,7 +10446,14 @@ (define-public go-github-com-charmbracelet-bubbletea
"1105cggi5fwqx69m0vrhgwx6kaw82w4ahn58sj0a81603c4yvrk0"))))
(build-system go-build-system)
(arguments
- `(#:import-path "github.com/charmbracelet/bubbletea"))
+ (list
+ #:import-path "github.com/charmbracelet/bubbletea"
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'remove-examples
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ (for-each delete-file-recursively
+ '("examples" "tutorials"))))))))
(propagated-inputs
`(("github.com/mattn/go-isatty" ,go-github-com-mattn-go-isatty)
("github.com/muesli/termenv" ,go-github-com-muesli-termenv)

base-commit: 16d2be641424815a1779119bb64bc6ba1be1161b
--
2.42.0
S
S
Sharlatan Hellseher wrote on 13 Feb 22:41 +0100
[PATCH] gnu: go-github-com-charmbracelet-bubbletea: Delete examples.
(address . 69043-done@debbugs.gnu.org)
8734twoxd7.fsf@gmail.com
Hi,

Pushed as 14ea50518d26060b12149078371b4a50e0dee938 to master.

--
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmXL4hQACgkQdtcnv/Ys
0rX0Mg/+NKu/ZbnS7HkHlPC1SyNtoFLl3XZTdo40bZeuPL1fHrdm16IuSDwm6ius
PU9hHgg9z4pGdYmioASnY08IaGgHhIXB0aD1YwI2B91z0vux7B8/MgBVwMbOLt4Q
zjWXd+vmBbcncQmTLDZqTSaSkS0oYkBqrQMAf/qw7HZuYRY8yB4/0pnmhSdr8sUI
dz7zALazr+n8WE5/T56q0/MG2n6bhAq4PE0tRpJXqmzYVqba8SHtUK6j80sb5yLk
DH1+9ZtP7qxVln0UEFvy+9tDTcwKeIge5PlyvvA7gBboRY7geefuWJqSXnxN0ye3
dkNXBzW2L3DqQPgrNPW81lenen/EsWylGJAfP37PR7vINH858u2kfLhfp2Mheiba
3NPTBSmvLy91FEa2IrZEB8wlMsuQoLCWtYizYMJew+BFjrgfGi2R2SYs2yBJXrTP
tBsKwuXVRxPDeqACmt3XvMcWC2ZdgGu1yJDqCLgC+HYtJc2O0AyIdhyVzpEe/A8g
btMu/AWCL8YpCS+u9aXwaiWrkq470+kFYpM/IkxjYJ3HTw+AP6z/TST1wINrCbjK
29sENfxVfVnOc1VhD9pxmyjrIDv7ZT2dDqx2lEzEAgBBw19GTI2RO5Z0I0iOHXEo
yDG/bCO+yDfTWr1fA3sZYfKhbsZqVitYYSxFq31v9v6uziXwdkY=
=97N+
-----END PGP SIGNATURE-----

Closed
?