diff --git a/editors/Makefile b/editors/Makefile index 283e9163216c..7d6e629ecb85 100644 --- a/editors/Makefile +++ b/editors/Makefile @@ -1,281 +1,282 @@ COMMENT = Editors SUBDIR += 2bsd-vi SUBDIR += abiword SUBDIR += abiword-docs SUBDIR += aee SUBDIR += aewan SUBDIR += apel SUBDIR += asedit SUBDIR += beav SUBDIR += biew SUBDIR += bitedit SUBDIR += boiling-egg SUBDIR += bpatch SUBDIR += bvi SUBDIR += calligra SUBDIR += calligraplan SUBDIR += chexedit SUBDIR += codelite SUBDIR += cooledit SUBDIR += cpeditor SUBDIR += cream SUBDIR += cudatext SUBDIR += deforaos-editor SUBDIR += dhex SUBDIR += diakonos SUBDIR += diamond SUBDIR += dkns SUBDIR += drjava SUBDIR += dte SUBDIR += e3 SUBDIR += e93 SUBDIR += ecce SUBDIR += ecrire SUBDIR += edith SUBDIR += editorconfig-core-c SUBDIR += elementary-code SUBDIR += emacs SUBDIR += emacs-devel SUBDIR += encryptpad SUBDIR += featherpad SUBDIR += fileobj SUBDIR += flim SUBDIR += focuswriter SUBDIR += fpc-ide SUBDIR += fte SUBDIR += fxite SUBDIR += gedit SUBDIR += gedit-plugins SUBDIR += ghex SUBDIR += ghostwriter SUBDIR += gmanedit SUBDIR += gnome-latex SUBDIR += gobby SUBDIR += gomate SUBDIR += gummi SUBDIR += helix SUBDIR += heme SUBDIR += hexcurse SUBDIR += hexedit SUBDIR += hexer SUBDIR += hexpert SUBDIR += hnb SUBDIR += hte SUBDIR += imhex SUBDIR += impress SUBDIR += jed SUBDIR += jedit SUBDIR += joe SUBDIR += jove SUBDIR += jucipp SUBDIR += jupp SUBDIR += kak-lsp SUBDIR += kakoune SUBDIR += kate SUBDIR += kibi SUBDIR += kile SUBDIR += komodo-edit SUBDIR += lazarus SUBDIR += lazarus-devel SUBDIR += lazarus-qt5 SUBDIR += lazarus-qt5-devel SUBDIR += le SUBDIR += leafpad SUBDIR += led SUBDIR += libreoffice SUBDIR += libreoffice-af SUBDIR += libreoffice-am SUBDIR += libreoffice-as SUBDIR += libreoffice-ast SUBDIR += libreoffice-be SUBDIR += libreoffice-bg SUBDIR += libreoffice-bn SUBDIR += libreoffice-bn_IN SUBDIR += libreoffice-bo SUBDIR += libreoffice-br SUBDIR += libreoffice-brx SUBDIR += libreoffice-bs SUBDIR += libreoffice-ca SUBDIR += libreoffice-ca_valencia SUBDIR += libreoffice-ckb SUBDIR += libreoffice-cs SUBDIR += libreoffice-cy SUBDIR += libreoffice-da SUBDIR += libreoffice-dgo SUBDIR += libreoffice-dsb SUBDIR += libreoffice-dz SUBDIR += libreoffice-el SUBDIR += libreoffice-en_GB SUBDIR += libreoffice-en_ZA SUBDIR += libreoffice-eo SUBDIR += libreoffice-es SUBDIR += libreoffice-et SUBDIR += libreoffice-eu SUBDIR += libreoffice-fa SUBDIR += libreoffice-fi SUBDIR += libreoffice-fur SUBDIR += libreoffice-fy SUBDIR += libreoffice-ga SUBDIR += libreoffice-gd SUBDIR += libreoffice-gl SUBDIR += libreoffice-gu SUBDIR += libreoffice-gug SUBDIR += libreoffice-hi SUBDIR += libreoffice-hr SUBDIR += libreoffice-hsb SUBDIR += libreoffice-i18n SUBDIR += libreoffice-id SUBDIR += libreoffice-is SUBDIR += libreoffice-it SUBDIR += libreoffice-ka SUBDIR += libreoffice-kab SUBDIR += libreoffice-kk SUBDIR += libreoffice-km SUBDIR += libreoffice-kmr_Latn SUBDIR += libreoffice-kn SUBDIR += libreoffice-kok SUBDIR += libreoffice-ks SUBDIR += libreoffice-lb SUBDIR += libreoffice-lo SUBDIR += libreoffice-lt SUBDIR += libreoffice-lv SUBDIR += libreoffice-mai SUBDIR += libreoffice-mk SUBDIR += libreoffice-ml SUBDIR += libreoffice-mn SUBDIR += libreoffice-mni SUBDIR += libreoffice-mr SUBDIR += libreoffice-my SUBDIR += libreoffice-nb SUBDIR += libreoffice-ne SUBDIR += libreoffice-nl SUBDIR += libreoffice-nn SUBDIR += libreoffice-nr SUBDIR += libreoffice-nso SUBDIR += libreoffice-oc SUBDIR += libreoffice-om SUBDIR += libreoffice-or SUBDIR += libreoffice-pa_IN SUBDIR += libreoffice-ro SUBDIR += libreoffice-rw SUBDIR += libreoffice-sa_IN SUBDIR += libreoffice-sat SUBDIR += libreoffice-sd SUBDIR += libreoffice-si SUBDIR += libreoffice-sid SUBDIR += libreoffice-sk SUBDIR += libreoffice-sl SUBDIR += libreoffice-sq SUBDIR += libreoffice-sr SUBDIR += libreoffice-sr_Latn SUBDIR += libreoffice-ss SUBDIR += libreoffice-st SUBDIR += libreoffice-sv SUBDIR += libreoffice-sw_TZ SUBDIR += libreoffice-szl SUBDIR += libreoffice-ta SUBDIR += libreoffice-te SUBDIR += libreoffice-tg SUBDIR += libreoffice-th SUBDIR += libreoffice-tn SUBDIR += libreoffice-tr SUBDIR += libreoffice-ts SUBDIR += libreoffice-tt SUBDIR += libreoffice-ug SUBDIR += libreoffice-uz SUBDIR += libreoffice-ve SUBDIR += libreoffice-vec SUBDIR += libreoffice-xh SUBDIR += libreoffice-zu SUBDIR += linux-bcompare SUBDIR += linux-sublime SUBDIR += linux-sublime-text4 SUBDIR += linux-sublime3 SUBDIR += linux-wps-office + SUBDIR += lite SUBDIR += madedit SUBDIR += marker SUBDIR += mg SUBDIR += micro SUBDIR += mined SUBDIR += mle SUBDIR += morla SUBDIR += mousepad SUBDIR += mp SUBDIR += nano SUBDIR += ne SUBDIR += nedit SUBDIR += neovim SUBDIR += neovim-qt SUBDIR += notepadnext SUBDIR += nvi-m17n SUBDIR += nvi2 SUBDIR += o SUBDIR += openoffice-4 SUBDIR += openoffice-devel SUBDIR += p5-Proc-InvokeEditor SUBDIR += p5-Vimana SUBDIR += paredit-mode.el SUBDIR += parinfer-rust SUBDIR += pdfedit SUBDIR += pico-alpine SUBDIR += picpas SUBDIR += pluma SUBDIR += pluma-plugins SUBDIR += poedit SUBDIR += poke SUBDIR += psgml SUBDIR += puff SUBDIR += py-babi SUBDIR += py-editorconfig SUBDIR += py-pynvim SUBDIR += py-vim-bridge SUBDIR += quilter SUBDIR += rehex SUBDIR += rubygem-neovim SUBDIR += scite SUBDIR += se SUBDIR += semi SUBDIR += setzer SUBDIR += shed SUBDIR += slime SUBDIR += sly SUBDIR += sly-asdf SUBDIR += sly-named-readtables SUBDIR += sly-quicklisp SUBDIR += ssed SUBDIR += sted SUBDIR += tamago SUBDIR += tea SUBDIR += teco SUBDIR += ted SUBDIR += tetradraw SUBDIR += texmacs SUBDIR += texmaker SUBDIR += texstudio SUBDIR += textadept SUBDIR += texworks SUBDIR += the SUBDIR += treeform SUBDIR += tweak SUBDIR += uemacs SUBDIR += uzap SUBDIR += ved SUBDIR += vigor SUBDIR += vile SUBDIR += vim SUBDIR += vscode SUBDIR += web-mode SUBDIR += with-editor SUBDIR += wordgrinder SUBDIR += wxhexeditor SUBDIR += xcoral SUBDIR += xed SUBDIR += xi-core SUBDIR += xi-term SUBDIR += xmlcopyeditor SUBDIR += xvile SUBDIR += yudit SUBDIR += zile .include diff --git a/editors/lite/Makefile b/editors/lite/Makefile new file mode 100644 index 000000000000..b5fe9d81aa3d --- /dev/null +++ b/editors/lite/Makefile @@ -0,0 +1,46 @@ +# Created by: Alexey Dokuchaev + +PORTNAME= lite +PORTVERSION= 1.11 +CATEGORIES= editors +PKGNAMESUFFIX= -editor # PORTNAME alone is too vague + +MAINTAINER= danfe@FreeBSD.org +COMMENT= Lightweight text editor written mostly in Lua + +LICENSE= MIT + +USES= gmake lua pkgconfig sdl +USE_SDL= sdl2 + +USE_GITHUB= yes +GH_ACCOUNT= rxi +GH_TAGNAME= 38bd9b3 + +BUILD_WRKSRC= ${WRKSRC}/src +MAKEFILE= ${FILESDIR}/makefile + +PORTDOCS= usage.md + +OPTIONS_DEFINE= DOCS + +post-extract: +# Prevent accidental build/use of bundled code/headers + @${RM} -r ${BUILD_WRKSRC}/lib/lua52 ${WRKSRC}/winlib + +post-patch: + @${REINPLACE_CMD} -e '/^#include/s,lib/lua52/,,' \ + ${BUILD_WRKSRC}/api/api.h + @${REINPLACE_CMD} -e 's,%%DATADIR%%,${DATADIR},' \ + ${BUILD_WRKSRC}/main.c + +do-install: + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/bin + ${CP} -a ${WRKSRC}/data ${STAGEDIR}${DATADIR} + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/* ${STAGEDIR}${DOCSDIR} + +.include diff --git a/editors/lite/distinfo b/editors/lite/distinfo new file mode 100644 index 000000000000..f7e67df7767a --- /dev/null +++ b/editors/lite/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1610208177 +SHA256 (rxi-lite-1.11-38bd9b3_GH0.tar.gz) = 63b0f22eb90f38564736f56d4d0f51f7219fcb7fe6398018e3435a62badd10d9 +SIZE (rxi-lite-1.11-38bd9b3_GH0.tar.gz) = 10707650 diff --git a/editors/lite/files/makefile b/editors/lite/files/makefile new file mode 100644 index 000000000000..5274d363e360 --- /dev/null +++ b/editors/lite/files/makefile @@ -0,0 +1,25 @@ +CFLAGS+= -Wall -Wextra +CPPFLAGS+= -DLUA_USE_POSIX -I. \ + $(shell pkg-config --cflags lua-$(LUA_VER) sdl2) +LIBS= $(shell pkg-config --libs lua-$(LUA_VER) sdl2) + +lite_OBJS= api/api.o \ + api/renderer.o \ + api/renderer_font.o \ + api/system.o \ + lib/stb/stb_truetype.o \ + main.o \ + rencache.o \ + renderer.o + +CCACHE?= $(shell command -v ccache) + +%.o: %.c + $(CCACHE) $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< + +lite: $(lite_OBJS) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + +all: lite + +.PHONY: all install diff --git a/editors/lite/files/patch-data_core_commands_core.lua b/editors/lite/files/patch-data_core_commands_core.lua new file mode 100644 index 000000000000..5be8d1f4ead5 --- /dev/null +++ b/editors/lite/files/patch-data_core_commands_core.lua @@ -0,0 +1,11 @@ +--- data/core/commands/core.lua.orig 2021-01-09 16:02:57 UTC ++++ 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(DATADIR .. "/user/init.lua")) + end, + + ["core:open-project-module"] = function() diff --git a/editors/lite/files/patch-data_core_init.lua b/editors/lite/files/patch-data_core_init.lua new file mode 100644 index 000000000000..7d13910080af --- /dev/null +++ b/editors/lite/files/patch-data_core_init.lua @@ -0,0 +1,49 @@ +--- data/core/init.lua.orig 2021-01-09 16:02:57 UTC ++++ data/core/init.lua +@@ -82,7 +82,7 @@ function core.init() + CommandView = require "core.commandview" + Doc = require "core.doc" + +- local project_dir = EXEDIR ++ local project_dir = os.getenv("HOME") or EXEDIR + local files = {} + for i = 2, #ARGS do + local info = system.get_file_info(ARGS[i]) or {} +@@ -131,16 +131,16 @@ local function delete_temp_files() + local temp_file_counter = 0 + + local function delete_temp_files() +- for _, filename in ipairs(system.list_dir(EXEDIR)) do ++ for _, filename in ipairs(system.list_dir("/tmp")) do + if filename:find(temp_file_prefix, 1, true) == 1 then +- os.remove(EXEDIR .. PATHSEP .. filename) ++ os.remove("/tmp" .. PATHSEP .. filename) + end + end + end + + function core.temp_filename(ext) + temp_file_counter = temp_file_counter + 1 +- return EXEDIR .. PATHSEP .. temp_file_prefix ++ return "/tmp" .. PATHSEP .. temp_file_prefix + .. string.format("%06x", temp_file_counter) .. (ext or "") + end + +@@ -174,7 +174,7 @@ function core.load_plugins() + + function core.load_plugins() + local no_errors = true +- local files = system.list_dir(EXEDIR .. "/data/plugins") ++ local files = system.list_dir(DATADIR .. "/plugins") + for _, filename in ipairs(files) do + local modname = "plugins." .. filename:gsub(".lua$", "") + local ok = core.try(require, modname) +@@ -464,7 +464,7 @@ function core.on_error(err) + + function core.on_error(err) + -- write error to file +- local fp = io.open(EXEDIR .. "/error.txt", "wb") ++ local fp = io.open("/tmp/lite-error.txt", "wb") + fp:write("Error: " .. tostring(err) .. "\n") + fp:write(debug.traceback(nil, 4)) + fp:close() diff --git a/editors/lite/files/patch-data_core_style.lua b/editors/lite/files/patch-data_core_style.lua new file mode 100644 index 000000000000..5107bf8479ef --- /dev/null +++ b/editors/lite/files/patch-data_core_style.lua @@ -0,0 +1,17 @@ +--- data/core/style.lua.orig 2021-01-09 16:02:57 UTC ++++ data/core/style.lua +@@ -7,10 +7,10 @@ style.tab_width = common.round(170 * 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(DATADIR .. "/fonts/font.ttf", 14 * SCALE) ++style.big_font = renderer.font.load(DATADIR .. "/fonts/font.ttf", 34 * SCALE) ++style.icon_font = renderer.font.load(DATADIR .. "/fonts/icons.ttf", 14 * SCALE) ++style.code_font = renderer.font.load(DATADIR .. "/fonts/monospace.ttf", 13.5 * SCALE) + + style.background = { common.color "#2e2e32" } + style.background2 = { common.color "#252529" } diff --git a/editors/lite/files/patch-src_main.c b/editors/lite/files/patch-src_main.c new file mode 100644 index 000000000000..1041196a88a6 --- /dev/null +++ b/editors/lite/files/patch-src_main.c @@ -0,0 +1,34 @@ +--- src/main.c.orig 2021-01-09 16:02:57 UTC ++++ src/main.c +@@ -9,6 +9,8 @@ + #include + #elif __APPLE__ + #include ++#elif __FreeBSD__ ++ #include + #endif + + +@@ -38,6 +40,10 @@ static void get_exe_filename(char *buf, int sz) { + #elif __APPLE__ + unsigned size = sz; + _NSGetExecutablePath(buf, &size); ++#elif __FreeBSD__ ++ size_t len = sz; ++ const int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; ++ sysctl(mib, 4, buf, &len, NULL, 0); + #else + strcpy(buf, "./lite"); + #endif +@@ -123,8 +129,9 @@ 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" ++ " DATADIR = '%%DATADIR%%'\n" ++ " package.path = DATADIR .. '/?.lua;' .. package.path\n" ++ " package.path = DATADIR .. '/?/init.lua;' .. package.path\n" + " core = require('core')\n" + " core.init()\n" + " core.run()\n" diff --git a/editors/lite/pkg-descr b/editors/lite/pkg-descr new file mode 100644 index 000000000000..7f5c781f0471 --- /dev/null +++ b/editors/lite/pkg-descr @@ -0,0 +1,6 @@ +lite is a lightweight text editor written mostly in Lua. It aims to +provide something practical, pretty, small, and fast, implemented as +simply as possible; easy to modify and extend via plugins, or to use +without doing either. + +WWW: https://github.com/rxi/lite diff --git a/editors/lite/pkg-plist b/editors/lite/pkg-plist new file mode 100644 index 000000000000..e3028f0a1938 --- /dev/null +++ b/editors/lite/pkg-plist @@ -0,0 +1,48 @@ +bin/lite +%%DATADIR%%/core/command.lua +%%DATADIR%%/core/commands/command.lua +%%DATADIR%%/core/commands/core.lua +%%DATADIR%%/core/commands/doc.lua +%%DATADIR%%/core/commands/findreplace.lua +%%DATADIR%%/core/commands/root.lua +%%DATADIR%%/core/commandview.lua +%%DATADIR%%/core/common.lua +%%DATADIR%%/core/config.lua +%%DATADIR%%/core/doc/highlighter.lua +%%DATADIR%%/core/doc/init.lua +%%DATADIR%%/core/doc/search.lua +%%DATADIR%%/core/doc/translate.lua +%%DATADIR%%/core/docview.lua +%%DATADIR%%/core/init.lua +%%DATADIR%%/core/keymap.lua +%%DATADIR%%/core/logview.lua +%%DATADIR%%/core/object.lua +%%DATADIR%%/core/rootview.lua +%%DATADIR%%/core/statusview.lua +%%DATADIR%%/core/strict.lua +%%DATADIR%%/core/style.lua +%%DATADIR%%/core/syntax.lua +%%DATADIR%%/core/tokenizer.lua +%%DATADIR%%/core/view.lua +%%DATADIR%%/fonts/font.ttf +%%DATADIR%%/fonts/icons.ttf +%%DATADIR%%/fonts/monospace.ttf +%%DATADIR%%/plugins/autocomplete.lua +%%DATADIR%%/plugins/autoreload.lua +%%DATADIR%%/plugins/language_c.lua +%%DATADIR%%/plugins/language_css.lua +%%DATADIR%%/plugins/language_js.lua +%%DATADIR%%/plugins/language_lua.lua +%%DATADIR%%/plugins/language_md.lua +%%DATADIR%%/plugins/language_python.lua +%%DATADIR%%/plugins/language_xml.lua +%%DATADIR%%/plugins/macro.lua +%%DATADIR%%/plugins/projectsearch.lua +%%DATADIR%%/plugins/quote.lua +%%DATADIR%%/plugins/reflow.lua +%%DATADIR%%/plugins/tabularize.lua +%%DATADIR%%/plugins/treeview.lua +%%DATADIR%%/plugins/trimwhitespace.lua +%%DATADIR%%/user/colors/fall.lua +%%DATADIR%%/user/colors/summer.lua +%%DATADIR%%/user/init.lua