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 4 # These settings are found in the Makefile, but there seems to be no 5 5 # way to select one ore the other setting other than editing the file 6 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 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 23 21 in 24 22 stdenv.mkDerivation rec { 25 23 pname = "tree"; ··· 30 28 sha256 = "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi"; 31 29 }; 32 30 33 - configurePhase = '' 31 + preConfigure = '' 34 32 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 33 ''; 42 34 43 - meta = { 35 + makeFlags = [ 36 + "prefix=${placeholder "out"}" 37 + "MANDIR=${placeholder "out"}/share/man/man1" 38 + "CC=$CC" 39 + systemFlags 40 + ]; 41 + 42 + meta = with lib; { 44 43 homepage = "http://mama.indstate.edu/users/ice/tree/"; 45 44 description = "Command to produce a depth indented directory listing"; 46 - license = lib.licenses.gpl2; 47 - 45 + license = licenses.gpl2; 48 46 longDescription = '' 49 47 Tree is a recursive directory listing command that produces a 50 48 depth indented listing of files, which is colorized ala dircolors if 51 49 the LS_COLORS environment variable is set and output is to tty. 52 50 ''; 53 - 54 - platforms = lib.platforms.all; 51 + platforms = platforms.all; 52 + maintainers = with maintainers; [ SuperSandro2000 ]; 55 53 }; 56 54 }