summary refs log tree commit diff
path: root/pkgs/servers/sql
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2018-11-29 12:49:40 -0600
committerAustin Seipp <aseipp@pobox.com>2018-11-29 15:12:35 -0600
commitc90a45a3832ac4ea7f265016710f19522df1b109 (patch)
treee4a6fc79deb3f8c0f0ec9da44205445f373d3ef5 /pkgs/servers/sql
parent43762227f89acb8d882475d206752987688e4a98 (diff)
downloadnixpkgs-c90a45a3832ac4ea7f265016710f19522df1b109.tar
nixpkgs-c90a45a3832ac4ea7f265016710f19522df1b109.tar.gz
nixpkgs-c90a45a3832ac4ea7f265016710f19522df1b109.tar.bz2
nixpkgs-c90a45a3832ac4ea7f265016710f19522df1b109.tar.lz
nixpkgs-c90a45a3832ac4ea7f265016710f19522df1b109.tar.xz
nixpkgs-c90a45a3832ac4ea7f265016710f19522df1b109.tar.zst
nixpkgs-c90a45a3832ac4ea7f265016710f19522df1b109.zip
cockroachdb: 2.0.0 -> 2.1.1, aarch64 support
This also splits the .bin output to have a separate .man attribute:
previously it contained both.

This also adds provisional support for aarch64-linux, which seems to
build easily. (Full testing will ideally come via NixOS tests later)

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/servers/sql')
-rw-r--r--pkgs/servers/sql/cockroachdb/default.nix44
1 files changed, 32 insertions, 12 deletions
diff --git a/pkgs/servers/sql/cockroachdb/default.nix b/pkgs/servers/sql/cockroachdb/default.nix
index aba997d75f1..6f4b10759e3 100644
--- a/pkgs/servers/sql/cockroachdb/default.nix
+++ b/pkgs/servers/sql/cockroachdb/default.nix
@@ -1,18 +1,28 @@
-{ stdenv, buildGoPackage, fetchurl, cmake, xz, which, autoconf, ncurses6, libedit }:
+{ stdenv, buildGoPackage, fetchurl
+, cmake, xz, which, autoconf
+, ncurses6, libedit, libunwind
+}:
 
+let
+  darwinDeps = [ libunwind libedit ];
+  linuxDeps  = [ ncurses6 ];
+
+  buildInputs = if stdenv.isDarwin then darwinDeps else linuxDeps;
+  nativeBuildInputs = [ cmake xz which autoconf ];
+
+in
 buildGoPackage rec {
   name = "cockroach-${version}";
-  version = "2.0.0";
+  version = "2.1.1";
 
   goPackagePath = "github.com/cockroachdb/cockroach";
 
   src = fetchurl {
     url = "https://binaries.cockroachdb.com/cockroach-v${version}.src.tgz";
-    sha256 = "0x8hf5qwvgb2w6dcnvy20v77nf19f0l1pb40jf31rm72xhk3bwvy";
+    sha256 = "1z34zlwznh4lgbc1ryn577w7mmycyjbmz28k1hhhb6ricmk1x847";
   };
 
-  buildInputs = [ (if stdenv.isDarwin then libedit else ncurses6) ];
-  nativeBuildInputs = [ cmake xz which autoconf ];
+  inherit nativeBuildInputs buildInputs;
 
   buildPhase = ''
     runHook preBuild
@@ -21,24 +31,34 @@ buildGoPackage rec {
     make buildoss
     cd src/${goPackagePath}
     for asset in man autocomplete; do
-      ./cockroach gen $asset
+      ./cockroachoss gen $asset
     done
     runHook postBuild
   '';
 
   installPhase = ''
     runHook preInstall
-    install -D cockroach $bin/bin/cockroach
+
+    install -D cockroachoss $bin/bin/cockroach
     install -D cockroach.bash $bin/share/bash-completion/completions/cockroach.bash
-    cp -r man $bin/share/man
+
+    mkdir -p $man/share/man
+    cp -r man $man/share/man
+
     runHook postInstall
   '';
 
+  # Unfortunately we have to keep an empty reference to $out, because it seems
+  # buildGoPackages only nukes references to the go compiler under $bin, effectively
+  # making all binary output under $bin mandatory. Ideally, we would just use
+  # $out and $man and remove $bin since there's no point in an empty path. :(
+  outputs = [ "bin" "man" "out" ];
+
   meta = with stdenv.lib; {
-    homepage = https://www.cockroachlabs.com;
+    homepage    = https://www.cockroachlabs.com;
     description = "A scalable, survivable, strongly-consistent SQL database";
-    license = licenses.asl20;
-    platforms = [ "x86_64-linux" "x86_64-darwin" ];
-    maintainers = [ maintainers.rushmorem ];
+    license     = licenses.asl20;
+    platforms   = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
+    maintainers = with maintainers; [ rushmorem thoughtpolice ];
   };
 }