fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib, stdenv, fetchFromGitHub, makeWrapper, cmake, ninja, pkg-config, m4, bash
2, xdg-utils, zip, unzip, gzip, bzip2, gnutar, p7zip, xz
3, IOKit, Carbon, Cocoa, AudioToolbox, OpenGL
4, withTTYX ? true, libX11
5, withGUI ? true, wxGTK32
6, withUCD ? true, libuchardet
7
8# Plugins
9, withColorer ? true, spdlog, xercesc
10, withMultiArc ? true, libarchive, pcre
11, withNetRocks ? true, openssl, libssh, samba, libnfs, neon
12, withPython ? false, python3Packages
13}:
14
15stdenv.mkDerivation rec {
16 pname = "far2l";
17 version = "2.4.1";
18
19 src = fetchFromGitHub {
20 owner = "elfmz";
21 repo = "far2l";
22 rev = "v_${version}";
23 sha256 = "sha256-0t1ND6LmDcivfrZ8RaEr1vjeS5JtaeWkoHkl2e7Xr5s=";
24 };
25
26 patches = [ ./python_prebuild.patch ];
27
28 nativeBuildInputs = [ cmake ninja pkg-config m4 makeWrapper ];
29
30 buildInputs = lib.optional withTTYX libX11
31 ++ lib.optional withGUI wxGTK32
32 ++ lib.optional withUCD libuchardet
33 ++ lib.optionals withColorer [ spdlog xercesc ]
34 ++ lib.optionals withMultiArc [ libarchive pcre ]
35 ++ lib.optionals withNetRocks [ openssl libssh libnfs neon ]
36 ++ lib.optional (withNetRocks && !stdenv.isDarwin) samba # broken on darwin
37 ++ lib.optionals withPython (with python3Packages; [ python cffi debugpy pcpp ])
38 ++ lib.optionals stdenv.isDarwin [ IOKit Carbon Cocoa AudioToolbox OpenGL ];
39
40 postPatch = ''
41 patchShebangs python/src/prebuild.sh
42 substituteInPlace far2l/src/vt/vtcompletor.cpp \
43 --replace '"/bin/bash"' '"${bash}/bin/bash"'
44 substituteInPlace far2l/src/cfg/config.cpp \
45 --replace '"/bin/bash"' '"${bash}/bin/bash"'
46 '' + lib.optionalString stdenv.isDarwin ''
47 substituteInPlace WinPort/src/Backend/WX/CMakeLists.txt \
48 --replace "-framework System" -lSystem
49 '';
50
51 cmakeFlags = lib.mapAttrsToList (k: v: "-D${k}=${if v then "yes" else "no"}") {
52 TTYX = withTTYX;
53 USEWX = withGUI;
54 USEUCD = withUCD;
55 COLORER = withColorer;
56 MULTIARC = withMultiArc;
57 NETROCKS = withNetRocks;
58 PYTHON = withPython;
59 };
60
61 runtimeDeps = [ unzip zip p7zip xz gzip bzip2 gnutar ];
62
63 postInstall = ''
64 wrapProgram $out/bin/far2l \
65 --argv0 $out/bin/far2l \
66 --prefix PATH : ${lib.makeBinPath runtimeDeps} \
67 --suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
68 '';
69
70 meta = with lib; {
71 description = "Linux port of FAR Manager v2, a program for managing files and archives in Windows operating systems";
72 homepage = "https://github.com/elfmz/far2l";
73 license = licenses.gpl2Only;
74 maintainers = with maintainers; [ hypersw ];
75 platforms = platforms.unix;
76 };
77}