tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
far2l: 2020-12-30 → 2.4.0, enable on darwin
Nikolay Korotkiy
4 years ago
b375c243
bc59ba15
+74
-53
3 changed files
expand all
collapse all
unified
split
pkgs
applications
misc
far2l
default.nix
python_prebuild.patch
top-level
all-packages.nix
+53
-53
pkgs/applications/misc/far2l/default.nix
···
1
-
{ lib, stdenv, fetchFromGitHub, makeWrapper, cmake, pkg-config, wxGTK30, glib, pcre, m4, bash
2
-
, xdg-utils, gvfs, zip, unzip, gzip, bzip2, gnutar, p7zip, xz, imagemagick
3
-
, libuchardet, spdlog, xercesc, openssl, libssh, samba, neon, libnfs, libarchive }:
0
0
0
0
0
0
0
0
0
0
4
0
0
0
5
stdenv.mkDerivation rec {
6
pname = "far2l";
7
-
version = "2020-12-30.git${builtins.substring 0 7 src.rev}";
8
9
src = fetchFromGitHub {
10
owner = "elfmz";
11
repo = "far2l";
12
-
rev = "52c1372441443aafd1a7dff6f17969a6ec19885d";
13
-
sha256 = "0s7427fgxzj5zkyy6mhb4y5hqa6adsr30m0bigycp12b0495ryx0";
14
};
15
16
-
nativeBuildInputs = [ cmake pkg-config m4 makeWrapper imagemagick ];
0
0
17
18
-
buildInputs = [ wxGTK30 glib pcre libuchardet spdlog xercesc ] # base requirements of the build
19
-
++ [ openssl libssh samba neon libnfs libarchive ]; # optional feature packages, like protocol support for Network panel, or archive formats
20
-
#++ lib.optional stdenv.isDarwin Cocoa # Mac support -- disabled, see "meta.broken" below
0
0
0
0
0
0
21
22
-
postPatch = lib.optionalString stdenv.isLinux ''
23
-
substituteInPlace far2l/bootstrap/trash.sh \
24
-
--replace 'gvfs-trash' '${gvfs}/bin/gvfs-trash'
0
0
0
25
'' + lib.optionalString stdenv.isDarwin ''
26
-
substituteInPlace far2l/CMakeLists.txt \
27
--replace "-framework System" -lSystem
28
-
'' + ''
29
-
echo 'echo ${version}' > far2l/bootstrap/scripts/vbuild.sh
30
-
substituteInPlace far2l/bootstrap/open.sh \
31
-
--replace 'xdg-open' '${xdg-utils}/bin/xdg-open'
32
-
substituteInPlace far2l/vtcompletor.cpp \
33
-
--replace '"/bin/bash"' '"${bash}/bin/bash"'
34
-
substituteInPlace multiarc/src/formats/zip/zip.cpp \
35
-
--replace '"unzip ' '"${unzip}/bin/unzip ' \
36
-
--replace '"zip ' '"${zip}/bin/zip '
37
-
substituteInPlace multiarc/src/formats/7z/7z.cpp \
38
-
--replace '"^7z ' '"^${p7zip}/lib/p7zip/7z ' \
39
-
--replace '"7z ' '"${p7zip}/lib/p7zip/7z '
40
-
substituteInPlace multiarc/src/formats/targz/targz.cpp \
41
-
--replace '"xz ' '"${xz}/bin/xz ' \
42
-
--replace '"gzip ' '"${gzip}/bin/gzip ' \
43
-
--replace '"bzip2 ' '"${bzip2}/bin/bzip2 ' \
44
-
--replace '"tar ' '"${gnutar}/bin/tar '
45
'';
46
47
-
installPhase = ''
48
-
mkdir -p $out/bin $out/share/applications $out/share/icons/hicolor/scalable/apps
49
-
cp -dpR install $out/share/far2l
50
-
mv $out/share/far2l/far2l $out/bin/
51
-
ln -s -r --force $out/bin/far2l $out/share/far2l/far2l_askpass
52
-
ln -s -r --force $out/bin/far2l $out/share/far2l/far2l_sudoapp
0
0
0
53
54
-
cp ../far2l/DE/far2l.desktop $out/share/applications/far2l.desktop
55
-
substituteInPlace $out/share/applications/far2l.desktop --replace \''${CMAKE_INSTALL_PREFIX} "$out"
56
57
-
cp ../far2l/DE/icons/hicolor/1024x1024/apps/far2l.svg $out/share/icons/hicolor/scalable/apps/
58
-
convert -size 128x128 ../far2l/DE/icons/far2l.svg $out/share/icons/far2l.png
59
-
for size in 16x16 24x24 32x32 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512 1024x1024; do
60
-
mkdir -p $out/share/icons/hicolor/$size/apps
61
-
convert -size $size ../far2l/DE/icons/hicolor/$size/apps/far2l.svg $out/share/icons/hicolor/$size/apps/far2l.png
62
-
done
63
-
'' + lib.optionalString stdenv.isDarwin ''
64
-
wrapProgram $out/bin/far2l --argv0 $out/bin/far2l
65
'';
66
67
-
stripDebugList = [ "bin" "share" ];
68
-
69
meta = with lib; {
70
description = "Linux port of FAR Manager v2, a program for managing files and archives in Windows operating systems";
71
homepage = "https://github.com/elfmz/far2l";
72
license = licenses.gpl2Plus; # NOTE: might change in far2l repo soon, check next time
73
maintainers = with maintainers; [ volth hypersw ];
74
-
platforms = platforms.all;
75
-
# fails to compile with:
76
-
# error: no member named 'st_ctim' in 'stat'
77
-
broken = stdenv.isDarwin;
78
};
79
}
···
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, wxGTK30, wxmac
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
15
+
let
16
+
wxWidgets = (if stdenv.isDarwin then wxmac else wxGTK30);
17
+
in
18
stdenv.mkDerivation rec {
19
pname = "far2l";
20
+
version = "2.4.0";
21
22
src = fetchFromGitHub {
23
owner = "elfmz";
24
repo = "far2l";
25
+
rev = "v_${version}";
26
+
sha256 = "sha256-nfoAElPLQ97lj65MBX4JMEdgTFbkdEbR1BazYZgV/lg=";
27
};
28
29
+
patches = [ ./python_prebuild.patch ];
30
+
31
+
nativeBuildInputs = [ cmake ninja pkg-config m4 makeWrapper ];
32
33
+
buildInputs = lib.optional withTTYX libX11
34
+
++ lib.optional withGUI wxWidgets
35
+
++ lib.optional withUCD libuchardet
36
+
++ lib.optionals withColorer [ spdlog xercesc ]
37
+
++ lib.optionals withMultiArc [ libarchive pcre ]
38
+
++ lib.optionals withNetRocks [ openssl libssh libnfs neon ]
39
+
++ lib.optional (withNetRocks && !stdenv.isDarwin) samba # broken on darwin
40
+
++ lib.optionals withPython (with python3Packages; [ python cffi debugpy pcpp ])
41
+
++ lib.optionals stdenv.isDarwin [ IOKit Carbon Cocoa AudioToolbox OpenGL ];
42
43
+
postPatch = ''
44
+
patchShebangs python/src/prebuild.sh
45
+
substituteInPlace far2l/src/vt/vtcompletor.cpp \
46
+
--replace '"/bin/bash"' '"${bash}/bin/bash"'
47
+
substituteInPlace far2l/src/cfg/config.cpp \
48
+
--replace '"/bin/bash"' '"${bash}/bin/bash"'
49
'' + lib.optionalString stdenv.isDarwin ''
50
+
substituteInPlace WinPort/src/Backend/WX/CMakeLists.txt \
51
--replace "-framework System" -lSystem
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
52
'';
53
54
+
cmakeFlags = lib.mapAttrsToList (k: v: "-D${k}=${if v then "yes" else "no"}") {
55
+
TTYX = withTTYX;
56
+
USEWX = withGUI;
57
+
USEUCD = withUCD;
58
+
COLORER = withColorer;
59
+
MULTIARC = withMultiArc;
60
+
NETROCKS = withNetRocks;
61
+
PYTHON = withPython;
62
+
};
63
64
+
runtimeDeps = [ unzip zip p7zip xz gzip bzip2 gnutar xdg-utils ];
0
65
66
+
postInstall = ''
67
+
wrapProgram $out/bin/far2l \
68
+
--argv0 $out/bin/far2l \
69
+
--prefix PATH : ${lib.makeBinPath runtimeDeps}
0
0
0
0
70
'';
71
0
0
72
meta = with lib; {
73
description = "Linux port of FAR Manager v2, a program for managing files and archives in Windows operating systems";
74
homepage = "https://github.com/elfmz/far2l";
75
license = licenses.gpl2Plus; # NOTE: might change in far2l repo soon, check next time
76
maintainers = with maintainers; [ volth hypersw ];
77
+
platforms = platforms.unix;
0
0
0
78
};
79
}
+20
pkgs/applications/misc/far2l/python_prebuild.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git i/python/src/prebuild.sh w/python/src/prebuild.sh
2
+
index d2847ee5..aa1ecc53 100755
3
+
--- i/python/src/prebuild.sh
4
+
+++ w/python/src/prebuild.sh
5
+
@@ -12,9 +12,6 @@ mkdir -p "$DST/incpy"
6
+
if [ ! -f "$DST/python/.prepared" ]; then
7
+
echo "Preparing python virtual env at $DST/python using $PYTHON"
8
+
mkdir -p "$DST/python"
9
+
- $PYTHON -m venv --system-site-packages "$DST/python"
10
+
- "$DST/python/bin/python" -m pip install --upgrade pip || true
11
+
- "$DST/python/bin/python" -m pip install --ignore-installed cffi debugpy pcpp
12
+
$PREPROCESSOR "$SRC/python/src/consts.gen" | sh > "${DST}/incpy/consts.h"
13
+
14
+
echo "1" > "$DST/python/.prepared"
15
+
@@ -26,4 +23,4 @@ cp -f -R \
16
+
"$SRC/python/configs/plug/far2l/"* \
17
+
"$DST/incpy/"
18
+
19
+
-"$DST/python/bin/python" "$SRC/python/src/pythongen.py" "${SRC}" "${DST}/incpy"
20
+
+"python" "$SRC/python/src/pythongen.py" "${SRC}" "${DST}/incpy"
+1
pkgs/top-level/all-packages.nix
···
16331
16332
far2l = callPackage ../applications/misc/far2l {
16333
stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv;
0
16334
};
16335
16336
farbfeld = callPackage ../development/libraries/farbfeld { };
···
16331
16332
far2l = callPackage ../applications/misc/far2l {
16333
stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv;
16334
+
inherit (darwin.apple_sdk.frameworks) IOKit Carbon Cocoa AudioToolbox OpenGL;
16335
};
16336
16337
farbfeld = callPackage ../development/libraries/farbfeld { };