mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 19:00:46 +00:00
golds: init at 0.7.1
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com> Co-authored-by: Kenichi Kamiya <kachick1@gmail.com>
This commit is contained in:
25
pkgs/by-name/go/golds/info_module-gover.patch
Normal file
25
pkgs/by-name/go/golds/info_module-gover.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
diff --git a/internal/server/info_module.go b/internal/server/info_module.go
|
||||
index d2513bd..ad2921e 100644
|
||||
--- a/internal/server/info_module.go
|
||||
+++ b/internal/server/info_module.go
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
+ "os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
@@ -756,7 +757,11 @@ func findGoToolchainVersionFromGoRoot(goroot string) (string, error) {
|
||||
versionData, err = ioutil.ReadFile(filepath.Join(goroot, "VERSION.cache"))
|
||||
}
|
||||
if err != nil {
|
||||
- return "", fmt.Errorf("failed to get Go toolchain version in GOROOT (%s)", goroot)
|
||||
+ cmd := exec.Command("go", "env", "GOVERSION")
|
||||
+ versionData, err = cmd.Output()
|
||||
+ if err != nil {
|
||||
+ return "", fmt.Errorf("failed to get Go toolchain version in GOROOT (%s)", goroot)
|
||||
+ }
|
||||
}
|
||||
matches := findGoVersionRegexp.FindSubmatch(versionData)
|
||||
if len(matches) >= 1 {
|
||||
42
pkgs/by-name/go/golds/package.nix
Normal file
42
pkgs/by-name/go/golds/package.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
testers,
|
||||
golds, # self
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "golds";
|
||||
version = "0.7.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "go101";
|
||||
repo = "golds";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-6YkyKJtSAFFYidMlZXSjNpjyIIaTlibg/QMMin/NbU0=";
|
||||
};
|
||||
|
||||
# nixpkgs is not using the go distpack archive and missing a VERSION file in the source
|
||||
# but we can use go env to get the same information
|
||||
# https://github.com/NixOS/nixpkgs/pull/358316#discussion_r1855322027
|
||||
patches = [ ./info_module-gover.patch ];
|
||||
|
||||
vendorHash = "sha256-omjHRZB/4VzPhc6RrFY11s6BRD69+Y4RRZ2XdeKbZf0=";
|
||||
|
||||
ldflags = [ "-s" ];
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = golds;
|
||||
version = "v${version}";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Experimental Go local docs server/generator and code reader implemented with some fresh ideas";
|
||||
homepage = "https://github.com/go101/golds";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ phanirithvij ];
|
||||
mainProgram = "golds";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user