On Sun, Nov 05, 2023 at 10:09:44AM -0500, James McCoy wrote:
> The former is fine with me. I took a quick look at what Fedora is
> doing, and it looks like they just patch setup.py to return from
> build_static_kittens() just before the “go build -v” line.
>
> Adding a patch for that and then adapting the rest of the Debian side of
> the build to do it seems reasonable.
Right. So I have an update for you. I have attached a patch on top of
MR!3 [1] with this mail which gets the go parts (static kitten binary) building
for me \o/.
I wanted to commit directly but admittedly the non-gbp flow is
confusing for me so I left figuring this out for later.
I tried testing it locally and so far it does work as I expect it to.
I did the following changes:
* GO111MODULE should be turned off for debian specific builds otherwise
it tries to fetch packages from the internet which is forbiden in
build.
* Add dh_auto_configure for go counterpart as it'd initialize a _build
directory with symlink to all packages. This saves us from some of the
manual work which is done for example in[2].
* Added a corresponding clean directive too so as to cleanup _build
* I realised using dh_auto_build with go profiles is not something that
works smoothly as it expects go files in 'kitty/' and it has none.
There are a couple of other caveats too, so using 'go build '
works better.
* Copied some generated header files in python counter part's build to
_build directory
* Since some files did not get copied by go's dh_auto_configure they
have been specified in DH_GOLANG_INSTALL_EXTRA
* Added a patch to ignore checking go version from go.mod as go list -m
does not work with GO111MODULE set to off. This needs to be adjusted
in d/control anyway
* Added kitten binary in d/kitten.install
* Add a XS-Go-Import-Path field in d/control in accordance with the
package name in go.mod
* Update build deps and add versioned B-D on exp-dev
-> Note that exp-dev needs to be updated in debian. Since this is a key
package I have pinged the maintainer (on IRC) to do it. For this build,
I locally updated this and a couple other packages in the chain. You can
use the .debs for these from here[3]
-> I skipped the tests in d/rules as python specific stuff fails. I
leave the onus of fixing this on you :)
I hope this helps!
[1]: https://salsa.debian.org/debian/kitty/-/merge_requests/3
[2]:
https://sources.debian.org/src/ncbi-entrez-direct/19.2.20230331+dfsg-3/debian/rules/
[3]: https://people.debian.org/~nilesh/kitty/
Best,
Nilesh
commit 281201ccddfee95a606d82e1860fa3ea73d355fd
Author: Nilesh Patra
Date: Mon Nov 6 03:05:17 2023 +0530
Changes to get kitten building
diff --git a/debian/control b/debian/control
index 3258bcc61..66ceda63c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,6 +4,7 @@ Maintainer: James McCoy
Section: x11
Standards-Version: 4.6.2
Rules-Requires-Root: no
+XS-Go-Import-Path: kitty
Homepage: https://sw.kovidgoyal.net/kitty/
Vcs-Git: https://salsa.debian.org/debian/kitty.git
Vcs-Browser: https://salsa.debian.org/debian/kitty
@@ -17,7 +18,7 @@ Build-Depends:
furo ,
golang-any,
golang-github-altree-bigfloat-dev,
- golang-github-alecthomas-chroma-dev,
+ golang-github-alecthomas-chroma-v2-dev,
golang-github-bmatcuk-doublestar-dev,
golang-github-disintegration-imaging-dev,
golang-github-dlclark-regexp2-dev,
@@ -26,7 +27,7 @@ Build-Depends:
golang-github-seancfoley-ipaddress-go-dev,
golang-github-shirou-gopsutil-dev,
golang-github-zeebo-xxh3-dev,
- golang-golang-x-exp-dev,
+ golang-golang-x-exp-dev (>= 0.0~git20230801),
golang-golang-x-image-dev,
golang-golang-x-sys-dev,
golang-howett-plist-dev,
diff --git a/debian/kitty.install b/debian/kitty.install
index fe49de93f..63b03ef63 100644
--- a/debian/kitty.install
+++ b/debian/kitty.install
@@ -1,4 +1,5 @@
debian/tmp/usr/bin/kitty
+debian/tmp/usr/bin/kitten
debian/tmp/usr/lib/
debian/tmp/usr/share/applications/kitty.desktop
debian/tmp/usr/share/icons/
diff --git a/debian/patches/fix-version.patch b/debian/patches/fix-version.patch
new file mode 100644
index 0..063c9d7d6
--- /dev/null
+++ b/debian/patches/fix-version.patch
@@ -0,0 +1,25 @@
+Description: "go list -m" does not work with GO111MODULE set to off. Disable version checking for now.
+ Also build the static kittens via debian buildsystem instead of the upstream one.
+Author: Nilesh Patra
+Forwarded: not-needed
+Last-Update: 2023-11-06
+--- a/setup.py
b/setup.py
+@@ -964,12 +964,13 @@
+ go = shutil.which('go')
+ if not go:
+ raise SystemExit('The go tool was not found on this system. Install Go')
+-required_go_version = subprocess.check_output([go] + 'list -f {{.GoVersion}} -m'.split()).decode().strip()
+-current_go_version = subprocess.check_output([go, 'version']).decode().strip().split()[2][2:]
+-if parse_go_version(required_go_version) > parse_go_version(current_go_version):
+-raise SystemExit(f'The version of go