2019-02-15 17:07:01 +00:00
|
|
|
{ stdenv, lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive
|
2020-02-05 18:27:16 +00:00
|
|
|
, libguestfs, qemu, writeText, withLibvirt ? stdenv.isLinux, fetchpatch
|
|
|
|
}:
|
2013-11-21 22:21:39 +00:00
|
|
|
|
2014-11-18 04:24:07 +00:00
|
|
|
let
|
2018-07-16 02:22:29 +01:00
|
|
|
# NOTE: bumping the version and updating the hash is insufficient;
|
2018-09-29 12:48:35 +01:00
|
|
|
# you must use bundix to generate a new gemset.nix in the Vagrant source.
|
2020-11-06 12:48:52 +00:00
|
|
|
version = "2.2.11";
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
url = "https://github.com/hashicorp/vagrant/archive/v${version}.tar.gz";
|
2020-11-06 12:48:52 +00:00
|
|
|
sha256 = "sha256-KDQDEMebqQYgsBroHmQrm/OJWTES9C9eGl0dDHTBpIc=";
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
|
|
|
|
deps = bundlerEnv rec {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
pname = "vagrant";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
inherit ruby;
|
2018-09-29 12:48:35 +01:00
|
|
|
gemfile = writeText "Gemfile" "";
|
|
|
|
lockfile = writeText "Gemfile.lock" "";
|
2018-10-27 07:28:58 +01:00
|
|
|
gemset = lib.recursiveUpdate (import ./gemset.nix) ({
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
vagrant = {
|
|
|
|
source = {
|
|
|
|
type = "url";
|
|
|
|
inherit url sha256;
|
|
|
|
};
|
|
|
|
inherit version;
|
|
|
|
};
|
2018-10-27 07:28:58 +01:00
|
|
|
} // lib.optionalAttrs withLibvirt (import ./gemset_libvirt.nix));
|
2020-01-01 04:04:50 +00:00
|
|
|
|
|
|
|
# This replaces the gem symlinks with directories, resolving this
|
|
|
|
# error when running vagrant (I have no idea why):
|
|
|
|
# /nix/store/p4hrycs0zaa9x0gsqylbk577ppnryixr-vagrant-2.2.6/lib/ruby/gems/2.6.0/gems/i18n-1.1.1/lib/i18n/config.rb:6:in `<module:I18n>': uninitialized constant I18n::Config (NameError)
|
|
|
|
postBuild = ''
|
|
|
|
for gem in "$out"/lib/ruby/gems/*/gems/*; do
|
|
|
|
cp -a "$gem/" "$gem.new"
|
|
|
|
rm "$gem"
|
2020-01-14 12:15:17 +00:00
|
|
|
# needed on macOS, otherwise the mv yields permission denied
|
|
|
|
chmod +w "$gem.new"
|
2020-01-01 04:04:50 +00:00
|
|
|
mv "$gem.new" "$gem"
|
|
|
|
done
|
|
|
|
'';
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
};
|
2014-11-18 04:24:07 +00:00
|
|
|
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
in buildRubyGem rec {
|
|
|
|
name = "${gemName}-${version}";
|
|
|
|
gemName = "vagrant";
|
|
|
|
inherit version;
|
2016-10-09 20:23:32 +01:00
|
|
|
|
2018-03-04 07:28:45 +00:00
|
|
|
doInstallCheck = true;
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
dontBuild = false;
|
|
|
|
src = fetchurl { inherit url sha256; };
|
2016-09-05 13:44:34 +01:00
|
|
|
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
patches = [
|
2019-03-05 14:44:40 +00:00
|
|
|
./unofficial-installation-nowarn.patch
|
2018-08-28 06:57:19 +01:00
|
|
|
./use-system-bundler-version.patch
|
2018-12-16 23:51:30 +00:00
|
|
|
./0004-Support-system-installed-plugins.patch
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
];
|
2016-09-05 13:44:34 +01:00
|
|
|
|
2018-12-16 23:51:30 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/vagrant/plugin/manager.rb --subst-var-by \
|
|
|
|
system_plugin_dir "$out/vagrant-plugins"
|
|
|
|
'';
|
|
|
|
|
2018-01-27 23:47:43 +00:00
|
|
|
# PATH additions:
|
|
|
|
# - libarchive: Make `bsdtar` available for extracting downloaded boxes
|
2019-01-02 04:03:20 +00:00
|
|
|
# withLibvirt only:
|
|
|
|
# - libguestfs: Make 'virt-sysprep' available for 'vagrant package'
|
|
|
|
# - qemu: Make 'qemu-img' available for 'vagrant package'
|
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
pathAdditions = lib.makeSearchPath "bin"
|
2019-09-09 00:38:31 +01:00
|
|
|
(map (x: lib.getBin x) ([
|
2019-01-02 04:03:20 +00:00
|
|
|
libarchive
|
|
|
|
] ++ lib.optionals withLibvirt [
|
|
|
|
libguestfs
|
|
|
|
qemu
|
|
|
|
]));
|
|
|
|
in ''
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
wrapProgram "$out/bin/vagrant" \
|
2018-01-27 23:47:43 +00:00
|
|
|
--set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}" \
|
2019-01-02 04:03:20 +00:00
|
|
|
--prefix PATH ':' ${pathAdditions}
|
2018-12-16 23:51:30 +00:00
|
|
|
|
|
|
|
mkdir -p "$out/vagrant-plugins/plugins.d"
|
|
|
|
echo '{}' > "$out/vagrant-plugins/plugins.json"
|
2019-07-27 12:58:00 +01:00
|
|
|
|
|
|
|
mkdir -p $out/share/bash-completion/completions/
|
|
|
|
cp -av contrib/bash/completion.sh $out/share/bash-completion/completions/vagrant
|
2018-12-17 00:16:20 +00:00
|
|
|
'' +
|
|
|
|
lib.optionalString withLibvirt ''
|
|
|
|
substitute ${./vagrant-libvirt.json.in} $out/vagrant-plugins/plugins.d/vagrant-libvirt.json \
|
|
|
|
--subst-var-by ruby_version ${ruby.version} \
|
|
|
|
--subst-var-by vagrant_version ${version}
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
'';
|
2013-11-21 22:21:39 +00:00
|
|
|
|
2018-03-04 07:28:45 +00:00
|
|
|
installCheckPhase = ''
|
2020-01-01 00:33:33 +00:00
|
|
|
HOME="$(mktemp -d)" $out/bin/vagrant init --output - > /dev/null
|
2018-03-04 07:28:45 +00:00
|
|
|
'';
|
|
|
|
|
2019-06-19 18:06:56 +01:00
|
|
|
# `patchShebangsAuto` patches this one script which is intended to run
|
|
|
|
# on foreign systems.
|
|
|
|
postFixup = ''
|
|
|
|
sed -i -e '1c#!/bin/sh -' \
|
|
|
|
$out/lib/ruby/gems/*/gems/vagrant-*/plugins/provisioners/salt/bootstrap-salt.sh
|
|
|
|
'';
|
|
|
|
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
passthru = {
|
|
|
|
inherit ruby deps;
|
2016-09-05 13:44:34 +01:00
|
|
|
};
|
|
|
|
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
meta = with lib; {
|
2013-11-21 22:21:39 +00:00
|
|
|
description = "A tool for building complete development environments";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.vagrantup.com/";
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
license = licenses.mit;
|
2020-03-24 05:21:22 +00:00
|
|
|
maintainers = with maintainers; [ ma27 ];
|
vagrant: Build from source
This is not quite as elegant as using `bundlerApp`,
which I could not get working.
However, this still uses most of the Ruby infrastructure,
including stock bundix, and should be fairly reasonable to maintain.
This means no more hacks to work around wrong embedded binaries,
and no need for an old version of Ruby.
Note that `vagrant share` is no longer included,
as that functionality is closed-source
and not present in the upstream source code.
The Vagrant maintainers publish official Vagrant installers,
which they prefer people use as most platforms don't
have great support for pinning known-good dependencies.
When run outside one of the offical installers,
Vagrant normally prints a warning to that effect.
However, Vagrant does run outside the installer environment
(nominally to support Vagrant development),
and this has the effect of functioning better by respecting
OS certs and shared libraries,
as opposed to trying to use bundled versions.
To keep these postive side effects without having to see the warning
on every Vagrant invocation, patch out the call to print the warning.
Note that I have reset the maintainers since the implementation is
totally redone; I'm happy to re-add any of the current maintainers.
2017-10-30 06:21:07 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2013-11-21 22:21:39 +00:00
|
|
|
};
|
|
|
|
}
|