nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchpatch,
5 fetchFromGitHub,
6 makeWrapper,
7 cmake,
8 ninja,
9 pkg-config,
10 m4,
11 perl,
12 bash,
13 xdg-utils,
14 zip,
15 unzip,
16 gzip,
17 bzip2,
18 gnutar,
19 p7zip,
20 xz,
21 withTTYX ? true,
22 libX11,
23 withGUI ? true,
24 wxGTK32,
25 withUCD ? true,
26 libuchardet,
27
28 # Plugins
29 withColorer ? true,
30 spdlog,
31 libxml2,
32 withMultiArc ? true,
33 libarchive,
34 pcre,
35 withNetRocks ? true,
36 openssl,
37 libssh,
38 samba,
39 libnfs,
40 neon,
41 withPython ? false,
42 python3Packages,
43}:
44
45stdenv.mkDerivation rec {
46 pname = "far2l";
47 version = "2.6.5";
48
49 src = fetchFromGitHub {
50 owner = "elfmz";
51 repo = "far2l";
52 rev = "v_${version}";
53 sha256 = "sha256-a/k36O19z/lHnETOGIbTJ7BNAI5zOQxVUSp+nIM08i4=";
54 };
55
56 patches = [
57 (fetchpatch {
58 name = "cmake4-fix";
59 url = "https://github.com/elfmz/far2l/commit/97ac0a3a0f29110a330d8f8634775e024561e817.patch?full_index=1";
60 hash = "sha256-LlCKgFPxoRrb2nD+PARsJCpUXqMO0rLyNbuvLh949fU=";
61 })
62 ];
63
64 nativeBuildInputs = [
65 cmake
66 ninja
67 pkg-config
68 m4
69 perl
70 makeWrapper
71 ];
72
73 buildInputs =
74 lib.optional withTTYX libX11
75 ++ lib.optional withGUI wxGTK32
76 ++ lib.optional withUCD libuchardet
77 ++ lib.optionals withColorer [
78 spdlog
79 libxml2
80 ]
81 ++ lib.optionals withMultiArc [
82 libarchive
83 pcre
84 ]
85 ++ lib.optionals withNetRocks [
86 openssl
87 libssh
88 libnfs
89 neon
90 ]
91 ++ lib.optional (withNetRocks && !stdenv.hostPlatform.isDarwin) samba # broken on darwin
92 ++ lib.optionals withPython (
93 with python3Packages;
94 [
95 python
96 cffi
97 debugpy
98 pcpp
99 ]
100 );
101
102 postPatch = ''
103 patchShebangs python/src/prebuild.sh
104 patchShebangs far2l/bootstrap/view.sh
105 '';
106
107 cmakeFlags = [
108 (lib.cmakeBool "TTYX" withTTYX)
109 (lib.cmakeBool "USEWX" withGUI)
110 (lib.cmakeBool "USEUCD" withUCD)
111 (lib.cmakeBool "COLORER" withColorer)
112 (lib.cmakeBool "MULTIARC" withMultiArc)
113 (lib.cmakeBool "NETROCKS" withNetRocks)
114 (lib.cmakeBool "PYTHON" withPython)
115 ]
116 ++ lib.optionals withPython [
117 (lib.cmakeFeature "VIRTUAL_PYTHON" "python")
118 (lib.cmakeFeature "VIRTUAL_PYTHON_VERSION" "python")
119 ];
120
121 runtimeDeps = [
122 unzip
123 zip
124 p7zip
125 xz
126 gzip
127 bzip2
128 gnutar
129 ];
130
131 postInstall = ''
132 wrapProgram $out/bin/far2l \
133 --prefix PATH : ${lib.makeBinPath runtimeDeps} \
134 --suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
135 '';
136
137 meta = {
138 description = "Linux port of FAR Manager v2, a program for managing files and archives in Windows operating systems";
139 homepage = "https://github.com/elfmz/far2l";
140 license = lib.licenses.gpl2Only;
141 maintainers = with lib.maintainers; [ hypersw ];
142 platforms = lib.platforms.unix;
143 };
144}