···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
23in
24stdenv.mkDerivation rec {
25 pname = "tree";
···30 sha256 = "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi";
31 };
3233- 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 '';
4243- meta = {
000000044 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
0021in
22stdenv.mkDerivation rec {
23 pname = "tree";
···28 sha256 = "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi";
29 };
3031+ preConfigure = ''
32 sed -i Makefile -e 's|^OBJS=|OBJS=$(EXTRA_OBJS) |'
00000033 '';
3435+ 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;
046 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}