Difference between revisions of "Obtaining Vifm"
(→Building x86 version: Add MXE target name) |
(→Windows: Add * to patches/pdcurses*/ as there are subdirectories now) |
||
(19 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | == *nix like == | |
− | + | === From sources === | |
Building from sources shouldn't cause any troubles. | Building from sources shouldn't cause any troubles. | ||
Line 7: | Line 7: | ||
Prerequisites: | Prerequisites: | ||
− | * '''development''' version (the one that includes header files) of [https://en.wikipedia.org/wiki/Curses_(programming_library) curses library] (most likely [https://en.wikipedia.org/wiki/Ncurses ncurses]) built | + | * '''development''' version (the one that includes header files) of [https://en.wikipedia.org/wiki/Curses_(programming_library) curses library] (most likely [https://en.wikipedia.org/wiki/Ncurses ncurses]) built with enabled wide-character support (should be available on most systems). On Debian-based systems package you need is called <code>libncursesw5-dev</code>. |
− | The standard set of | + | The standard set of commands should work just fine: |
<source lang="bash"> | <source lang="bash"> | ||
− | ./configure | + | ./configure --sysconfdir=/etc |
make | make | ||
make install | make install | ||
</source> | </source> | ||
− | By default Vifm will be installed under | + | By default Vifm will be installed under <code>/usr/local</code>, if you want to have it in <code>/usr</code>, also specify <code>--prefix</code> parameter to get: |
<source lang="bash"> | <source lang="bash"> | ||
− | ./configure --prefix=/usr | + | ./configure --sysconfdir=/etc --prefix=/usr |
</source> | </source> | ||
− | If you know how to make a package | + | 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: | ||
Line 33: | Line 33: | ||
</source> | </source> | ||
− | + | == GNU/Linux == | |
− | + | === Using package managers === | |
See [http://vifm.info/downloads.shtml Downloads page] for a list (probably | See [http://vifm.info/downloads.shtml Downloads page] for a list (probably | ||
Line 43: | Line 43: | ||
version of Vifm refer to [[#From_sources | section on building Vifm from sources]]. | version of Vifm refer to [[#From_sources | section on building Vifm from sources]]. | ||
− | + | == Windows == | |
− | + | === Cygwin === | |
There are no prebuild Cygwin packages for Vifm, so one needs to build it from sources. | There are no prebuild Cygwin packages for Vifm, so one needs to build it from sources. | ||
+ | |||
+ | The following packages are required: | ||
+ | * <code>make</code>; | ||
+ | * <code>gcc-core</code> (it has a lot of dependencies, some of which are required for build); | ||
+ | * <code>ncurses-devel</code>. | ||
The process is basically the same as building on *nix like operating system [[ #From_sources | from sources ]]. | The process is basically the same as building on *nix like operating system [[ #From_sources | from sources ]]. | ||
<code>configure</code> script takes care of most of details and normally no additional steps are needed. | <code>configure</code> script takes care of most of details and normally no additional steps are needed. | ||
− | ==== Using [http://mxe.cc/ MXE] (on GNU/Linux) | + | === Development builds === |
+ | |||
+ | 32-bit and 64-bit <code>vifm.exe</code> executables built on <code>master</code> | ||
+ | branch can be downloaded [http://builds.vifm.info/ 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 [http://mxe.cc/ MXE] (on GNU/Linux) === | ||
MXE (M cross environment) is a great tool to cross compile Windows | MXE (M cross environment) is a great tool to cross compile Windows | ||
Line 59: | Line 72: | ||
Additional patches for <code>pdcurses</code> from | Additional patches for <code>pdcurses</code> from | ||
− | <code>patches/pdcurses/</code> directory of Vifm's source tree | + | <code>patches/pdcurses*/</code> directory of Vifm's source tree |
should be copied to <code>src/</code> directory of MXE. | should be copied to <code>src/</code> directory of MXE. | ||
− | |||
− | |||
− | |||
− | |||
Required MXE packages: | Required MXE packages: | ||
Line 75: | Line 84: | ||
* pthreads | * pthreads | ||
* w32api | * w32api | ||
− | |||
− | + | Building MXE toolchains: | |
+ | |||
+ | <source lang="bash"> | ||
+ | make MXE_TARGETS='i686-w64-mingw32.static x86_64-w64-mingw32.static' binutils gcc libgnurx mingwrt pdcurses pthreads w32api | ||
+ | </source> | ||
+ | |||
+ | <code>dos2unix</code> tool is also needed. | ||
+ | |||
+ | ==== Building x86 version ==== | ||
+ | |||
+ | MXE target name: <code>i686-w64-mingw32.static</code>. | ||
To build Vifm, export <code>$CROSS</code> environment variable like this: | To build Vifm, export <code>$CROSS</code> environment variable like this: | ||
<source lang="bash"> | <source lang="bash"> | ||
− | export CROSS=$HOME/repos/mxe/usr/bin/i686- | + | export CROSS=$HOME/repos/mxe/usr/bin/i686-w64-mingw32.static- |
</source> | </source> | ||
Line 89: | Line 107: | ||
</source> | </source> | ||
− | + | ==== Building x86_64 version ==== | |
− | MXE target name: <code>x86_64-w64-mingw32 | + | MXE target name: <code>x86_64-w64-mingw32.static</code>. |
− | |||
− | |||
− | |||
− | |||
To build Vifm, export <code>$CROSS</code> environment variable like this: | To build Vifm, export <code>$CROSS</code> environment variable like this: | ||
<source lang="bash"> | <source lang="bash"> | ||
− | export CROSS=$HOME/repos/mxe/usr/bin/x86_64-w64-mingw32- | + | export CROSS=$HOME/repos/mxe/usr/bin/x86_64-w64-mingw32.static- |
</source> | </source> | ||
Line 107: | Line 121: | ||
</source> | </source> | ||
− | ==== Using MinGW ==== | + | ==== Cross-compiling with ccache ==== |
+ | |||
+ | Override <code>CC</code> like this: | ||
+ | |||
+ | <source lang="bash"> | ||
+ | make -C src/ -f Makefile.win CC="ccache ${CROSS}gcc" | ||
+ | </source> | ||
+ | |||
+ | === Using MinGW === | ||
+ | |||
+ | One can get MinGW on [https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/ their site] (this is 32-bit version, go up for 64-bit one). | ||
+ | |||
+ | <code>dos2unix</code> tool is needed, which is probably already available in the package. | ||
+ | |||
+ | ==== PDCurses ==== | ||
+ | |||
+ | Needs to be altered with patches from <code>patches/pdcurses*/</code> directory | ||
+ | of Vifm's source tree and rebuilt as shared library like this: | ||
+ | <source lang="bash"> | ||
+ | # from root level of pdcurses after applying patches | ||
+ | make -C win32/ -f gccwin32.mak DLL=Y WIDE=Y | ||
+ | </source> | ||
+ | |||
+ | ==== GNU regex library ==== | ||
+ | |||
+ | Binary as well as development files for this library is required. It can be downloaded from | ||
+ | [https://sourceforge.net/projects/mingw/files/Other/UserContributed/regex/ SourceForge of MinGW]. | ||
+ | |||
+ | ==== Pthreads library ==== | ||
+ | |||
+ | ''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 [http://sourceware.org/pthreads-win32/#download their site] | ||
+ | and installed to appropriate directories (<code>include/</code> and <code>lib/</code>) of MinGW. | ||
+ | |||
+ | ==== Groff binary ==== | ||
+ | |||
+ | This one is required for converting manual pages to plain text format and can be omitted. | ||
+ | Package can be found at the [http://gnuwin32.sourceforge.net/packages/groff.htm official site]. | ||
+ | |||
+ | ==== Building ==== | ||
+ | |||
+ | From <code>src/</code> directory run: | ||
+ | |||
+ | <source lang="bash"> | ||
+ | make -f Makefile.win | ||
+ | </source> | ||
+ | |||
+ | == OS X == | ||
− | + | === Using [http://brew.sh/ HomeBrew] === | |
− | + | If you have it installed, installing Vifm is rather easy: | |
− | + | <pre> | |
+ | brew install vifm | ||
+ | </pre> | ||
− | + | === Using [http://www.macports.org/ MacPorts] === | |
− | + | Installing Vifm is very simple as with any other package manager: | |
− | + | <pre> | |
+ | sudo port install vifm | ||
+ | </pre> |
Revision as of 17:20, 25 May 2019
*nix like
From sources
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 package you need is called
libncursesw5-dev
.
The standard set of commands should work just fine:
./configure --sysconfdir=/etc
make
make install
By default Vifm will be installed under /usr/local
, if you want to have it in /usr
, 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
Using package managers
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
Cygwin
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
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)
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.
Required MXE packages:
- binutils
- gcc
- libgnurx
- mingwrt
- pdcurses
- pthreads
- w32api
Building MXE toolchains:
make MXE_TARGETS='i686-w64-mingw32.static x86_64-w64-mingw32.static' binutils gcc libgnurx mingwrt pdcurses pthreads w32api
dos2unix
tool is also needed.
Building x86 version
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
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
Override CC
like this:
make -C src/ -f Makefile.win CC="ccache ${CROSS}gcc"
Using MinGW
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
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
GNU regex library
Binary as well as development files for this library is required. It can be downloaded from SourceForge of MinGW.
Pthreads library
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
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
From src/
directory run:
make -f Makefile.win
OS X
Using HomeBrew
If you have it installed, installing Vifm is rather easy:
brew install vifm
Using MacPorts
Installing Vifm is very simple as with any other package manager:
sudo port install vifm