Merge pull request #145647 from SuperSandro2000/tree

authored by

Sandro and committed by
GitHub
36941818 5db4c4e5

+26 -28
+26 -28
pkgs/tools/system/tree/default.nix
··· 4 # These settings are found in the Makefile, but there seems to be no 5 # way to select one ore the other setting other than editing the file 6 # manually, so we have to duplicate the know how here. 7 - systemFlags = with stdenv; 8 - if isDarwin then '' 9 - CFLAGS="-O2 -Wall -fomit-frame-pointer" 10 - LDFLAGS= 11 - EXTRA_OBJS=strverscmp.o 12 - '' else if isCygwin then '' 13 - CFLAGS="-O2 -Wall -fomit-frame-pointer -DCYGWIN" 14 - LDFLAGS=-s 15 - TREE_DEST=tree.exe 16 - EXTRA_OBJS=strverscmp.o 17 - '' else if (isFreeBSD || isOpenBSD) then '' 18 - CFLAGS="-O2 -Wall -fomit-frame-pointer" 19 - LDFLAGS=-s 20 - EXTRA_OBJS=strverscmp.o 21 - '' else 22 - ""; # use linux flags by default 23 in 24 stdenv.mkDerivation rec { 25 pname = "tree"; ··· 30 sha256 = "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi"; 31 }; 32 33 - configurePhase = '' 34 sed -i Makefile -e 's|^OBJS=|OBJS=$(EXTRA_OBJS) |' 35 - makeFlagsArray=( 36 - prefix=$out 37 - MANDIR=$out/share/man/man1 38 - ${systemFlags} 39 - CC="$CC" 40 - ) 41 ''; 42 43 - meta = { 44 homepage = "http://mama.indstate.edu/users/ice/tree/"; 45 description = "Command to produce a depth indented directory listing"; 46 - license = lib.licenses.gpl2; 47 - 48 longDescription = '' 49 Tree is a recursive directory listing command that produces a 50 depth indented listing of files, which is colorized ala dircolors if 51 the LS_COLORS environment variable is set and output is to tty. 52 ''; 53 - 54 - platforms = lib.platforms.all; 55 }; 56 }
··· 4 # These settings are found in the Makefile, but there seems to be no 5 # way to select one ore the other setting other than editing the file 6 # manually, so we have to duplicate the know how here. 7 + systemFlags = lib.optionalString stdenv.isDarwin '' 8 + CFLAGS="-O2 -Wall -fomit-frame-pointer" 9 + LDFLAGS= 10 + EXTRA_OBJS=strverscmp.o 11 + '' + lib.optionalString stdenv.isCygwin '' 12 + CFLAGS="-O2 -Wall -fomit-frame-pointer -DCYGWIN" 13 + LDFLAGS=-s 14 + TREE_DEST=tree.exe 15 + EXTRA_OBJS=strverscmp.o 16 + '' + lib.optionalString (stdenv.isFreeBSD || stdenv.isOpenBSD) '' 17 + CFLAGS="-O2 -Wall -fomit-frame-pointer" 18 + LDFLAGS=-s 19 + EXTRA_OBJS=strverscmp.o 20 + ''; # use linux flags by default 21 in 22 stdenv.mkDerivation rec { 23 pname = "tree"; ··· 28 sha256 = "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi"; 29 }; 30 31 + preConfigure = '' 32 sed -i Makefile -e 's|^OBJS=|OBJS=$(EXTRA_OBJS) |' 33 ''; 34 35 + makeFlags = [ 36 + "prefix=${placeholder "out"}" 37 + "MANDIR=${placeholder "out"}/share/man/man1" 38 + "CC=$CC" 39 + systemFlags 40 + ]; 41 + 42 + meta = with lib; { 43 homepage = "http://mama.indstate.edu/users/ice/tree/"; 44 description = "Command to produce a depth indented directory listing"; 45 + license = licenses.gpl2; 46 longDescription = '' 47 Tree is a recursive directory listing command that produces a 48 depth indented listing of files, which is colorized ala dircolors if 49 the LS_COLORS environment variable is set and output is to tty. 50 ''; 51 + platforms = platforms.all; 52 + maintainers = with maintainers; [ SuperSandro2000 ]; 53 }; 54 }