Sunday, March 31, 2024

small tweaks for editors/litexl

Hi.

- install desktop files and icon
- enable kqueue support
- drop useless patch and use CONFIGURE_ARGS instead
- don't hardcode lua version nor patch to lite-xl

OK?


Index: Makefile
===================================================================
RCS file: /cvs/ports/editors/litexl/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile 11 Feb 2024 11:41:04 -0000 1.3
+++ Makefile 31 Mar 2024 17:51:54 -0000
@@ -5,6 +5,7 @@ GH_ACCOUNT = lite-xl
GH_PROJECT = lite-xl
GH_TAGNAME = v$V
PKGNAME = litexl-$V
+REVISION = 0

CATEGORIES = editors
HOMEPAGE = https://lite-xl.com
@@ -26,5 +27,14 @@ MODLUA_VERSION =5.4

LIB_DEPENDS = devel/sdl2 \
devel/pcre2
+
+RUN_DEPENDS = devel/desktop-file-utils \
+ x11/gtk+4,-guic
+
+CONFIGURE_ARGS = -Duse_system_lua=true \
+ -Ddirmonitor_backend=kqueue
+
+pre-configure:
+ ${SUBST_CMD} ${WRKSRC}/{meson.build,src/main.c}

.include <bsd.port.mk>
Index: patches/patch-meson_build
===================================================================
RCS file: /cvs/ports/editors/litexl/patches/patch-meson_build,v
retrieving revision 1.2
diff -u -p -r1.2 patch-meson_build
--- patches/patch-meson_build 11 Feb 2024 11:41:04 -0000 1.2
+++ patches/patch-meson_build 31 Mar 2024 17:51:54 -0000
@@ -5,7 +5,16 @@ Index: meson.build
# Lua has no official .pc file
# so distros come up with their own names
lua_names = [
-+ 'lua54', # OpenBSD
++ 'lua${MODLUA_DEP_VERSION}', # OpenBSD
'lua5.4', # Debian
'lua-5.4', # FreeBSD
'lua', # Fedora
+@@ -204,7 +205,7 @@ else
+ lite_bindir = 'bin'
+ lite_docdir = 'share/doc/lite-xl'
+ lite_datadir = 'share/lite-xl'
+- if host_machine.system() == 'linux'
++ if host_machine.system() == 'linux' or host_machine.system() == 'openbsd'
+ install_data('resources/icons/lite-xl.svg',
+ install_dir : 'share/icons/hicolor/scalable/apps'
+ )
Index: patches/patch-meson_options_txt
===================================================================
RCS file: patches/patch-meson_options_txt
diff -N patches/patch-meson_options_txt
--- patches/patch-meson_options_txt 11 Feb 2024 11:41:04 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,9 +0,0 @@
-Index: meson_options.txt
---- meson_options.txt.orig
-+++ meson_options.txt
-@@ -4,4 +4,4 @@ option('portable', type : 'boolean', value : false, de
- option('renderer', type : 'boolean', value : false, description: 'Use SDL renderer')
- option('dirmonitor_backend', type : 'combo', value : '', choices : ['', 'inotify', 'fsevents', 'kqueue', 'win32', 'dummy'], description: 'define what dirmonitor backend to use')
- option('arch_tuple', type : 'string', value : '', description: 'Specify a custom architecture tuple')
--option('use_system_lua', type : 'boolean', value : false, description: 'Prefer System Lua over a the meson wrap')
-+option('use_system_lua', type : 'boolean', value : true, description: 'Prefer System Lua over a the meson wrap')
Index: patches/patch-src_api_dirmonitor_kqueue_c
===================================================================
RCS file: patches/patch-src_api_dirmonitor_kqueue_c
diff -N patches/patch-src_api_dirmonitor_kqueue_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_api_dirmonitor_kqueue_c 31 Mar 2024 17:51:54 -0000
@@ -0,0 +1,18 @@
+Nove include so __uintptr_t gets defined when needed.
+
+Index: src/api/dirmonitor/kqueue.c
+--- src/api/dirmonitor/kqueue.c.orig
++++ src/api/dirmonitor/kqueue.c
+@@ -1,10 +1,10 @@
+-#include <sys/event.h>
+-#include <sys/stat.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <time.h>
++#include <sys/event.h>
++#include <sys/stat.h>
+
+ struct dirmonitor_internal {
+ int fd;
Index: patches/patch-src_main_c
===================================================================
RCS file: /cvs/ports/editors/litexl/patches/patch-src_main_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_main_c
--- patches/patch-src_main_c 11 Feb 2024 11:41:04 -0000 1.2
+++ patches/patch-src_main_c 31 Mar 2024 17:51:54 -0000
@@ -9,7 +9,7 @@ Index: src/main.c
+ if (strchr(argv[0], '/') != NULL)
+ lua_pushstring(L, argv[0]);
+ else
-+ lua_pushstring(L, "/usr/local/bin/lite-xl");
++ lua_pushstring(L, "${PREFIX}/bin/lite-xl");
}
lua_setglobal(L, "EXEFILE");

Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/editors/litexl/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST 11 Feb 2024 11:41:04 -0000 1.2
+++ pkg/PLIST 31 Mar 2024 17:51:54 -0000
@@ -1,6 +1,8 @@
@bin bin/lite-xl
+share/applications/org.lite_xl.lite_xl.desktop
share/doc/lite-xl/
share/doc/lite-xl/licenses.md
+share/icons/hicolor/scalable/apps/lite-xl.svg
share/lite-xl/
share/lite-xl/colors/
share/lite-xl/colors/default.lua
@@ -93,3 +95,7 @@ share/lite-xl/renderer.lua
share/lite-xl/string.lua
share/lite-xl/system.lua
share/lite-xl/utf8extra.lua
+share/metainfo/
+share/metainfo/org.lite_xl.lite_xl.appdata.xml
+@tag update-desktop-database
+@tag gtk-update-icon-cache %D/share/icons/hicolor


--
Antoine

No comments:

Post a Comment