unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Lucy Coleclough <coleclough.lucy@gmail.com>
To: 71011@debbugs.gnu.org
Subject: bug#71011: [BUG] Fail to buidl latest kitty
Date: Thu, 23 May 2024 14:57:38 +0100	[thread overview]
Message-ID: <1f71215b-9831-f0ce-331b-20bafa15bcbb@gmail.com> (raw)
In-Reply-To: <238cac50f9d0de7b468d977f96883e5d@riseup.net>

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

Ok this works now but needs a lot of cleaning
One issue was that a dependant package `x-exp` needed to be compiled by 
go-1.22
It would probably be good to build them all off 1.22
I apply-ed the patch you sent
The function to make the symlink-s real would be better off as build 
utils or in some other standard location that can be pulled in
Perhaps they could be real-ise-ed in the go build system 
`setup-go-environment` which is where they are created
There are some runtime dependency-s such as libcanberra that are loaded 
with dlopen, they have been pointed to in `( invoke "python" "setup.py" 
...)`, perhaps there is some guix mechanism to give kitty a custom 
environment which allows auto detection with no absolute path.

[-- Attachment #2: kitty.scm --]
[-- Type: text/x-scheme, Size: 35553 bytes --]

(define-module (pantheon packages terminals)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module ((guix build utils) #:select (alist-replace))
  #:use-module (guix build-system cargo)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system glib-or-gtk)
  #:use-module (guix build-system go)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system pyproject)
  #:use-module (guix build-system python)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages assembly)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages crates-io)
  #:use-module (gnu packages crates-graphics)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages dlang)
  #:use-module (gnu packages digest)
  #:use-module (gnu packages docbook)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages fribidi)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages golang-build)
  #:use-module (gnu packages golang-check)
  #:use-module (gnu packages golang-xyz)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages image)
  #:use-module (gnu packages libcanberra)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages libunwind)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages man)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages pcre)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages perl-check)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages popt)
  #:use-module (gnu packages protobuf)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-build)
  #:use-module (gnu packages python-check)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages serialization)
  #:use-module (gnu packages sphinx)
  #:use-module (gnu packages ssh)
  #:use-module (gnu packages textutils)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg)
  #:use-module (srfi srfi-26))

(define-public python-furo
  (package
    (name "python-furo")
    (version "2024.5.6")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "furo" version))
       (sha256
        (base32 "02rb7mdh8nglw5hjzj8v7pfrc08whfs3411mhfwcpg2yc2k0bwl1"))))
    (build-system pyproject-build-system)
    (propagated-inputs (list python-beautifulsoup4 python-pygments
                             python-sphinx python-sphinx-basic-ng
                             python-sphinx-theme-builder
    ))
    (home-page "")
    (synopsis "A clean customisable Sphinx documentation theme.")
    (description
     "This package provides a clean customisable Sphinx documentation theme.")
    (license #f)))

(define-public python-sphinx-inline-tabs
  (package
    (name "python-sphinx-inline-tabs")
    (version "2023.4.21")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "sphinx_inline_tabs" version))
       (sha256
        (base32 "1g5yhdk208i8maippnbnijd1knpai809wl3cbwzqy59cc0zz3wjx"))))
    (build-system pyproject-build-system)
    (propagated-inputs (list ;python-furo
                             python-myst-parser
                             python-flit-core
                             python-pytest
                             python-pytest-cov
                             python-pytest-xdist
                             python-sphinx))
	( arguments ( list #:tests? #f))
    (home-page "https://github.com/pradyunsg/sphinx-inline-tabs")
    (synopsis "Add inline tabbed content to your Sphinx documentation.")
    (description "Add inline tabbed content to your Sphinx documentation.")
    (license #f)))


;; via gnu/packages/terminals.scm
;; https://github.com/zzkt/guix/blob/endless/channel/zzkt/packages/kitty.scm
(define-public go-1.22
  (package
    (inherit go-1.21)
    (name "go")
    (version "1.22.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/golang/go")
             (commit (string-append "go" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "00j6sn2zysk5pdzxw1wfdi31wggzw1h1026ah3x3mi85dwsijhjs"))))
    (arguments
     (substitute-keyword-arguments (package-arguments go-1.21)
       ((#:phases phases)
        #~(modify-phases #$phases
        	( delete 'check)
            (replace 'unpatch-perl-shebangs
              (lambda _
                ;; Avoid inclusion of perl in closure by rewriting references
                ;; to perl input in sourcecode generators and test scripts
                (substitute* (find-files "src" "\\.pl$")
                  (("^#!.*")
                   "#!/usr/bin/env perl\n"))))))))
    (native-inputs
     ;; Go 1.22 and later requires Go 1.20 (min. 1.20.6, which we don't have)
     ;; as the bootstrap toolchain.
     (alist-replace "go"
                    (list go-1.21)
                    (package-native-inputs go-1.21)))))

; (define-public go-github-com-google-go-cmp
;   (package
;     (name "go-github-com-google-go-cmp")
;     (version "0.6.0")
;     (source
;      (origin
;        (method git-fetch)
;        (uri (git-reference
;              (url "https://github.com/google/go-cmp")
;              (commit (string-append "v" version))))
;        (file-name (git-file-name name version))
;        (sha256
;         (base32 "1n1j4hi50bl05pyys4i7y417k9g6k1blslj27z327qny7kkdl2ma"))))
;     (build-system go-build-system)
;     (arguments
;      (list
; 	#:go go-1.22
;       #:import-path "github.com/google/go-cmp"))
;     (home-page "https://github.com/google/go-cmp")
;     (synopsis "Package for equality of Go values")
;     (description
;      "This package is intended to be a more powerful and safer alternative to
; @@code{reflect.@code{DeepEqual}} for comparing whether two values are
; semantically equal.")
;     (license license:bsd-3)))

; (define-public go-github-com-google-go-cmp-cmp
;   (package
;     (name "go-github-com-google-go-cmp-cmp")
;     (version "0.6.0")
;     (source
;      (origin
;        (method git-fetch)
;        (uri (git-reference
;              (url "https://github.com/google/go-cmp")
;              (commit (string-append "v" version))))
;        (file-name (git-file-name name version))
;        (sha256
;         (base32 "1n1j4hi50bl05pyys4i7y417k9g6k1blslj27z327qny7kkdl2ma"))))
;     (build-system go-build-system)
;     (arguments
;      ( list #:import-path "github.com/google/go-cmp/cmp"
;        #:unpack-path "github.com/google/go-cmp"
;     #:go go-1.22
;        #:phases
;        `(modify-phases %standard-phases
;          (replace 'check
;            (lambda* (#:key inputs #:allow-other-keys #:rest args)
;              (unless
;                ;; The tests fail when run with gccgo.
;                (false-if-exception (search-input-file inputs "/bin/gccgo"))
;                (apply (assoc-ref %standard-phases 'check) args)))))))
;     (synopsis "Determine equality of values in Go")
;     (description
;      "This package is intended to be a more powerful and safer
; alternative to @@code{reflect.DeepEqual} for comparing whether two values are
; semantically equal.")
;     (home-page "https://github.com/google/go-cmp")
;     (license license:bsd-3)))

; (define-public go-golang-org-x-exp-q
;   (package
;     (name "go-golang-org-x-exp")
;     (version "0.0.0-20240506185415-9bf2ced13842")
;     (source
;      (origin
;        (method git-fetch)
;        (uri (git-reference
;              (url "https://go.googlesource.com/exp")
;              (commit (go-version->git-ref version))))
;        (file-name (git-file-name name version))
;        (sha256
;         (base32 "1r7r0dj9rg1iyzi4dxkg2y4s35px43sx8z3v7dqdzgim8ccf50z4"))))
;     (build-system go-build-system)
;     (arguments
;      (list
;       #:go go-1.22
;       #:import-path "golang.org/x/exp"))
;     (propagated-inputs `(("go-golang-org-x-tools" ,go-golang-org-x-tools)
;                          ("go-golang-org-x-mod" ,go-golang-org-x-mod)
;                          ("go-github-com-google-go-cmp" ,go-github-com-google-go-cmp-cmp)))
;     (home-page "https://golang.org/x/exp")
;     (synopsis "exp")
;     (description
;      "This subrepository holds experimental and deprecated (in the @@code{old}
; directory) packages.")
;     (license license:bsd-3)))

(define-public go-golang-org-x-exp-q
  (package
    (name "go-golang-org-x-exp")
    (version "0.0.0-20240506185415-9bf2ced13842")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://go.googlesource.com/exp")
             (commit (go-version->git-ref version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1r7r0dj9rg1iyzi4dxkg2y4s35px43sx8z3v7dqdzgim8ccf50z4"))))
    (build-system go-build-system)
    (arguments
     ( list #:import-path "golang.org/x/exp"
       ;; Source-only package
        #:go go-1.22
       #:tests? #f
       #:phases `(modify-phases %standard-phases
                  (delete 'build))))
    (home-page "https://golang.org/x/exp")
    (synopsis "Experimental and deprecated Go packages")
    (description "This subrepository holds experimental and deprecated (in the
@code{old} directory) packages.")
    (license license:bsd-3)))

(define-public go-github-com-altree-bigfloat
  (package
    (name "go-github-com-altree-bigfloat")
    (version "0.2.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/ALTree/bigfloat")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1jvqg5w4azwqv0ranir6vhlh6403pn6043jqbwsldan4vj6n5xmh"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/ALTree/bigfloat"))
    (native-inputs
     (list go-1.22))
    (home-page "https://github.com/ALTree/bigfloat")
    (synopsis "Example")
    (description
     "Package bigfloat provides arbitrary-precision natural logarithm and
exponentiation for the standard library's @@code{big.Float} type.")
    (license license:expat)))

(define-public go-github-com-bmatcuk-doublestar-v4
  (package
    (name "go-github-com-bmatcuk-doublestar-v4")
    (version "4.6.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/bmatcuk/doublestar")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "12rf4a9isgg2nh927gikgbmyaynaqp4kjahgscb4qnr04m3vpr41"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/bmatcuk/doublestar/v4"))
    (home-page "https://github.com/bmatcuk/doublestar")
    (synopsis "doublestar")
    (description
     "Path pattern matching and globbing supporting @@code{doublestar} (@@code{**})
patterns.")
    (license license:expat)))

(define-public go-github-com-seancfoley-bintree
  (package
    (name "go-github-com-seancfoley-bintree")
    (version "1.2.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/seancfoley/bintree")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "17faiyfbf8x688ij40d3g80s2z2m5h5w23j92mf2k0ws5g6fi9vx"))))
    (build-system go-build-system)
    (arguments
     (list
      #:go go-1.18
      #:import-path "github.com/seancfoley/bintree/tree"
      #:unpack-path "github.com/seancfoley/bintree"))
    (home-page "https://github.com/seancfoley/bintree")
    (synopsis "bintree")
    (description "Binary trees and tries")
    (license license:asl2.0)))

(define-public go-github-com-seancfoley-ipaddress-go-ipaddr
  (package
    (name "go-github-com-seancfoley-ipaddress-go-ipaddr")
    (version "1.5.5")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/seancfoley/ipaddress-go")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "03yz5pb1mgj25i4n90sfqnmwr88872s096pna178g8zh90r55628"))))
    (build-system go-build-system)
    (arguments
     (list
      #:go go-1.18
      #:import-path "github.com/seancfoley/ipaddress-go/ipaddr"
      #:unpack-path "github.com/seancfoley/ipaddress-go"))
    (propagated-inputs `(("go-github-com-seancfoley-bintree" ,go-github-com-seancfoley-bintree)))
    (home-page "https://github.com/seancfoley/ipaddress-go")
    (synopsis #f)
    (description
     "IPAddress is a library for handling IP addresses and subnets, both IPv4 and
IPv6.")
    (license (list license:asl2.0 license:asl2.0))))

(define-public go-github-com-rwcarlsen-goexif-exif
  (package
    (name "go-github-com-rwcarlsen-goexif-exif")
    (version "0.0.0-20190401172101-9e8deecbddbd")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/rwcarlsen/goexif")
             (commit (go-version->git-ref version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1drqhzplg72lvrf3qmb9awbggnjqp23hwn2pgvksi3spv17kc9h2"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/rwcarlsen/goexif/exif"
      #:unpack-path "github.com/rwcarlsen/goexif"))
    (home-page "https://github.com/rwcarlsen/goexif")
    (synopsis "goexif")
    (description
     "This package provides decoding of basic exif and tiff encoded data.  Still in
alpha - no guarantees.  Suggestions and pull requests are welcome.
Functionality is split into two packages - \"exif\" and \"tiff\" The exif package
depends on the tiff package.")
    (license license:bsd-2)))

(define-public go-github-com-rwcarlsen-goexif-tiff
  (package
    (name "go-github-com-rwcarlsen-goexif-tiff")
    (version "0.0.0-20190401172101-9e8deecbddbd")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/rwcarlsen/goexif")
             (commit (go-version->git-ref version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1drqhzplg72lvrf3qmb9awbggnjqp23hwn2pgvksi3spv17kc9h2"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/rwcarlsen/goexif/tiff"
      #:unpack-path "github.com/rwcarlsen/goexif"))
    (home-page "https://github.com/rwcarlsen/goexif")
    (synopsis "goexif")
    (description
     "This package provides decoding of basic exif and tiff encoded data.  Still in
alpha - no guarantees.  Suggestions and pull requests are welcome.
Functionality is split into two packages - \"exif\" and \"tiff\" The exif package
depends on the tiff package.")
    (license license:bsd-2)))


(define-public go-github-com-edwvee-exiffix
  (package
    (name "go-github-com-edwvee-exiffix")
    (version "0.0.0-20240229113213-0dbb146775be")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/edwvee/exiffix")
             (commit (go-version->git-ref version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1i4p1xnbm04ih2735h58n1p1j6cjmr6d3bfx41862ki0qc12lfn4"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/edwvee/exiffix"))
    (propagated-inputs
     (list go-golang-org-x-image
           go-github-com-disintegration-imaging
           go-github-com-rwcarlsen-goexif-exif
           go-github-com-rwcarlsen-goexif-tiff))
    (home-page "https://github.com/edwvee/exiffix")
    (synopsis "Exiffix")
    (description
     "Exiffix is a one function golang library made to be a replacement for
image.Decode to handle orientation stored in EXIF data.")
    (license license:expat)))

(define-public go-github-com-kovidgoyal-imaging
  (package
    (name "go-github-com-kovidgoyal-imaging")
    (version "1.6.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/kovidgoyal/imaging")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "123hfgjzp2401l8rfb3h2agyijj03w2a2sdxcziybmplw4r8pbi3"))))
    (build-system go-build-system)
    (arguments
     (list
      #:go go-1.21
      #:import-path "github.com/kovidgoyal/imaging"))
    (propagated-inputs `(("go-golang-org-x-image" ,go-golang-org-x-image)))
    (home-page "https://github.com/kovidgoyal/imaging")
    (synopsis "Imaging")
    (description
     "Package imaging provides basic image processing functions (resize, rotate, crop,
brightness/contrast adjustments, etc.).")
    (license license:expat)))

(define-public go-github-com-klauspost-cpuid-v2
  (package
    (name "go-github-com-klauspost-cpuid-v2")
    (version "2.2.7")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/klauspost/cpuid")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0i1y5zgcj350l3idqfxjkcs18ii5w315xjmmabqbqrx27sn8fqh1"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/klauspost/cpuid/v2"))
    (propagated-inputs `(("go-golang-org-x-sys" ,go-golang-org-x-sys)))
    (home-page "https://github.com/klauspost/cpuid")
    (synopsis "cpuid")
    (description
     "Package cpuid provides information about the CPU running the current program.")
    (license license:expat)))

(define-public go-github-com-zeebo-assert
  (package
    (name "go-github-com-zeebo-assert")
    (version "1.3.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/zeebo/assert")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0xfklg04ic4xl5q7xy913jzvn2v9bxmrsnm4lyjqznninysgs9xb"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/zeebo/assert"))
    (home-page "https://github.com/zeebo/assert")
    (synopsis "package assert")
    (description
     "See the api docs.  There's not a lot of surface area, and that's the goal.")
    (license license:cc0)))

(define-public go-github-com-zeebo-xxh3
  (package
    (name "go-github-com-zeebo-xxh3")
    (version "1.0.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/zeebo/xxh3")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1gy666r5v1d1n2cfig9plhyp7z09f06k6mr5lrf0mk6psk6bnwgi"))))
    (build-system go-build-system)
    (arguments
     (list
      #:import-path "github.com/zeebo/xxh3"))
    (propagated-inputs `(("go-github-com-zeebo-assert" ,go-github-com-zeebo-assert)
                         ("go-github-com-klauspost-cpuid-v2" ,go-github-com-klauspost-cpuid-v2)))
    (home-page "https://github.com/zeebo/xxh3")
    (synopsis "XXH3")
    (description
     "This package is a port of the
@@url{https://github.com/Cyan4973/@code{xxHash,xxh3}} library to Go.")
    (license license:bsd-2)))

(define-public go-github-com-alecthomas-chroma-v2-13
  (package
    (inherit go-github-com-alecthomas-chroma)
    (name "go-github-com-alecthomas-chroma-v2-13")
    (version "2.13.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/alecthomas/chroma")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1vq53pma340g3v9xb5g8wpj9zvl9jsdshq6gw245f4hczn569sdd"))))
    (arguments
     (list #:go go-1.22
           #:import-path "github.com/alecthomas/chroma/v2"
           #:unpack-path "github.com/alecthomas/chroma/v2"))
           ; ))
    (propagated-inputs
     (list go-github-com-dlclark-regexp2))
    (native-inputs
     (list go-github-com-alecthomas-assert-v2
           go-github-com-alecthomas-repr))))

(define-public kitty-next
  (let ((commit "b3cc5aed30c8e83715fa955e9d3183a0e433a9c3")
        (revision "0"))
    (package
      (name "kitty-next")
      (version (git-version "0.34.1" revision commit))
      (home-page "https://sw.kovidgoyal.net/kitty/")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/kovidgoyal/kitty")
               (commit commit)
               (recursive? #t)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0n841kyhbm7icbby575blx75ykac9zj0a3jjy35ymkhqnz5dayq1"))
         (modules '((guix build utils)))
         (snippet
          '(begin
             ;; patch needed as sphinx-build is used as a python script
             ;; whereas the guix package uses a bash script launching the
             ;; python script
             (substitute* "docs/conf.py"
               (("(from kitty.constants import str_version)" kitty-imp)
                (string-append "sys.path.append(\"..\")\n" kitty-imp)))
             (substitute* "docs/Makefile"
               (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
                "SPHINXBUILD = sphinx-build\n"))
             #t))
		( patches
			( list
				( plain-file
					"removeDocBuild.patch"
"index 61352c2..560596e 100755
--- a/setup.py
+++ b/setup.py
@@ -1316,24 +1316,7 @@ def create_linux_bundle_gunk(ddir: str, args: Options) -> None:
     base = Path(ddir)
     in_src_launcher = base / (f'{libdir_name}/kitty/kitty/launcher/kitty')
     launcher = base / 'bin/kitty'
-    skip_docs = False
-    if not os.path.exists('docs/_build/html'):
-        kitten_exe = os.path.join(os.path.dirname(str(launcher)), 'kitten')
-        if os.path.exists(kitten_exe):
-            os.environ['KITTEN_EXE_FOR_DOCS'] = kitten_exe
-            make = 'gmake' if is_freebsd else 'make'
-            run_tool([make, 'docs'])
-        else:
-            if args.skip_building_kitten:
-                skip_docs = True
-                print('WARNING: You have chosen to skip building kitten.'
-                      ' This means docs could not be generated and will not be included in the linux package.'
-                      ' You should build kitten and then re-run this build.', file=sys.stderr)
-            else:
-                raise SystemExit(f'kitten binary not found at: {kitten_exe}')
-    if not skip_docs:
-        copy_man_pages(ddir)
-        copy_html_docs(ddir)
+
     for (icdir, ext) in {'256x256': 'png', 'scalable': 'svg'}.items():
         icdir = os.path.join(ddir, 'share', 'icons', 'hicolor', icdir, 'apps')
         safe_makedirs(icdir)"
				)
			)
		)
	))
      (build-system go-build-system)
      (propagated-inputs
       (list go-golang-org-x-sys
             go-golang-org-x-exp-q
             go-github-com-altree-bigfloat
             go-github-com-bmatcuk-doublestar-v4
             go-github-com-seancfoley-ipaddress-go-ipaddr
             go-github-com-dhowett-go-plist
             go-github-com-shirou-gopsutil-v3
             go-github-com-google-uuid
             go-github-com-edwvee-exiffix
             go-github-com-kovidgoyal-imaging
             go-golang-org-x-image
             ; go-github-com-alecthomas-chroma-v2
             go-github-com-alecthomas-chroma-v2-13
             go-github-com-dlclark-regexp2
             go-github-com-zeebo-xxh3
            ))
      (native-inputs
       (list dbus
             mesa
             libxcursor
             libxi
             libxinerama
             libxkbcommon
             libxrandr
             ncurses ;; for tic command
             pkg-config
             ; python-sphinx
             ; python-sphinx-copybutton
             ; python-sphinxext-opengraph
             ; python-sphinx-inline-tabs
             wayland-protocols
             go-1.22
             simde

             strace
             coreutils

             git))
      (inputs
       (list fontconfig
             freetype
             harfbuzz
             lcms
             libcanberra
             startup-notification
             libpng
             python-pygments
             python-wrapper
             wayland
             openssl
             xxhash
             zlib))
      (arguments
       (list
        #:go go-1.22
        #:import-path "kitty"
        #:phases
        #~( begin ( use-modules ( oop goops) ( ice-9 ftw) ( guix build utils)) ( modify-phases %standard-phases
            (add-before 'check 'fix-home-directory
              (lambda _
                (setenv "HOME" "/tmp")))
            (add-before 'build 'fix-gocache-directory
              (lambda _
                (setenv "HOME" "/tmp")
                (setenv "GOCACHE" "/tmp/.gocache")
                (setenv "GOPROXY" "direct")
                (setenv "GOFLAGS" "-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw")))
            (delete 'configure)   ;no configure script
			 ( add-after
				'setup-go-environment
				'realIseLinkS
				( lambda _
				         ( define
					        ( readBaseLink file)
				         	( if
				         		( equal?
				         			( stat:type
				         				( lstat file)
				         			)
				         			'symlink
				         		)
				         		( readBaseLink
					         		( let
					         			(
					         				( linkResult
												( readlink file)
					         				)
					         			)
					         			( if
					         				( and
					         					( not
						         					( eqv?
						         						( string-length linkResult)
					         							0
						         					)
					         					)
						         				( equal?
						         					( string-ref
							         					linkResult
					         							0
					         						)
					         						#\/
						         				)
					         				)
					         				linkResult
					         				( string-append
					         					( dirname file)
					         					"/"
					         					linkResult
					         				)
					         			)
					         		)
				         		)
				         		file
				         	)
			         	)
				         ( define
							( realise dir)
					         		( for-each
					         			( lambda
					         				( fileName)
					         				( let*
					         					(
				         							( path
							         					( string-append
							         						dir
							         						"/"
							         						fileName
							         					)
				         							)
				         							( pathType
							         					( stat:type
							         						( lstat path)
							         					)
				         							)
				         						)
					        					( if
					        						( equal?
					        							pathType
														'symlink
					        						)
				         							( let*
					         					  		(
						         					  		( base
						         					  			( readBaseLink path)
						         					  			; ( readlink path)
						         					  		)
						         					  		( baseType
						         					  			( stat:type
						         					  				( stat base)
						         					  			)
						         					  		)
						         					  	)
					        							( display "SYMLINK ")( display path)( display " -> ")( display base)( display baseType)( newline)
					        							( if
					        								( equal?
					        									baseType
					        									'regular
					        								)
					        								( begin
					         					  				( delete-file path)
					         					  			  	( copy-file
					         					  			  		base
					         					  			  		path
					         					  			  	)
					        								)
					        								( when
						        								( equal?
						        									baseType
						        									'directory
						        								)
					        									( begin
						         					  				( delete-file path)
						         					  			  	( copy-recursively
						         					  			  		base
						         					  			  		path
						         					  			  	)
						         					  			  	( realise
						         					  			  		path
						         					  			  	)
					        									)
					        								)
					        							)
					         					  	)
					        						( when
						        						( equal?
						        							pathType
															'directory
						        						)
					         							( realise
						         					  		path
						         					  	)
					        						)
					        					)
					         				)
					         			)
				         				( filter
				         					( lambda
				         						( name)
				         						( not
				         							( member
				         								name
				         								( list
				         									"."
				         									".."
				         								)
				         							)
				         						)
				         					)
						         			( scandir dir)
				         				)
					         		)
					         	)
				        ( realise
				         	( string-append
				         		( getcwd)
				         		"/src/github.com/alecthomas/chroma/v2"
				         	)
				        )
	              ;       ( invoke "ls" "-la" ( string-append
				         	; 	( getcwd)
				         	; 	"/src/github.com/alecthomas/chroma/v2/styles"
				         	; ))
				         ; ( error "")
					)
			)
            (replace 'build
              (lambda* (#:key inputs #:allow-other-keys)
                ;; The "kitty" sub-directory must be writable prior to
                ;; configuration (e.g., un-setting updates).
                ( newline)
                ; ( display inputs)
                ( let
                       	( ( chroma ( assoc-ref inputs "go-github-com-alecthomas-chroma-v2-13")))
                       	( display
                       		( scandir
	                       		( string-append
	                       			chroma
	                       			; "/src/styles"
	                       			"/src/github.com/alecthomas/chroma/v2"
	                       		)
                       		)
                       	)
                )
                ( newline)
                ( let
                       	( ( dir 
	                       		( string-append
	                       			( getcwd)
	                       			"/src/github.com/alecthomas/chroma/v2/styles"
	                       		)
                       	 ))
                    ( invoke "ls" "-la" dir)
	               ;  ( display
	               ;         	( map
	               ;         		( lambda
	               ;         			( name)
                       				
	               ;         		)
		              ;          	( scandir
                ;        				dir
		              ;          	)
	               ;         	)
	               ; )
                )
                ( newline)
                (chdir "src/kitty")
                (for-each make-file-writable (find-files "kitty"))
                ( invoke "go" "version")
                (invoke "python3" "setup.py" "linux-package"
                        ;; Do not phone home.
                        "--update-check-interval=0"
                        ;; "--skip-building-kitten"
                        (string-append "--fontconfig-library="
                                       (search-input-file inputs "/lib/libfontconfig.so"))
                        (string-append "--canberra-library="
                                       (search-input-file inputs "/lib/libcanberra.so"))
                        (string-append "--startup-notification-library="
                                       (search-input-file inputs "/lib/libstartup-notification-1.so"))
                        ;; Wayland backend requires EGL, which isn't
                        ;; found out-of-the-box for some reason.
                        (string-append "--egl-library="
                                       (search-input-file inputs "/lib/libEGL.so.1"))
                )
        		)
            )
            (delete 'check)
            ;; (replace 'check
            ;;   (lambda* (#:key tests? #:allow-other-keys)
            ;;     (when tests?
            ;;       ;; Fix "cannot find kitty executable" error when running
            ;;       ;; tests.
            ;;       (invoke "ls" "-l")
            ;;       (setenv "PATH" (string-append "linux-package/bin:"
            ;;                                     (getenv "PATH")))
            ;;       (invoke "python3" "test.py"))))
            (add-before 'install 'rm-pycache
              ;; created python cache __pycache__ are non deterministic
              (lambda _
                (let ((pycaches (find-files "linux-package/"
                                            "__pycache__"
                                            #:directories? #t)))
                  (for-each delete-file-recursively pycaches))))
            (delete 'install-license-files)
            (replace 'install
              (lambda _
                (let* ((obin (string-append #$output "/bin"))
                       (olib (string-append #$output "/lib"))
                       (oshare (string-append #$output "/share")))
                  (copy-recursively "linux-package/bin" obin)
                  (copy-recursively "linux-package/share" oshare)
                  (copy-recursively "linux-package/lib" olib))))))))
      (synopsis "Fast, featureful, GPU based terminal emulator")
      (description "Kitty is a fast and featureful GPU-based terminal emulator:
@itemize
@item Offloads rendering to the GPU for lower system load and buttery smooth
scrolling.  Uses threaded rendering to minimize input latency.
@item Supports all modern terminal features: graphics (images), unicode,
true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
paste and several new terminal protocol extensions.
@item Supports tiling multiple terminal windows side by side in different
layouts without needing to use an extra program like tmux.
@item Can be controlled from scripts or the shell prompt, even over SSH.
@item Has a framework for Kittens, small terminal programs that can be used to
extend kitty's functionality.  For example, they are used for Unicode input,
hints, and side-by-side diff.
@item Supports startup sessions which allow you to specify the window/tab
layout, working directories and programs to run on startup.
@item Allows you to open the scrollback buffer in a separate window using
arbitrary programs of your choice.  This is useful for browsing the history
comfortably in a pager or editor.
@end itemize")
      (license license:gpl3+))))
; go-github-com-alecthomas-chroma-v2-13
kitty-next

[-- Attachment #3: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2468 bytes --]

  parent reply	other threads:[~2024-05-25 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 12:43 bug#71011: [BUG] Fail to buidl latest kitty Edison Ibáñez
2024-05-21 20:51 ` Sharlatan Hellseher
2024-05-21 20:53 ` Sharlatan Hellseher
2024-05-21 21:25 ` Edison Ibáñez
2024-05-22 12:27 ` Lucy Coleclough
2024-05-22 17:19 ` Lucy Coleclough
2024-05-23  1:49 ` Edison Ibáñez
2024-05-23 13:57 ` Lucy Coleclough [this message]
2024-06-29 16:14 ` Sharlatan Hellseher
2024-07-01 19:49 ` Lucy Coleclough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f71215b-9831-f0ce-331b-20bafa15bcbb@gmail.com \
    --to=coleclough.lucy@gmail.com \
    --cc=71011@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).