Skip to content

Commit

Permalink
consul: Upgrade to version 1.0.6
Browse files Browse the repository at this point in the history
This is a rollup of the following commits/PRs, in the listed order:
  ab557fc
  2c14093
  NixOS#41243
  • Loading branch information
andrew-d committed Sep 22, 2018
1 parent b917020 commit b7f1c13
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 48 deletions.
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/consul/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ stdenv, buildPythonPackage, fetchPypi
, requests, six, pytest }:

buildPythonPackage rec {
pname = "python-consul";
version = "1.0.1";

src = fetchPypi {
inherit pname version;
sha256 = "1i0pf3yvga7kvzzkj378hhmn9qs0y0iyhs28xflvz6w6nqa7msqg";
};

buildInputs = [ requests six pytest ];

# No tests distributed. https://github.com/cablehead/python-consul/issues/133
doCheck = false;

meta = with stdenv.lib; {
description = "Python client for Consul (https://www.consul.io/)";
homepage = https://github.com/cablehead/python-consul;
license = licenses.mit;
maintainers = with maintainers; [ desiderius ];
};
}
7 changes: 5 additions & 2 deletions pkgs/servers/consul/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ GEM
remote: https://rubygems.org/
specs:
execjs (2.3.0)
json (1.8.2)
libv8 (3.16.14.11)
json (1.8.5)
libv8 (3.16.14.15)
ref (1.0.5)
sass (3.4.11)
therubyracer (0.12.1)
Expand All @@ -20,3 +20,6 @@ DEPENDENCIES
sass
therubyracer
uglifier

BUNDLED WITH
1.12.5
14 changes: 14 additions & 0 deletions pkgs/servers/consul/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Updating consul

When updating consul, you must also update `consul-ui`'s Ruby dependencies.

Do so by downloading the source code, `cd ui`, and run

```bash
cd TEMP_DIR_WITH_CONSUL_SOURCE
cd ui
$(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic
cp gemset.nix Gemfile Gemfile.lock THIS_DIRECTORY
```

(As described in https://nixos.org/nixpkgs/manual/#sec-language-ruby)
4 changes: 2 additions & 2 deletions pkgs/servers/consul/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildGoPackage rec {
name = "consul-${version}";
version = "0.9.3";
version = "1.0.6";
rev = "v${version}";

goPackagePath = "github.com/hashicorp/consul";
Expand All @@ -11,7 +11,7 @@ buildGoPackage rec {
owner = "hashicorp";
repo = "consul";
inherit rev;
sha256 = "1176frp7kimpycsmz9wrbizf46jgxr8jq7hz5w4q1x90lswvrxv3";
sha256 = "06isx7y6nc3305d9bw61738jfmyyh0czshgfdn8dvhdhvxjs5pp2";
};

# Keep consul.ui for backward compatability
Expand Down
47 changes: 24 additions & 23 deletions pkgs/servers/consul/gemset.nix
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
{
execjs = {
version = "2.3.0";
source = {
type = "gem";
remotes = ["https://rubygems.org"];
sha256 = "097v02bhmzc70j7n0yyf8j0z5wms88zcmgpmggby4hnvqxf41y1h";
type = "gem";
};
version = "2.3.0";
};
json = {
version = "1.8.2";
source = {
type = "gem";
remotes = ["https://rubygems.org"];
sha256 = "0zzvv25vjikavd3b1bp6lvbgj23vv9jvmnl4vpim8pv30z8p6vr5";
type = "gem";
};
version = "1.8.5";
};
libv8 = {
version = "3.16.14.11";
source = {
remotes = ["https://rubygems.org"];
sha256 = "1j5x22v7rqdk1047k0sz4k1xhf6hkdw6h1nl7xsw694hfjdb0vyx";
type = "gem";
sha256 = "000vbiy78wk5r1f6p7qncab8ldg7qw5pjz7bchn3lw700gpaacxp";
};
version = "3.16.14.15";
};
ref = {
version = "1.0.5";
source = {
type = "gem";
remotes = ["https://rubygems.org"];
sha256 = "19qgpsfszwc2sfh6wixgky5agn831qq8ap854i1jqqhy1zsci3la";
type = "gem";
};
version = "1.0.5";
};
sass = {
version = "3.4.11";
source = {
type = "gem";
remotes = ["https://rubygems.org"];
sha256 = "10dncnv7g5v8d1xpw2aaarxjjlm68f7nm02ns2kl8nf3yxi6wzdf";
type = "gem";
};
version = "3.4.11";
};
therubyracer = {
version = "0.12.1";
dependencies = ["libv8" "ref"];
source = {
type = "gem";
remotes = ["https://rubygems.org"];
sha256 = "106fqimqyaalh7p6czbl5m2j69z8gv7cm10mjb8bbb2p2vlmqmi6";
type = "gem";
};
dependencies = [
"libv8"
"ref"
];
version = "0.12.1";
};
uglifier = {
version = "2.7.0";
dependencies = ["execjs" "json"];
source = {
type = "gem";
remotes = ["https://rubygems.org"];
sha256 = "1x1mnakx086l83a3alj690c6n8kfmb4bk243a6m6yz99s15gbxfq";
type = "gem";
};
dependencies = [
"execjs"
"json"
];
version = "2.7.0";
};
}
}
16 changes: 15 additions & 1 deletion pkgs/servers/consul/ui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ stdenv.mkDerivation {

buildInputs = [ ruby gems zip ];

patchPhase = "patchShebangs ./ui/scripts/dist.sh";
patchPhase = ''
patchShebangs ./ui/scripts/dist.sh
'' +
# Patch out upstream's habit of checking if all deps are available,
# hiding all error messages and installing them with `bundle install`
# if they aren't.
# That way we can easily see when upstream's deps changed but
# `bundix` wasn't run to reflect that in nixpkgs.
# This will have to be updated if
# https://github.com/hashicorp/consul/pull/4176 is merged
# (we still want to patch `bundle install` out to make the error
# message more obvious).
''
sed -i 's:bundle check >/dev/null 2>&1 || bundle install:bundle check:g' ui/scripts/dist.sh
'';

buildPhase = ''
# Build ui static files
Expand Down
21 changes: 1 addition & 20 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2531,26 +2531,7 @@ in {

construct = callPackage ../development/python-modules/construct {};

consul = buildPythonPackage (rec {
name = "python-consul-0.7.0";

src = pkgs.fetchurl {
url = "mirror://pypi/p/python-consul/${name}.tar.gz";
sha256 = "18gs5myk9wkkq5zvj0n0s68ngj3mrbdcifshxfj1j0bgb1km0wpm";
};

buildInputs = with self; [ requests six pytest ];

# No tests distributed. https://github.com/cablehead/python-consul/issues/133
doCheck = false;

meta = {
description = "Python client for Consul (https://www.consul.io/)";
homepage = https://github.com/cablehead/python-consul;
license = licenses.mit;
maintainers = with maintainers; [ desiderius ];
};
});
consul = callPackage ../development/python-modules/consul { };

contexter = buildPythonPackage rec {
name = "contexter-${version}";
Expand Down

0 comments on commit b7f1c13

Please sign in to comment.