diff options
author | Rasmus Thomsen <oss@cogitri.dev> | 2020-08-08 11:30:34 +0200 |
---|---|---|
committer | Rasmus Thomsen <oss@cogitri.dev> | 2020-08-08 11:30:34 +0200 |
commit | ff15e8ca0f58b95294d914c32aef4ae0b5dfa898 (patch) | |
tree | 86b55e2436ea1c413a928b2f46c3e33c28d8a3d6 /unmaintained | |
parent | 07598ecb97715c397fa503ea32f504c8f761bfd5 (diff) | |
download | alpine_aports-ff15e8ca0f58b95294d914c32aef4ae0b5dfa898.tar.bz2 alpine_aports-ff15e8ca0f58b95294d914c32aef4ae0b5dfa898.tar.xz alpine_aports-ff15e8ca0f58b95294d914c32aef4ae0b5dfa898.zip |
unmaintained/lite-editor: move from testing
Diffstat (limited to 'unmaintained')
-rw-r--r-- | unmaintained/lite-editor/APKBUILD | 28 | ||||
-rw-r--r-- | unmaintained/lite-editor/dont-assume-local-project.patch | 75 |
2 files changed, 103 insertions, 0 deletions
diff --git a/unmaintained/lite-editor/APKBUILD b/unmaintained/lite-editor/APKBUILD new file mode 100644 index 0000000000..b55ecbd42c --- /dev/null +++ b/unmaintained/lite-editor/APKBUILD | |||
@@ -0,0 +1,28 @@ | |||
1 | # Contributor: Rasmus Thomsen <oss@cogitri.dev> | ||
2 | # Maintainer: | ||
3 | pkgname=lite-editor | ||
4 | pkgver=1.06 | ||
5 | pkgrel=0 | ||
6 | pkgdesc="A lightweight text editor written in Lua" | ||
7 | url="https://github.com/rxi/lite" | ||
8 | arch="all" | ||
9 | license="MIT" | ||
10 | depends="lua" | ||
11 | makedepends="bash sdl2-dev" | ||
12 | options="!check" # no tests | ||
13 | source="$pkgname-$pkgver.tar.gz::https://github.com/rxi/lite/archive/v$pkgver/v$pkgver.tar.gz | ||
14 | dont-assume-local-project.patch" | ||
15 | builddir="$srcdir/lite-$pkgver" | ||
16 | |||
17 | build() { | ||
18 | ./build.sh | ||
19 | } | ||
20 | |||
21 | package() { | ||
22 | mkdir -p "$pkgdir"/usr/bin/ "$pkgdir"/usr/share/lite-editor | ||
23 | cp lite "$pkgdir"/usr/bin/lite | ||
24 | cp -r data "$pkgdir"/usr/share/lite-editor | ||
25 | } | ||
26 | |||
27 | sha512sums="e0c834f9e0004d26549f91559eae9e9d4bff5b018e39d4486d82003a7247034168331fa179ad788c04c59b9510b58f051fa65eab1c54fc784d6e434bae548cf8 lite-editor-1.06.tar.gz | ||
28 | a8de78079bd4333827ffafed60ee6aab34b4b04dcc3fb6cef1347a4541cc892848959f8ddbbe8e6b80ecc8042c37dc1f7460083cb0c108dd733aa045937393fc dont-assume-local-project.patch" | ||
diff --git a/unmaintained/lite-editor/dont-assume-local-project.patch b/unmaintained/lite-editor/dont-assume-local-project.patch new file mode 100644 index 0000000000..096911880a --- /dev/null +++ b/unmaintained/lite-editor/dont-assume-local-project.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Upstream: Issue opened: https://github.com/rxi/lite/issues/49 | ||
2 | Reason: Right now lite just assumes that the data directory will be right | ||
3 | next to the binary, but we want the binary in /usr/bin and the data in | ||
4 | /usr/share/lite-editor | ||
5 | |||
6 | diff --git a/data/core/commands/core.lua b/data/core/commands/core.lua | ||
7 | index 5c9d622..568f0ef 100644 | ||
8 | --- a/data/core/commands/core.lua | ||
9 | +++ b/data/core/commands/core.lua | ||
10 | @@ -85,7 +85,7 @@ command.add(nil, { | ||
11 | end, | ||
12 | |||
13 | ["core:open-user-module"] = function() | ||
14 | - core.root_view:open_doc(core.open_doc(EXEDIR .. "/data/user/init.lua")) | ||
15 | + core.root_view:open_doc(core.open_doc("/usr/share/lite-editor/data/user/init.lua")) | ||
16 | end, | ||
17 | |||
18 | ["core:open-project-module"] = function() | ||
19 | diff --git a/data/core/init.lua b/data/core/init.lua | ||
20 | index a25cdb5..3bea486 100644 | ||
21 | --- a/data/core/init.lua | ||
22 | +++ b/data/core/init.lua | ||
23 | @@ -150,7 +150,7 @@ end | ||
24 | |||
25 | function core.load_plugins() | ||
26 | local no_errors = true | ||
27 | - local files = system.list_dir(EXEDIR .. "/data/plugins") | ||
28 | + local files = system.list_dir("/usr/share/lite-editor/data/plugins") | ||
29 | for _, filename in ipairs(files) do | ||
30 | local modname = "plugins." .. filename:gsub(".lua$", "") | ||
31 | local ok = core.try(require, modname) | ||
32 | @@ -421,7 +421,7 @@ end | ||
33 | |||
34 | function core.on_error(err) | ||
35 | -- write error to file | ||
36 | - local fp = io.open(EXEDIR .. "/error.txt", "wb") | ||
37 | + local fp = io.open("/tmp/lite-editor-error.txt", "wb") | ||
38 | fp:write("Error: " .. tostring(err) .. "\n") | ||
39 | fp:write(debug.traceback(nil, 4)) | ||
40 | fp:close() | ||
41 | diff --git a/data/core/style.lua b/data/core/style.lua | ||
42 | index ab597c2..23b551f 100644 | ||
43 | --- a/data/core/style.lua | ||
44 | +++ b/data/core/style.lua | ||
45 | @@ -7,10 +7,10 @@ style.scrollbar_size = common.round(4 * SCALE) | ||
46 | style.caret_width = common.round(2 * SCALE) | ||
47 | style.tab_width = common.round(170 * SCALE) | ||
48 | |||
49 | -style.font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", 14 * SCALE) | ||
50 | -style.big_font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", 34 * SCALE) | ||
51 | -style.icon_font = renderer.font.load(EXEDIR .. "/data/fonts/icons.ttf", 14 * SCALE) | ||
52 | -style.code_font = renderer.font.load(EXEDIR .. "/data/fonts/monospace.ttf", 13.5 * SCALE) | ||
53 | +style.font = renderer.font.load("/usr/share/lite-editor/data/fonts/font.ttf", 14 * SCALE) | ||
54 | +style.big_font = renderer.font.load("/usr/share/lite-editor/data/fonts/font.ttf", 34 * SCALE) | ||
55 | +style.icon_font = renderer.font.load("/usr/share/lite-editor/data/fonts/icons.ttf", 14 * SCALE) | ||
56 | +style.code_font = renderer.font.load("/usr/share/lite-editor/data/fonts/monospace.ttf", 13.5 * SCALE) | ||
57 | |||
58 | style.background = { common.color "#2e2e32" } | ||
59 | style.background2 = { common.color "#252529" } | ||
60 | diff --git a/src/main.c b/src/main.c | ||
61 | index d282a9a..50eedb5 100644 | ||
62 | --- a/src/main.c | ||
63 | +++ b/src/main.c | ||
64 | @@ -119,8 +119,8 @@ | ||
65 | " SCALE = tonumber(os.getenv(\"LITE_SCALE\")) or SCALE\n" | ||
66 | " PATHSEP = package.config:sub(1, 1)\n" | ||
67 | " EXEDIR = EXEFILE:match(\"^(.+)[/\\\\].*$\")\n" | ||
68 | - " package.path = EXEDIR .. '/data/?.lua;' .. package.path\n" | ||
69 | - " package.path = EXEDIR .. '/data/?/init.lua;' .. package.path\n" | ||
70 | + " package.path = '/usr/share/lite-editor/data/?.lua;' .. package.path\n" | ||
71 | + " package.path = '/usr/share/lite-editor/data/?/init.lua;' .. package.path\n" | ||
72 | " core = require('core')\n" | ||
73 | " core.init()\n" | ||
74 | " core.run()\n" | ||
75 | |||