# vagrant Build and distribute virtualized development environments ^ runtime dependencies | xz (Compressors and decompressors) | ^ ::: | rsync (Networking applications) | ^ ::: | libarchive (Libraries/Compression and decompression) | ^ ::: | librsync (Libraries/Networking) | ^ ::: | libcurl (Libraries/Networking) | ^ ::: | libxml2 (Libraries/JSON/XML) | ^ ::: | libxslt (Libraries/JSON/XML) | ^ ::: | libssh2 (Libraries/crypto) | ^ ::: | ruby (Interpreter languages and scripting) | ^ ::: | perl (Interpreter languages and scripting) | ^ make dependencies | git (Development tools) | ^ ::: | go | ^ ::: | ruby (Interpreter languages and scripting) | ## Recette La version de Vagrant utilisée dans cette recette n'est compatible qu'avec les versions de ruby comprise entre la version 2.6 et 3.0\\ \\ Afin d'installer cette version il faut adapter le package `/buildroot/package/ruby/ruby.mk` afin d'utiliser la version 3.0.0 de ruby. ``` mkdir /data/buildroot/package/vagrant cat > /data/buildroot/package/vagrant/Config.in<< 'EOF' config BR2_PACKAGE_VAGRANT bool "vagrant" depends on BR2_PACKAGE_LIBCURL depends on BR2_PACKAGE_LIBARCHIVE depends on BR2_PACKAGE_LIBSSH2 depends on BR2_PACKAGE_LIBXML2 depends on BR2_PACKAGE_LIBXSLT depends on BR2_PACKAGE_RSYNC depends on BR2_PACKAGE_RUBY depends on BR2_PACKAGE_XZ help Build and distribute virtualized development environments EOF cat > /data/buildroot/package/vagrant/vagrant.mk<< 'EOF' ############################################################# # # vagrant # https://github.com/hashicorp/vagrant/archive/refs/tags/v2.2.19.tar.gz # ############################################################# VAGRANT_VERSION = 2.2.19 VAGRANT_SOURCE = v$(VAGRANT_VERSION).tar.gz VAGRANT_SITE = https://github.com/hashicorp/vagrant/archive/refs/tags VAGRANT_DEPENDENCIES = libcurl libarchive libssh2 libxml2 libxslt rsync ruby xz define VAGRANT_BUILD_CMDS cd $(@D)/ && \ INSTALLERS_DIR="$(@D)"/vagrant-installers/substrate \ $(HOST_DIR)/bin/gem build vagrant.gemspec && \ cp vagrant-*.gem vagrant.gem && \ git clone https://github.com/hashicorp/vagrant-installers.git && \ cd "$(@D)"/vagrant-installers/substrate/launcher && \ git clone https://github.com/mitchellh/osext && \ GOROOT=/go GOPATH=$(@D)/go go build -o vagrant endef define VAGRANT_INSTALL_TARGET_CMDS install -d "$(TARGET_DIR)"/usr/{bin,share/bash-completion/completions} install -Dm644 $(@D)/vagrant-installers/substrate/common/gemrc \ $(TARGET_DIR)/opt/vagrant/embedded/etc/gemrc ln -s $(HOST_DIR)/include/ruby-$(RUBY_VERSION)/ /usr/lib/ruby/include cd $(@D)/ && \ GEM_PATH="$(TARGET_DIR)"/opt/vagrant/embedded/gems GEM_HOME="$GEM_PATH" \ GEMRC="$(TARGET_DIR)"/opt/vagrant/embedded/etc/gemrc \ $(HOST_DIR)/bin/gem install vagrant.gem --no-document install -Dm755 "$(@D)"/vagrant-installers/substrate/launcher/vagrant \ "$(TARGET_DIR)"/opt/vagrant/bin/vagrant ln -s /opt/vagrant/bin/$_pkgname "$(TARGET_DIR)"/usr/bin/vagrant install -Dm644 $(@D)/contrib/bash/completion.sh \ "$(TARGET_DIR)"/usr/share/bash-completion/completions/$_pkgname install -Dm644 $(@D)/LICENSE \ "$(TARGET_DIR)"/usr/share/licenses/vagrant/LICENSE endef $(eval $(generic-package)) EOF sed -i '/menu "Custom packages"/a source "package/vagrant/Config.in' /data/buildroot/package/Config.in ```