about summary refs log tree commit diff
path: root/pkgs/development/tools/vagrant
diff options
context:
space:
mode:
authorChristian Albrecht <christian.albrecht@mayflower.de>2018-10-27 08:28:58 +0200
committerRobin Gloster <mail@glob.in>2018-11-07 17:46:57 +0100
commit7ed92b1497818a2c8d0f17769b126be8fbc620c2 (patch)
treea4be82a925c61d3eb2e1538196c2357384bdb6e8 /pkgs/development/tools/vagrant
parent933561399507d4d03e4d0247a90784f1035fc3ea (diff)
downloadnixlib-7ed92b1497818a2c8d0f17769b126be8fbc620c2.tar
nixlib-7ed92b1497818a2c8d0f17769b126be8fbc620c2.tar.gz
nixlib-7ed92b1497818a2c8d0f17769b126be8fbc620c2.tar.bz2
nixlib-7ed92b1497818a2c8d0f17769b126be8fbc620c2.tar.lz
nixlib-7ed92b1497818a2c8d0f17769b126be8fbc620c2.tar.xz
nixlib-7ed92b1497818a2c8d0f17769b126be8fbc620c2.tar.zst
nixlib-7ed92b1497818a2c8d0f17769b126be8fbc620c2.zip
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.
Diffstat (limited to 'pkgs/development/tools/vagrant')
-rw-r--r--pkgs/development/tools/vagrant/default.nix15
-rw-r--r--pkgs/development/tools/vagrant/gemset_libvirt.nix19
2 files changed, 30 insertions, 4 deletions
diff --git a/pkgs/development/tools/vagrant/default.nix b/pkgs/development/tools/vagrant/default.nix
index c06d1d0f9d0a..2b77d5358196 100644
--- a/pkgs/development/tools/vagrant/default.nix
+++ b/pkgs/development/tools/vagrant/default.nix
@@ -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 = ''
diff --git a/pkgs/development/tools/vagrant/gemset_libvirt.nix b/pkgs/development/tools/vagrant/gemset_libvirt.nix
new file mode 100644
index 000000000000..aeaf42341a87
--- /dev/null
+++ b/pkgs/development/tools/vagrant/gemset_libvirt.nix
@@ -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";
+  };
+}