Skip to content

movsw/far2l

 
 

Repository files navigation

far2l

Linux port of FAR v2 (http://farmanager.com/) ALPHA VERSION. Currently interesting only for entusiasts!!!

Currently working plugins: colorer, multiarc, farftp, tmppanel, align, autowrap, drawline, editcase, SimpleIndent

Travis

License: GNU/GPLv2

Used code from projects

  • FAR for Windows
  • Wine
  • ANSICON
  • Portable UnRAR
  • 7z ANSI-C Decoder

Contributing, Hacking

Required dependencies

  • gawk
  • m4
  • libglib2.0-dev
  • libwxgtk3.0-dev
  • cmake ( >= 3.2.2 )
  • g++

Or simply on Ubuntu:

apt-get install gawk m4 libglib2.0-dev libwxgtk3.0-dev cmake g++

Clone and Build

git clone https://github.com/elfmz/far2l
mkdir build
cd build

with make:

cmake -DCMAKE_BUILD_TYPE=Release ../far2l
make -j4

or with ninja (you need ninja-build package installed)

cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ../far2l
ninja -j4

macOS build

  • Supported compiler: AppleClang 8.0.0.x or newer. Check your version, and install/update XCode if necessary.
clang++ -v
  • Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install required packages:
brew install glib gawk cmake pkg-config wget
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0.tar.bz2
bunzip2 wxWidgets-3.1.0.tar.bz2
tar xvf wxWidgets-3.1.0.tar
cd wxWidgets-3.1.0
./configure --disable-shared --disable-debug CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=c++11" OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS=-stdlib=libc++ --enable-monolithic --enable-unicode
make -j4
make install
  • Download, generate makefiles and build far2l:
git clone https://github.com/elfmz/far2l
cd far2l
cmake -G "Unix Makefiles"
make -j4

IDE Setup

You can import the project into your favourite IDE like QtCreator, CodeLite or any other, which supports cmake or cmake is able to generate projects for

  • QtCreator: Select "Open Project" and point QtCreator to the CMakeLists.txt in far2l root directory
  • CodeLite: use this guide to setup a project: http://codelite.org/LiteEditor/WorkingWithCMake. Don't create workspace inside far2l directory, so you don't pollute your source tree.

Useful add-ons

Notes on porting

I implemented/borrowed from Wine some commonly used WinAPI functions. They are all declared in WinPort/WinPort.h and corresponding defines can be found in WinPort/WinCompat.h. Both included by WinPort/windows.h. Note that this stuff may not be 1-to-1 to corresponding Win32 functionality also doesn't provide full-UNIX functionality, but it simplifies porting and can be considered as temporary scaffold.

However only main executable linked statically to WinPort, it also exports WinPort functionality, so plugins use it without neccessity to bring own copy of its code. So plugin binary should not statically link to WinPort!

While FAR internally is UTF16, so WinPort contains UTF16- related stuff. However native Linux wchar_t size is 4 so potentially Linux FAR may be fully UTF32-capable in future, but while it uses Win32-style UTF16 functions - its not. However programmers must be aware on fact that wchar_t is not 2 bytes long anymore.

Inspect all printf format strings: unlike Windows in Linux both wide and multibyte printf-like functions has same multibyte and wide specifiers. That means %s is always multibyte, while %ls is always wide. So any %s used in wide-printf-s or %ws used in any printf should be replaces by %ls.

Update from 27aug: now its possible by defining WINPORT_DIRECT to avoid renaming used WIndows API and also to avoid changing format strings as swprintf will be intercepted by compatibility wrapper.

About

Linux port of FAR v2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 51.0%
  • C++ 43.8%
  • M4 4.0%
  • CMake 0.4%
  • Makefile 0.3%
  • CSS 0.1%
  • Other 0.4%