Merge branch 'elfmz:master' into iterm2
[far2l.git] / README.md
blobfdba3796a1f9caac8f03dda245c4b4639f03db69
1 [![Cirrus Build Status](https://api.cirrus-ci.com/github/elfmz/far2l.svg)](https://cirrus-ci.com/github/elfmz/far2l) [![Coverage Status](https://codecov.io/gh/elfmz/far2l/coverage.svg?branch=master)](https://codecov.io/gh/elfmz/far2l?branch=master) [![Coverity Scan](https://scan.coverity.com/projects/27038/badge.svg)](https://scan.coverity.com/projects/elfmz-far2l) [![Language Grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/elfmz/far2l.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/elfmz/far2l/context:cpp) [![Packages](https://repology.org/badge/tiny-repos/far2l.svg)](https://repology.org/project/far2l)
3 # far2l [![tag](https://img.shields.io/github/tag/elfmz/far2l.svg)](https://github.com/elfmz/far2l/tags)
4 Linux fork of FAR Manager v2 (http://farmanager.com/)   
5 Works also on OSX/MacOS and BSD (but latter not tested on regular manner)   
6 BETA VERSION.   
7 **Use on your own risk!**
9 Plug-ins that are currently working: NetRocks (SFTP/SCP/FTP/FTPS/SMB/NFS/WebDAV), colorer, multiarc, tmppanel, align, autowrap, drawline, editcase, SimpleIndent, Calculator, Python (optional scripting support)
11 FreeBSD/MacOS (Cirrus CI): [![Cirrus](https://api.cirrus-ci.com/github/elfmz/far2l.svg)](https://cirrus-ci.com/github/elfmz/far2l)
14 #### License: GNU/GPLv2
16 ### Used code from projects
18 * FAR for Windows and some of its plugins
19 * WINE
20 * ANSICON
21 * Portable UnRAR
22 * 7z ANSI-C Decoder
23 * utf-cpp by ww898
25 ## Contributing, Hacking
26 #### Required dependencies
28 * gawk
29 * m4
30 * libwxgtk3.0-gtk3-dev (in new distributives - libwxgtk3.2-dev, in old distributives - libwxgtk3.0-dev)  (needed for GUI backend, not needed with -DUSEWX=no)
31 * libx11-dev (optional - needed for X11 extension that provides better UX for TTY backend wherever X11 is available)
32 * libxi-dev (optional - needed for X11/Xi extension that provides best UX for TTY backend wherever X11 Xi extension is available)
33 * libxerces-c-dev
34 * libspdlog-dev
35 * libuchardet-dev
36 * libssh-dev (needed for NetRocks/SFTP)
37 * libssl-dev (needed for NetRocks/FTPS)
38 * libsmbclient-dev (needed for NetRocks/SMB)
39 * libnfs-dev (needed for NetRocks/NFS)
40 * libneon27-dev (or later, needed for NetRocks/WebDAV)
41 * libarchive-dev (needed for better archives support in multiarc)
42 * libunrar-dev (optionally needed for RAR archives support in multiarc - see UNRAR command line option)
43 * libpcre3-dev (or in older distributives - libpcre2-dev) (needed for custom archives support in multiarc)
44 * cmake ( >= 3.2.2 )
45 * g++
46 * git (needed for downloading source code)
48 #### Or simply on Debian/Ubuntu:
49 ``` sh
50 apt-get install gawk m4 libwxgtk3.0-gtk3-dev libx11-dev libxi-dev libpcre3-dev libxerces-c-dev libspdlog-dev libuchardet-dev libssh-dev libssl-dev libsmbclient-dev libnfs-dev libneon27-dev libarchive-dev cmake g++ git
51 ```
53 On Debian unstable/sid:
55 `apt-get install far2l`
57 A simple sid back port should be as easy as (build your own binary deb from the official source deb package):
59 ```
60 # you will find the latest dsc link at http://packages.debian.org/sid/far2l
61 dget http://deb.debian.org/debian/pool/main/f/far2l/far2l_2.5.0~beta+git20230223+ds-2.dsc
62 dpkg-source -x *.dsc
63 cd far2l-*/
64 debuild
65 # cd .. and install your self built far2l*.deb
66 ```
68 In older distributives: use libpcre2-dev and libwxgtk3.0-dev instead of libpcre3-dev and libwxgtk3.0-gtk3-dev
70 #### Clone and Build
71  * Clone current master `git clone https://github.com/elfmz/far2l`
72  * Checkout some stable release tag (master considered unstable): `git checkout v_2.#.#`
73  * Prepare build directory:
74 ``` sh
75 mkdir -p far2l/_build
76 cd far2l/_build
77 ```
79  * Build:
80 _with make:_
81 ``` sh
82 cmake -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release ..
83 cmake --build . -j$(nproc --all)
84 ``` 
85 _or with ninja (you need **ninja-build** package installed)_
86 ``` sh
87 cmake -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release -G Ninja ..
88 cmake --build .
89 ```
91  * If above commands finished without errors - you may also install far2l, `sudo cmake --install .`
93  * Also its possible to create far2l_2.X.X_ARCH.deb or ...tar.gz packages in `_build` directory by running `cmake --build . --target package` command.
95 ##### Additional build configuration options:
97 To build without WX backend (console version only): change `-DUSEWX=yes` to `-DUSEWX=no` also in this case dont need to install libwxgtk\*-dev package
99 To force-disable TTY|X and TTY|Xi backends: add argument `-DTTYX=no`; to disable only TTY|Xi - add argument `-DTTYXI=no`
101 To eliminate libuchardet requirement to reduce far2l dependencies by cost of losing automatic charset detection functionality: add -DUSEUCD=no
103 To build with Python plugin: add argument `-DPYTHON=yes`
105 To control how RAR archives will be handled in multiarc:
106  `-DUNRAR=bundled` (default) use bundled sources found in multiarc/src/formats/rar/unrar
107  `-DUNRAR=lib` use libunrar and unrar utility, also build requires libunrar-dev to be installed
108  `-DUNRAR=NO` dont use special unrar code, rar archives will be handled by libarchive unless its also disabled
110 There're also options to toggle other plugins build in same way: ALIGN AUTOWRAP CALC COLORER COMPARE DRAWLINE EDITCASE EDITORCOMP FARFTP FILECASE INCSRCH INSIDE MULTIARC NETROCKS SIMPLEINDENT TMPPANEL
112 #### OSX/MacOS install
114  * You can install prebuilt package for x86_64 platform via Homebrew Cask, by command:
115  ```sh
116  brew install --cask far2l
117  ```
118  * You can also manually download and install prebuilt package for x86_64 platform from Releases page: <https://github.com/elfmz/far2l/releases>
119  * But if you need custom/recent build, you can proceed to build steps below: using brew or MacPorts.
120  * Supported compiler: `AppleClang 8.0.0.x` or newer. Check your version, and install/update Xcode if necessary.
121  ```sh
122  clang++ -v
123  ```
124  * If you want to build using Homebrew - first visit <https://brew.sh/> for installation instructions. Note that there're reported problems with Homebrew-based build under MacOS Big Sur.
125  * If you want to build using MacPorts - first visit <https://www.macports.org/install.php> for installation instructions.
127 ##### One line OSX/MacOS install latest far2l git master via unofficial brew tap
129  * With GUI/TTY backends:
130 ```sh
131 brew install --HEAD yurikoles/yurikoles/far2l
133  * With TTY backend only:
134 ```sh
135 brew install --HEAD yurikoles/yurikoles/far2l --without-wxwidgets
137  * Additionally you can enable python support by adding `--with-python@3.10` to the one of two above commands.
139 ##### Full OSX/MacOS build from sources (harder):
140 Some issues can be caused by conflicting dependencies, like having two versions of wxWidgets, so avoid such situation when installing dependecies.
142  * Clone:
143 ```sh
144 git clone https://github.com/elfmz/far2l
145 cd far2l
147  * Install needed dependencies with MacPorts:
148 ``` sh
149 sudo port install cmake gawk pkgconfig wxWidgets-3.2 libssh openssl xercesc3 libfmt spdlog uchardet neon
151  * OR if you prefer to use brew packages, then:
152 ```sh
153 brew bundle -v
155  * After dependencies installed - you can build far2l:
156 _with make:_
157 ```sh
158 mkdir _build
159 cd _build
160 cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release ..
161 cmake --build . -j$(sysctl -n hw.logicalcpu)
162 ``` 
163 _or with ninja:_
164 ```sh
165 mkdir _build
166 cd _build
167 cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DUSEWX=yes -DCMAKE_BUILD_TYPE=Release -G Ninja ..
168 cmake --build .
170  * Then you may create .dmg package by running: `cpack` command.
171 Note that this step sometimes fails and may succeed from not very first attempt.
172 Its recommended not to do anything on machine while cpack is in progress.
173 After .dmg successfully created, you may install it by running `open ...path/to/created/far2l-*.dmg`
175 #### Building on Gentoo (and derivatives)
176 For absolute minimum you need:
178 emerge -avn dev-libs/xerces-c app-i18n/uchardet dev-util/cmake dev-libs/spdlog
180 If you want to build far2l with wxGTK support also install it:
182 emerge -avn x11-libs/wxGTK
184 Additionally, for NetRocks you will need:
186 emerge -avn net-libs/neon net-libs/libssh net-fs/libnfs net-fs/samba
188 After installing, follow Clone and Build section above.
190 #### Installing and Building on [NixOS](https://nixos.org/)
192 To install system-wide, add the `far2l` package to your [`configuration.nix`](https://nixos.org/manual/nixos/stable/index.html#sec-changing-config) `environment.systemPackages` list. To run the application on-demand without affecting the system state, execute `nix-shell -p far2l --command far2l`. These use a package version from your current [channel](https://nixos.wiki/wiki/Nix_channels).
194 The Far2l adaptation for _nix_ is [a small file on GitHub](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/far2l/default.nix), it tells which Git revision from Far2l repo to fetch, with what dependencies to build it, and how to patch its references to other software to make it run in isolated fashion independently from other versions available in the system.
196 You can build and run `far2l` package for any revision:
197 * Directly from GitHub (`NixOS/nixpkgs` repo, or your own fork and branch):
198  ``` sh
199 nix-shell -I nixpkgs=https://github.com/<fork>/nixpkgs/archive/<revision-or-branch>.tar.gz -p far2l --command far2l
200  ```
201 * From a locally cloned working directory of the repo:
202 ``` sh
203 nix-shell -I nixpkgs=/path/to/nixpkgs -p far2l --command far2l
206 To advance the package to a new Far2l revision, edit the `fetchFromGitHub` set attributes `rev` (revision hash) and `sha256` (revision content hash). **Important!** If you leave the old content hash, the old cached content for that hash might be used without attempting to download the new revision. If you're not expecting the build to break, the easiest would be to make a fork, push the change, and build straight from github. 
208 #### IDE Setup
209 You can import the project into your favourite IDE like QtCreator, CodeLite, or any other, which supports cmake or which cmake is able to generate projects for.
211  * **QtCreator**: select "Open Project" and point QtCreator to the CMakeLists.txt in far2l root directory
212  * **CLion**: the same as **QtCreator**.
213  * **CodeLite**: use this guide to setup a project: https://wiki.codelite.org/pmwiki.php/Main/TheCMakePlugin (to avoid polluting your source tree, don't create your workspace inside of the far2l directory)
215 ### Useful 3rd-party extras
217  * A collection of macros for far2l: https://github.com/corporateshark/far2l-macros
218  * Fork of Putty (Windows SSH client) with added far2l TTY extensions support (fluent keypresses, clipboard sharing etc): https://github.com/unxed/putty4far2l
219  * Kitty (another fork of Putty) also have far2l TTY extensions support: https://github.com/cyd01/KiTTY
220  * putty-nd, one more putty fork with extensions support: https://sourceforge.net/p/putty-nd/
221  * Turbo Vision, TUI framework supporting far2l terminal extensions: https://github.com/magiblot/tvision
222  * turbo, text editor supporting far2l terminal extensions: https://github.com/magiblot/turbo
223  * Tool to import color schemes from windows FAR manager 2 .reg format: https://github.com/unxed/far2l-deb/blob/master/far2l_import.pl
225 ## Notes on porting and FAR Plugin API changes
226  * See HACKING.md
228 ## Known issues:
229 * Only valid translations are English, Russian, Ukrainian and Belarussian (interface only), all other languages require deep correction.