about summary refs log tree commit diff
path: root/nixpkgs/pkgs/shells/hilbish/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/shells/hilbish/default.nix')
-rw-r--r--nixpkgs/pkgs/shells/hilbish/default.nix27
1 files changed, 24 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/shells/hilbish/default.nix b/nixpkgs/pkgs/shells/hilbish/default.nix
index ddc5b28e5e09..a4a54e45c636 100644
--- a/nixpkgs/pkgs/shells/hilbish/default.nix
+++ b/nixpkgs/pkgs/shells/hilbish/default.nix
@@ -2,19 +2,40 @@
 
 buildGoModule rec {
   pname = "hilbish";
-  version = "0.5.1";
+  version = "0.6.0";
 
   src = fetchFromGitHub {
     owner = "Rosettea";
     repo = "Hilbish";
     rev = "v${version}";
-    sha256 = "sha256-xqGesBNN9lZTYx0kTZfFARq1a/dEC+c3Fo0xLxZuZP4=";
+    sha256 = "sha256-ACHHHGT3VGnvZVi1UZb57+g/slcld5e3bh+DDhUVVpQ=";
+    fetchSubmodules = true;
   };
 
-  vendorSha256 = "sha256-8l+Kb1ADMLwv0Hf/ikok8eUcEEST07rhk8BjHxJI0lc=";
+  vendorSha256 = "sha256-SVGPMFpQjVOWCfiPpEmqhp6MEO0wqeyAZVyeNmTuXl0=";
 
   buildInputs = [ readline ];
 
+  ldflags = [ "-s" "-w" ];
+
+  postPatch = ''
+    substituteInPlace vars_linux.go \
+      --replace "/usr/share" "${placeholder "out"}/share/"
+  '';
+
+  postInstall = ''
+    mkdir -p "$out/share/hilbish"
+
+    cp .hilbishrc.lua $out/share/hilbish/
+    cp -r docs -t $out/share/hilbish
+    cp -r libs -t $out/share/hilbish/
+    cp preload.lua $out/share/hilbish/
+
+    # segfaults and it's already been generated upstream
+    # we copy the docs over with the above cp command
+    rm $out/bin/docgen
+  '';
+
   meta = with lib; {
     description = "An interactive Unix-like shell written in Go";
     changelog = "https://github.com/Rosettea/Hilbish/releases/tag/v${version}";