1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 18:40:57 +02:00

gnu: micro: Fix version flag variables and syntax highlighting.

* gnu/packages/text-editors.scm (micro)[arguments]: Fix import
and unpack path.  Add build flags to set version, hash and build
date variables through ldflags.  Add a go-generate phase before
the build phase to generate syntax files for highlighting.

Change-Id: Ifa56e8760a702f4954343ceaf6b77d97bc5c69fd
This commit is contained in:
Ashvith Shetty 2025-04-19 19:20:59 +05:30 committed by Ludovic Courtès
parent 4567f589d8
commit 960efc55b0
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -162,53 +162,74 @@ extensions over the standard utility.")
(license license:gpl3+))) (license license:gpl3+)))
(define-public micro (define-public micro
(package (let ((commit "04c577049ca898f097cd6a2dae69af0b4d4493e1")
(name "micro") (date "April 16, 2025"))
(version "2.0.14") (package
(source (name "micro")
(origin (version "2.0.14")
(method git-fetch) (source
(uri (git-reference (origin
(url "https://github.com/zyedidia/micro") (method git-fetch)
(commit (string-append "v" version)))) (uri (git-reference
(file-name (git-file-name name version)) (url "https://github.com/zyedidia/micro")
(sha256 (commit (string-append "v" version))))
(base32 "1pcfsaq7k6q59vh3xgh8gy350apkv5rkc09d4fh15lx7m6bxbwka")))) (file-name (git-file-name name version))
(build-system go-build-system) (sha256
(arguments (base32 "1pcfsaq7k6q59vh3xgh8gy350apkv5rkc09d4fh15lx7m6bxbwka"))))
(list (build-system go-build-system)
#:install-source? #f (arguments
#:import-path "github.com/zyedidia/micro/cmd/micro" (list
#:unpack-path "github.com/zyedidia/micro" #:install-source? #f
;; Step away from cmd/micro to test the whole project. #:import-path "github.com/zyedidia/micro/v2/cmd/micro"
#:test-subdirs #~(list "../../..."))) #:unpack-path "github.com/zyedidia/micro/v2"
(inputs #:build-flags
(list go-github-com-blang-semver ;; Set value for variables in the `--version` flag
go-github-com-dustin-go-humanize #~(list (format #f "-ldflags=~a ~a ~a"
go-github-com-go-errors-errors (string-append
go-github-com-layeh-gopher-luar "-X github.com/zyedidia/micro/v2/internal/util.Version="
go-github-com-mattn-go-isatty #$version)
go-github-com-mitchellh-go-homedir (string-append
go-github-com-sergi-go-diff "-X github.com/zyedidia/micro/v2/internal/util.CommitHash="
go-github-com-stretchr-testify (string-take #$commit 7))
go-github-com-yuin-gopher-lua (format #f
go-github-com-zyedidia-clipper "-X 'github.com/zyedidia/micro/v2/internal/util.CompileDate=~a'"
go-github-com-zyedidia-glob #$date)))
go-github-com-zyedidia-go-runewidth ;; Step away from cmd/micro to test the whole project.
go-github-com-zyedidia-go-shellquote #:test-subdirs
go-github-com-zyedidia-json5 #~(list "../../...")
go-github-com-zyedidia-tcell-v2 #:phases
go-github-com-zyedidia-terminal #~(modify-phases %standard-phases
go-golang-org-x-text ;; Generate syntax files.
go-gopkg-in-yaml-v2)) (add-before 'build 'go-generate
(home-page "https://github.com/zyedidia/micro") (lambda _
(synopsis "Modern and intuitive terminal-based text editor") (invoke "go" "generate" "-v" "-x"
(description "github.com/zyedidia/micro/v2/runtime"))))))
"@code{micro} is a terminal-based text editor that aims to be easy to use and (inputs (list go-github-com-blang-semver
go-github-com-dustin-go-humanize
go-github-com-go-errors-errors
go-github-com-layeh-gopher-luar
go-github-com-mattn-go-isatty
go-github-com-mitchellh-go-homedir
go-github-com-sergi-go-diff
go-github-com-stretchr-testify
go-github-com-yuin-gopher-lua
go-github-com-zyedidia-clipper
go-github-com-zyedidia-glob
go-github-com-zyedidia-go-runewidth
go-github-com-zyedidia-go-shellquote
go-github-com-zyedidia-json5
go-github-com-zyedidia-tcell-v2
go-github-com-zyedidia-terminal
go-golang-org-x-text
go-gopkg-in-yaml-v2))
(home-page "https://github.com/zyedidia/micro")
(synopsis "Modern and intuitive terminal-based text editor")
(description
"@code{micro} is a terminal-based text editor that aims to be easy to use and
intuitive, while also taking advantage of the capabilities of modern terminals.") intuitive, while also taking advantage of the capabilities of modern terminals.")
;; The project lists licenses of all used sources in LICENSE-THIRD-PARTY ;; The project lists licenses of all used sources in LICENSE-THIRD-PARTY
;; file which are already included in Guix's package definition. ;; file which are already included in Guix's package definition.
(license license:expat))) (license license:expat))))
(define-public lem (define-public lem
(let ((commit "5fd512c8bab9de9a62709ac858fbb56337260cd5") (let ((commit "5fd512c8bab9de9a62709ac858fbb56337260cd5")