vagrant-libvirt: init at 2.2.0

Adds a flag and a new package to build vagrant with libvirt support,
to be able to install and use the vagrant-libvirt plugin.
This commit is contained in:
Christian Albrecht 2018-10-27 08:28:58 +02:00 committed by Robin Gloster
parent 9335613995
commit 7ed92b1497
3 changed files with 31 additions and 4 deletions

View File

@ -1,4 +1,4 @@
{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive, writeText }:
{ lib, fetchurl, buildRubyGem, bundlerEnv, ruby, libarchive, writeText, withLibvirt ? false, libvirt, pkgconfig }:
let
# NOTE: bumping the version and updating the hash is insufficient;
@ -15,7 +15,7 @@ let
inherit ruby;
gemfile = writeText "Gemfile" "";
lockfile = writeText "Gemfile.lock" "";
gemset = lib.recursiveUpdate (import ./gemset.nix) {
gemset = lib.recursiveUpdate (import ./gemset.nix) ({
vagrant = {
source = {
type = "url";
@ -23,7 +23,7 @@ let
};
inherit version;
};
};
} // lib.optionalAttrs withLibvirt (import ./gemset_libvirt.nix));
};
in buildRubyGem rec {
@ -35,6 +35,8 @@ in buildRubyGem rec {
dontBuild = false;
src = fetchurl { inherit url sha256; };
buildInputs = lib.optional withLibvirt [ libvirt pkgconfig ];
patches = [
./unofficial-installation-nowarn.patch
./use-system-bundler-version.patch
@ -45,7 +47,12 @@ in buildRubyGem rec {
postInstall = ''
wrapProgram "$out/bin/vagrant" \
--set GEM_PATH "${deps}/lib/ruby/gems/${ruby.version.libDir}" \
--prefix PATH ':' "${lib.getBin libarchive}/bin"
--prefix PATH ':' "${lib.getBin libarchive}/bin" \
${lib.optionalString withLibvirt ''
--prefix PATH ':' "${pkgconfig}/bin" \
--prefix PKG_CONFIG_PATH ':' \
"${lib.makeSearchPath "lib/pkgconfig" [ libvirt ]}"
''}
'';
installCheckPhase = ''

View File

@ -0,0 +1,19 @@
{
mini_portile2 = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y";
type = "gem";
};
version = "2.3.0";
};
nokogiri = {
dependencies = ["mini_portile2"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0byyxrazkfm29ypcx5q4syrv126nvjnf7z6bqi01sqkv4llsi4qz";
type = "gem";
};
version = "1.8.5";
};
}

View File

@ -8990,6 +8990,7 @@ with pkgs;
universal-ctags = callPackage ../development/tools/misc/universal-ctags { };
vagrant = callPackage ../development/tools/vagrant {};
vagrant-libvirt = self.vagrant.override { withLibvirt = true; };
bashdb = callPackage ../development/tools/misc/bashdb { };