at 18.03-beta 67 lines 1.7 kB view raw
1{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive }: 2 3let 4 version = "2.0.2"; 5 url = "https://github.com/hashicorp/vagrant/archive/v${version}.tar.gz"; 6 sha256 = "1sjfwgy2y6q5s1drd8h8xgz2a0sv1l3kx9jilgc02hlcdz070iir"; 7 8 deps = bundlerEnv rec { 9 name = "${pname}-${version}"; 10 pname = "vagrant"; 11 inherit version; 12 13 inherit ruby; 14 gemdir = ./.; 15 gemset = lib.recursiveUpdate (import ./gemset.nix) { 16 vagrant = { 17 source = { 18 type = "url"; 19 inherit url sha256; 20 }; 21 inherit version; 22 }; 23 }; 24 }; 25 26in buildRubyGem rec { 27 name = "${gemName}-${version}"; 28 gemName = "vagrant"; 29 inherit version; 30 31 doInstallCheck = true; 32 dontBuild = false; 33 src = fetchurl { inherit url sha256; }; 34 35 patches = [ 36 ./unofficial-installation-nowarn.patch 37 ]; 38 39 # PATH additions: 40 # - libarchive: Make `bsdtar` available for extracting downloaded boxes 41 postInstall = '' 42 wrapProgram "$out/bin/vagrant" \ 43 --set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}" \ 44 --prefix PATH ':' "${lib.getBin libarchive}/bin" 45 ''; 46 47 installCheckPhase = '' 48 if [[ "$("$out/bin/vagrant" --version)" == "Vagrant ${version}" ]]; then 49 echo 'Vagrant smoke check passed' 50 else 51 echo 'Vagrant smoke check failed' 52 return 1 53 fi 54 ''; 55 56 passthru = { 57 inherit ruby deps; 58 }; 59 60 meta = with lib; { 61 description = "A tool for building complete development environments"; 62 homepage = https://www.vagrantup.com/; 63 license = licenses.mit; 64 maintainers = with maintainers; [ aneeshusa ]; 65 platforms = with platforms; linux ++ darwin; 66 }; 67}