Difference between revisions of "Obtaining Vifm"
(→From sources: Add a note about /usr prefix) |
(<source> -> <syntaxhighlight>) |
||
Line 10: | Line 10: | ||
The standard set of commands should work just fine: | The standard set of commands should work just fine: | ||
− | < | + | <syntaxhighlight lang="bash"> |
scripts/fix-timestamps # run this if the file exists, avoids issues with autotools (they don't even need to be installed then) | scripts/fix-timestamps # run this if the file exists, avoids issues with autotools (they don't even need to be installed then) | ||
./configure --sysconfdir=/etc | ./configure --sysconfdir=/etc | ||
make | make | ||
make install | make install | ||
− | </ | + | </syntaxhighlight> |
By default Vifm will be installed under <code>/usr/local</code>, if you want to have it in <code>/usr</code> (e.g., you want to reuse data files installed by system's package manager), also specify <code>--prefix</code> parameter to get: | By default Vifm will be installed under <code>/usr/local</code>, if you want to have it in <code>/usr</code> (e.g., you want to reuse data files installed by system's package manager), also specify <code>--prefix</code> parameter to get: | ||
− | < | + | <syntaxhighlight lang="bash"> |
./configure --sysconfdir=/etc --prefix=/usr | ./configure --sysconfdir=/etc --prefix=/usr | ||
− | </ | + | </syntaxhighlight> |
If you know how to make a package for your distribution, it's recommended to | If you know how to make a package for your distribution, it's recommended to | ||
make one and install it rather than running <code>make install</code>. E.g. on | make one and install it rather than running <code>make install</code>. E.g. on | ||
[https://en.wikipedia.org/wiki/Slackware Slackware Linux] one could do: | [https://en.wikipedia.org/wiki/Slackware Slackware Linux] one could do: | ||
− | < | + | <syntaxhighlight lang="bash"> |
mkdir build | mkdir build | ||
make DESTDIR="$PWD/build" install | make DESTDIR="$PWD/build" install | ||
Line 32: | Line 32: | ||
makepkg ../vifm-dev.txz | makepkg ../vifm-dev.txz | ||
installpkg ../vifm-dev.txz | installpkg ../vifm-dev.txz | ||
− | </ | + | </syntaxhighlight> |
== GNU/Linux == | == GNU/Linux == | ||
Line 89: | Line 89: | ||
Building MXE toolchains: | Building MXE toolchains: | ||
− | < | + | <syntaxhighlight lang="bash"> |
make MXE_TARGETS='i686-w64-mingw32.static x86_64-w64-mingw32.static' binutils gcc libgnurx pdcurses pthreads | make MXE_TARGETS='i686-w64-mingw32.static x86_64-w64-mingw32.static' binutils gcc libgnurx pdcurses pthreads | ||
− | </ | + | </syntaxhighlight> |
<code>dos2unix</code> tool is also needed. | <code>dos2unix</code> tool is also needed. | ||
Line 100: | Line 100: | ||
To build Vifm, export <code>$CROSS</code> environment variable like this: | To build Vifm, export <code>$CROSS</code> environment variable like this: | ||
− | < | + | <syntaxhighlight lang="bash"> |
export CROSS=$HOME/repos/mxe/usr/bin/i686-w64-mingw32.static- | export CROSS=$HOME/repos/mxe/usr/bin/i686-w64-mingw32.static- | ||
− | </ | + | </syntaxhighlight> |
Then run the following command from root of Vifm's source tree: | Then run the following command from root of Vifm's source tree: | ||
− | < | + | <syntaxhighlight lang="bash"> |
make -C src/ -f Makefile.win | make -C src/ -f Makefile.win | ||
− | </ | + | </syntaxhighlight> |
==== Building x86_64 version ==== | ==== Building x86_64 version ==== | ||
Line 114: | Line 114: | ||
To build Vifm, export <code>$CROSS</code> environment variable like this: | To build Vifm, export <code>$CROSS</code> environment variable like this: | ||
− | < | + | <syntaxhighlight lang="bash"> |
export CROSS=$HOME/repos/mxe/usr/bin/x86_64-w64-mingw32.static- | export CROSS=$HOME/repos/mxe/usr/bin/x86_64-w64-mingw32.static- | ||
− | </ | + | </syntaxhighlight> |
Then run the following command from root of Vifm's source tree: | Then run the following command from root of Vifm's source tree: | ||
− | < | + | <syntaxhighlight lang="bash"> |
make -C src/ -f Makefile.win | make -C src/ -f Makefile.win | ||
− | </ | + | </syntaxhighlight> |
==== Cross-compiling with ccache ==== | ==== Cross-compiling with ccache ==== | ||
Line 127: | Line 127: | ||
Override <code>CC</code> like this: | Override <code>CC</code> like this: | ||
− | < | + | <syntaxhighlight lang="bash"> |
make -C src/ -f Makefile.win CC="ccache ${CROSS}gcc" | make -C src/ -f Makefile.win CC="ccache ${CROSS}gcc" | ||
− | </ | + | </syntaxhighlight> |
=== Using MinGW === | === Using MinGW === | ||
Line 141: | Line 141: | ||
Needs to be altered with patches from <code>patches/pdcurses*/</code> directory | Needs to be altered with patches from <code>patches/pdcurses*/</code> directory | ||
of Vifm's source tree and rebuilt as shared library like this: | of Vifm's source tree and rebuilt as shared library like this: | ||
− | < | + | <syntaxhighlight lang="bash"> |
# from root level of pdcurses after applying patches | # from root level of pdcurses after applying patches | ||
make -C win32/ -f gccwin32.mak DLL=Y WIDE=Y UTF8=Y | make -C win32/ -f gccwin32.mak DLL=Y WIDE=Y UTF8=Y | ||
− | </ | + | </syntaxhighlight> |
==== GNU regex library ==== | ==== GNU regex library ==== | ||
Line 167: | Line 167: | ||
From <code>src/</code> directory run: | From <code>src/</code> directory run: | ||
− | < | + | <syntaxhighlight lang="bash"> |
make -f Makefile.win | make -f Makefile.win | ||
− | </ | + | </syntaxhighlight> |
==== Download Package ==== | ==== Download Package ==== |
Latest revision as of 11:22, 2 November 2021
*nix like[edit]
From sources[edit]
Building from sources shouldn't cause any troubles.
Prerequisites:
- Development version (the one that includes header files) of curses library (most likely ncurses) built with enabled wide-character support (should be available on most systems). On Debian-based systems the package you need is called
libncursesw5-dev
.
The standard set of commands should work just fine:
scripts/fix-timestamps # run this if the file exists, avoids issues with autotools (they don't even need to be installed then)
./configure --sysconfdir=/etc
make
make install
By default Vifm will be installed under /usr/local
, if you want to have it in /usr
(e.g., you want to reuse data files installed by system's package manager), also specify --prefix
parameter to get:
./configure --sysconfdir=/etc --prefix=/usr
If you know how to make a package for your distribution, it's recommended to
make one and install it rather than running make install
. E.g. on
Slackware Linux one could do:
mkdir build
make DESTDIR="$PWD/build" install
su
cd build
makepkg ../vifm-dev.txz
installpkg ../vifm-dev.txz
GNU/Linux[edit]
Using package managers[edit]
See Downloads page for a list (probably incomplete) of Vifm packages in various operating systems.
Note that there is no guarantee that packages are up to date. To use the latest version of Vifm refer to section on building Vifm from sources.
Windows[edit]
Cygwin[edit]
There are no prebuild Cygwin packages for Vifm, so one needs to build it from sources.
The following packages are required:
make
;gcc-core
(it has a lot of dependencies, some of which are required for build);ncurses-devel
.
The process is basically the same as building on *nix like operating system from sources .
configure
script takes care of most of details and normally no additional steps are needed.
Development builds[edit]
32-bit and 64-bit vifm.exe
executables built on master
branch can be downloaded here. Note that this is
work in progress, so it might contain newly introduced and not yet resolved
bugs (please report them), but it's expected to be quite safe for general
use.
Using MXE (on GNU/Linux)[edit]
MXE (M cross environment) is a great tool to cross compile Windows applications on GNU/Linux, which is actually much easier than building them on Windows.
Additional patches for pdcurses
from
patches/pdcurses*/
directory of Vifm's source tree
should be copied to src/
directory of MXE.
The instructions below are valid for commit
885a03134121f7564bd49313a70e3d372a546192
of MXE made on Sat Jul 11 14:26:30 2020 +1000
.
Required MXE packages:
- binutils
- gcc
- libgnurx
- pdcurses
- pthreads
Building MXE toolchains:
make MXE_TARGETS='i686-w64-mingw32.static x86_64-w64-mingw32.static' binutils gcc libgnurx pdcurses pthreads
dos2unix
tool is also needed.
Building x86 version[edit]
MXE target name: i686-w64-mingw32.static
.
To build Vifm, export $CROSS
environment variable like this:
export CROSS=$HOME/repos/mxe/usr/bin/i686-w64-mingw32.static-
Then run the following command from root of Vifm's source tree:
make -C src/ -f Makefile.win
Building x86_64 version[edit]
MXE target name: x86_64-w64-mingw32.static
.
To build Vifm, export $CROSS
environment variable like this:
export CROSS=$HOME/repos/mxe/usr/bin/x86_64-w64-mingw32.static-
Then run the following command from root of Vifm's source tree:
make -C src/ -f Makefile.win
Cross-compiling with ccache[edit]
Override CC
like this:
make -C src/ -f Makefile.win CC="ccache ${CROSS}gcc"
Using MinGW[edit]
One can get MinGW on their site (this is 32-bit version, go up for 64-bit one).
dos2unix
tool is needed, which is probably already available in the package.
PDCurses[edit]
Needs to be altered with patches from patches/pdcurses*/
directory
of Vifm's source tree and rebuilt as shared library like this:
# from root level of pdcurses after applying patches
make -C win32/ -f gccwin32.mak DLL=Y WIDE=Y UTF8=Y
GNU regex library[edit]
Binary as well as development files for this library is required. It can be downloaded from SourceForge of MinGW.
Pthreads library[edit]
Note: newest MinGW seems to come with their own version of Pthreads, so one might not need this step.
Development files should be downloaded from their site
and installed to appropriate directories (include/
and lib/
) of MinGW.
Groff binary[edit]
This one is required for converting manual pages to plain text format and can be omitted. Package can be found at the official site.
Building[edit]
From src/
directory run:
make -f Makefile.win
Download Package[edit]
If you are using a MINGW version compatible with the latest MSYS2 version (for example the MINGW version used for Git Bash), you can download the Vifm binary package from the official Package Repository.
After you download the package, you'll need to uncompress the package and move the files to the correct folders. For example, in the case of the MINGW version used for Git Bash, you'll need to move the files to the /usr folder.
OS X[edit]
Using HomeBrew[edit]
If you have it installed, installing Vifm is rather easy:
brew install vifm
Using MacPorts[edit]
Installing Vifm is very simple as with any other package manager:
sudo port install vifm