aboutsummaryrefslogtreecommitdiff
path: root/pkgs/servers/consul
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2018-10-26 18:07:56 +0200
committerNiklas Hambüchen <mail@nh2.me>2018-11-03 18:39:46 +0100
commit2cb7f5fb1e502fe5502d37fce0a9b7a16ea24fd0 (patch)
tree85d6d24513e1f5f696ac60448134c9cbfc99a31c /pkgs/servers/consul
parentdf28b4b6e5a996a4971a0b32a98e654e4c44a54a (diff)
consul: 0.9.3 -> 1.3.0.
Removes the old UI build tooling; it is no longer necessary because as of 1.2.0 it's bundled into the server binary. It doesn't even need to have JS built, because it's bundled into the release commit's source tree (see #48714). The UI is enabled by default, so the NixOS service is updated to directly use `ui = webUi;` now. Fixes #48714. Fixes #44192. Fixes #41243. Fixes #35602. Signed-off-by: Niklas Hambüchen <mail@nh2.me>
Diffstat (limited to 'pkgs/servers/consul')
-rw-r--r--pkgs/servers/consul/Gemfile5
-rw-r--r--pkgs/servers/consul/Gemfile.lock25
-rw-r--r--pkgs/servers/consul/default.nix19
-rw-r--r--pkgs/servers/consul/gemset.nix62
-rw-r--r--pkgs/servers/consul/ui-no-bundle-exec.patch17
-rw-r--r--pkgs/servers/consul/ui.nix41
6 files changed, 12 insertions, 157 deletions
diff --git a/pkgs/servers/consul/Gemfile b/pkgs/servers/consul/Gemfile
deleted file mode 100644
index 0e782af6b000..000000000000
--- a/pkgs/servers/consul/Gemfile
+++ /dev/null
@@ -1,5 +0,0 @@
-# A sample Gemfile
-source "https://rubygems.org"
-
-gem "uglifier"
-gem "sass"
diff --git a/pkgs/servers/consul/Gemfile.lock b/pkgs/servers/consul/Gemfile.lock
deleted file mode 100644
index 60a565f66951..000000000000
--- a/pkgs/servers/consul/Gemfile.lock
+++ /dev/null
@@ -1,25 +0,0 @@
-GEM
- remote: https://rubygems.org/
- specs:
- execjs (2.7.0)
- ffi (1.9.23)
- rb-fsevent (0.10.3)
- rb-inotify (0.9.10)
- ffi (>= 0.5.0, < 2)
- sass (3.5.6)
- sass-listen (~> 4.0.0)
- sass-listen (4.0.0)
- rb-fsevent (~> 0.9, >= 0.9.4)
- rb-inotify (~> 0.9, >= 0.9.7)
- uglifier (4.1.10)
- execjs (>= 0.3.0, < 3)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- sass
- uglifier
-
-BUNDLED WITH
- 1.14.6
diff --git a/pkgs/servers/consul/default.nix b/pkgs/servers/consul/default.nix
index 5cf192791000..d1dcd78667f0 100644
--- a/pkgs/servers/consul/default.nix
+++ b/pkgs/servers/consul/default.nix
@@ -1,22 +1,27 @@
-{ stdenv, buildGoPackage, consul-ui, fetchFromGitHub }:
+{ stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
name = "consul-${version}";
- version = "0.9.3";
+ version = "1.3.0";
rev = "v${version}";
goPackagePath = "github.com/hashicorp/consul";
+ # Note: Currently only release tags are supported, because they have the Consul UI
+ # vendored. See
+ # https://github.com/NixOS/nixpkgs/pull/48714#issuecomment-433454834
+ # If you want to use a non-release commit as `src`, you probably want to improve
+ # this derivation so that it can build the UI's JavaScript from source.
+ # See https://github.com/NixOS/nixpkgs/pull/49082 for something like that.
+ # Or, if you want to patch something that doesn't touch the UI, you may want
+ # to apply your changes as patches on top of a release commit.
src = fetchFromGitHub {
owner = "hashicorp";
repo = "consul";
inherit rev;
- sha256 = "1176frp7kimpycsmz9wrbizf46jgxr8jq7hz5w4q1x90lswvrxv3";
+ sha256 = "1zv84snvrjm74w3v3rr27linsbxj00m73xd047sb78a4766xs2h0";
};
- # Keep consul.ui for backward compatability
- passthru.ui = consul-ui;
-
preBuild = ''
buildFlagsArray+=("-ldflags" "-X github.com/hashicorp/consul/version.GitDescribe=v${version} -X github.com/hashicorp/consul/version.Version=${version} -X github.com/hashicorp/consul/version.VersionPrerelease=")
'';
@@ -26,6 +31,6 @@ buildGoPackage rec {
homepage = https://www.consul.io/;
platforms = platforms.linux ++ platforms.darwin;
license = licenses.mpl20;
- maintainers = with maintainers; [ pradeepchhetri ];
+ maintainers = with maintainers; [ pradeepchhetri vdemeester nh2 ];
};
}
diff --git a/pkgs/servers/consul/gemset.nix b/pkgs/servers/consul/gemset.nix
deleted file mode 100644
index 2a5425ccf5f5..000000000000
--- a/pkgs/servers/consul/gemset.nix
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- execjs = {
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "1yz55sf2nd3l666ms6xr18sm2aggcvmb8qr3v53lr4rir32y1yp1";
- type = "gem";
- };
- version = "2.7.0";
- };
- ffi = {
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0zw6pbyvmj8wafdc7l5h7w20zkp1vbr2805ql5d941g2b20pk4zr";
- type = "gem";
- };
- version = "1.9.23";
- };
- rb-fsevent = {
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "1lm1k7wpz69jx7jrc92w3ggczkjyjbfziq5mg62vjnxmzs383xx8";
- type = "gem";
- };
- version = "0.10.3";
- };
- rb-inotify = {
- dependencies = ["ffi"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0yfsgw5n7pkpyky6a9wkf1g9jafxb0ja7gz0qw0y14fd2jnzfh71";
- type = "gem";
- };
- version = "0.9.10";
- };
- sass = {
- dependencies = ["sass-listen"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "19wyzp9qsg8hdkkxlsv713w0qmy66qrdp0shj42587ssx4qhrlag";
- type = "gem";
- };
- version = "3.5.6";
- };
- sass-listen = {
- dependencies = ["rb-fsevent" "rb-inotify"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0xw3q46cmahkgyldid5hwyiwacp590zj2vmswlll68ryvmvcp7df";
- type = "gem";
- };
- version = "4.0.0";
- };
- uglifier = {
- dependencies = ["execjs"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0dycp9c5xiricla6sgvg0vf22i3axs5k1v1607dvl7nv1xkkaczi";
- type = "gem";
- };
- version = "4.1.10";
- };
-} \ No newline at end of file
diff --git a/pkgs/servers/consul/ui-no-bundle-exec.patch b/pkgs/servers/consul/ui-no-bundle-exec.patch
deleted file mode 100644
index 5707b871049b..000000000000
--- a/pkgs/servers/consul/ui-no-bundle-exec.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/ui/scripts/dist.sh b/ui/scripts/dist.sh
-index 0ad6e28e..db340da0 100755
---- a/ui/scripts/dist.sh
-+++ b/ui/scripts/dist.sh
-@@ -15,10 +15,9 @@ DEPLOY="../pkg/web_ui"
- rm -rf $DEPLOY
- mkdir -p $DEPLOY
-
--bundle check >/dev/null 2>&1 || bundle install
--bundle exec sass styles/base.scss static/base.css
-+sass styles/base.scss static/base.css
-
--bundle exec ruby scripts/compile.rb
-+ruby scripts/compile.rb
-
- # Copy into deploy
- shopt -s dotglob
diff --git a/pkgs/servers/consul/ui.nix b/pkgs/servers/consul/ui.nix
deleted file mode 100644
index da9b518bad73..000000000000
--- a/pkgs/servers/consul/ui.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ stdenv, consul, ruby, bundlerEnv, zip, nodejs }:
-
-let
- # `sass` et al
- gems = bundlerEnv {
- name = "consul-ui-deps";
- gemdir = ./.;
- };
-in
-
-stdenv.mkDerivation {
- name = "consul-ui-${consul.version}";
-
- src = consul.src;
-
- buildInputs = [ ruby gems zip nodejs ];
-
- patches = [ ./ui-no-bundle-exec.patch ];
-
- postPatch = "patchShebangs ./ui/scripts/dist.sh";
-
- buildPhase = ''
- # Build ui static files
- cd ui
- make dist
- '';
-
- installPhase = ''
- # Install ui static files
- mkdir -p $out
- mv ../pkg/web_ui/* $out
- '';
-
- meta = with stdenv.lib; {
- homepage = https://www.consul.io/;
- description = "A tool for service discovery, monitoring and configuration";
- maintainers = with maintainers; [ cstrahan wkennington ];
- license = licenses.mpl20 ;
- platforms = platforms.unix;
- };
-}