* Re: [PR PATCH] [Updated] kitty: update to 0.28.1, adopt.
2023-06-09 21:28 [PR PATCH] kitty: update to 0.28.1, adopt classabbyamp
@ 2023-06-10 2:23 ` classabbyamp
2023-06-13 4:14 ` classabbyamp
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2023-06-10 2:23 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
There is an updated pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages update/kitty
https://github.com/void-linux/void-packages/pull/44338
kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
closes #43270 (supercedes)
@emacsomancer can I adopt this from you?
A patch file from https://github.com/void-linux/void-packages/pull/44338.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/kitty-44338.patch --]
[-- Type: text/x-diff, Size: 3474 bytes --]
From 468c3d724d0c20cdbcfb5200b0cdb7519dd14d4d Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 9 Jun 2023 13:39:30 -0400
Subject: [PATCH] kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
nocross because upstream doesn't want to support it (sigh)
---
srcpkgs/kitty-kitten | 1 +
srcpkgs/kitty-shell-integration | 1 +
srcpkgs/kitty/template | 37 ++++++++++++++++++++++++++-------
3 files changed, 31 insertions(+), 8 deletions(-)
create mode 120000 srcpkgs/kitty-kitten
create mode 120000 srcpkgs/kitty-shell-integration
diff --git a/srcpkgs/kitty-kitten b/srcpkgs/kitty-kitten
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-kitten
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty-shell-integration b/srcpkgs/kitty-shell-integration
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-shell-integration
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty/template b/srcpkgs/kitty/template
index 90eb7261085c..e27fed51114b 100644
--- a/srcpkgs/kitty/template
+++ b/srcpkgs/kitty/template
@@ -1,20 +1,26 @@
# Template file for 'kitty'
pkgname=kitty
-version=0.26.5
-revision=2
+version=0.28.1
+revision=1
pycompile_dirs="usr/lib/kitty"
-hostmakedepends="pkg-config python3 wayland-devel wayland-protocols"
+hostmakedepends="go pkg-config python3 wayland-devel wayland-protocols"
makedepends="gettext-devel glfw-devel harfbuzz-devel libxkbcommon-devel
- python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel openssl-devel"
-depends="kitty-terminfo-${version}_${revision}"
+ python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel
+ openssl-devel dbus-devel libXcursor-devel libXrandr-devel libXi-devel
+ fontconfig-devel libxcb-devel lcms2-devel"
+depends="kitty-terminfo-${version}_${revision} kitty-shell-integration-${version}_${revision}
+ kitty-kitten-${version}_${revision}"
short_desc="Modern, hackable, featureful, OpenGL based terminal emulator"
-maintainer="Benjamin Slade <slade@jnanam.net>"
-license="GPL-3.0-or-later"
+maintainer="classabbyamp <void@placeviolette.net>"
+license="GPL-3.0-only"
homepage="https://sw.kovidgoyal.net/kitty/"
changelog="https://sw.kovidgoyal.net/kitty/changelog.html"
distfiles="https://github.com/kovidgoyal/kitty/releases/download/v${version}/kitty-${version}.tar.xz"
-checksum=5544a580314fec7711187ce28162909b5ecff6780071444fe96fb97f8be5c9ad
+checksum=c11c545ca56adf1c26cfd8f5b4a3ba5f149f00542fbf0fa2c4439bd9bf6f78a5
python_version=3
+nopie_files="/usr/bin/kitten"
+nocross="https://github.com/kovidgoyal/kitty/issues/6354"
+
LDFLAGS+=" -Wl,-z,stack-size=2097152"
# TIOCSWINSZ on ppc overflows signed int, used in ioctl()
@@ -27,6 +33,7 @@ do_build() {
if [ "$CROSS_BUILD" ]; then
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc}"
fi
+ . /void-packages/common/environment/build-style/go.sh
python3 setup.py linux-package --prefix=${DESTDIR}/usr --update-check-interval=0 --verbose
}
@@ -40,3 +47,17 @@ kitty-terminfo_package() {
vmove usr/share/terminfo
}
}
+
+kitty-shell-integration_package() {
+ short_desc+=" - shell integration scripts"
+ pkg_install() {
+ vmove usr/lib/kitty/shell-integration
+ }
+}
+
+kitty-kitten_package() {
+ short_desc+=" - kitten client"
+ pkg_install() {
+ vmove usr/bin/kitten
+ }
+}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Updated] kitty: update to 0.28.1, adopt.
2023-06-09 21:28 [PR PATCH] kitty: update to 0.28.1, adopt classabbyamp
2023-06-10 2:23 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-06-13 4:14 ` classabbyamp
2023-06-13 4:31 ` classabbyamp
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2023-06-13 4:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
There is an updated pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages update/kitty
https://github.com/void-linux/void-packages/pull/44338
kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
closes #43270 (supercedes)
@emacsomancer can I adopt this from you?
A patch file from https://github.com/void-linux/void-packages/pull/44338.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/kitty-44338.patch --]
[-- Type: text/x-diff, Size: 11128 bytes --]
From 5ff762e02b8d9bd06382363f07c189ac7ff9f7a3 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 9 Jun 2023 13:39:30 -0400
Subject: [PATCH] kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
---
srcpkgs/kitty-kitten | 1 +
srcpkgs/kitty-shell-integration | 1 +
srcpkgs/kitty/patches/cross.patch | 174 ++++++++++++++++++++++++++++++
srcpkgs/kitty/template | 51 +++++++--
4 files changed, 218 insertions(+), 9 deletions(-)
create mode 120000 srcpkgs/kitty-kitten
create mode 120000 srcpkgs/kitty-shell-integration
create mode 100644 srcpkgs/kitty/patches/cross.patch
diff --git a/srcpkgs/kitty-kitten b/srcpkgs/kitty-kitten
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-kitten
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty-shell-integration b/srcpkgs/kitty-shell-integration
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-shell-integration
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty/patches/cross.patch b/srcpkgs/kitty/patches/cross.patch
new file mode 100644
index 000000000000..886eb7fa2c4d
--- /dev/null
+++ b/srcpkgs/kitty/patches/cross.patch
@@ -0,0 +1,174 @@
+From 88a5086f71f44e09539cae9af0cf62697df01f45 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <kovid@kovidgoyal.net>
+Date: Tue, 13 Jun 2023 07:56:16 +0530
+Subject: [PATCH] Add rudimentary support for cross-compilation
+
+Not really tested, actual cross compilers, feel free to send patches.
+Fixes #6354
+---
+ Makefile | 10 ++++++++++
+ docs/build.rst | 16 ++++++++++++++++
+ setup.py | 51 ++++++++++++++++++++++++++++++++++++--------------
+ 3 files changed, 63 insertions(+), 14 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5231798c5a..dfc968b865 100644
+--- a/Makefile
++++ b/Makefile
+@@ -61,3 +61,13 @@ docs: man html
+
+ develop-docs:
+ $(MAKE) -C docs develop-docs
++
++
++prepare-for-cross-compile:
++ $(MAKE) clean
++ $(MAKE) build
++ python3 setup.py $(VVAL) clean --clean-for-cross-compile
++
++cross-compile:
++ python3 setup.py linux-package --skip-code-generation
++
+diff --git a/docs/build.rst b/docs/build.rst
+index bd8a73c772..5082892d71 100644
+--- a/docs/build.rst
++++ b/docs/build.rst
+@@ -204,3 +204,19 @@ the kitty program expects to find them there.
+
+ This applies to creating packages for |kitty| for macOS package managers such as
+ Homebrew or MacPorts as well.
++
++Cross-compilation
++-------------------
++
++While cross compilation is neither officially supported, nor recommended, as it
++means the test suite cannot be run for the cross-compiled build, there is some
++support for cross-compilation. Basically, run::
++
++ make prepare-for-cross-compile
++
++Then setup the cross compile environment (CC, CFLAGS, etc.) and run::
++
++ make cross-compile
++
++This will create the cross compiled build in the :file:`linux-package`
++directory.
+diff --git a/setup.py b/setup.py
+index 1d3c76f0f7..2b1ba6fde9 100755
+--- a/setup.py
++++ b/setup.py
+@@ -62,6 +62,8 @@ class Options(argparse.Namespace):
+ sanitize: bool = False
+ prefix: str = './linux-package'
+ dir_for_static_binaries: str = 'build/static'
++ skip_code_generation: bool = False
++ clean_for_cross_compile: bool = False
+ incremental: bool = True
+ profile: bool = False
+ libdir_name: str = 'lib'
+@@ -841,16 +843,17 @@ def extract_rst_targets() -> Dict[str, Dict[str, str]]:
+ return cast(Dict[str, Dict[str, str]], m['main']())
+
+
+-def build_ref_map() -> str:
+- d = extract_rst_targets()
+- h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++def build_ref_map(skip_generation: bool = False) -> str:
+ dest = 'kitty/docs_ref_map_generated.h'
+- q = ''
+- with suppress(FileNotFoundError), open(dest) as f:
+- q = f.read()
+- if q != h:
+- with open(dest, 'w') as f:
+- f.write(h)
++ if not skip_generation:
++ d = extract_rst_targets()
++ h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++ q = ''
++ with suppress(FileNotFoundError), open(dest) as f:
++ q = f.read()
++ if q != h:
++ with open(dest, 'w') as f:
++ f.write(h)
+ return dest
+
+
+@@ -868,7 +871,7 @@ def build(args: Options, native_optimizations: bool = True, call_init: bool = Tr
+ if call_init:
+ init_env_from_args(args, native_optimizations)
+ sources, headers = find_c_files()
+- headers.append(build_ref_map())
++ headers.append(build_ref_map(args.skip_code_generation))
+ compile_c_extension(
+ kitty_env(), 'kitty/fast_data_types', args.compilation_database, sources, headers
+ )
+@@ -881,6 +884,9 @@ def safe_makedirs(path: str) -> None:
+
+
+ def update_go_generated_files(args: Options, kitty_exe: str) -> None:
++ if args.skip_code_generation:
++ print('Skipping generation of Go files due to command line option', flush=True)
++ return
+ # update all the various auto-generated go files, if needed
+ if args.verbose:
+ print('Updating Go generated files...', flush=True)
+@@ -1493,7 +1499,7 @@ def clean_launcher_dir(launcher_dir: str) -> None:
+ os.remove(x)
+
+
+-def clean() -> None:
++def clean(for_cross_compile: bool = False) -> None:
+
+ def safe_remove(*entries: str) -> None:
+ for x in entries:
+@@ -1506,7 +1512,9 @@ def safe_remove(*entries: str) -> None:
+ safe_remove(
+ 'build', 'compile_commands.json', 'link_commands.json',
+ 'linux-package', 'kitty.app', 'asan-launcher',
+- 'kitty-profile', 'docs/generated')
++ 'kitty-profile')
++ if not for_cross_compile:
++ safe_remove('docs/generated')
+ clean_launcher_dir('kitty/launcher')
+
+ def excluded(root: str, d: str) -> bool:
+@@ -1521,7 +1529,9 @@ def excluded(root: str, d: str) -> bool:
+ dirs.remove(d)
+ for f in files:
+ ext = f.rpartition('.')[-1]
+- if ext in ('so', 'dylib', 'pyc', 'pyo') or f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'):
++ if ext in ('so', 'dylib', 'pyc', 'pyo') or (not for_cross_compile and (
++ f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'))
++ ):
+ os.unlink(os.path.join(root, f))
+ for x in glob.glob('glfw/wayland-*-protocol.[ch]'):
+ os.unlink(x)
+@@ -1581,6 +1591,19 @@ def option_parser() -> argparse.ArgumentParser: # {{{
+ default=Options.dir_for_static_binaries,
+ help='Where to create the static kitten binary'
+ )
++ p.add_argument(
++ '--skip-code-generation',
++ default=Options.skip_code_generation,
++ action='store_true',
++ help='Do not create the *_generated.* source files. This is useful if they'
++ ' have already been generated by a previous build, for example during a two-stage cross compilation.'
++ )
++ p.add_argument(
++ '--clean-for-cross-compile',
++ default=Options.clean_for_cross_compile,
++ action='store_true',
++ help='Do not clean generated Go source files. Useful for cross-compilation.'
++ )
+ p.add_argument(
+ '--full',
+ dest='incremental',
+@@ -1743,7 +1766,7 @@ def main() -> None:
+ texe = os.path.abspath(os.path.join(launcher_dir, 'kitty'))
+ os.execl(texe, texe, '+launch', 'test.py')
+ if args.action == 'clean':
+- clean()
++ clean(for_cross_compile=args.clean_for_cross_compile)
+ return
+
+ with CompilationDatabase(args.incremental) as cdb:
diff --git a/srcpkgs/kitty/template b/srcpkgs/kitty/template
index 90eb7261085c..8eb4deffa487 100644
--- a/srcpkgs/kitty/template
+++ b/srcpkgs/kitty/template
@@ -1,20 +1,26 @@
# Template file for 'kitty'
pkgname=kitty
-version=0.26.5
-revision=2
+version=0.28.1
+revision=1
pycompile_dirs="usr/lib/kitty"
-hostmakedepends="pkg-config python3 wayland-devel wayland-protocols"
+hostmakedepends="go pkg-config python3 wayland-devel wayland-protocols"
makedepends="gettext-devel glfw-devel harfbuzz-devel libxkbcommon-devel
- python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel openssl-devel"
-depends="kitty-terminfo-${version}_${revision}"
+ python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel
+ openssl-devel dbus-devel libXcursor-devel libXrandr-devel libXi-devel
+ fontconfig-devel libxcb-devel lcms2-devel"
+depends="kitty-terminfo-${version}_${revision} kitty-shell-integration-${version}_${revision}
+ kitty-kitten-${version}_${revision}"
short_desc="Modern, hackable, featureful, OpenGL based terminal emulator"
-maintainer="Benjamin Slade <slade@jnanam.net>"
-license="GPL-3.0-or-later"
+maintainer="classabbyamp <void@placeviolette.net>"
+license="GPL-3.0-only"
homepage="https://sw.kovidgoyal.net/kitty/"
changelog="https://sw.kovidgoyal.net/kitty/changelog.html"
distfiles="https://github.com/kovidgoyal/kitty/releases/download/v${version}/kitty-${version}.tar.xz"
-checksum=5544a580314fec7711187ce28162909b5ecff6780071444fe96fb97f8be5c9ad
+checksum=c11c545ca56adf1c26cfd8f5b4a3ba5f149f00542fbf0fa2c4439bd9bf6f78a5
python_version=3
+nopie_files="/usr/bin/kitten"
+# nocross="https://github.com/kovidgoyal/kitty/issues/6354"
+
LDFLAGS+=" -Wl,-z,stack-size=2097152"
# TIOCSWINSZ on ppc overflows signed int, used in ioctl()
@@ -23,11 +29,24 @@ case "$XBPS_TARGET_MACHINE" in
ppc*-musl) CFLAGS+=" -Wno-error=overflow";;
esac
+if [ "$CROSS_BUILD" ]; then
+ # cursed but this build system is a hot mess
+ hostmakedepends+=" $makedepends"
+fi
+
do_build() {
if [ "$CROSS_BUILD" ]; then
+ # hot mess, continued
+ env CC="cc" CFLAGS="$XBPS_CFLAGS" LDFLAGS="$XBPS_LDFLAGS" python3 setup.py build \
+ --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose
+ python3 setup.py clean --clean-for-cross-compile
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc}"
+ . /void-packages/common/environment/build-style/go.sh
+ python3 setup.py linux-package --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose --skip-code-generation
+ else
+ . /void-packages/common/environment/build-style/go.sh
+ python3 setup.py linux-package --prefix=${DESTDIR}/usr --update-check-interval=0 --verbose
fi
- python3 setup.py linux-package --prefix=${DESTDIR}/usr --update-check-interval=0 --verbose
}
do_install() {
@@ -40,3 +59,17 @@ kitty-terminfo_package() {
vmove usr/share/terminfo
}
}
+
+kitty-shell-integration_package() {
+ short_desc+=" - shell integration scripts"
+ pkg_install() {
+ vmove usr/lib/kitty/shell-integration
+ }
+}
+
+kitty-kitten_package() {
+ short_desc+=" - kitten client"
+ pkg_install() {
+ vmove usr/bin/kitten
+ }
+}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Updated] kitty: update to 0.28.1, adopt.
2023-06-09 21:28 [PR PATCH] kitty: update to 0.28.1, adopt classabbyamp
2023-06-10 2:23 ` [PR PATCH] [Updated] " classabbyamp
2023-06-13 4:14 ` classabbyamp
@ 2023-06-13 4:31 ` classabbyamp
2023-06-14 6:20 ` classabbyamp
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2023-06-13 4:31 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
There is an updated pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages update/kitty
https://github.com/void-linux/void-packages/pull/44338
kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
closes #43270 (supercedes)
@emacsomancer can I adopt this from you?
A patch file from https://github.com/void-linux/void-packages/pull/44338.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/kitty-44338.patch --]
[-- Type: text/x-diff, Size: 11213 bytes --]
From d0af3f3804ba41d3ed54a2e7d88be9e51495034c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 9 Jun 2023 13:39:30 -0400
Subject: [PATCH] kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
---
srcpkgs/kitty-kitten | 1 +
srcpkgs/kitty-shell-integration | 1 +
srcpkgs/kitty/patches/cross.patch | 174 ++++++++++++++++++++++++++++++
srcpkgs/kitty/template | 52 +++++++--
4 files changed, 219 insertions(+), 9 deletions(-)
create mode 120000 srcpkgs/kitty-kitten
create mode 120000 srcpkgs/kitty-shell-integration
create mode 100644 srcpkgs/kitty/patches/cross.patch
diff --git a/srcpkgs/kitty-kitten b/srcpkgs/kitty-kitten
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-kitten
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty-shell-integration b/srcpkgs/kitty-shell-integration
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-shell-integration
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty/patches/cross.patch b/srcpkgs/kitty/patches/cross.patch
new file mode 100644
index 000000000000..886eb7fa2c4d
--- /dev/null
+++ b/srcpkgs/kitty/patches/cross.patch
@@ -0,0 +1,174 @@
+From 88a5086f71f44e09539cae9af0cf62697df01f45 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <kovid@kovidgoyal.net>
+Date: Tue, 13 Jun 2023 07:56:16 +0530
+Subject: [PATCH] Add rudimentary support for cross-compilation
+
+Not really tested, actual cross compilers, feel free to send patches.
+Fixes #6354
+---
+ Makefile | 10 ++++++++++
+ docs/build.rst | 16 ++++++++++++++++
+ setup.py | 51 ++++++++++++++++++++++++++++++++++++--------------
+ 3 files changed, 63 insertions(+), 14 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5231798c5a..dfc968b865 100644
+--- a/Makefile
++++ b/Makefile
+@@ -61,3 +61,13 @@ docs: man html
+
+ develop-docs:
+ $(MAKE) -C docs develop-docs
++
++
++prepare-for-cross-compile:
++ $(MAKE) clean
++ $(MAKE) build
++ python3 setup.py $(VVAL) clean --clean-for-cross-compile
++
++cross-compile:
++ python3 setup.py linux-package --skip-code-generation
++
+diff --git a/docs/build.rst b/docs/build.rst
+index bd8a73c772..5082892d71 100644
+--- a/docs/build.rst
++++ b/docs/build.rst
+@@ -204,3 +204,19 @@ the kitty program expects to find them there.
+
+ This applies to creating packages for |kitty| for macOS package managers such as
+ Homebrew or MacPorts as well.
++
++Cross-compilation
++-------------------
++
++While cross compilation is neither officially supported, nor recommended, as it
++means the test suite cannot be run for the cross-compiled build, there is some
++support for cross-compilation. Basically, run::
++
++ make prepare-for-cross-compile
++
++Then setup the cross compile environment (CC, CFLAGS, etc.) and run::
++
++ make cross-compile
++
++This will create the cross compiled build in the :file:`linux-package`
++directory.
+diff --git a/setup.py b/setup.py
+index 1d3c76f0f7..2b1ba6fde9 100755
+--- a/setup.py
++++ b/setup.py
+@@ -62,6 +62,8 @@ class Options(argparse.Namespace):
+ sanitize: bool = False
+ prefix: str = './linux-package'
+ dir_for_static_binaries: str = 'build/static'
++ skip_code_generation: bool = False
++ clean_for_cross_compile: bool = False
+ incremental: bool = True
+ profile: bool = False
+ libdir_name: str = 'lib'
+@@ -841,16 +843,17 @@ def extract_rst_targets() -> Dict[str, Dict[str, str]]:
+ return cast(Dict[str, Dict[str, str]], m['main']())
+
+
+-def build_ref_map() -> str:
+- d = extract_rst_targets()
+- h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++def build_ref_map(skip_generation: bool = False) -> str:
+ dest = 'kitty/docs_ref_map_generated.h'
+- q = ''
+- with suppress(FileNotFoundError), open(dest) as f:
+- q = f.read()
+- if q != h:
+- with open(dest, 'w') as f:
+- f.write(h)
++ if not skip_generation:
++ d = extract_rst_targets()
++ h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++ q = ''
++ with suppress(FileNotFoundError), open(dest) as f:
++ q = f.read()
++ if q != h:
++ with open(dest, 'w') as f:
++ f.write(h)
+ return dest
+
+
+@@ -868,7 +871,7 @@ def build(args: Options, native_optimizations: bool = True, call_init: bool = Tr
+ if call_init:
+ init_env_from_args(args, native_optimizations)
+ sources, headers = find_c_files()
+- headers.append(build_ref_map())
++ headers.append(build_ref_map(args.skip_code_generation))
+ compile_c_extension(
+ kitty_env(), 'kitty/fast_data_types', args.compilation_database, sources, headers
+ )
+@@ -881,6 +884,9 @@ def safe_makedirs(path: str) -> None:
+
+
+ def update_go_generated_files(args: Options, kitty_exe: str) -> None:
++ if args.skip_code_generation:
++ print('Skipping generation of Go files due to command line option', flush=True)
++ return
+ # update all the various auto-generated go files, if needed
+ if args.verbose:
+ print('Updating Go generated files...', flush=True)
+@@ -1493,7 +1499,7 @@ def clean_launcher_dir(launcher_dir: str) -> None:
+ os.remove(x)
+
+
+-def clean() -> None:
++def clean(for_cross_compile: bool = False) -> None:
+
+ def safe_remove(*entries: str) -> None:
+ for x in entries:
+@@ -1506,7 +1512,9 @@ def safe_remove(*entries: str) -> None:
+ safe_remove(
+ 'build', 'compile_commands.json', 'link_commands.json',
+ 'linux-package', 'kitty.app', 'asan-launcher',
+- 'kitty-profile', 'docs/generated')
++ 'kitty-profile')
++ if not for_cross_compile:
++ safe_remove('docs/generated')
+ clean_launcher_dir('kitty/launcher')
+
+ def excluded(root: str, d: str) -> bool:
+@@ -1521,7 +1529,9 @@ def excluded(root: str, d: str) -> bool:
+ dirs.remove(d)
+ for f in files:
+ ext = f.rpartition('.')[-1]
+- if ext in ('so', 'dylib', 'pyc', 'pyo') or f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'):
++ if ext in ('so', 'dylib', 'pyc', 'pyo') or (not for_cross_compile and (
++ f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'))
++ ):
+ os.unlink(os.path.join(root, f))
+ for x in glob.glob('glfw/wayland-*-protocol.[ch]'):
+ os.unlink(x)
+@@ -1581,6 +1591,19 @@ def option_parser() -> argparse.ArgumentParser: # {{{
+ default=Options.dir_for_static_binaries,
+ help='Where to create the static kitten binary'
+ )
++ p.add_argument(
++ '--skip-code-generation',
++ default=Options.skip_code_generation,
++ action='store_true',
++ help='Do not create the *_generated.* source files. This is useful if they'
++ ' have already been generated by a previous build, for example during a two-stage cross compilation.'
++ )
++ p.add_argument(
++ '--clean-for-cross-compile',
++ default=Options.clean_for_cross_compile,
++ action='store_true',
++ help='Do not clean generated Go source files. Useful for cross-compilation.'
++ )
+ p.add_argument(
+ '--full',
+ dest='incremental',
+@@ -1743,7 +1766,7 @@ def main() -> None:
+ texe = os.path.abspath(os.path.join(launcher_dir, 'kitty'))
+ os.execl(texe, texe, '+launch', 'test.py')
+ if args.action == 'clean':
+- clean()
++ clean(for_cross_compile=args.clean_for_cross_compile)
+ return
+
+ with CompilationDatabase(args.incremental) as cdb:
diff --git a/srcpkgs/kitty/template b/srcpkgs/kitty/template
index 90eb7261085c..f902c768ed5e 100644
--- a/srcpkgs/kitty/template
+++ b/srcpkgs/kitty/template
@@ -1,20 +1,25 @@
# Template file for 'kitty'
pkgname=kitty
-version=0.26.5
-revision=2
+version=0.28.1
+revision=1
pycompile_dirs="usr/lib/kitty"
-hostmakedepends="pkg-config python3 wayland-devel wayland-protocols"
+hostmakedepends="go pkg-config python3 wayland-devel wayland-protocols"
makedepends="gettext-devel glfw-devel harfbuzz-devel libxkbcommon-devel
- python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel openssl-devel"
-depends="kitty-terminfo-${version}_${revision}"
+ python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel
+ openssl-devel dbus-devel libXcursor-devel libXrandr-devel libXi-devel
+ fontconfig-devel libxcb-devel lcms2-devel"
+depends="kitty-terminfo-${version}_${revision} kitty-shell-integration-${version}_${revision}
+ kitty-kitten-${version}_${revision}"
short_desc="Modern, hackable, featureful, OpenGL based terminal emulator"
-maintainer="Benjamin Slade <slade@jnanam.net>"
-license="GPL-3.0-or-later"
+maintainer="classabbyamp <void@placeviolette.net>"
+license="GPL-3.0-only"
homepage="https://sw.kovidgoyal.net/kitty/"
changelog="https://sw.kovidgoyal.net/kitty/changelog.html"
distfiles="https://github.com/kovidgoyal/kitty/releases/download/v${version}/kitty-${version}.tar.xz"
-checksum=5544a580314fec7711187ce28162909b5ecff6780071444fe96fb97f8be5c9ad
+checksum=c11c545ca56adf1c26cfd8f5b4a3ba5f149f00542fbf0fa2c4439bd9bf6f78a5
python_version=3
+nopie_files="/usr/bin/kitten"
+
LDFLAGS+=" -Wl,-z,stack-size=2097152"
# TIOCSWINSZ on ppc overflows signed int, used in ioctl()
@@ -23,11 +28,26 @@ case "$XBPS_TARGET_MACHINE" in
ppc*-musl) CFLAGS+=" -Wno-error=overflow";;
esac
+if [ "$CROSS_BUILD" ]; then
+ # cursed but this build system is a hot mess
+ hostmakedepends+=" $makedepends"
+fi
+
do_build() {
if [ "$CROSS_BUILD" ]; then
+ # hot mess, continued
+ msg_normal "$pkgver: compiling tools and generating go code on the host arch...\n"
+ env CC="cc" CFLAGS="$XBPS_CFLAGS" LDFLAGS="$XBPS_LDFLAGS" python3 setup.py build \
+ --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose
+ python3 setup.py clean --clean-for-cross-compile
+ msg_normal "$pkgver: compiling for the target arch...\n"
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc}"
+ . /void-packages/common/environment/build-style/go.sh
+ python3 setup.py linux-package --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose --skip-code-generation
+ else
+ . /void-packages/common/environment/build-style/go.sh
+ python3 setup.py linux-package --prefix=${DESTDIR}/usr --update-check-interval=0 --verbose
fi
- python3 setup.py linux-package --prefix=${DESTDIR}/usr --update-check-interval=0 --verbose
}
do_install() {
@@ -40,3 +60,17 @@ kitty-terminfo_package() {
vmove usr/share/terminfo
}
}
+
+kitty-shell-integration_package() {
+ short_desc+=" - shell integration scripts"
+ pkg_install() {
+ vmove usr/lib/kitty/shell-integration
+ }
+}
+
+kitty-kitten_package() {
+ short_desc+=" - kitten client"
+ pkg_install() {
+ vmove usr/bin/kitten
+ }
+}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Updated] kitty: update to 0.28.1, adopt.
2023-06-09 21:28 [PR PATCH] kitty: update to 0.28.1, adopt classabbyamp
` (2 preceding siblings ...)
2023-06-13 4:31 ` classabbyamp
@ 2023-06-14 6:20 ` classabbyamp
2023-06-14 6:23 ` classabbyamp
2023-06-14 6:50 ` [PR PATCH] [Merged]: " classabbyamp
5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2023-06-14 6:20 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
There is an updated pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages update/kitty
https://github.com/void-linux/void-packages/pull/44338
kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
closes #43270 (supercedes)
@emacsomancer can I adopt this from you?
A patch file from https://github.com/void-linux/void-packages/pull/44338.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/kitty-44338.patch --]
[-- Type: text/x-diff, Size: 10989 bytes --]
From 36a2c9368956e97d24403cddef83f9a48546d2dd Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 9 Jun 2023 13:39:30 -0400
Subject: [PATCH] kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
---
srcpkgs/kitty-kitten | 1 +
srcpkgs/kitty-shell-integration | 1 +
srcpkgs/kitty/patches/cross.patch | 174 ++++++++++++++++++++++++++++++
srcpkgs/kitty/template | 51 +++++++--
4 files changed, 217 insertions(+), 10 deletions(-)
create mode 120000 srcpkgs/kitty-kitten
create mode 120000 srcpkgs/kitty-shell-integration
create mode 100644 srcpkgs/kitty/patches/cross.patch
diff --git a/srcpkgs/kitty-kitten b/srcpkgs/kitty-kitten
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-kitten
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty-shell-integration b/srcpkgs/kitty-shell-integration
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-shell-integration
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty/patches/cross.patch b/srcpkgs/kitty/patches/cross.patch
new file mode 100644
index 000000000000..886eb7fa2c4d
--- /dev/null
+++ b/srcpkgs/kitty/patches/cross.patch
@@ -0,0 +1,174 @@
+From 88a5086f71f44e09539cae9af0cf62697df01f45 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <kovid@kovidgoyal.net>
+Date: Tue, 13 Jun 2023 07:56:16 +0530
+Subject: [PATCH] Add rudimentary support for cross-compilation
+
+Not really tested, actual cross compilers, feel free to send patches.
+Fixes #6354
+---
+ Makefile | 10 ++++++++++
+ docs/build.rst | 16 ++++++++++++++++
+ setup.py | 51 ++++++++++++++++++++++++++++++++++++--------------
+ 3 files changed, 63 insertions(+), 14 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5231798c5a..dfc968b865 100644
+--- a/Makefile
++++ b/Makefile
+@@ -61,3 +61,13 @@ docs: man html
+
+ develop-docs:
+ $(MAKE) -C docs develop-docs
++
++
++prepare-for-cross-compile:
++ $(MAKE) clean
++ $(MAKE) build
++ python3 setup.py $(VVAL) clean --clean-for-cross-compile
++
++cross-compile:
++ python3 setup.py linux-package --skip-code-generation
++
+diff --git a/docs/build.rst b/docs/build.rst
+index bd8a73c772..5082892d71 100644
+--- a/docs/build.rst
++++ b/docs/build.rst
+@@ -204,3 +204,19 @@ the kitty program expects to find them there.
+
+ This applies to creating packages for |kitty| for macOS package managers such as
+ Homebrew or MacPorts as well.
++
++Cross-compilation
++-------------------
++
++While cross compilation is neither officially supported, nor recommended, as it
++means the test suite cannot be run for the cross-compiled build, there is some
++support for cross-compilation. Basically, run::
++
++ make prepare-for-cross-compile
++
++Then setup the cross compile environment (CC, CFLAGS, etc.) and run::
++
++ make cross-compile
++
++This will create the cross compiled build in the :file:`linux-package`
++directory.
+diff --git a/setup.py b/setup.py
+index 1d3c76f0f7..2b1ba6fde9 100755
+--- a/setup.py
++++ b/setup.py
+@@ -62,6 +62,8 @@ class Options(argparse.Namespace):
+ sanitize: bool = False
+ prefix: str = './linux-package'
+ dir_for_static_binaries: str = 'build/static'
++ skip_code_generation: bool = False
++ clean_for_cross_compile: bool = False
+ incremental: bool = True
+ profile: bool = False
+ libdir_name: str = 'lib'
+@@ -841,16 +843,17 @@ def extract_rst_targets() -> Dict[str, Dict[str, str]]:
+ return cast(Dict[str, Dict[str, str]], m['main']())
+
+
+-def build_ref_map() -> str:
+- d = extract_rst_targets()
+- h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++def build_ref_map(skip_generation: bool = False) -> str:
+ dest = 'kitty/docs_ref_map_generated.h'
+- q = ''
+- with suppress(FileNotFoundError), open(dest) as f:
+- q = f.read()
+- if q != h:
+- with open(dest, 'w') as f:
+- f.write(h)
++ if not skip_generation:
++ d = extract_rst_targets()
++ h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++ q = ''
++ with suppress(FileNotFoundError), open(dest) as f:
++ q = f.read()
++ if q != h:
++ with open(dest, 'w') as f:
++ f.write(h)
+ return dest
+
+
+@@ -868,7 +871,7 @@ def build(args: Options, native_optimizations: bool = True, call_init: bool = Tr
+ if call_init:
+ init_env_from_args(args, native_optimizations)
+ sources, headers = find_c_files()
+- headers.append(build_ref_map())
++ headers.append(build_ref_map(args.skip_code_generation))
+ compile_c_extension(
+ kitty_env(), 'kitty/fast_data_types', args.compilation_database, sources, headers
+ )
+@@ -881,6 +884,9 @@ def safe_makedirs(path: str) -> None:
+
+
+ def update_go_generated_files(args: Options, kitty_exe: str) -> None:
++ if args.skip_code_generation:
++ print('Skipping generation of Go files due to command line option', flush=True)
++ return
+ # update all the various auto-generated go files, if needed
+ if args.verbose:
+ print('Updating Go generated files...', flush=True)
+@@ -1493,7 +1499,7 @@ def clean_launcher_dir(launcher_dir: str) -> None:
+ os.remove(x)
+
+
+-def clean() -> None:
++def clean(for_cross_compile: bool = False) -> None:
+
+ def safe_remove(*entries: str) -> None:
+ for x in entries:
+@@ -1506,7 +1512,9 @@ def safe_remove(*entries: str) -> None:
+ safe_remove(
+ 'build', 'compile_commands.json', 'link_commands.json',
+ 'linux-package', 'kitty.app', 'asan-launcher',
+- 'kitty-profile', 'docs/generated')
++ 'kitty-profile')
++ if not for_cross_compile:
++ safe_remove('docs/generated')
+ clean_launcher_dir('kitty/launcher')
+
+ def excluded(root: str, d: str) -> bool:
+@@ -1521,7 +1529,9 @@ def excluded(root: str, d: str) -> bool:
+ dirs.remove(d)
+ for f in files:
+ ext = f.rpartition('.')[-1]
+- if ext in ('so', 'dylib', 'pyc', 'pyo') or f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'):
++ if ext in ('so', 'dylib', 'pyc', 'pyo') or (not for_cross_compile and (
++ f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'))
++ ):
+ os.unlink(os.path.join(root, f))
+ for x in glob.glob('glfw/wayland-*-protocol.[ch]'):
+ os.unlink(x)
+@@ -1581,6 +1591,19 @@ def option_parser() -> argparse.ArgumentParser: # {{{
+ default=Options.dir_for_static_binaries,
+ help='Where to create the static kitten binary'
+ )
++ p.add_argument(
++ '--skip-code-generation',
++ default=Options.skip_code_generation,
++ action='store_true',
++ help='Do not create the *_generated.* source files. This is useful if they'
++ ' have already been generated by a previous build, for example during a two-stage cross compilation.'
++ )
++ p.add_argument(
++ '--clean-for-cross-compile',
++ default=Options.clean_for_cross_compile,
++ action='store_true',
++ help='Do not clean generated Go source files. Useful for cross-compilation.'
++ )
+ p.add_argument(
+ '--full',
+ dest='incremental',
+@@ -1743,7 +1766,7 @@ def main() -> None:
+ texe = os.path.abspath(os.path.join(launcher_dir, 'kitty'))
+ os.execl(texe, texe, '+launch', 'test.py')
+ if args.action == 'clean':
+- clean()
++ clean(for_cross_compile=args.clean_for_cross_compile)
+ return
+
+ with CompilationDatabase(args.incremental) as cdb:
diff --git a/srcpkgs/kitty/template b/srcpkgs/kitty/template
index 90eb7261085c..6ec5e8af4a50 100644
--- a/srcpkgs/kitty/template
+++ b/srcpkgs/kitty/template
@@ -1,20 +1,26 @@
# Template file for 'kitty'
pkgname=kitty
-version=0.26.5
-revision=2
+version=0.28.1
+revision=1
+build_helper="python3"
pycompile_dirs="usr/lib/kitty"
-hostmakedepends="pkg-config python3 wayland-devel wayland-protocols"
+hostmakedepends="go pkg-config python3 wayland-devel wayland-protocols"
makedepends="gettext-devel glfw-devel harfbuzz-devel libxkbcommon-devel
- python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel openssl-devel"
-depends="kitty-terminfo-${version}_${revision}"
+ python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel
+ openssl-devel dbus-devel libXcursor-devel libXrandr-devel libXi-devel
+ fontconfig-devel libxcb-devel lcms2-devel"
+depends="kitty-terminfo-${version}_${revision} kitty-shell-integration-${version}_${revision}
+ kitty-kitten-${version}_${revision}"
short_desc="Modern, hackable, featureful, OpenGL based terminal emulator"
-maintainer="Benjamin Slade <slade@jnanam.net>"
-license="GPL-3.0-or-later"
+maintainer="classabbyamp <void@placeviolette.net>"
+license="GPL-3.0-only"
homepage="https://sw.kovidgoyal.net/kitty/"
changelog="https://sw.kovidgoyal.net/kitty/changelog.html"
distfiles="https://github.com/kovidgoyal/kitty/releases/download/v${version}/kitty-${version}.tar.xz"
-checksum=5544a580314fec7711187ce28162909b5ecff6780071444fe96fb97f8be5c9ad
+checksum=c11c545ca56adf1c26cfd8f5b4a3ba5f149f00542fbf0fa2c4439bd9bf6f78a5
python_version=3
+nopie_files="/usr/bin/kitten"
+
LDFLAGS+=" -Wl,-z,stack-size=2097152"
# TIOCSWINSZ on ppc overflows signed int, used in ioctl()
@@ -23,11 +29,22 @@ case "$XBPS_TARGET_MACHINE" in
ppc*-musl) CFLAGS+=" -Wno-error=overflow";;
esac
+if [ "$CROSS_BUILD" ]; then
+ # cursed but this build system is a hot mess
+ hostmakedepends+=" $makedepends"
+fi
+
do_build() {
+ local _cross_args
if [ "$CROSS_BUILD" ]; then
- CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc}"
+ # hot mess, continued
+ env CC="cc" CFLAGS="$XBPS_CFLAGS" LDFLAGS="$XBPS_LDFLAGS" python3 setup.py build \
+ --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose
+ python3 setup.py clean --clean-for-cross-compile
+ _cross_args=(--skip-code-generation)
fi
- python3 setup.py linux-package --prefix=${DESTDIR}/usr --update-check-interval=0 --verbose
+ . /void-packages/common/environment/build-style/go.sh
+ python3 setup.py linux-package --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose "${_cross_args[@]}"
}
do_install() {
@@ -40,3 +57,17 @@ kitty-terminfo_package() {
vmove usr/share/terminfo
}
}
+
+kitty-shell-integration_package() {
+ short_desc+=" - shell integration scripts"
+ pkg_install() {
+ vmove usr/lib/kitty/shell-integration
+ }
+}
+
+kitty-kitten_package() {
+ short_desc+=" - kitten client"
+ pkg_install() {
+ vmove usr/bin/kitten
+ }
+}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Updated] kitty: update to 0.28.1, adopt.
2023-06-09 21:28 [PR PATCH] kitty: update to 0.28.1, adopt classabbyamp
` (3 preceding siblings ...)
2023-06-14 6:20 ` classabbyamp
@ 2023-06-14 6:23 ` classabbyamp
2023-06-14 6:50 ` [PR PATCH] [Merged]: " classabbyamp
5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2023-06-14 6:23 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
There is an updated pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages update/kitty
https://github.com/void-linux/void-packages/pull/44338
kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
closes #43270 (supercedes)
@emacsomancer can I adopt this from you?
A patch file from https://github.com/void-linux/void-packages/pull/44338.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update/kitty-44338.patch --]
[-- Type: text/x-diff, Size: 9589 bytes --]
From 8e76c50d6acb8508c061088f4afb5356e241293e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 9 Jun 2023 13:39:30 -0400
Subject: [PATCH] kitty: update to 0.28.1, adopt.
add subpackages for components that can be used in remote/headless envs
---
srcpkgs/kitty-kitten | 1 +
srcpkgs/kitty-shell-integration | 1 +
srcpkgs/kitty/patches/cross.patch | 128 ++++++++++++++++++++++++++++++
srcpkgs/kitty/template | 51 +++++++++---
4 files changed, 171 insertions(+), 10 deletions(-)
create mode 120000 srcpkgs/kitty-kitten
create mode 120000 srcpkgs/kitty-shell-integration
create mode 100644 srcpkgs/kitty/patches/cross.patch
diff --git a/srcpkgs/kitty-kitten b/srcpkgs/kitty-kitten
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-kitten
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty-shell-integration b/srcpkgs/kitty-shell-integration
new file mode 120000
index 000000000000..659fb6b426aa
--- /dev/null
+++ b/srcpkgs/kitty-shell-integration
@@ -0,0 +1 @@
+kitty
\ No newline at end of file
diff --git a/srcpkgs/kitty/patches/cross.patch b/srcpkgs/kitty/patches/cross.patch
new file mode 100644
index 000000000000..b718adb3e6d3
--- /dev/null
+++ b/srcpkgs/kitty/patches/cross.patch
@@ -0,0 +1,128 @@
+From 88a5086f71f44e09539cae9af0cf62697df01f45 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <kovid@kovidgoyal.net>
+Date: Tue, 13 Jun 2023 07:56:16 +0530
+Subject: [PATCH] Add rudimentary support for cross-compilation
+
+Not really tested, actual cross compilers, feel free to send patches.
+Fixes #6354
+---
+
+diff --git a/setup.py b/setup.py
+index 1d3c76f0f7..2b1ba6fde9 100755
+--- a/setup.py
++++ b/setup.py
+@@ -62,6 +62,8 @@ class Options(argparse.Namespace):
+ sanitize: bool = False
+ prefix: str = './linux-package'
+ dir_for_static_binaries: str = 'build/static'
++ skip_code_generation: bool = False
++ clean_for_cross_compile: bool = False
+ incremental: bool = True
+ profile: bool = False
+ libdir_name: str = 'lib'
+@@ -841,16 +843,17 @@ def extract_rst_targets() -> Dict[str, Dict[str, str]]:
+ return cast(Dict[str, Dict[str, str]], m['main']())
+
+
+-def build_ref_map() -> str:
+- d = extract_rst_targets()
+- h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++def build_ref_map(skip_generation: bool = False) -> str:
+ dest = 'kitty/docs_ref_map_generated.h'
+- q = ''
+- with suppress(FileNotFoundError), open(dest) as f:
+- q = f.read()
+- if q != h:
+- with open(dest, 'w') as f:
+- f.write(h)
++ if not skip_generation:
++ d = extract_rst_targets()
++ h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
++ q = ''
++ with suppress(FileNotFoundError), open(dest) as f:
++ q = f.read()
++ if q != h:
++ with open(dest, 'w') as f:
++ f.write(h)
+ return dest
+
+
+@@ -868,7 +871,7 @@ def build(args: Options, native_optimizations: bool = True, call_init: bool = Tr
+ if call_init:
+ init_env_from_args(args, native_optimizations)
+ sources, headers = find_c_files()
+- headers.append(build_ref_map())
++ headers.append(build_ref_map(args.skip_code_generation))
+ compile_c_extension(
+ kitty_env(), 'kitty/fast_data_types', args.compilation_database, sources, headers
+ )
+@@ -881,6 +884,9 @@ def safe_makedirs(path: str) -> None:
+
+
+ def update_go_generated_files(args: Options, kitty_exe: str) -> None:
++ if args.skip_code_generation:
++ print('Skipping generation of Go files due to command line option', flush=True)
++ return
+ # update all the various auto-generated go files, if needed
+ if args.verbose:
+ print('Updating Go generated files...', flush=True)
+@@ -1493,7 +1499,7 @@ def clean_launcher_dir(launcher_dir: str) -> None:
+ os.remove(x)
+
+
+-def clean() -> None:
++def clean(for_cross_compile: bool = False) -> None:
+
+ def safe_remove(*entries: str) -> None:
+ for x in entries:
+@@ -1506,7 +1512,9 @@ def safe_remove(*entries: str) -> None:
+ safe_remove(
+ 'build', 'compile_commands.json', 'link_commands.json',
+ 'linux-package', 'kitty.app', 'asan-launcher',
+- 'kitty-profile', 'docs/generated')
++ 'kitty-profile')
++ if not for_cross_compile:
++ safe_remove('docs/generated')
+ clean_launcher_dir('kitty/launcher')
+
+ def excluded(root: str, d: str) -> bool:
+@@ -1521,7 +1529,9 @@ def excluded(root: str, d: str) -> bool:
+ dirs.remove(d)
+ for f in files:
+ ext = f.rpartition('.')[-1]
+- if ext in ('so', 'dylib', 'pyc', 'pyo') or f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'):
++ if ext in ('so', 'dylib', 'pyc', 'pyo') or (not for_cross_compile and (
++ f.endswith('_generated.h') or f.endswith('_generated.go') or f.endswith('_generated.bin'))
++ ):
+ os.unlink(os.path.join(root, f))
+ for x in glob.glob('glfw/wayland-*-protocol.[ch]'):
+ os.unlink(x)
+@@ -1581,6 +1591,19 @@ def option_parser() -> argparse.ArgumentParser: # {{{
+ default=Options.dir_for_static_binaries,
+ help='Where to create the static kitten binary'
+ )
++ p.add_argument(
++ '--skip-code-generation',
++ default=Options.skip_code_generation,
++ action='store_true',
++ help='Do not create the *_generated.* source files. This is useful if they'
++ ' have already been generated by a previous build, for example during a two-stage cross compilation.'
++ )
++ p.add_argument(
++ '--clean-for-cross-compile',
++ default=Options.clean_for_cross_compile,
++ action='store_true',
++ help='Do not clean generated Go source files. Useful for cross-compilation.'
++ )
+ p.add_argument(
+ '--full',
+ dest='incremental',
+@@ -1743,7 +1766,7 @@ def main() -> None:
+ texe = os.path.abspath(os.path.join(launcher_dir, 'kitty'))
+ os.execl(texe, texe, '+launch', 'test.py')
+ if args.action == 'clean':
+- clean()
++ clean(for_cross_compile=args.clean_for_cross_compile)
+ return
+
+ with CompilationDatabase(args.incremental) as cdb:
diff --git a/srcpkgs/kitty/template b/srcpkgs/kitty/template
index 90eb7261085c..6ec5e8af4a50 100644
--- a/srcpkgs/kitty/template
+++ b/srcpkgs/kitty/template
@@ -1,20 +1,26 @@
# Template file for 'kitty'
pkgname=kitty
-version=0.26.5
-revision=2
+version=0.28.1
+revision=1
+build_helper="python3"
pycompile_dirs="usr/lib/kitty"
-hostmakedepends="pkg-config python3 wayland-devel wayland-protocols"
+hostmakedepends="go pkg-config python3 wayland-devel wayland-protocols"
makedepends="gettext-devel glfw-devel harfbuzz-devel libxkbcommon-devel
- python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel openssl-devel"
-depends="kitty-terminfo-${version}_${revision}"
+ python3-devel wayland-devel wayland-protocols librsync-devel libcanberra-devel
+ openssl-devel dbus-devel libXcursor-devel libXrandr-devel libXi-devel
+ fontconfig-devel libxcb-devel lcms2-devel"
+depends="kitty-terminfo-${version}_${revision} kitty-shell-integration-${version}_${revision}
+ kitty-kitten-${version}_${revision}"
short_desc="Modern, hackable, featureful, OpenGL based terminal emulator"
-maintainer="Benjamin Slade <slade@jnanam.net>"
-license="GPL-3.0-or-later"
+maintainer="classabbyamp <void@placeviolette.net>"
+license="GPL-3.0-only"
homepage="https://sw.kovidgoyal.net/kitty/"
changelog="https://sw.kovidgoyal.net/kitty/changelog.html"
distfiles="https://github.com/kovidgoyal/kitty/releases/download/v${version}/kitty-${version}.tar.xz"
-checksum=5544a580314fec7711187ce28162909b5ecff6780071444fe96fb97f8be5c9ad
+checksum=c11c545ca56adf1c26cfd8f5b4a3ba5f149f00542fbf0fa2c4439bd9bf6f78a5
python_version=3
+nopie_files="/usr/bin/kitten"
+
LDFLAGS+=" -Wl,-z,stack-size=2097152"
# TIOCSWINSZ on ppc overflows signed int, used in ioctl()
@@ -23,11 +29,22 @@ case "$XBPS_TARGET_MACHINE" in
ppc*-musl) CFLAGS+=" -Wno-error=overflow";;
esac
+if [ "$CROSS_BUILD" ]; then
+ # cursed but this build system is a hot mess
+ hostmakedepends+=" $makedepends"
+fi
+
do_build() {
+ local _cross_args
if [ "$CROSS_BUILD" ]; then
- CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc}"
+ # hot mess, continued
+ env CC="cc" CFLAGS="$XBPS_CFLAGS" LDFLAGS="$XBPS_LDFLAGS" python3 setup.py build \
+ --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose
+ python3 setup.py clean --clean-for-cross-compile
+ _cross_args=(--skip-code-generation)
fi
- python3 setup.py linux-package --prefix=${DESTDIR}/usr --update-check-interval=0 --verbose
+ . /void-packages/common/environment/build-style/go.sh
+ python3 setup.py linux-package --prefix="${DESTDIR}/usr" --update-check-interval=0 --verbose "${_cross_args[@]}"
}
do_install() {
@@ -40,3 +57,17 @@ kitty-terminfo_package() {
vmove usr/share/terminfo
}
}
+
+kitty-shell-integration_package() {
+ short_desc+=" - shell integration scripts"
+ pkg_install() {
+ vmove usr/lib/kitty/shell-integration
+ }
+}
+
+kitty-kitten_package() {
+ short_desc+=" - kitten client"
+ pkg_install() {
+ vmove usr/bin/kitten
+ }
+}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Merged]: kitty: update to 0.28.1, adopt.
2023-06-09 21:28 [PR PATCH] kitty: update to 0.28.1, adopt classabbyamp
` (4 preceding siblings ...)
2023-06-14 6:23 ` classabbyamp
@ 2023-06-14 6:50 ` classabbyamp
5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2023-06-14 6:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
There's a merged pull request on the void-packages repository
kitty: update to 0.28.1, adopt.
https://github.com/void-linux/void-packages/pull/44338
Description:
add subpackages for components that can be used in remote/headless envs
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
closes #43270 (supercedes)
@emacsomancer can I adopt this from you?
^ permalink raw reply [flat|nested] 7+ messages in thread