···114115### `buildFlagsArray` and `buildFlags`: {#ex-goBuildFlags-noarray}
116117-These attributes set build flags supported by `go build`. We recommend using `buildFlagsArray`. The most common use case of these attributes is to make the resulting executable aware of its own version. For example:
118119```nix
120 buildFlagsArray = [
121- # Note: single quotes are not needed.
122- "-ldflags=-X main.Version=${version} -X main.Commit=${version}"
123 ];
124```
1250000126```nix
127- buildFlagsArray = ''
128- -ldflags=
129- -X main.Version=${version}
130- -X main.Commit=${version}
131- '';
132```
133134### `deleteVendor` {#var-go-deleteVendor}
···114115### `buildFlagsArray` and `buildFlags`: {#ex-goBuildFlags-noarray}
116117+These attributes set build flags supported by `go build`. We recommend using `buildFlagsArray`.
118119```nix
120 buildFlagsArray = [
121+ "-tags=release"
0122 ];
123```
124125+### `ldflags` {#var-go-ldflags}
126+127+Arguments to pass to the Go linker tool via the `-ldflags` argument of `go build`. The most common use case for this argument is to make the resulting executable aware of its own version. For example:
128+129```nix
130+ ldflags = [
131+ "-s" "-w"
132+ "-X main.Version=${version}"
133+ "-X main.Commit=${version}"
134+ ];
135```
136137### `deleteVendor` {#var-go-deleteVendor}
···1-{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
2-3-stdenv.mkDerivation rec {
45- version = "0.7";
0067- name = "ocaml${ocaml.version}-ansiterminal-${version}";
89- src = fetchurl {
10- url = "https://github.com/Chris00/ANSITerminal/releases/download/${version}/ANSITerminal-${version}.tar.gz";
11- sha256 = "03pqfxvw9pa9720l8i5fgxky1qx70kw6wxbczd5i50xi668lh0i9";
0012 };
1314- buildInputs = [ ocaml findlib ocamlbuild ];
15-16- configurePhase = "ocaml setup.ml -configure --prefix $out";
17-18- buildPhase = "ocaml setup.ml -build";
19-20- installPhase = "ocaml setup.ml -install";
21-22- createFindlibDestdir = true;
2324 meta = with lib; {
25- homepage = "https://github.com/Chris00/ANSITerminal";
26 description = "A module allowing to use the colors and cursor movements on ANSI terminals";
27 longDescription = ''
28 ANSITerminal is a module allowing to use the colors and cursor
29 movements on ANSI terminals. It also works on the windows shell (but
30 this part is currently work in progress).
31 '';
032 license = licenses.lgpl3;
33- platforms = ocaml.meta.platforms or [];
34 maintainers = [ maintainers.jirkamarsik ];
35 };
36}
···1+{ lib, buildDunePackage, fetchFromGitHub }:
0023+buildDunePackage rec {
4+ pname = "ANSITerminal";
5+ version = "0.8.2";
67+ useDune2 = true;
89+ src = fetchFromGitHub {
10+ owner = "Chris00";
11+ repo = pname;
12+ rev = version;
13+ sha256 = "0dyjischrgwlxqz1p5zbqq76jvk6pl1qj75i7ydhijssr9pj278d";
14 };
1516+ doCheck = true;
000000001718 meta = with lib; {
019 description = "A module allowing to use the colors and cursor movements on ANSI terminals";
20 longDescription = ''
21 ANSITerminal is a module allowing to use the colors and cursor
22 movements on ANSI terminals. It also works on the windows shell (but
23 this part is currently work in progress).
24 '';
25+ inherit (src.meta) homepage;
26 license = licenses.lgpl3;
027 maintainers = [ maintainers.jirkamarsik ];
28 };
29}