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

78 lines
3.1 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper, cmake, pkgconfig, wxGTK30, glib, pcre, m4, bash,
2017-09-26 22:28:51 +00:00
xdg_utils, gvfs, zip, unzip, gzip, bzip2, gnutar, p7zip, xz, imagemagick, darwin }:
2017-03-21 02:52:35 +00:00
2017-09-26 22:28:51 +00:00
with stdenv.lib;
2017-03-21 02:52:35 +00:00
stdenv.mkDerivation rec {
2018-02-27 20:50:21 +00:00
rev = "819d131110a9fedfc14f3b3bea8f1f56e68b077a";
build = "unstable-2018-02-27.git${builtins.substring 0 7 rev}";
2017-03-21 02:52:35 +00:00
name = "far2l-2.1.${build}";
src = fetchFromGitHub {
owner = "elfmz";
repo = "far2l";
rev = rev;
2018-02-27 20:50:21 +00:00
sha256 = "1xjy2ricd68pm9j758pb2axc2269ns2xh86443x5llfcaxrjja4b";
2017-03-21 02:52:35 +00:00
};
2017-05-02 10:18:04 +00:00
nativeBuildInputs = [ cmake pkgconfig m4 makeWrapper imagemagick ];
2017-03-21 02:52:35 +00:00
2017-09-26 22:28:51 +00:00
buildInputs = [ wxGTK30 glib pcre ]
++ optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
2017-03-21 02:52:35 +00:00
2017-08-13 15:09:37 +00:00
patches = [ ./add-nix-syntax-highlighting.patch ];
2017-09-26 22:28:51 +00:00
postPatch = optionalString stdenv.isLinux ''
substituteInPlace far2l/bootstrap/open.sh \
2017-03-21 02:52:35 +00:00
--replace 'gvfs-trash' '${gvfs}/bin/gvfs-trash'
2017-09-26 22:28:51 +00:00
'' + optionalString stdenv.isDarwin ''
substituteInPlace far2l/CMakeLists.txt \
--replace "-framework System" -lSystem
'' + ''
echo 'echo ${build}' > far2l/bootstrap/scripts/vbuild.sh
2017-03-21 02:52:35 +00:00
substituteInPlace far2l/bootstrap/open.sh \
--replace 'xdg-open' '${xdg_utils}/bin/xdg-open'
2017-03-21 02:52:35 +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 = ''
2017-05-02 10:18:04 +00:00
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
sed "s,/usr/bin/,$out/bin/," ../far2l/DE/far2l.desktop > $out/share/applications/far2l.desktop
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
2017-03-21 02:52:35 +00:00
'';
stripDebugList = "bin share";
enableParallelBuilding = true;
2017-09-26 22:28:51 +00:00
meta = {
2017-03-21 02:52:35 +00:00
description = "An orthodox file manager";
homepage = https://github.com/elfmz/far2l;
2017-03-21 02:52:35 +00:00
license = licenses.gpl2;
maintainers = [ maintainers.volth ];
platforms = platforms.all;
};
}