Github messages for voidlinux
 help / color / mirror / Atom feed
From: drichline <drichline@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: lite-1.11
Date: Fri, 14 Oct 2022 21:45:36 +0200	[thread overview]
Message-ID: <20221014194536.w3UlkHEwUAjpmT8z_iHZWLBUXJCZM8hyCtL62fAwYb8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-39925@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]

There is an updated pull request by drichline against master on the void-packages repository

https://github.com/drichline/void-packages lite-branch
https://github.com/void-linux/void-packages/pull/39925

New package: lite-1.11
Note: even though lite is a GUI app, it is meant to be launched from the terminal, e.g. `lite project-dir/`; upstream does not provide an svg icon or .desktop file. 

#### Testing the changes
- I tested the changes in this PR: **YES**

#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)


A patch file from https://github.com/void-linux/void-packages/pull/39925.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-lite-branch-39925.patch --]
[-- Type: text/x-diff, Size: 5500 bytes --]

From 0718b9e9991a75b8447dbfc2dfe003bbc7c34942 Mon Sep 17 00:00:00 2001
From: Dakota Richline <43507179+drichline@users.noreply.github.com>
Date: Thu, 13 Oct 2022 00:36:42 -0400
Subject: [PATCH] New package: lite-1.11

---
 srcpkgs/lite/patches/lite-build-fix.patch | 22 +++++++
 srcpkgs/lite/patches/lite-path-fix.patch  | 73 +++++++++++++++++++++++
 srcpkgs/lite/template                     | 22 +++++++
 3 files changed, 117 insertions(+)
 create mode 100644 srcpkgs/lite/patches/lite-build-fix.patch
 create mode 100644 srcpkgs/lite/patches/lite-path-fix.patch
 create mode 100644 srcpkgs/lite/template

diff --git a/srcpkgs/lite/patches/lite-build-fix.patch b/srcpkgs/lite/patches/lite-build-fix.patch
new file mode 100644
index 000000000000..9efea67ea7a3
--- /dev/null
+++ b/srcpkgs/lite/patches/lite-build-fix.patch
@@ -0,0 +1,22 @@
+(Patch from @classabbyamp on GitHub)
+--- a/build.sh
++++ b/build.sh
+@@ -1,7 +1,7 @@
+ #!/bin/bash
+ 
+-cflags="-Wall -O3 -g -std=gnu11 -fno-strict-aliasing -Isrc"
+-lflags="-lSDL2 -lm"
++cflags="$CFLAGS -Wall -O3 -g -std=gnu11 -fno-strict-aliasing -Isrc"
++lflags="$LDFLAGS -lSDL2 -lm"
+ 
+ if [[ $* == *windows* ]]; then
+   platform="windows"
+@@ -14,7 +14,7 @@
+ else
+   platform="unix"
+   outfile="lite"
+-  compiler="gcc"
++  compiler="$CC"
+   cflags="$cflags -DLUA_USE_POSIX"
+   lflags="$lflags -o $outfile"
+ fi
diff --git a/srcpkgs/lite/patches/lite-path-fix.patch b/srcpkgs/lite/patches/lite-path-fix.patch
new file mode 100644
index 000000000000..5087bc267c58
--- /dev/null
+++ b/srcpkgs/lite/patches/lite-path-fix.patch
@@ -0,0 +1,73 @@
+Upstream Issue: https://github.com/rxi/lite/issues/49
+
+(Patch adapted from Alpine Linux, updated for 1.06)
+
+diff --git a/data/core/commands/core.lua b/data/core/commands/core.lua
+index 5c9d622..568f0ef 100644
+--- a/data/core/commands/core.lua
++++ b/data/core/commands/core.lua
+@@ -85,7 +85,7 @@ command.add(nil, {
+   end,
+ 
+   ["core:open-user-module"] = function()
+-    core.root_view:open_doc(core.open_doc(EXEDIR .. "/data/user/init.lua"))
++    core.root_view:open_doc(core.open_doc("/usr/share/lite/user/init.lua"))
+   end,
+ 
+   ["core:open-project-module"] = function()
+diff --git a/data/core/init.lua b/data/core/init.lua
+index a25cdb5..3bea486 100644
+--- a/data/core/init.lua
++++ b/data/core/init.lua
+@@ -150,7 +150,7 @@ end
+ 
+ function core.load_plugins()
+   local no_errors = true
+-  local files = system.list_dir(EXEDIR .. "/data/plugins")
++  local files = system.list_dir("/usr/share/lite/plugins")
+   for _, filename in ipairs(files) do
+     local modname = "plugins." .. filename:gsub(".lua$", "")
+     local ok = core.try(require, modname)
+@@ -421,7 +421,7 @@ end
+ 
+ function core.on_error(err)
+   -- write error to file
+-  local fp = io.open(EXEDIR .. "/error.txt", "wb")
++  local fp = io.open("/tmp/lite-editor-error.txt", "wb")
+   fp:write("Error: " .. tostring(err) .. "\n")
+   fp:write(debug.traceback(nil, 4))
+   fp:close()
+diff --git a/data/core/style.lua b/data/core/style.lua
+index ab597c2..23b551f 100644
+--- a/data/core/style.lua
++++ b/data/core/style.lua
+@@ -7,10 +7,10 @@ style.scrollbar_size = common.round(4 * SCALE)
+ style.caret_width = common.round(2 * SCALE)
+ style.tab_width = common.round(170 * SCALE)
+ 
+-style.font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", 14 * SCALE)
+-style.big_font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", 34 * SCALE)
+-style.icon_font = renderer.font.load(EXEDIR .. "/data/fonts/icons.ttf", 14 * SCALE)
+-style.code_font = renderer.font.load(EXEDIR .. "/data/fonts/monospace.ttf", 13.5 * SCALE)
++style.font = renderer.font.load("/usr/share/lite/fonts/font.ttf", 14 * SCALE)
++style.big_font = renderer.font.load("/usr/share/lite/fonts/font.ttf", 34 * SCALE)
++style.icon_font = renderer.font.load("/usr/share/lite/fonts/icons.ttf", 14 * SCALE)
++style.code_font = renderer.font.load("/usr/share/lite/fonts/monospace.ttf", 13.5 * SCALE)
+ 
+ style.background = { common.color "#2e2e32" }
+ style.background2 = { common.color "#252529" }
+diff --git a/src/main.c b/src/main.c
+index c739f5f..0b796fa 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -119,8 +119,8 @@ int main(int argc, char **argv) {
+     "  SCALE = tonumber(os.getenv(\"LITE_SCALE\")) or SCALE\n"
+     "  PATHSEP = package.config:sub(1, 1)\n"
+     "  EXEDIR = EXEFILE:match(\"^(.+)[/\\\\].*$\")\n"
+-    "  package.path = EXEDIR .. '/data/?.lua;' .. package.path\n"
+-    "  package.path = EXEDIR .. '/data/?/init.lua;' .. package.path\n"
++    "  package.path = '/usr/share/lite/?.lua;' .. package.path\n"
++    "  package.path = '/usr/share/lite/?/init.lua;' .. package.path\n"
+     "  core = require('core')\n"
+     "  core.init()\n"
+     "  core.run()\n"
diff --git a/srcpkgs/lite/template b/srcpkgs/lite/template
new file mode 100644
index 000000000000..4c8813a7073b
--- /dev/null
+++ b/srcpkgs/lite/template
@@ -0,0 +1,22 @@
+# Template file for 'lite'
+pkgname=lite
+version=1.11
+revision=1
+makedepends="SDL2-devel"
+short_desc="Lightweight text editor written mostly in Lua"
+maintainer="Dakota Richline <drichline@protonmail.com>"
+license="MIT"
+homepage="https://github.com/rxi/lite"
+distfiles="https://github.com/rxi/lite/archive/refs/tags/v${version}.tar.gz"
+checksum=2fd9466663182da56a36a557d05925d226dc1c5de6fb24e423a7b0056db2eec4
+
+do_build() {
+	bash build.sh
+}
+
+do_install() {
+	vlicense LICENSE
+	vmkdir usr/share/${pkgname}
+	vbin lite
+	vcopy data/* usr/share/${pkgname}
+}

  parent reply	other threads:[~2022-10-14 19:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  4:42 [PR PATCH] " drichline
2022-10-13  5:51 ` [PR REVIEW] " classabbyamp
2022-10-13  5:51 ` classabbyamp
2022-10-13  5:51 ` classabbyamp
2022-10-13  5:51 ` classabbyamp
2022-10-13  5:51 ` classabbyamp
2022-10-13  6:16 ` [PR PATCH] [Updated] " drichline
2022-10-13  6:22 ` drichline
2022-10-13 19:13 ` drichline
2022-10-13 19:23 ` classabbyamp
2022-10-14 19:39 ` [PR PATCH] [Updated] " drichline
2022-10-14 19:41 ` drichline
2022-10-14 19:44 ` drichline
2022-10-14 19:45 ` drichline
2022-10-14 19:45 ` drichline [this message]
2022-11-03 20:16 ` classabbyamp
2022-11-03 20:32 ` tranzystorek-io
2022-11-03 21:30 ` [PR PATCH] [Closed]: " drichline
2022-11-03 21:30 ` drichline
2022-11-04  6:41 ` drichline
2022-11-04  7:21 ` tranzystorek-io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221014194536.w3UlkHEwUAjpmT8z_iHZWLBUXJCZM8hyCtL62fAwYb8@z \
    --to=drichline@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).