Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gomplate: init at 3.5.0 #67615

Closed
wants to merge 1 commit into from
Closed

Conversation

jlesquembre
Copy link
Member

@jlesquembre jlesquembre commented Aug 28, 2019

Motivation for this change

Add gomplate

I was able to build it locally. I also did some tests and the binary seems to work fine, but I don't have much experience with go packages, feedback about the nix expression would be appreciated.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jlesquembre
Copy link
Member Author

I updated the PR to use fetchFromGithub instead of fetchgit, to make it more deterministic

@@ -0,0 +1,37 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to switch to buildGoModule as that's the recommended approach for projects that support it.


buildGoPackage rec {
pname = "gomplate";
version = "3.5.0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-X ${goPackagePath}/version.GitCommit=${rev}")
'';

goPackagePath = "github.com/hairyhenderson/gomplate";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With buildGoModule that's not needed.


meta = with stdenv.lib; {
description = "A flexible commandline tool for template rendering. Supports lots of local and remote datasources";
homepage = https://gomplate.ca/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
homepage = https://gomplate.ca/;
homepage = "https://gomplate.ca/";

NixOS/rfcs#45

"-ldflags=
-w -s
-X ${goPackagePath}/version.Version=${version}
-X ${goPackagePath}/version.GitCommit=${rev}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you really want the executable to have the git commit defined in it, wouldn't it be almost as good to use:

Suggested change
-X ${goPackagePath}/version.GitCommit=${rev}")
-X ${goPackagePath}/version.GitCommit=${version}")

?

@jlesquembre
Copy link
Member Author

Thanks for your review @doronbehar . I created a new derivation for 3.6 version, but never created a PR for it, doing it now. I'm closing this, we can continue on #85157

@jlesquembre jlesquembre deleted the add-gomplate branch April 13, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants