Message ID | 20220623093808.21573-6-contact@dhruvin.dev |
---|---|
State | Accepted |
Headers | show |
Series | [bug#54882,v4,1/6] gnu: Add go-github-com-google-shlex. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
Hello! Dhruvin Gandhi <contact@dhruvin.dev> writes: > * gnu/packages/version-control.scm (hut): New variable. > --- > gnu/packages/version-control.scm | 61 ++++++++++++++++++++++++++++++++ > 1 file changed, 61 insertions(+) > > diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm > index eefb4a01ec..860c281ab2 100644 > --- a/gnu/packages/version-control.scm > +++ b/gnu/packages/version-control.scm > @@ -45,6 +45,7 @@ > ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com> > ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com> > ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be> > +;;; Copyright © 2022 Dhruvin Gandhi <contact@dhruvin.dev> > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -104,6 +105,7 @@ (define-module (gnu packages version-control) > #:use-module (gnu packages image) > #:use-module (gnu packages linux) > #:use-module (gnu packages mail) > + #:use-module (gnu packages man) > #:use-module (gnu packages maths) > #:use-module (gnu packages nano) > #:use-module (gnu packages ncurses) > @@ -3407,3 +3409,62 @@ (define-public gitlint > "Gitlint is a Git commit message linter written in Python: it checks your > commit messages for style.") > (license license:expat))) > + > +(define-public hut > + (package > + (name "hut") > + (version "0.1.0") > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://git.sr.ht/~emersion/hut") > + (commit (string-append "v" version)))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 "15ag8fibnahcfgd0w2j4k813z10ymi39rx8d3c8b9955zc62p1fr")))) > + (build-system go-build-system) > + (arguments > + (list > + #:import-path "git.sr.ht/~emersion/hut" > + #:phases > + #~(modify-phases > + %standard-phases > + (replace 'build > + (lambda* (#:key import-path #:allow-other-keys) > + (with-directory-excursion > + (string-append "src/" import-path) > + ;; From guix/build/go-build-system.scm > + (setenv "CGO_LDFLAGS" "-s -w") > + (invoke "make" "all" "GOFLAGS=-v -x")))) > + (replace 'install > + (lambda* (#:key import-path outputs #:allow-other-keys) > + (with-directory-excursion (string-append "src/" import-path) > + (invoke "make" "install" > + (string-append "PREFIX=" (assoc-ref outputs "out"))))))))) > + (native-inputs > + (list scdoc)) > + (inputs > + (list go-golang-org-x-term > + go-golang-org-x-oauth2 > + go-github-com-spf13-cobra > + go-github-com-juju-ansiterm > + go-git-sr-ht--emersion-gqlclient > + go-git-sr-ht--emersion-go-scfg)) > + (home-page "https://git.sr.ht/~emersion/hut") > + (synopsis "CLI tool for sr.ht") > + (description "@command{hut} is a CLI tool for > +@uref{https://sr.ht/~sircmpwn/sourcehut/, sr.ht}. It helps you interact with > +sr.ht's public services: > +@itemize > +@item builds: submit, and manage build jobs > +@item git: create, and manage git repositories, and artifacts > +@item hg: list Mercurial repositories > +@item lists: manage mailing lists, and patches > +@item meta: manage PGP, and SSH keys > +@item pages: publish, and manage hosted websites > +@item paste: create, and manage pastes > +@item todo: create, and manage trackers, and tickets > +@item graphql: interact with GraphQL APIs directly > +@end itemize") > + (license license:agpl3))) Thanks for this contribution! I've applied the 6 patches of this series, making them appear in the correct order, and made some changes to them, mostly making complete sentences in the description and fixing the indentation (please use the Emacs-based formatting tool next time, or 'guix style', which should get this right). I've also removed the double hydhen ('--') from package names, as we do not have this convention in Guix. For 'hut', I've taken the liberty to adjust the package definition like: --8<---------------cut here---------------start------------->8--- modified gnu/packages/version-control.scm @@ -3464,56 +3464,63 @@ (define-public hut (name "hut") (version "0.1.0") (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.sr.ht/~emersion/hut") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "15ag8fibnahcfgd0w2j4k813z10ymi39rx8d3c8b9955zc62p1fr")))) + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~emersion/hut") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "15ag8fibnahcfgd0w2j4k813z10ymi39rx8d3c8b9955zc62p1fr")))) (build-system go-build-system) (arguments - (list - #:import-path "git.sr.ht/~emersion/hut" - #:phases - #~(modify-phases - %standard-phases + (list + #:import-path "git.sr.ht/~emersion/hut" + #:phases + #~(modify-phases %standard-phases (replace 'build (lambda* (#:key import-path #:allow-other-keys) - (with-directory-excursion - (string-append "src/" import-path) - ;; From guix/build/go-build-system.scm + (with-directory-excursion (string-append "src/" import-path) + ;; The flags are copied from (guix build go-build-system). (setenv "CGO_LDFLAGS" "-s -w") (invoke "make" "all" "GOFLAGS=-v -x")))) (replace 'install - (lambda* (#:key import-path outputs #:allow-other-keys) + (lambda* (#:key import-path #:allow-other-keys) (with-directory-excursion (string-append "src/" import-path) (invoke "make" "install" - (string-append "PREFIX=" (assoc-ref outputs "out"))))))))) + (string-append "PREFIX=" #$output)))))))) (native-inputs - (list scdoc)) + (list scdoc)) (inputs - (list go-golang-org-x-term - go-golang-org-x-oauth2 - go-github-com-spf13-cobra - go-github-com-juju-ansiterm - go-git-sr-ht--emersion-gqlclient - go-git-sr-ht--emersion-go-scfg)) + (list go-git-sr-ht-emersion-go-scfg + go-git-sr-ht-emersion-gqlclient + go-github-com-juju-ansiterm + go-github-com-spf13-cobra + go-golang-org-x-oauth2 + go-golang-org-x-term)) (home-page "https://git.sr.ht/~emersion/hut") (synopsis "CLI tool for sr.ht") (description "@command{hut} is a CLI tool for @uref{https://sr.ht/~sircmpwn/sourcehut/, sr.ht}. It helps you interact with sr.ht's public services: -@itemize -@item builds: submit, and manage build jobs -@item git: create, and manage git repositories, and artifacts -@item hg: list Mercurial repositories -@item lists: manage mailing lists, and patches -@item meta: manage PGP, and SSH keys -@item pages: publish, and manage hosted websites -@item paste: create, and manage pastes -@item todo: create, and manage trackers, and tickets -@item graphql: interact with GraphQL APIs directly -@end itemize") +@table @asis +@item builds +submit and manage build jobs +@item git +create, and manage git repositories and artifacts +@item hg +list Mercurial repositories +@item lists +manage mailing lists and patches +@item meta +manage PGP, and SSH keys +@item pages +publish and manage hosted websites +@item paste +create and manage pastes +@item todo +create and manage trackers, tickets +@item graphql +interact with GraphQL APIs directly +@end table") (license license:agpl3))) --8<---------------cut here---------------end--------------->8--- Normalizing the formatting of the code a bit, and turning the itemize list into a table in the description. Pushed, thank you! Closing.
Hey Maxim, On Sat Oct 8, 2022 at 5:16 AM BST, Maxim Cournoyer wrote: > Thanks for this contribution! I've applied the 6 patches of this > series, making them appear in the correct order, and made some changes > to them, mostly making complete sentences in the description and fixing > the indentation (please use the Emacs-based formatting tool next time, > or 'guix style', which should get this right). I've also removed the > double hydhen ('--') from package names, as we do not have this > convention in Guix. Pretty sure we already have some packages with the double-hyphen in them; also, it's not a separator, rather a translation of: git.sr.ht/~foo/bar ^^ these two characters So, wouldn't it be better to keep things consistent with them existing packages? -- (
Hi, "(" <paren@disroot.org> writes: > Hey Maxim, > > On Sat Oct 8, 2022 at 5:16 AM BST, Maxim Cournoyer wrote: >> Thanks for this contribution! I've applied the 6 patches of this >> series, making them appear in the correct order, and made some changes >> to them, mostly making complete sentences in the description and fixing >> the indentation (please use the Emacs-based formatting tool next time, >> or 'guix style', which should get this right). I've also removed the >> double hydhen ('--') from package names, as we do not have this >> convention in Guix. > > Pretty sure we already have some packages with the double-hyphen in them; > also, it's not a separator, rather a translation of: I haven't see any, but feel free to point to actual examples we have. > git.sr.ht/~foo/bar > ^^ these two characters > > So, wouldn't it be better to keep things consistent with them existing > packages? From what I understand, ~ is automatically inserted by source hut, not something meaningful, at least when it comes to the package name.
On Mon Oct 10, 2022 at 4:19 AM BST, Maxim Cournoyer wrote: > I haven't see any, but feel free to point to actual examples we have. Oh, I'm mistaken, we don't have any. > From what I understand, ~ is automatically inserted by source hut, not > something meaningful, at least when it comes to the package name. Yes. But the ~ is translated into a - by the importer. I suppose since we don't have any precedent for keeping that --, but we now do for removing it, we'd better just stick to -... -- (
Thanks for merging :) On Mon Oct 10, 2022 at 8:49 AM IST, Maxim Cournoyer wrote: > From what I understand, ~ is automatically inserted by source hut, not > something meaningful, at least when it comes to the package name. It will be important once sourcehut adds organizations/groups. They will have a different prefix. Although what exact prefix will be used is undecided, one candidate for org prefix is '+'. So, an org/repo url will be https://git.sr.ht/+<org>/<repo> I'm advised to have an indicator in package names that helps differentiate between user repo and org repo. (in #sr.ht on libera.chat) If org names are not allowed to be same as existing user names, then we don't have to worry about that prefix. But this is yet to be decided. FWIW, guixrus uses '--', i.e. go-git-sr-ht--emersion-go-scfg. This is what unmatched-paren might be recalling.
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index eefb4a01ec..860c281ab2 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -45,6 +45,7 @@ ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com> ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com> ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be> +;;; Copyright © 2022 Dhruvin Gandhi <contact@dhruvin.dev> ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,7 @@ (define-module (gnu packages version-control) #:use-module (gnu packages image) #:use-module (gnu packages linux) #:use-module (gnu packages mail) + #:use-module (gnu packages man) #:use-module (gnu packages maths) #:use-module (gnu packages nano) #:use-module (gnu packages ncurses) @@ -3407,3 +3409,62 @@ (define-public gitlint "Gitlint is a Git commit message linter written in Python: it checks your commit messages for style.") (license license:expat))) + +(define-public hut + (package + (name "hut") + (version "0.1.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~emersion/hut") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "15ag8fibnahcfgd0w2j4k813z10ymi39rx8d3c8b9955zc62p1fr")))) + (build-system go-build-system) + (arguments + (list + #:import-path "git.sr.ht/~emersion/hut" + #:phases + #~(modify-phases + %standard-phases + (replace 'build + (lambda* (#:key import-path #:allow-other-keys) + (with-directory-excursion + (string-append "src/" import-path) + ;; From guix/build/go-build-system.scm + (setenv "CGO_LDFLAGS" "-s -w") + (invoke "make" "all" "GOFLAGS=-v -x")))) + (replace 'install + (lambda* (#:key import-path outputs #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + (invoke "make" "install" + (string-append "PREFIX=" (assoc-ref outputs "out"))))))))) + (native-inputs + (list scdoc)) + (inputs + (list go-golang-org-x-term + go-golang-org-x-oauth2 + go-github-com-spf13-cobra + go-github-com-juju-ansiterm + go-git-sr-ht--emersion-gqlclient + go-git-sr-ht--emersion-go-scfg)) + (home-page "https://git.sr.ht/~emersion/hut") + (synopsis "CLI tool for sr.ht") + (description "@command{hut} is a CLI tool for +@uref{https://sr.ht/~sircmpwn/sourcehut/, sr.ht}. It helps you interact with +sr.ht's public services: +@itemize +@item builds: submit, and manage build jobs +@item git: create, and manage git repositories, and artifacts +@item hg: list Mercurial repositories +@item lists: manage mailing lists, and patches +@item meta: manage PGP, and SSH keys +@item pages: publish, and manage hosted websites +@item paste: create, and manage pastes +@item todo: create, and manage trackers, and tickets +@item graphql: interact with GraphQL APIs directly +@end itemize") + (license license:agpl3)))