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

cod: init at unstable-2020-09-10 #97700

Merged
merged 1 commit into from Sep 15, 2020
Merged

Conversation

SuperSandro2000
Copy link
Member

Motivation for this change

I find the concept of cod quite interesting.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

pkgs/tools/misc/cod/default.nix Outdated Show resolved Hide resolved
pkgs/tools/misc/cod/default.nix Show resolved Hide resolved
@SuperSandro2000
Copy link
Member Author

I've added the ldflags. I am unsure about the other stuff.

Copy link
Member

@samuelgrf samuelgrf left a comment

Choose a reason for hiding this comment

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

diff --git a/pkgs/tools/misc/cod/default.nix b/pkgs/tools/misc/cod/default.nix
index 80961ae5bbc..2eb527a1d10 100644
--- a/pkgs/tools/misc/cod/default.nix
+++ b/pkgs/tools/misc/cod/default.nix
@@ -3,24 +3,22 @@
 buildGoPackage rec {
   pname = "cod";
   version = "unstable-2020-09-10";
-  rev = "ae68da08339471dd278d6df79abbfd6fe89a10fe";
-
-  goPackagePath = "cod";
 
+  goPackagePath = pname;
   goDeps = ./deps.nix;
 
   src = fetchFromGitHub {
     owner = "dim-an";
     repo = pname;
-    rev = "${rev}";
+    rev = "ae68da08339471dd278d6df79abbfd6fe89a10fe";
     sha256 = "1l3gn9v8dcy72f5xq9hwbkvkis0vp4dp8qyinsrii3acmhksg9v6";
   };
 
-  buildFlagsArray = [ "-ldflags=-X main.GitSha=${rev}" ];
+  buildFlagsArray = [ "-ldflags=-X main.GitSha=${src.rev}" ];
 
   meta = with lib; {
-    description = "cod is a completion daemon for bash/zsh";
-    homepage = "https://github.com/dim-an/cod";
+    description = "Tool for generating Bash/Zsh autocompletions based on `--help` output";
+    homepage = src.meta.homepage;
     license = licenses.asl20;
     maintainers = with maintainers; [ SuperSandro2000 ];
   };

@SuperSandro2000
Copy link
Member Author

goPackagePath = pname;

That is coincidence. The go package path should change in the future to allow downloading it via go get.

buildGoModule enables tests which I couldn't get to work so I disabled them.

@samuelgrf
Copy link
Member

That is coincidence. The go package path should change in the future to allow downloading it via go get.

Didn't know about that, makes sense to keep this then.

One question, Is there any particular reason for not setting homepage = src.meta.homepage, it seems like a nicer approach than setting the GitHub url as a string?

@SuperSandro2000
Copy link
Member Author

One question, Is there any particular reason for not setting homepage = src.meta.homepage, it seems like a nicer approach than setting the GitHub url as a string?

Because I forgot it 😄

Copy link
Member

@samuelgrf samuelgrf left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

Passes nixpkgs-review build and --help test.

@ofborg ofborg bot requested a review from kalbasit September 15, 2020 21:07
@doronbehar doronbehar merged commit 5a9358c into NixOS:master Sep 15, 2020
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

3 participants