nixpkgs/pkgs/applications/misc/far2l/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
2.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, makeWrapper, cmake, ninja, pkg-config, m4, bash
, xdg-utils, zip, unzip, gzip, bzip2, gnutar, p7zip, xz
, IOKit, Carbon, Cocoa, AudioToolbox, OpenGL
, withTTYX ? true, libX11
2022-10-11 10:05:38 +03:00
, withGUI ? true, wxGTK32
, withUCD ? true, libuchardet
2017-03-21 05:52:35 +03:00
# Plugins
, withColorer ? true, spdlog, xercesc
, withMultiArc ? true, libarchive, pcre
, withNetRocks ? true, openssl, libssh, samba, libnfs, neon
, withPython ? false, python3Packages
}:
2017-03-21 05:52:35 +03:00
stdenv.mkDerivation rec {
2019-12-16 19:53:46 +03:00
pname = "far2l";
2022-10-11 10:05:38 +03:00
version = "2.4.1";
2017-03-21 05:52:35 +03:00
src = fetchFromGitHub {
owner = "elfmz";
repo = "far2l";
rev = "v_${version}";
2022-10-11 10:05:38 +03:00
sha256 = "sha256-0t1ND6LmDcivfrZ8RaEr1vjeS5JtaeWkoHkl2e7Xr5s=";
2017-03-21 05:52:35 +03:00
};
patches = [ ./python_prebuild.patch ];
nativeBuildInputs = [ cmake ninja pkg-config m4 makeWrapper ];
2017-03-21 05:52:35 +03:00
buildInputs = lib.optional withTTYX libX11
2022-10-11 10:05:38 +03:00
++ lib.optional withGUI wxGTK32
++ lib.optional withUCD libuchardet
++ lib.optionals withColorer [ spdlog xercesc ]
++ lib.optionals withMultiArc [ libarchive pcre ]
++ lib.optionals withNetRocks [ openssl libssh libnfs neon ]
++ lib.optional (withNetRocks && !stdenv.isDarwin) samba # broken on darwin
++ lib.optionals withPython (with python3Packages; [ python cffi debugpy pcpp ])
++ lib.optionals stdenv.isDarwin [ IOKit Carbon Cocoa AudioToolbox OpenGL ];
2017-03-21 05:52:35 +03:00
postPatch = ''
patchShebangs python/src/prebuild.sh
substituteInPlace far2l/src/vt/vtcompletor.cpp \
--replace '"/bin/bash"' '"${bash}/bin/bash"'
substituteInPlace far2l/src/cfg/config.cpp \
--replace '"/bin/bash"' '"${bash}/bin/bash"'
2021-01-15 08:42:41 +03:00
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace WinPort/src/Backend/WX/CMakeLists.txt \
2017-09-27 01:28:51 +03:00
--replace "-framework System" -lSystem
2017-03-21 05:52:35 +03:00
'';
cmakeFlags = lib.mapAttrsToList (k: v: "-D${k}=${if v then "yes" else "no"}") {
TTYX = withTTYX;
USEWX = withGUI;
USEUCD = withUCD;
COLORER = withColorer;
MULTIARC = withMultiArc;
NETROCKS = withNetRocks;
PYTHON = withPython;
};
2017-05-02 13:18:04 +03:00
runtimeDeps = [ unzip zip p7zip xz gzip bzip2 gnutar ];
2017-05-02 13:18:04 +03:00
postInstall = ''
wrapProgram $out/bin/far2l \
--argv0 $out/bin/far2l \
--prefix PATH : ${lib.makeBinPath runtimeDeps} \
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
2017-03-21 05:52:35 +03:00
'';
meta = with lib; {
description = "Linux port of FAR Manager v2, a program for managing files and archives in Windows operating systems";
homepage = "https://github.com/elfmz/far2l";
2022-10-11 10:05:38 +03:00
license = licenses.gpl2Only;
maintainers = with maintainers; [ hypersw ];
platforms = platforms.unix;
2017-03-21 05:52:35 +03:00
};
}