Created attachment 198996 [details] x11-kitty.diff In WantedPorts: https://wiki.freebsd.org/WantedPorts. Note that because Sphinx isn't yet at >= 1.7, the docs option is untestable and I didn't spend much time on it.
Comment on attachment 198996 [details] x11-kitty.diff BINARY_ALIAS= python3=${PYTHON_CMD} How is that used? DOCS_DESC= build docs Remove, DOCS already has DESC in framework BELL= Should be BELL_DESC= +OPTIONS_DEFINE= ICAT DOCS BELL NLS +OPTIONS_DEFAULT= NLS Goes at the start of OPTIONS, not at the end DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=1.7:textproc/py-sphinx should be: OCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=1.7:textproc/py-sphinx@${PY_FLAVOR}
(In reply to Nathan from comment #1) The project's internal installation logic tries to call python3, which is worked around via ALIAS_BINARY. All the other changes have been made locally. I will wait for some more feedback before uploading the patch.
neat! I pulled this in as a patch to https://github.com/skunkwerks/ports/tree/x11/kitty to run it in a clean build in poudriere, similar to what the FreeBSD packaging system would run. This includes DOCS built by default: ===> kitty-0.12.3 depends on package: py36-sphinx>=1.7 - not found *** Error code 1 DOCS is a pretty common base option to have defined, so I suggest poking the maintainer for py-sphinx and seeing if that's an option. Either py-sphinx gets updated to 1.8.1 (current release) so this works, or the patch should remove the docs completely pending py-sphinx becoming available.
(In reply to Dave Cottlehuber from comment #3) Yes. I pinged lwhsu@ about this who originally wrote the package before I uploaded this. BTW, off topic, I did test this would poudriere and it seemed like default options would always add docs no matter what. Is there a way to have poudriere jail testing test all the different options?
Note, terminfo handling is currently broken. There are two issues: 1. tic run at install time isn't actually adding the entry. 2. Even when the entry is manually added, curses can't seem to figure it out.
For base ncurses which uses old TERMCAP (thanks Scott): TERMCAP=xterm-kitty|KovIdTTY:am:hs:km:mi:ms:xn:co#80:it#8:li#24:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:K1=:K3=:K4=:K5=:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h:
Created attachment 199085 [details] fixed nits and added terminfo explanation
The TERMCAP method doesn't seem to properly set colors...
You need to add "tc=xterm-new:" to the termcap entry.
BTW, if we cannot get textproc/py-sphinx updated soon, disabling building doc might be another option...
Reporter is Committer, assign accoringly
(In reply to Kubilay Kocak from comment #11) I am not a ports committer.
Created attachment 201630 [details] v0.13.3 + dependency on termcap
heh, I've also created a port for that some time ago :) https://github.com/myfreeweb/freebsd-ports-dank/blob/955b576dc5a0369e4486d9e5ca073a584b0e2d63/x11/kitty/Makefile https://github.com/myfreeweb/freebsd-ports-dank/blob/955b576dc5a0369e4486d9e5ca073a584b0e2d63/x11/kitty/files/patch-glfw_memfd.h https://github.com/myfreeweb/freebsd-ports-dank/blob/955b576dc5a0369e4486d9e5ca073a584b0e2d63/x11/kitty/files/patch-glfw_wl__window.c you could take the libwayland/epoll related lines from the makefile and the patches linked above to enable building glfw-wayland.so.
(In reply to Greg V from comment #14) Do you just want to take this over? I only did this because I wanted kitty a few months back and no port existed. I have no particular desire to maintain a port.
Created attachment 202146 [details] Small fixes + wayland support
Created attachment 202705 [details] More minor fixes
Comment on attachment 202705 [details] More minor fixes > USES= gl gmake pkgconfig:build python:3.5+ shebangfix terminfo pkgconfig defaults to build-only dependency, so you can drop :build argument. > BINARY_ALIAS= python3=${PYTHON_CMD} [...] > post-patch-DOCS-on: > ${REINPLACE_CMD} -e 's|python3|${PYTHON_CMD}|g' ${WRKSRC}/docs/Makefile > ${REINPLACE_CMD} -e 's|sphinx-build|&-${PYTHON_VER}|' ${WRKSRC}/docs/Makefile Why both approaches? And do you still need either given DOCS is commented out? > do-build: > cd ${WRKSRC} && CC=clang ${PYTHON_CMD} setup.py --prefix ${STAGEDIR}${PREFIX} linux-package - Replace CC=clang with ${SETENV} ${MAKE_ENV} to avoid breaking GCC architectures (powerpc*, sparc64, mips*, riscv64*) - Add USES=compiler:c11 (for -std=c11) to avoid ancient GCC 4.2 in base x11/kitty/files/patch-glfw_wl__init.c: > --- glfw/wl_init.c.orig 2019-02-17 23:49:36 UTC > +++ glfw/wl_init.c > @@ -31,7 +31,7 @@ > #include <assert.h> > #include <errno.h> > #include <limits.h> > -#include <linux/input.h> > +#include <dev/evdev/input.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> Drop in favor of BUILD_DEPENDS=evdev-proto>0:devel/evdev-proto. According to wulf@ (maintainer of <dev/evdev/*>): "The rule is simple: always use <linux/*> except you are writing something FreeBSD-only like kernel drivers"
Created attachment 202721 [details] Latest round of improvements from jbeich
Created attachment 202749 [details] INSTALLS_ICONS re-removed
Comment on attachment 202749 [details] INSTALLS_ICONS re-removed Fails to build with ICAT=on: [00:00:02] Error: x11/kitty depends on nonexistent origin 'graphics/ImageMagick' (moved to graphics/ImageMagick6) > COMMENT= Cross-platform, fast, feature full, GPU based terminal emulator feature full -> featureful? GPU based -> GPU-based? Why , (comma) before "GPU based" (cumulative adjective)? Maybe also drop "Cross-platform" as it's ambiguous and doesn't include Windows or Android. See https://repology.org/project/kitty/information for alternative summaries. > BUILD_DEPENDS= wayland-protocols>=0:graphics/wayland-protocols \ > evdev-proto>0:devel/evdev-proto Consistently use either >0 or >=0 for both. > LIB_DEPENDS= libdbus-1.so:devel/dbus \ > libfontconfig.so:x11-fonts/fontconfig \ > libfreetype.so:print/freetype2 \ > libglfw.so:graphics/glfw \ Why is this necessary if the port builds bundled version? > libharfbuzz.so:print/harfbuzz \ > libpng.so:graphics/png \ > libxkbcommon.so:x11/libxkbcommon \ > libncursesw.so:devel/ncurses \ Switch to USES=ncurses:port as libncursesw.so may match /usr/lib/libncursesw.so > libdbus-1.so:devel/dbus \ Is there any reason to specify devel/dbus more than once? > libwayland-egl.so:graphics/wayland \ > libwayland-client.so:graphics/wayland \ libwayland-egl.so is part of graphics/wayland after bug 227423, so drop libwayland-client.so line to avoid redundancy. There's no need to list every single library used from a dependency port. > libepoll-shim.so:devel/libepoll-shim \ > libpng.so:graphics/png Is there any reason to specify graphics/png more than once? Can you sort *_DEPENDS based on port category? For one, in Emacs select region via C-SPC then C-u C-| sort -k2 -t: Also try to keep indentation consistent as there's plenty of room before exceeding 80 columns. > USE_XORG= x11 xft xrandr xinerama xcb xcursor xi Why xft is necessary? According to "poudriere testport" libXft is not NEEDED. xi (libXi) can be dropped as like xxf86vm (libXxf86vm.so) it's only dlopen'd. > BINARY_ALIAS= python3=${PYTHON_CMD} Doesn't appear to be necessary as do-build invokes ${PYTHON_CMD} explicitly. post-patch-DOCS-on is enough otherwise. > OPTIONS_DEFAULT= NLS NOBELL #DOCS NLS and DOCS are always enabled by default, see Mk/bsd.options.mk. > OPTIONS_DEFINE= ICAT NOBELL NLS #DOCS [...] > # XXX: docs cannot build because it relies on sphinx >= 1.7 which doesn't yet > # exist in ports. When docs is capable of building, remove EXTRA_PATCHES and > # uncomment all the DOCS_* lines. > #DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=1.7:textproc/py-sphinx@${PY_FLAVOR} > #DOCS_EXTRA_PATCHES= ${PATCHDIR}/docs-on-patch-setup.py > #DOCS_EXTRA_PATCHES_OFF= ${PATCHDIR}/docs-off-patch-setup.py Don't leave unfinished code in. Better apply bug 230140, enable and test the code properly, fix issues then add OPTIONS_EXCLUDE=DOCS until the main tree catches up. > ICAT_DESC= tool to display images in the terminal > NOBELL_DESC= disable audio bell by default (can be changed in kitty.conf) Capitalize the first letter in sentence. > ICAT_LIB_DEPENDS= libMagickCore-6.so:graphics/ImageMagick Does it link against the library? If not convert to RUN_DEPENDS. That'd also make it easier to switch between ImageMagick6 and ImageMagick7. > NLS_USES= gettext Can one actually disable NLS? If not make it unconditional. If only the library is required switch to USES=gettext-runtime. > ${FIND} ${STAGEDIR}${PREFIX} -name __pycache__ -type d -exec ${RM} -r {} + Maybe define USE_PYTHON=py3kplist and add .pyo for each .py file in pkg-plist instead. $ sed -i '' '/\.py$/ { p; s//&o/; }' pkg-plist
Any progress here during the last year? It would be nice to get this off the list of Wanted Ports https://wiki.freebsd.org/WantedPorts
Someone else needs to take over as the original submitter hasn't been active[1] in FreeBSD for over 1 year. I'm not interested in this port myself. [1] https://freshbsd.org/search?committer=bwidawsk
I've worked on the patch a bit. The port still needs some patching and testing before it gets committed in my opinion. I do not plan to work on kitty any time soon, however.
I've installed the port today on FreeBSD 13.0. The only crash I could reproduce was with "Shift or Alt + DirectionalArrow. It fails with : "OSError: Failed to load the function ca_context_create with error: Shared object "liballocator.so.0" not found, required by "kitty"" A github issue was opened but the answer was to install the dependencies on canberra : https://github.com/kovidgoyal/kitty/issues/2575. On the bright side, I've installed it from source using : git clone https://github.com/kovidgoyal/kitty && cd kitty gmake And it works without issue so far.
Compiled from source, been working fine for a half hour or more now. Someone just needs to update the port, I believe, and it should be good to go.
I have a working version with less dependencies, which pass all the test and run fine. I just have to figure out how to disable docs by default (which are always built and always fails because it uses BSD make...).
Created attachment 224668 [details] Update dependencies for kitty v0.20.2. Fully functional version, passing all tests. Documentation is built by default. Upstream code uses "make" (hardcoded) so I've patched it to use gmake. A pull request has been submitted upstream : https://github.com/kovidgoyal/kitty/pull/3574 Please let me know of any coding style issues. I've used poudriere and portlint.
Created attachment 225004 [details] Update dependencies for kitty v0.20.3 The patch mentioned before was added upstream, so update kitty to 0.20.3 means there's no patching needed for FreeBSD. Tested with poudriere.
(In reply to Alexis Praga from comment #29) What is the purpose of pkg-message? Is it correct? I use kitty on some of my systems, it works pretty well. Try to send message to freebsd-ports@freebsd.org
Created attachment 225021 [details] Update dependencies for kitty v0.20.3 Removed wrong pkg-message
From the quick look, your Makefile seems to have wrong variable order. Consult https://www.freebsd.org/doc/en/books/porters-handbook/porting-order.html or run ports-mgmt/portlint on your port.
(In reply to Gleb Popov from comment #32) I think this is the last location of that doc: https://docs.freebsd.org/en/books/porters-handbook/order/ BTW I modified this myself earlier, hope this help: https://gist.github.com/lwhsu/f699c66c7af3f6a6f84ece74b8e49971
As a side note, style issues can be fixed with portfmt (from ports-mgmt/portfmt) and Makefile order can be fixed with portclippy (also from ports-mgmt/portfmt)
BTW it builds fine on 13 and 12, but not on 11: https://gist.github.com/589d93b41f6a2f7b6fe5a7f23d0424f2
Created attachment 225057 [details] v0.20.3 building for 11.4, 12.2 and 13.0 I've taken all of the remarks above so - added support for 11.4 amd64 with dealing around the bug with "-lfto" flags (thanks Jan Beich) - also tested on 12.2 and 13.0 amd64 with poudriere - variable should be in the proper order (portlint + portfmt) - improved format with portclippy Thanks for the reviews !
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=18c12117db747a2654d5c8d86fad4dd8835b5823 commit 18c12117db747a2654d5c8d86fad4dd8835b5823 Author: Alexis Praga <alexis.praga@free.fr> AuthorDate: 2021-05-19 15:18:24 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2021-05-19 15:28:23 +0000 x11/kitty: + Fast GPU-based terminal emulator. PR: 233010 x11/kitty/Makefile (new) | 67 ++++++++++++++++++ x11/kitty/distinfo (new) | 3 + x11/kitty/pkg-descr (new) | 18 +++++ x11/kitty/pkg-plist (new) | 170 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 258 insertions(+)
Pushed in, thanks everyone involved.