summary refs log tree commit diff
path: root/pkgs/applications/misc/far2l
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2017-09-26 22:28:51 +0000
committerGitHub <noreply@github.com>2017-09-26 22:28:51 +0000
commitb200a3417b36f85e9e5fd97002e9e2bbc3657eab (patch)
tree16b6ada886068c01e1f201e18b72e7170640b189 /pkgs/applications/misc/far2l
parentbfaf508f4f68a49aea636c7e29a16fc6dcddf640 (diff)
downloadnixpkgs-b200a3417b36f85e9e5fd97002e9e2bbc3657eab.tar
nixpkgs-b200a3417b36f85e9e5fd97002e9e2bbc3657eab.tar.gz
nixpkgs-b200a3417b36f85e9e5fd97002e9e2bbc3657eab.tar.bz2
nixpkgs-b200a3417b36f85e9e5fd97002e9e2bbc3657eab.tar.lz
nixpkgs-b200a3417b36f85e9e5fd97002e9e2bbc3657eab.tar.xz
nixpkgs-b200a3417b36f85e9e5fd97002e9e2bbc3657eab.tar.zst
nixpkgs-b200a3417b36f85e9e5fd97002e9e2bbc3657eab.zip
far2l: support darwin
Diffstat (limited to 'pkgs/applications/misc/far2l')
-rw-r--r--pkgs/applications/misc/far2l/default.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/pkgs/applications/misc/far2l/default.nix b/pkgs/applications/misc/far2l/default.nix
index 3b63c90f060..ad1a1b951bd 100644
--- a/pkgs/applications/misc/far2l/default.nix
+++ b/pkgs/applications/misc/far2l/default.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchFromGitHub, makeWrapper, cmake, pkgconfig, wxGTK30, glib, pcre, m4, bash,
-  xdg_utils, gvfs, zip, unzip, gzip, bzip2, gnutar, p7zip, xz, imagemagick }:
+  xdg_utils, gvfs, zip, unzip, gzip, bzip2, gnutar, p7zip, xz, imagemagick, darwin }:
 
+with stdenv.lib;
 stdenv.mkDerivation rec {
   rev = "73e52ccbc7626631b6898c7324413ee1fc09bc0e";
   build = "unstable-2017-09-25.git${builtins.substring 0 7 rev}";
@@ -15,15 +16,19 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig m4 makeWrapper imagemagick ];
 
-  buildInputs = [ wxGTK30 glib pcre ];
+  buildInputs = [ wxGTK30 glib pcre ]
+    ++ optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
 
   patches = [ ./add-nix-syntax-highlighting.patch ];
 
-  postPatch = ''
-    echo 'echo ${build}' > far2l/bootstrap/scripts/vbuild.sh
-
-    substituteInPlace far2l/bootstrap/open.sh              \
+  postPatch = optionalString stdenv.isLinux ''
+    substituteInPlace far2l/bootstrap/open.sh \
       --replace 'gvfs-trash'  '${gvfs}/bin/gvfs-trash'
+  '' + optionalString stdenv.isDarwin ''
+    substituteInPlace far2l/CMakeLists.txt \
+      --replace "-framework System" -lSystem
+  '' + ''
+    echo 'echo ${build}' > far2l/bootstrap/scripts/vbuild.sh
     substituteInPlace far2l/bootstrap/open.sh              \
       --replace 'xdg-open'    '${xdg_utils}/bin/xdg-open'
     substituteInPlace far2l/vtcompletor.cpp                \
@@ -62,7 +67,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = {
     description = "An orthodox file manager";
     homepage = https://github.com/elfmz/far2l;
     license = licenses.gpl2;