Skip to content

Commit

Permalink
Ports: Update lite-xl to 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan200101 authored and timschumi committed Mar 14, 2024
1 parent 0c76c7e commit 466f1f5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Ports/AvailablePorts.md
Expand Up @@ -187,7 +187,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
| [`libyaml`](libyaml/) | libyaml | 0.2.5 | https://pyyaml.org/wiki/LibYAML |
| [`libzip`](libzip/) | libzip | 1.10.1 | https://libzip.org/ |
| [`links`](links/) | Links web browser | 2.29 | http://links.twibright.com/ |
| [`lite-xl`](lite-xl/) | Lite-XL | 2.1.0 | https://lite-xl.com/ |
| [`lite-xl`](lite-xl/) | Lite-XL | 2.1.3 | https://lite-xl.com/ |
| [`llvm`](llvm/) | LLVM | 16.0.6 | https://llvm.org/ |
| [`lowdown`](lowdown/) | lowdown | 1.0.2 | https://kristaps.bsd.lv/lowdown/ |
| [`lrzip`](lrzip/) | lrzip | 0.651 | https://github.com/ckolivas/lrzip |
Expand Down
7 changes: 3 additions & 4 deletions Ports/lite-xl/package.sh
@@ -1,7 +1,6 @@
#!/usr/bin/env -S bash ../.port_include.sh
port='lite-xl'
version='2.1.0'
commit_hash='97ba91af8b855a10a14bdc5cad774c877156f4a9'
version='2.1.3'
useconfigure='true'
configopts=(
"--buildtype=release"
Expand All @@ -14,9 +13,9 @@ depends=(
'SDL2'
)
files=(
"https://github.com/lite-xl/lite-xl/archive/${commit_hash}.tar.gz#25a0dd0a6ef856fd312eecd54983d401224eb8d7a5d5aa4a37c9131ac77bd9ca"
"https://github.com/lite-xl/lite-xl/archive/refs/tags/v${version}.tar.gz#a13c423588a5549e42fda7dfe9064bd3776b6202c170c7bb493d96a692360383"
)
workdir="lite-xl-${commit_hash}"
workdir="lite-xl-${version}"
launcher_name='Lite-XL'
icon_file='resources/icons/icon.ico'
launcher_category='D&evelopment'
Expand Down
58 changes: 28 additions & 30 deletions Ports/lite-xl/patches/0001-Add-SerenityOS-platform-support.patch
@@ -1,37 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jan200101 <sentrycraft123@gmail.com>
Date: Mon, 24 Oct 2022 19:23:31 +0200
Date: Wed, 13 Mar 2024 20:09:25 +0100
Subject: [PATCH] Add SerenityOS platform support

Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
---
meson.build | 3 +-
src/api/dirmonitor/inodewatcher.cpp | 75 +++++++++++++++++++++++++++++
src/main.c | 7 ++-
src/meson.build | 16 +++---
4 files changed, 92 insertions(+), 9 deletions(-)
src/meson.build | 17 ++++---
4 files changed, 93 insertions(+), 9 deletions(-)
create mode 100644 src/api/dirmonitor/inodewatcher.cpp

diff --git a/meson.build b/meson.build
index adb7ceb..963bd17 100644
index 3f88be37..70627782 100644
--- a/meson.build
+++ b/meson.build
@@ -1,10 +1,11 @@
project('lite-xl',
- ['c'],
+ ['c', 'cpp'],
version : '2.1.0',
@@ -4,7 +4,8 @@ project('lite-xl',
license : 'MIT',
meson_version : '>= 0.47',
meson_version : '>= 0.56',
default_options : [
'c_std=gnu11',
+ 'cpp_std=c++20',
'wrap_mode=nofallback'
- 'c_std=gnu11'
+ 'c_std=gnu11',
+ 'cpp_std=c++20'
]
)

diff --git a/src/api/dirmonitor/inodewatcher.cpp b/src/api/dirmonitor/inodewatcher.cpp
new file mode 100644
index 0000000..e749f5b
index 00000000..e749f5bd
--- /dev/null
+++ b/src/api/dirmonitor/inodewatcher.cpp
@@ -0,0 +1,75 @@
Expand Down Expand Up @@ -111,28 +108,28 @@ index 0000000..e749f5b
+
+int get_mode_dirmonitor() { return 2; }
diff --git a/src/main.c b/src/main.c
index 9784c0a..232b9a9 100644
index dca3cbd1..e11fb7ae 100644
--- a/src/main.c
+++ b/src/main.c
@@ -7,7 +7,7 @@
@@ -9,7 +9,7 @@

#ifdef _WIN32
#include <windows.h>
-#elif __linux__ || __FreeBSD__
+#elif __linux__ || __FreeBSD__ || __serenity__
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__serenity__)
#include <unistd.h>
#include <signal.h>
#elif __APPLE__
@@ -31,7 +31,7 @@ static void get_exe_filename(char *buf, int sz) {
#if _WIN32
int len = GetModuleFileName(NULL, buf, sz - 1);
buf[len] = '\0';
#elif defined(__APPLE__)
#include <mach-o/dyld.h>
@@ -34,7 +34,7 @@ static void get_exe_filename(char *buf, int sz) {
} else {
buf[0] = '\0';
}
-#elif __linux__
+#elif __linux__ || __serenity__
char path[] = "/proc/self/exe";
int len = readlink(path, buf, sz - 1);
buf[len] = '\0';
@@ -101,6 +101,9 @@ void set_macos_bundle_resources(lua_State *L);
ssize_t len = readlink(path, buf, sz - 1);
if (len > 0)
@@ -110,6 +110,9 @@ void set_macos_bundle_resources(lua_State *L);
#define ARCH_PLATFORM "freebsd"
#elif __APPLE__
#define ARCH_PLATFORM "darwin"
Expand All @@ -143,10 +140,10 @@ index 9784c0a..232b9a9 100644

#if !defined(ARCH_PROCESSOR) || !defined(ARCH_PLATFORM)
diff --git a/src/meson.build b/src/meson.build
index 06bb397..8dd25c4 100644
index a156ae3f..501914c8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -11,20 +11,30 @@ lite_sources = [
@@ -11,20 +11,31 @@ lite_sources = [
'main.c',
]

Expand All @@ -164,6 +161,7 @@ index 06bb397..8dd25c4 100644
+ lite_sources += 'api/dirmonitor/kqueue.c'
+ elif cc.has_function('create_inode_watcher', prefix : '#include<fcntl.h>')
+ dirmonitor_backend = 'inodewatcher'
+ add_languages('cpp')
+ lite_sources += 'api/dirmonitor/inodewatcher.cpp'
elif dependency('libkqueue', required : false).found()
dirmonitor_backend = 'kqueue'
Expand All @@ -177,7 +175,7 @@ index 06bb397..8dd25c4 100644
warning('no suitable backend found, defaulting to dummy backend')
endif
else
@@ -40,12 +50,6 @@ if dirmonitor_backend == 'kqueue'
@@ -40,12 +51,6 @@ if dirmonitor_backend == 'kqueue'
endif
endif

Expand Down

0 comments on commit 466f1f5

Please sign in to comment.