consul-ui: fix build

Update the dependencies used for building consul-ui. therubyracer
is no longer required and fails to build. Instead, a nodejs
binary is required to build the assets. Patch out unnecessary
executions of `bundle` which can cause failures.

+67 -43
-1
pkgs/servers/consul/Gemfile
··· 3 3 4 4 gem "uglifier" 5 5 gem "sass" 6 - gem "therubyracer"
+15 -12
pkgs/servers/consul/Gemfile.lock
··· 1 1 GEM 2 2 remote: https://rubygems.org/ 3 3 specs: 4 - execjs (2.3.0) 5 - json (1.8.2) 6 - libv8 (3.16.14.11) 7 - ref (1.0.5) 8 - sass (3.4.11) 9 - therubyracer (0.12.1) 10 - libv8 (~> 3.16.14.0) 11 - ref 12 - uglifier (2.7.0) 13 - execjs (>= 0.3.0) 14 - json (>= 1.8.0) 4 + execjs (2.7.0) 5 + ffi (1.9.23) 6 + rb-fsevent (0.10.3) 7 + rb-inotify (0.9.10) 8 + ffi (>= 0.5.0, < 2) 9 + sass (3.5.6) 10 + sass-listen (~> 4.0.0) 11 + sass-listen (4.0.0) 12 + rb-fsevent (~> 0.9, >= 0.9.4) 13 + rb-inotify (~> 0.9, >= 0.9.7) 14 + uglifier (4.1.10) 15 + execjs (>= 0.3.0, < 3) 15 16 16 17 PLATFORMS 17 18 ruby 18 19 19 20 DEPENDENCIES 20 21 sass 21 - therubyracer 22 22 uglifier 23 + 24 + BUNDLED WITH 25 + 1.14.6
+30 -27
pkgs/servers/consul/gemset.nix
··· 1 1 { 2 2 execjs = { 3 - version = "2.3.0"; 4 3 source = { 4 + remotes = ["https://rubygems.org"]; 5 + sha256 = "1yz55sf2nd3l666ms6xr18sm2aggcvmb8qr3v53lr4rir32y1yp1"; 5 6 type = "gem"; 6 - sha256 = "097v02bhmzc70j7n0yyf8j0z5wms88zcmgpmggby4hnvqxf41y1h"; 7 7 }; 8 + version = "2.7.0"; 8 9 }; 9 - json = { 10 - version = "1.8.2"; 10 + ffi = { 11 11 source = { 12 + remotes = ["https://rubygems.org"]; 13 + sha256 = "0zw6pbyvmj8wafdc7l5h7w20zkp1vbr2805ql5d941g2b20pk4zr"; 12 14 type = "gem"; 13 - sha256 = "0zzvv25vjikavd3b1bp6lvbgj23vv9jvmnl4vpim8pv30z8p6vr5"; 14 15 }; 16 + version = "1.9.23"; 15 17 }; 16 - libv8 = { 17 - version = "3.16.14.11"; 18 + rb-fsevent = { 18 19 source = { 20 + remotes = ["https://rubygems.org"]; 21 + sha256 = "1lm1k7wpz69jx7jrc92w3ggczkjyjbfziq5mg62vjnxmzs383xx8"; 19 22 type = "gem"; 20 - sha256 = "000vbiy78wk5r1f6p7qncab8ldg7qw5pjz7bchn3lw700gpaacxp"; 21 23 }; 24 + version = "0.10.3"; 22 25 }; 23 - ref = { 24 - version = "1.0.5"; 26 + rb-inotify = { 27 + dependencies = ["ffi"]; 25 28 source = { 29 + remotes = ["https://rubygems.org"]; 30 + sha256 = "0yfsgw5n7pkpyky6a9wkf1g9jafxb0ja7gz0qw0y14fd2jnzfh71"; 26 31 type = "gem"; 27 - sha256 = "19qgpsfszwc2sfh6wixgky5agn831qq8ap854i1jqqhy1zsci3la"; 28 32 }; 33 + version = "0.9.10"; 29 34 }; 30 35 sass = { 31 - version = "3.4.11"; 36 + dependencies = ["sass-listen"]; 32 37 source = { 38 + remotes = ["https://rubygems.org"]; 39 + sha256 = "19wyzp9qsg8hdkkxlsv713w0qmy66qrdp0shj42587ssx4qhrlag"; 33 40 type = "gem"; 34 - sha256 = "10dncnv7g5v8d1xpw2aaarxjjlm68f7nm02ns2kl8nf3yxi6wzdf"; 35 41 }; 42 + version = "3.5.6"; 36 43 }; 37 - therubyracer = { 38 - version = "0.12.1"; 44 + sass-listen = { 45 + dependencies = ["rb-fsevent" "rb-inotify"]; 39 46 source = { 47 + remotes = ["https://rubygems.org"]; 48 + sha256 = "0xw3q46cmahkgyldid5hwyiwacp590zj2vmswlll68ryvmvcp7df"; 40 49 type = "gem"; 41 - sha256 = "106fqimqyaalh7p6czbl5m2j69z8gv7cm10mjb8bbb2p2vlmqmi6"; 42 50 }; 43 - dependencies = [ 44 - "libv8" 45 - "ref" 46 - ]; 51 + version = "4.0.0"; 47 52 }; 48 53 uglifier = { 49 - version = "2.7.0"; 54 + dependencies = ["execjs"]; 50 55 source = { 56 + remotes = ["https://rubygems.org"]; 57 + sha256 = "0dycp9c5xiricla6sgvg0vf22i3axs5k1v1607dvl7nv1xkkaczi"; 51 58 type = "gem"; 52 - sha256 = "1x1mnakx086l83a3alj690c6n8kfmb4bk243a6m6yz99s15gbxfq"; 53 59 }; 54 - dependencies = [ 55 - "execjs" 56 - "json" 57 - ]; 60 + version = "4.1.10"; 58 61 }; 59 - } 62 + }
+17
pkgs/servers/consul/ui-no-bundle-exec.patch
··· 1 + diff --git a/ui/scripts/dist.sh b/ui/scripts/dist.sh 2 + index 0ad6e28e..db340da0 100755 3 + --- a/ui/scripts/dist.sh 4 + +++ b/ui/scripts/dist.sh 5 + @@ -15,10 +15,9 @@ DEPLOY="../pkg/web_ui" 6 + rm -rf $DEPLOY 7 + mkdir -p $DEPLOY 8 + 9 + -bundle check >/dev/null 2>&1 || bundle install 10 + -bundle exec sass styles/base.scss static/base.css 11 + +sass styles/base.scss static/base.css 12 + 13 + -bundle exec ruby scripts/compile.rb 14 + +ruby scripts/compile.rb 15 + 16 + # Copy into deploy 17 + shopt -s dotglob
+5 -3
pkgs/servers/consul/ui.nix
··· 1 - { stdenv, consul, ruby, bundlerEnv, zip }: 1 + { stdenv, consul, ruby, bundlerEnv, zip, nodejs }: 2 2 3 3 let 4 4 # `sass` et al ··· 13 13 14 14 src = consul.src; 15 15 16 - buildInputs = [ ruby gems zip ]; 16 + buildInputs = [ ruby gems zip nodejs ]; 17 17 18 - patchPhase = "patchShebangs ./ui/scripts/dist.sh"; 18 + patches = [ ./ui-no-bundle-exec.patch ]; 19 + 20 + postPatch = "patchShebangs ./ui/scripts/dist.sh"; 19 21 20 22 buildPhase = '' 21 23 # Build ui static files