1{ stdenv, lib, bundlerEnv, bundlerUpdateScript, makeWrapper, ruby }:
2
3let
4 rubyEnv = bundlerEnv {
5 name = "shopify-cli";
6 gemdir = ./.;
7 ruby = ruby;
8 };
9in
10stdenv.mkDerivation rec {
11 pname = "shopify-cli";
12 version = (import ./gemset.nix).shopify-cli.version;
13
14 nativeBuildInputs = [ makeWrapper ];
15
16 dontUnpack = true;
17
18 installPhase = ''
19 mkdir -p $out/bin
20 makeWrapper ${rubyEnv}/bin/shopify $out/bin/shopify
21 wrapProgram $out/bin/shopify \
22 --prefix PATH : ${lib.makeBinPath [ ruby ]}
23 '';
24
25 passthru.updateScript = bundlerUpdateScript "shopify-cli";
26
27 meta = with lib; {
28 description = "CLI which helps you build against the Shopify platform faster";
29 homepage = "https://github.com/Shopify/shopify-cli";
30 license = licenses.mit;
31 maintainers = with maintainers; [ onny ];
32 mainProgram = "shopify";
33 platforms = ruby.meta.platforms;
34 };
35}
36