From e56b4f031013c07d63d3095d210c1a12e9f8abef Mon Sep 17 00:00:00 2001 From: Gabriel Sanches Date: Mon, 21 Sep 2020 11:31:30 -0300 Subject: [PATCH 1/5] New package: btrfs_map_physical-git.0 --- srcpkgs/btrfs_map_physical/template | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 srcpkgs/btrfs_map_physical/template diff --git a/srcpkgs/btrfs_map_physical/template b/srcpkgs/btrfs_map_physical/template new file mode 100644 index 00000000000..668fe49538a --- /dev/null +++ b/srcpkgs/btrfs_map_physical/template @@ -0,0 +1,22 @@ +# Template file for 'btrfs_map_physical' +pkgname=btrfs_map_physical +version=git.0 +revision=1 +build_style=fetch +hostmakedepends="" +makedepends="" +depends="" +short_desc="Program to get physical offset of a file under btrfs" +maintainer="Gabriel Sanches " +license="custom:unlicensed" +homepage="https://github.com/osandov/osandov-linux" +distfiles="https://raw.githubusercontent.com/osandov/osandov-linux/1e49d070bc01db1f2c32df4fc678f08a1c2392d5/scripts/btrfs_map_physical.c" +checksum=9f55c0c4f020e194c0fa2716f40ac3bc8e8a92c085cd634684e014b36f3b02b7 + +do_build() { + gcc -O2 -o ${pkgname} ${pkgname}.c +} + +do_install() { + vbin ${pkgname} +} From 17cfc5e4a4c2257925188eb3b27f7b577f6a878d Mon Sep 17 00:00:00 2001 From: Gabriel Sanches Date: Sun, 20 Sep 2020 00:13:15 -0300 Subject: [PATCH 2/5] New package: lua-language-server-git.0 --- srcpkgs/lua-language-server/files/wrapper | 4 + .../patches/0001-Fix-paths.patch | 126 ++++++++++++++++++ srcpkgs/lua-language-server/template | 45 +++++++ 3 files changed, 175 insertions(+) create mode 100644 srcpkgs/lua-language-server/files/wrapper create mode 100644 srcpkgs/lua-language-server/patches/0001-Fix-paths.patch create mode 100644 srcpkgs/lua-language-server/template diff --git a/srcpkgs/lua-language-server/files/wrapper b/srcpkgs/lua-language-server/files/wrapper new file mode 100644 index 00000000000..d61d05d05d4 --- /dev/null +++ b/srcpkgs/lua-language-server/files/wrapper @@ -0,0 +1,4 @@ +#!/bin/sh + +cd /usr/share/@PKGNAME@ +exec /usr/lib/@PKGNAME@/@PKGNAME@ -E ./main.lua diff --git a/srcpkgs/lua-language-server/patches/0001-Fix-paths.patch b/srcpkgs/lua-language-server/patches/0001-Fix-paths.patch new file mode 100644 index 00000000000..ef7c35a1eea --- /dev/null +++ b/srcpkgs/lua-language-server/patches/0001-Fix-paths.patch @@ -0,0 +1,126 @@ +diff --git a/main-beta.lua b/main-beta.lua +index 1d1eecae..6a2a3e30 100644 +--- a/main-beta.lua ++++ b/main-beta.lua +@@ -1,7 +1,11 @@ + local currentPath = debug.getinfo(1, 'S').source:sub(2) + local rootPath = currentPath:gsub('[/\\]*[^/\\]-$', '') +-loadfile(rootPath .. '/platform.lua')('script-beta') ++ ++loadfile(rootPath .. '/platform.lua')(rootPath, 'script-beta') ++ ++local math = require 'math' + local fs = require 'bee.filesystem' ++ + ROOT = fs.path(rootPath) + LANG = LANG or 'en-US' + +@@ -9,7 +13,7 @@ collectgarbage('generational', 10, 50) + --collectgarbage('incremental', 120, 120, 0) + + log = require 'log' +-log.init(ROOT, ROOT / 'log' / 'service.log') ++log.init(ROOT, fs.path('/tmp/lua-language-server' .. math.random(1000, 9000)) / 'log' / 'service.log') + log.info('Lua Lsp startup, root: ', ROOT) + log.debug('ROOT:', ROOT:string()) + +diff --git a/main.lua b/main.lua +index b7c10ed5..6d3e4035 100644 +--- a/main.lua ++++ b/main.lua +@@ -1,21 +1,27 @@ + local currentPath = debug.getinfo(1, 'S').source:sub(2) + local rootPath = currentPath:gsub('[/\\]*[^/\\]-$', '') +-loadfile(rootPath .. '/platform.lua')('script') ++ ++loadfile(rootPath .. '/platform.lua')(rootPath, 'script') ++ ++local math = require 'math' + local fs = require 'bee.filesystem' ++ ++rootPath = fs.path(rootPath) + ROOT = fs.current_path() / rootPath + LANG = LANG or 'en-US' ++LOG_PATH = fs.path('/tmp/lua-lua-language-server' .. math.random(1000, 9000)) / 'log' + + --collectgarbage('generational') + collectgarbage("setpause", 100) + collectgarbage("setstepmul", 1000) + + log = require 'log' +-log.init(ROOT, ROOT / 'log' / 'service.log') ++log.init(ROOT, LOG_PATH / 'service.log') + log.info('Lua Lsp startup, root: ', ROOT) + log.debug('ROOT:', ROOT:string()) + ac = {} + +-xpcall(dofile, log.debug, rootPath .. '/debugger.lua') ++xpcall(dofile, log.debug, tostring(rootPath / 'debugger.lua')) + require 'utility' + local service = require 'service' + local session = service() +diff --git a/platform.lua b/platform.lua +index 46656fda..a1c1989c 100644 +--- a/platform.lua ++++ b/platform.lua +@@ -1,4 +1,4 @@ +-local script = ... ++local rootPath, script = ... + + local function findExePath() + local n = 0 +@@ -30,13 +30,7 @@ cpath: %s + end + + local fs = require 'bee.filesystem' +-local rootPath = fs.path(exePath):parent_path():parent_path():remove_filename():string() +-if dll == '.dll' then +- rootPath = rootPath:gsub('/', '\\') +- package.path = rootPath .. script .. '\\?.lua' +- .. ';' .. rootPath .. script .. '\\?\\init.lua' +-else +- rootPath = rootPath:gsub('\\', '/') +- package.path = rootPath .. script .. '/?.lua' +- .. ';' .. rootPath .. script .. '/?/init.lua' +-end ++rootPath = fs.absolute(fs.path(rootPath)) ++ ++package.path = tostring(rootPath / script / '?.lua') ++ .. ';' .. tostring(rootPath / script / '?' / 'init.lua') +diff --git a/script/workspace.lua b/script/workspace.lua +index 75bc27a0..ba855700 100644 +--- a/script/workspace.lua ++++ b/script/workspace.lua +@@ -187,7 +187,7 @@ function mt:init(rootUri) + end + log.info('Workspace inited, root: ', self.root) + log.info('Workspace inited, uri: ', rootUri) +- local logPath = ROOT / 'log' / (rootUri:gsub('[/:]+', '_') .. '.log') ++ local logPath = LOG_PATH / (rootUri:gsub('[/:]+', '_') .. '.log') + log.info('Log path: ', logPath) + log.init(ROOT, logPath) + end +diff --git a/test.lua b/test.lua +index 72178860..da8f46dc 100644 +--- a/test.lua ++++ b/test.lua +@@ -3,16 +3,17 @@ local rootPath = currentPath:gsub('[^/\\]-$', '') + if rootPath == '' then + rootPath = './' + end +-loadfile(rootPath .. 'platform.lua')('script') ++loadfile(rootPath .. 'platform.lua')(rootPath, 'script') + package.path = package.path + .. ';' .. rootPath .. 'test/?.lua' + .. ';' .. rootPath .. 'test/?/init.lua' + local fs = require 'bee.filesystem' + ROOT = fs.absolute(fs.path(rootPath):parent_path()) + LANG = 'en-US' ++LOG_PATH = ROOT / 'log' + + log = require 'log' +-log.init(ROOT, ROOT / 'log' / 'test.log') ++log.init(ROOT, LOG_PATH / 'test.log') + log.debug('测试开始') + ac = {} + diff --git a/srcpkgs/lua-language-server/template b/srcpkgs/lua-language-server/template new file mode 100644 index 00000000000..df2e6802945 --- /dev/null +++ b/srcpkgs/lua-language-server/template @@ -0,0 +1,45 @@ +# Template file for 'lua-language-server' +pkgname=lua-language-server +version=git.0 +revision=1 +wrksrc=${pkgname} +hostmakedepends="ninja git" +depends="lua" +short_desc="Lua Language Server coded by Lua" +maintainer="Gabriel Sanches " +license="MIT" +homepage="https://github.com/sumneko/lua-language-server" +patch_args=-Np1 + +do_fetch() { + git clone https://github.com/sumneko/${pkgname}.git ${wrksrc} + cd ${wrksrc} + git submodule update --init --recursive +} + +do_build() { + cd ${wrksrc}/3rd/luamake + ninja -f ninja/linux.ninja + cd ../.. + ./3rd/luamake/luamake rebuild +} + +do_install() { + vlicense LICENSE + + # main script + vmkdir usr/lib/${pkgname} + vcopy "${wrksrc}/bin/Linux/*" usr/lib/${pkgname} + + # entrypoint and files + vmkdir usr/share/${pkgname} + for script in main.lua script libs locale platform.lua; do + vcopy "${wrksrc}/${script}" usr/share/${pkgname} + done + + vmkdir usr/bin + sed ${FILESDIR}/wrapper \ + -e "s;@PKGNAME@;$pkgname;g" \ + > ${DESTDIR}/usr/bin/${pkgname} + chmod 755 ${DESTDIR}/usr/bin/${pkgname} +} From cee4cac44b1be05a737e9472f1fa51ad477b6738 Mon Sep 17 00:00:00 2001 From: Gabriel Sanches Date: Fri, 17 Jul 2020 15:50:57 -0300 Subject: [PATCH 3/5] New package: rust-analyzer-2020.09.14 --- srcpkgs/rust-analyzer/template | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 srcpkgs/rust-analyzer/template diff --git a/srcpkgs/rust-analyzer/template b/srcpkgs/rust-analyzer/template new file mode 100644 index 00000000000..1361ce39766 --- /dev/null +++ b/srcpkgs/rust-analyzer/template @@ -0,0 +1,20 @@ +# Template file for 'rust-analyzer' +pkgname=rust-analyzer +version=2020.09.14 +revision=1 +_ver=${version//./-} +wrksrc="${pkgname}-${_ver}" +build_style=cargo +make_install_args="--path=crates/${pkgname}" +short_desc="Rust compiler front-end for IDEs" +maintainer="Gabriel Sanches " +license="Apache-2.0, MIT" +homepage="https://rust-analyzer.github.io/" +distfiles="https://github.com/${pkgname}/${pkgname}/archive/${_ver}.tar.gz" +checksum=162c0acac4c025e287deab7974340bf6147343495697ac72101cb8d56caab01e + +post_install() { + vlicense LICENSE-APACHE + vlicense LICENSE-MIT + vdoc README.md +} From 0e6dff508bfb22cb35398f37cefd6e861f5c8091 Mon Sep 17 00:00:00 2001 From: Gabriel Sanches Date: Mon, 4 May 2020 20:45:04 -0300 Subject: [PATCH 4/5] New package: pilgo-0.5.0 --- srcpkgs/pilgo/template | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 srcpkgs/pilgo/template diff --git a/srcpkgs/pilgo/template b/srcpkgs/pilgo/template new file mode 100644 index 00000000000..c70540dba9e --- /dev/null +++ b/srcpkgs/pilgo/template @@ -0,0 +1,17 @@ +# Template file for 'pilgo' +pkgname=pilgo +version=0.5.0 +revision=1 +build_style=go +go_import_path="github.com/gbrlsnchs/pilgo/cmd/plg" +go_ldflags="-X github.com/gbrlsnchs/pilgo/cmd/internal.version=${version}" +short_desc="Configuration-based dotfiles manager" +maintainer="Gabriel Sanches " +license="MIT" +homepage="https://gsr.dev/pilgo" +distfiles="https://github.com/gbrlsnchs/pilgo/archive/v${version}.tar.gz" +checksum=4fefbc30e8d2568c04687613a611ac9f9864028add28b82b3912b9e267c20635 + +post_install() { + vlicense LICENSE +} From baa6767bc808e5316bb3c530511222f946289356 Mon Sep 17 00:00:00 2001 From: Gabriel Sanches Date: Thu, 7 May 2020 21:04:47 -0300 Subject: [PATCH 5/5] fzf: install fzf.vim to Neovim plugin directory For Vim users, FZF works out of the box, but Neovim users have to manually copy /usr/share/vim/vimfiles/plugin/fzf.vim to the proper Neovim equivalent. --- srcpkgs/fzf/template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srcpkgs/fzf/template b/srcpkgs/fzf/template index 109f5d44028..d67a722709b 100644 --- a/srcpkgs/fzf/template +++ b/srcpkgs/fzf/template @@ -1,7 +1,7 @@ # Template file for 'fzf' pkgname=fzf version=0.22.0 -revision=1 +revision=2 build_style=go go_import_path=github.com/junegunn/fzf hostmakedepends="git" @@ -22,6 +22,7 @@ post_install() { sed -i -e 's#source ~/\.fzf\.bash; ##' shell/key-bindings.bash vinstall plugin/fzf.vim 644 usr/share/vim/vimfiles/plugin + vinstall plugin/fzf.vim 644 usr/share/nvim/runtime/plugin vinstall shell/completion.bash 644 usr/share/bash-completion/completions fzf vinstall shell/completion.zsh 644 usr/share/doc/fzf vinstall shell/key-bindings.zsh 644 usr/share/doc/fzf