initial import
This commit is contained in:
34
lite/PKGBUILD
Normal file
34
lite/PKGBUILD
Normal file
@@ -0,0 +1,34 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=lite
|
||||
pkgver=1.11
|
||||
pkgrel=2
|
||||
pkgdesc="A lightweight text editor written in Lua"
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://github.com/rxi/lite'
|
||||
license=('Expat')
|
||||
depends=('sdl2')
|
||||
source=("$pkgname-$pkgver.tar.gz::https://github.com/rxi/lite/archive/v$pkgver.tar.gz"
|
||||
"$pkgname-path-fix.patch")
|
||||
sha512sums=('2fe3a651cc3ddedd67d8b8f2b53b262eed8a64295d65d31b17ff80f787cfe53fd82c8e69aaaada7806c08f9814eb4a576668dc5614de43ddf2caa6d5aae338f0'
|
||||
'6db0ea772befa653a962e6d28311b3485f983e6dcbb29514a771222fc2d68d282306571b1afe3284881a85ffd77e7d31323d0c5c3631c0bdea8aa6220d90cc40')
|
||||
|
||||
prepare() {
|
||||
cd "$pkgname-$pkgver"
|
||||
patch -p1 < "$srcdir/$pkgname-path-fix.patch"
|
||||
sed -i -e '/^cflags=/s/"/"$CFLAGS /' \
|
||||
-e '/^lflags=/s/"/"$LDFLAGS /' build.sh
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$pkgname-$pkgver"
|
||||
./build.sh
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$pkgname-$pkgver"
|
||||
install -Dm755 -t "$pkgdir/usr/bin/" $pkgname
|
||||
install -d "$pkgdir/usr/share/$pkgname"
|
||||
cp -a data/* "$pkgdir/usr/share/$pkgname/"
|
||||
install -Dm644 LICENSE -t $pkgdir/usr/share/licenses/$pkgname
|
||||
}
|
||||
73
lite/lite-path-fix.patch
Normal file
73
lite/lite-path-fix.patch
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user