Go: Difference between revisions

imported>Nix
m add Software/Applications subcategory
imported>Synapze
m fix broken implementation links of buildGoModule and buildGoPackage
Line 2: Line 2:


== Packaging go modules ==
== Packaging go modules ==
The nixpkgs library function '''buildGoModule''' ([https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/go-modules/generic/default.nix implementation]) works in most cases of packaging go modules or applications.
The nixpkgs library function '''buildGoModule''' ([https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/go/module.nix implementation]) works in most cases of packaging go modules or applications.
See [https://nixos.org/manual/nixpkgs/stable/#sec-language-go nixpkgs manual '''Language: Go''']
See [https://nixos.org/manual/nixpkgs/stable/#sec-language-go nixpkgs manual '''Language: Go''']


Line 18: Line 18:


=== buildGoPackage ===
=== buildGoPackage ===
If no <tt>go.mod</tt> file is available, '''buildGoPackage''' ([https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/go-packages/generic/default.nix implementation]) can be used.
If no <tt>go.mod</tt> file is available, '''buildGoPackage''' ([https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/go/package.nix implementation]) can be used.
Dependencies must be specified manually in a <tt>deps.nix</tt> file,
Dependencies must be specified manually in a <tt>deps.nix</tt> file,
which is linked with
which is linked with