home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

odo.nix (1728B)


      1 { stdenv, lib, fetchurl }:
      2 
      3 with lib;
      4 rec {
      5   odoGen =
      6     { version
      7     , sha256
      8     }:
      9 
     10     stdenv.mkDerivation rec {
     11       pname = "odo";
     12       name = "${pname}-${version}";
     13 
     14       src = fetchurl {
     15         url = "https://mirror.openshift.com/pub/openshift-v4/clients/odo/v${version}/odo-linux-amd64.tar.gz";
     16         sha256 = "${sha256}";
     17       };
     18 
     19       phases = " unpackPhase installPhase fixupPhase ";
     20 
     21       unpackPhase = ''
     22         runHook preUnpack
     23         mkdir ${name}
     24         tar -C ${name} -xzf $src
     25       '';
     26 
     27       installPhase = ''
     28         runHook preInstall
     29         install -D ${name}/odo $out/bin/odo
     30         patchelf \
     31           --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
     32           $out/bin/odo
     33         # completions
     34         mkdir -p $out/share/bash-completion/completions/
     35         $out/bin/odo utils terminal bash > $out/share/bash-completion/completions/odo
     36         mkdir -p $out/share/zsh/site-functions
     37         $out/bin/odo utils terminal zsh > $out/share/zsh/site-functions/_odo
     38       '';
     39     };
     40 
     41   odo = odo_2_3;
     42   odo_2_3 = makeOverridable odoGen {
     43     version = "2.3.1";
     44     sha256 = "13frxa5mf52j08mica4j9v6zdrqxhccx0injz860fywbcsz0x67p";
     45   };
     46   odo_2_2 = makeOverridable odoGen {
     47     version = "2.2.4";
     48     sha256 = "1ma0q79s85dy23b4ygjm67dm05i7clm39h5p86sdz4wz63amiqcg";
     49   };
     50   odo_2_1 = makeOverridable odoGen {
     51     version = "2.1.0";
     52     sha256 = "1jy79wg7war7i1hnlnzxcs2nj81r5zyk9sr2vc6knwxjg5cllis6";
     53   };
     54   odo_2_0 = makeOverridable odoGen {
     55     version = "2.0.7";
     56     sha256 = "05mxdxy8llava10sq9b111xq2bd5ywlw80s3zkwk8nzikhjjfvg3";
     57   };
     58   odo_1_2 = makeOverridable odoGen {
     59     version = "1.2.6";
     60     sha256 = "0dhnc413sgymwy8df27diz7bkpkckgm6jws88na4mg82jffnyn1w";
     61   };
     62 }