about summary refs log tree commit diff
path: root/pkgs/tools/system/tree/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/tree/default.nix')
-rw-r--r--pkgs/tools/system/tree/default.nix29
1 files changed, 12 insertions, 17 deletions
diff --git a/pkgs/tools/system/tree/default.nix b/pkgs/tools/system/tree/default.nix
index 03ffee077d9fd..fc579a8c001f9 100644
--- a/pkgs/tools/system/tree/default.nix
+++ b/pkgs/tools/system/tree/default.nix
@@ -1,44 +1,39 @@
-{ lib, stdenv, fetchurl }:
+{ lib, stdenv, fetchFromGitLab }:
 
 let
   # These settings are found in the Makefile, but there seems to be no
   # way to select one ore the other setting other than editing the file
   # manually, so we have to duplicate the know how here.
   systemFlags = lib.optionalString stdenv.isDarwin ''
-    CFLAGS="-O2 -Wall -fomit-frame-pointer"
+    CFLAGS="-O2 -Wall -fomit-frame-pointer -no-cpp-precomp"
     LDFLAGS=
-    EXTRA_OBJS=strverscmp.o
   '' + lib.optionalString stdenv.isCygwin ''
-    CFLAGS="-O2 -Wall -fomit-frame-pointer -DCYGWIN"
+    CFLAGS="-O2 -Wall -fomit-frame-pointer"
     LDFLAGS=-s
     TREE_DEST=tree.exe
-    EXTRA_OBJS=strverscmp.o
   '' + lib.optionalString (stdenv.isFreeBSD || stdenv.isOpenBSD) ''
     CFLAGS="-O2 -Wall -fomit-frame-pointer"
     LDFLAGS=-s
-    EXTRA_OBJS=strverscmp.o
   ''; # use linux flags by default
 in
 stdenv.mkDerivation rec {
   pname = "tree";
-  version = "1.8.0";
+  version = "2.0.2";
 
-  src = fetchurl {
-    url = "http://mama.indstate.edu/users/ice/tree/src/tree-${version}.tgz";
-    sha256 = "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi";
+  src = fetchFromGitLab {
+    owner = "OldManProgrammer";
+    repo = "unix-tree";
+    rev = version;
+    sha256 = "sha256-ex4fD8dZJGplL3oMaSokMBn6PRJ8/s83CnWQaAjBcao=";
   };
 
   preConfigure = ''
-    sed -i Makefile -e 's|^OBJS=|OBJS=$(EXTRA_OBJS) |'
-    makeFlagsArray+=(
-      ${systemFlags}
-      "CC=$CC"
-    )
+    makeFlagsArray+=(${systemFlags})
   '';
 
   makeFlags = [
-    "prefix=${placeholder "out"}"
-    "MANDIR=${placeholder "out"}/share/man/man1"
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "PREFIX=${placeholder "out"}"
   ];
 
   meta = with lib; {