2021-02-19 19:06:45 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, cmake, pkg-config, wxGTK30, glib, pcre, m4, bash
|
2021-02-13 14:23:35 +00:00
|
|
|
, xdg-utils, gvfs, zip, unzip, gzip, bzip2, gnutar, p7zip, xz, imagemagick
|
2021-12-06 16:07:01 +00:00
|
|
|
, libuchardet, spdlog, xercesc, openssl, libssh, samba, neon, libnfs, libarchive }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "far2l";
|
2021-02-13 14:23:35 +00:00
|
|
|
version = "2020-12-30.git${builtins.substring 0 7 src.rev}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "elfmz";
|
|
|
|
repo = "far2l";
|
2021-02-13 14:23:35 +00:00
|
|
|
rev = "52c1372441443aafd1a7dff6f17969a6ec19885d";
|
|
|
|
sha256 = "0s7427fgxzj5zkyy6mhb4y5hqa6adsr30m0bigycp12b0495ryx0";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config m4 makeWrapper imagemagick ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [ wxGTK30 glib pcre libuchardet spdlog xercesc ] # base requirements of the build
|
2021-02-13 14:23:35 +00:00
|
|
|
++ [ openssl libssh samba neon libnfs libarchive ]; # optional feature packages, like protocol support for Network panel, or archive formats
|
|
|
|
#++ lib.optional stdenv.isDarwin Cocoa # Mac support -- disabled, see "meta.broken" below
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isLinux ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace far2l/bootstrap/trash.sh \
|
|
|
|
--replace 'gvfs-trash' '${gvfs}/bin/gvfs-trash'
|
2021-01-15 22:18:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace far2l/CMakeLists.txt \
|
|
|
|
--replace "-framework System" -lSystem
|
|
|
|
'' + ''
|
|
|
|
echo 'echo ${version}' > far2l/bootstrap/scripts/vbuild.sh
|
|
|
|
substituteInPlace far2l/bootstrap/open.sh \
|
2021-02-05 17:12:51 +00:00
|
|
|
--replace 'xdg-open' '${xdg-utils}/bin/xdg-open'
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace far2l/vtcompletor.cpp \
|
|
|
|
--replace '"/bin/bash"' '"${bash}/bin/bash"'
|
|
|
|
substituteInPlace multiarc/src/formats/zip/zip.cpp \
|
|
|
|
--replace '"unzip ' '"${unzip}/bin/unzip ' \
|
|
|
|
--replace '"zip ' '"${zip}/bin/zip '
|
|
|
|
substituteInPlace multiarc/src/formats/7z/7z.cpp \
|
|
|
|
--replace '"^7z ' '"^${p7zip}/lib/p7zip/7z ' \
|
|
|
|
--replace '"7z ' '"${p7zip}/lib/p7zip/7z '
|
|
|
|
substituteInPlace multiarc/src/formats/targz/targz.cpp \
|
|
|
|
--replace '"xz ' '"${xz}/bin/xz ' \
|
|
|
|
--replace '"gzip ' '"${gzip}/bin/gzip ' \
|
|
|
|
--replace '"bzip2 ' '"${bzip2}/bin/bzip2 ' \
|
|
|
|
--replace '"tar ' '"${gnutar}/bin/tar '
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/scalable/apps
|
|
|
|
cp -dpR install $out/share/far2l
|
|
|
|
mv $out/share/far2l/far2l $out/bin/
|
|
|
|
ln -s -r --force $out/bin/far2l $out/share/far2l/far2l_askpass
|
|
|
|
ln -s -r --force $out/bin/far2l $out/share/far2l/far2l_sudoapp
|
|
|
|
|
|
|
|
cp ../far2l/DE/far2l.desktop $out/share/applications/far2l.desktop
|
|
|
|
substituteInPlace $out/share/applications/far2l.desktop --replace \''${CMAKE_INSTALL_PREFIX} "$out"
|
|
|
|
|
|
|
|
cp ../far2l/DE/icons/hicolor/1024x1024/apps/far2l.svg $out/share/icons/hicolor/scalable/apps/
|
|
|
|
convert -size 128x128 ../far2l/DE/icons/far2l.svg $out/share/icons/far2l.png
|
|
|
|
for size in 16x16 24x24 32x32 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512 1024x1024; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/$size/apps
|
|
|
|
convert -size $size ../far2l/DE/icons/hicolor/$size/apps/far2l.svg $out/share/icons/hicolor/$size/apps/far2l.png
|
|
|
|
done
|
2021-01-15 22:18:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/far2l --argv0 $out/bin/far2l
|
|
|
|
'';
|
|
|
|
|
|
|
|
stripDebugList = [ "bin" "share" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-02-13 14:23:35 +00:00
|
|
|
description = "Linux port of FAR Manager v2, a program for managing files and archives in Windows operating systems";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/elfmz/far2l";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.gpl2Plus; # NOTE: might change in far2l repo soon, check next time
|
|
|
|
maintainers = with maintainers; [ volth hypersw ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
2021-02-13 14:23:35 +00:00
|
|
|
# fails to compile with:
|
|
|
|
# error: no member named 'st_ctim' in 'stat'
|
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|