1{ stdenv, fetchurl }:
2
3let
4 linuxPredicate = stdenv.system == "x86_64-linux";
5 bsdPredicate = stdenv.system == "x86_64-freebsd";
6 darwinPredicate = stdenv.system == "x86_64-darwin";
7 metadata = assert linuxPredicate || bsdPredicate || darwinPredicate;
8 if linuxPredicate then
9 { arch = "linux-amd64";
10 sha256 = "0b3h0d0qsrjx99kcd2cf71xijh44wm5rpm2sr54snh3f7macj2p1";
11 archiveBinaryPath = "linux/amd64"; }
12 else if bsdPredicate then
13 { arch = "freebsd-amd64";
14 sha256 = "1yydm4ndkh80phiwk41kcf6pizvwrfhsfk3jwrrgr42wsnkkgj0q";
15 archiveBinaryPath = "freebsd/amd64"; }
16 else
17 { arch = "darwin-amd64";
18 sha256 = "1dj74cf1ahihia2dr9ii9ky0cpmywn42z2iq1vkbrrcggjvyrnlf";
19 archiveBinaryPath = "darwin/amd64"; };
20in stdenv.mkDerivation rec {
21 shortname = "github-release";
22 name = "${shortname}-${version}";
23 version = "0.6.2";
24
25 src = fetchurl {
26 url = "https://github.com/aktau/github-release/releases/download/v${version}/${metadata.arch}-${shortname}.tar.bz2";
27 sha256 = metadata.sha256;
28 };
29
30 buildInputs = [ ];
31
32 phases = [ "unpackPhase" "installPhase" ];
33
34 installPhase = ''
35 mkdir -p "$out/bin"
36 cp "${metadata.archiveBinaryPath}/github-release" "$out/bin/"
37 '';
38
39 meta = with stdenv.lib; {
40 description = "Commandline app to create and edit releases on Github (and upload artifacts)";
41 longDescription = ''
42 A small commandline app written in Go that allows you to easily create and
43 delete releases of your projects on Github.
44 In addition it allows you to attach files to those releases.
45 '';
46
47 license = licenses.mit;
48 homepage = https://github.com/aktau/github-release;
49 maintainers = with maintainers; [ ardumont ];
50 };
51}