Merge pull request #257951 from aaronjheng/platinum-searcher

platinum-searcher: use buildGoModule

authored by

Mario Rodas and committed by
GitHub
5e76c1a5 a5d327e3

+15 -91
+15 -8
pkgs/tools/text/platinum-searcher/default.nix
··· 1 - { lib, buildGoPackage, fetchFromGitHub }: 1 + { lib, buildGoModule, fetchFromGitHub, fetchpatch }: 2 2 3 - buildGoPackage rec { 3 + buildGoModule rec { 4 4 pname = "the_platinum_searcher"; 5 5 version = "2.1.5"; 6 - rev = "v${version}"; 7 - 8 - goPackagePath = "github.com/monochromegane/the_platinum_searcher"; 9 6 10 7 src = fetchFromGitHub { 11 - inherit rev; 12 8 owner = "monochromegane"; 13 9 repo = "the_platinum_searcher"; 14 - sha256 = "1y7kl3954dimx9hp2bf1vjg1h52hj1v6cm4f5nhrqzwrawp0b6q0"; 10 + rev = "v${version}"; 11 + hash = "sha256-AJsFLleZf5yhLY5UZnaQUBQYntzBLXFh6jU2UtKg8/g="; 15 12 }; 16 13 17 - goDeps = ./deps.nix; 14 + vendorHash = "sha256-GIjPgu0e+duN5MeWcRaF5xUFCkqe2aZJCwGbLUMko08="; 15 + 16 + patches = [ 17 + # Add Go Modules support. See https://github.com/monochromegane/the_platinum_searcher/pull/217. 18 + (fetchpatch { 19 + url = "https://github.com/monochromegane/the_platinum_searcher/pull/217/commits/69064d11c57d5fd5f66ddd95f0e789786183d3c6.patch"; 20 + hash = "sha256-qQ7kZYb2MWSUV6T1frIPT9nMfb20SI7lbG8YhqyQEi8="; 21 + }) 22 + ]; 23 + 24 + ldflags = [ "-s" "-w" ]; 18 25 19 26 meta = with lib; { 20 27 homepage = "https://github.com/monochromegane/the_platinum_searcher";
-83
pkgs/tools/text/platinum-searcher/deps.nix
··· 1 - [ 2 - { 3 - goPackagePath = "gopkg.in/yaml.v2"; 4 - fetch = { 5 - type = "git"; 6 - url = "https://gopkg.in/yaml.v2"; 7 - rev = "a5b47d31c556af34a302ce5d659e6fea44d90de0"; 8 - sha256 = "0v6l48fshdjrqzyq1kwn22gy7vy434xdr1i0lm3prsf6jbln9fam"; 9 - }; 10 - } 11 - { 12 - goPackagePath = "github.com/jessevdk/go-flags"; 13 - fetch = { 14 - type = "git"; 15 - url = "https://github.com/jessevdk/go-flags"; 16 - rev = "4e64e4a4e2552194cf594243e23aa9baf3b4297e"; 17 - sha256 = "02x7f1wm8119s27h4dc3a4aw6shydnpnnkvzwg5xm0snn5kb4zxm"; 18 - }; 19 - } 20 - { 21 - goPackagePath = "github.com/BurntSushi/toml"; 22 - fetch = { 23 - type = "git"; 24 - url = "https://github.com/BurntSushi/toml"; 25 - rev = "99064174e013895bbd9b025c31100bd1d9b590ca"; 26 - sha256 = "058qrar8rvw3wb0ci1mf1axnqq2729cvv9zmdr4ms2nn9s97yiz9"; 27 - }; 28 - } 29 - { 30 - goPackagePath = "golang.org/x/text"; 31 - fetch = { 32 - type = "git"; 33 - url = "https://go.googlesource.com/text"; 34 - rev = "a49bea13b776691cb1b49873e5d8df96ec74831a"; 35 - sha256 = "1pcmgf88wml6ca8v63nh3nxsfvpzjv3c4qj2w2wkizbil826g7as"; 36 - }; 37 - } 38 - { 39 - goPackagePath = "github.com/monochromegane/conflag"; 40 - fetch = { 41 - type = "git"; 42 - url = "https://github.com/monochromegane/conflag"; 43 - rev = "6d68c9aa4183844ddc1655481798fe4d90d483e9"; 44 - sha256 = "0csfr5c8d3kbna9sqhzfp2z06wq6mc6ijja1zj2i82kzsq8534wa"; 45 - }; 46 - } 47 - { 48 - goPackagePath = "github.com/monochromegane/go-home"; 49 - fetch = { 50 - type = "git"; 51 - url = "https://github.com/monochromegane/go-home"; 52 - rev = "25d9dda593924a11ea52e4ffbc8abdb0dbe96401"; 53 - sha256 = "172chakrj22xfm0bcda4qj5zqf7lwr53pzwc3xj6wz8vd2bcxkww"; 54 - }; 55 - } 56 - { 57 - goPackagePath = "github.com/monochromegane/terminal"; 58 - fetch = { 59 - type = "git"; 60 - url = "https://github.com/monochromegane/terminal"; 61 - rev = "2da212063ce19aed90ee5bbb00ad1ad7393d7f48"; 62 - sha256 = "1rddaq9pk5q57ildms35iihghqk505gb349pb0f6k3svchay38nh"; 63 - }; 64 - } 65 - { 66 - goPackagePath = "github.com/monochromegane/go-gitignore"; 67 - fetch = { 68 - type = "git"; 69 - url = "https://github.com/monochromegane/go-gitignore"; 70 - rev = "38717d0a108ca0e5af632cd6845ca77d45b50729"; 71 - sha256 = "0r1inabpgg6sn6i47b02hcmd2p4dc1ab1mcy20mn1b2k3mpdj4b7"; 72 - }; 73 - } 74 - { 75 - goPackagePath = "github.com/shiena/ansicolor"; 76 - fetch = { 77 - type = "git"; 78 - url = "https://github.com/shiena/ansicolor"; 79 - rev = "a422bbe96644373c5753384a59d678f7d261ff10"; 80 - sha256 = "1dcn8a9z6a5dxa2m3fkppnajcls8lanbl38qggkf646yi5qsk1hc"; 81 - }; 82 - } 83 - ]