This idea is not new and Vanat is inspired by composer and node's npm.
Suppose:See the Basic usage chapter for more details on declaring dependencies.
sudo apt install valac
sudo apt install meson
sudo apt install git
sudo apt install libgee-0.8-dev
sudo apt install libarchive-dev
sudo apt install libsoup2.4-dev
sudo apt install libjson-glib-dev
git clone https://github.com/vanat/vanat.git
cd vanat
meson build && cd build
meson configure -Dprefix=/usr
ninja
To install, use ninja install, then execute with valet
sudo ninja install
To verify that Vanat has been properly installed, type in the terminal:
vanat -v
If the output is correctly installed, the output should be:
vanat version 0.1.0
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install vala
brew install meson
brew install git
brew install libarchive
The libarchive is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have libarchive first in your PATH, run:
echo 'export PATH="/usr/local/opt/libarchive/bin:$PATH"' >> ~/.zshrc
For compilers to find libarchive you may need to set:
export LDFLAGS="-L/usr/local/opt/libarchive/lib"
export CPPFLAGS="-I/usr/local/opt/libarchive/include"
The CPPFLAGS and CXXFLAGS are environment variables used to set compilation options that will
be passed to the preprocessor and compiler, respectively. These options can include, for example,
directories for header file inclusion, optimization flags, among others.
To configure multiple items in CPPFLAGS and CXXFLAGS, you can use the shell's list syntax,
separating each item with a whitespace. For example:
export LDFLAGS="-L/usr/local/opt/openssl@3/lib -L/usr/local/opt/libarchive/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include -I/usr/local/opt/libarchive/include"
For pkg-config to find libarchive you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libarchive/lib/pkgconfig"
To configure multiple items in PKG_CONFIG_PATH, you can use the following command in a Linux or macOS terminal:
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig:/usr/local/opt/libarchive/lib/pkgconfig:$PKG_CONFIG_PATH"
Note that you can add as many directory paths as you need, separated by :. Make sure to add
the directories in the correct order so that dependencies are resolved correctly.
brew install libsoup
brew install json-glib
git clone https://github.com/vanat/vanat.git
cd vanat
meson build && cd build
meson compile
To install, use ninja install, then execute with valet
meson install
To verify that Vanat has been properly installed, type in the terminal:
vanat -v
If the output is correctly installed, the output should be:
vanat version 0.1.0
vanat.json
file. This file will have the dependency
settings for your project. It can be considered as a search list for Vanat; It will only download the
packages (dependencies) for your project that are mentioned in this file.
Below is a basic skeleton of vanat.json
, the file in which the
dependencies will be described, then the same will be clarified.
{
"name":"Project name",
"description": "Brief description of what the application proposes to do",
"require":{
"vala":"0.36.*"
}
}
The name
is the name of your application. This marking is
optional but recommended.
The description
is a brief description of what your application
proposes to do. Also optional.
The require
is basically the key of everything and the only
obligatory markup. In it you make clear what are the dependencies of your application. In this case if
the vala version is below 0.36
then an error message will be
thrown when installing the dependencies informing you that it is not possible to proceed because not
all requirements are satisfied.
As you can see above this is the skeleton of a very basic application, with no advanced settings and no indication of any third party library.
VPackagist
where any developer can create their own packages and make
them available to the community similar to github. VPackagist
can
provide you with several packages.
vanat.json
file simply add just below the line that defines that the
vala needs the desired package name and version. In this case the package is vala-development-kit/vdk
and the version is 0.1.*
. With this the new structure of vanat.json
is:
{
"name":"Project name",
"description": "Brief description of what the application proposes to do",
"require":{
"vala":"0.36.*"
"vala-development-kit/vdk":"0.1.*"
}
}
Vanat works with a package repository, VPackagist
(the official
destination for packages created for Vanat). This is where you find the name and version of the
packages you can use in your project. Then it is assumed that the vala-development-kit/vdk
package is registered in VPackagist
.
vanat.json
is) run the vanat install
command. This command will make the vanat
read the settings set in the json file and install all the libraries/packages needed for your
application and also these same libraries that have dependencies will have the same ones solved. Think
of vanat more or less like Linux debian apt-get. In it, when installing any package, all its
dependencies are resolved automatically.
Note that in the folder where your application is now there is the vendor
folder, a vanat file (which was already there) and a vanat.lock
file - which is the file that was automatically generated after the installation was successful.
vanat.json
file, simply notify the vanat of your
choice so that it can add it to your project. To do this, type the following command on the terminal:
$ vanat require vala-development-kit/vdk
vendor
name and the project's name. Often these will be identical - the
vendor name just exists to prevent naming clashes. For example, it would allow two different people to
create a library named json. One might be named igorw/json
while the
other might be seldaek/json
.
VPackagist
is the
default Vanat package repository. It lets you find packages and lets Vanat know where to get the code
from.
You can find the https://github.com/vpackagist
source on GitHub.
Found a bug or did you have any idea how to improve vanat? We'd love to hear about it! Please report all issues about the issues in our github.