2019-01-02 04:03:20 +00:00
|
|
|
{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive, libguestfs, qemu, writeText, withLibvirt ? true}:
|
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.
|
2019-02-11 23:22:19 +00:00
|
|
|
version = "2.2.3";
|
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";
|
2019-02-11 23:22:19 +00:00
|
|
|
sha256 = "1j00glqn8b1zsgqg2nyk5as405a6s6vclswg2ri0a229hnsiabvs";
|
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));
|
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 = [
|
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"
|
|
|
|
(map (x: "${lib.getBin x}") ([
|
|
|
|
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"
|
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 = ''
|
|
|
|
if [[ "$("$out/bin/vagrant" --version)" == "Vagrant ${version}" ]]; then
|
|
|
|
echo 'Vagrant smoke check passed'
|
|
|
|
else
|
|
|
|
echo 'Vagrant smoke check failed'
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
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";
|
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
|
|
|
homepage = https://www.vagrantup.com/;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ aneeshusa ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2013-11-21 22:21:39 +00:00
|
|
|
};
|
|
|
|
}
|