1 { lib, stdenv, fetchFromGitHub, makeWrapper, cmake, ninja, pkg-config, m4, perl, bash
2 , xdg-utils, zip, unzip, gzip, bzip2, gnutar, p7zip, xz
3 , IOKit, Carbon, Cocoa, AudioToolbox, OpenGL, System
4 , withTTYX ? true, libX11
5 , withGUI ? true, wxGTK32
6 , withUCD ? true, libuchardet
9 , withColorer ? true, spdlog, xercesc
10 , withMultiArc ? true, libarchive, pcre
11 , withNetRocks ? true, openssl, libssh, samba, libnfs, neon
12 , withPython ? false, python3Packages
15 stdenv.mkDerivation rec {
19 src = fetchFromGitHub {
23 sha256 = "sha256-iWZQpLe+shdepCVOHZDp7QEQoqelbHGRJh09KWb6aD0=";
26 nativeBuildInputs = [ cmake ninja pkg-config m4 perl makeWrapper ];
28 buildInputs = lib.optional withTTYX libX11
29 ++ lib.optional withGUI wxGTK32
30 ++ lib.optional withUCD libuchardet
31 ++ lib.optionals withColorer [ spdlog xercesc ]
32 ++ lib.optionals withMultiArc [ libarchive pcre ]
33 ++ lib.optionals withNetRocks [ openssl libssh libnfs neon ]
34 ++ lib.optional (withNetRocks && !stdenv.hostPlatform.isDarwin) samba # broken on darwin
35 ++ lib.optionals withPython (with python3Packages; [ python cffi debugpy pcpp ])
36 ++ lib.optionals stdenv.hostPlatform.isDarwin [ IOKit Carbon Cocoa AudioToolbox OpenGL System ];
39 patchShebangs python/src/prebuild.sh
40 patchShebangs far2l/bootstrap/view.sh
44 (lib.cmakeBool "TTYX" withTTYX)
45 (lib.cmakeBool "USEWX" withGUI)
46 (lib.cmakeBool "USEUCD" withUCD)
47 (lib.cmakeBool "COLORER" withColorer)
48 (lib.cmakeBool "MULTIARC" withMultiArc)
49 (lib.cmakeBool "NETROCKS" withNetRocks)
50 (lib.cmakeBool "PYTHON" withPython)
51 ] ++ lib.optionals withPython [
52 (lib.cmakeFeature "VIRTUAL_PYTHON" "python")
53 (lib.cmakeFeature "VIRTUAL_PYTHON_VERSION" "python")
56 runtimeDeps = [ unzip zip p7zip xz gzip bzip2 gnutar ];
59 wrapProgram $out/bin/far2l \
60 --argv0 $out/bin/far2l \
61 --prefix PATH : ${lib.makeBinPath runtimeDeps} \
62 --suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
66 description = "Linux port of FAR Manager v2, a program for managing files and archives in Windows operating systems";
67 homepage = "https://github.com/elfmz/far2l";
68 license = licenses.gpl2Only;
69 maintainers = with maintainers; [ hypersw ];
70 platforms = platforms.unix;