diff options
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | package.json.patch | 10 | ||||
-rwxr-xr-x | patch.py | 13 |
4 files changed, 22 insertions, 18 deletions
@@ -1,6 +1,6 @@ pkgbase = neovim-coc-go-git pkgdesc = Go language server extension using gopls for coc.nvim - pkgver = 0.13.3.r6.ga0e68ff + pkgver = 1.3.24.r2.g4e401fa pkgrel = 1 url = https://github.com/josa42/coc-go arch = any @@ -8,13 +8,14 @@ pkgbase = neovim-coc-go-git makedepends = yarn makedepends = npm makedepends = git + makedepends = python depends = neovim-coc depends = gopls provides = neovim-coc-go conflicts = neovim-coc-go source = coc-go::git+https://github.com/josa42/coc-go.git - source = package.json.patch + source = patch.py sha256sums = SKIP - sha256sums = c694b3c9def3ddb1bce2dfcef6721a43a9458e96c117e9a2ba911e4b4bfd492b + sha256sums = 64ec60c5df767e4fc0a005c72077a2954183837381efcec2a223abfc3790b0a2 pkgname = neovim-coc-go-git @@ -10,14 +10,14 @@ provides=("${_variant}-${_extname}") conflicts=("${_variant}-${_extname}") arch=('any') depends=("${_variant}-coc" 'gopls') -makedepends=('yarn' 'npm' 'git') +makedepends=('yarn' 'npm' 'git' 'python') license=('MIT') source=("${_extname}::git+${url}.git" - 'package.json.patch') -pkgver=0.13.3.r6.ga0e68ff + "patch.py") +pkgver=1.3.24.r2.g4e401fa pkgrel=1 sha256sums=('SKIP' - 'c694b3c9def3ddb1bce2dfcef6721a43a9458e96c117e9a2ba911e4b4bfd492b') + '64ec60c5df767e4fc0a005c72077a2954183837381efcec2a223abfc3790b0a2') pkgver() { cd "${srcdir}/${_extname}" @@ -41,6 +41,6 @@ package() { install -Dm 644 '{}' "${pkgdir}/${_packdir}/{}" \; rm -rf "${srcdir}/${_extname}/package" find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d' - patch "$pkgdir/$_packdir/package.json" <"$srcdir/package.json.patch" + "$srcdir/patch.py" "$pkgdir/$_packdir/package.json" chown -R root:root "${pkgdir}" } diff --git a/package.json.patch b/package.json.patch deleted file mode 100644 index 5b95d5b6e1c1..000000000000 --- a/package.json.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- package.json.old 2021-03-28 10:33:24.557720327 +0800 -+++ package.json.new 2021-03-28 10:35:32.467725438 +0800 -@@ -87,6 +87,7 @@ - }, - "go.goplsPath": { - "type": "string", -+ "default": "/usr/bin/gopls", - "description": "Path to `gopls` bin (Change requires `:CocRestart`)" - }, - "go.goplsArgs": { diff --git a/patch.py b/patch.py new file mode 100755 index 000000000000..80c612ea86f2 --- /dev/null +++ b/patch.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import sys +import json +import os + +file_path = sys.argv[1] + +with open(file_path, "r") as rfile: + data = json.load(rfile) +data["contributes"]["configuration"]["properties"]["go.goplsPath"]["default"] = "/usr/bin/gopls" +with open(file_path, "w") as wfile: + json.dump(data, wfile, indent='\t') |