tree: 1.8.0 -> 2.0.2

This commit is contained in:
Sandro Jäckel 2022-06-02 01:31:21 +02:00 committed by Sandro Jäckel
parent 5b906c698d
commit 08bb43c7dd
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -1,44 +1,39 @@
{ lib, stdenv, fetchurl }: { lib, stdenv, fetchFromGitLab }:
let let
# These settings are found in the Makefile, but there seems to be no # 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 # way to select one ore the other setting other than editing the file
# manually, so we have to duplicate the know how here. # manually, so we have to duplicate the know how here.
systemFlags = lib.optionalString stdenv.isDarwin '' systemFlags = lib.optionalString stdenv.isDarwin ''
CFLAGS="-O2 -Wall -fomit-frame-pointer" CFLAGS="-O2 -Wall -fomit-frame-pointer -no-cpp-precomp"
LDFLAGS= LDFLAGS=
EXTRA_OBJS=strverscmp.o
'' + lib.optionalString stdenv.isCygwin '' '' + lib.optionalString stdenv.isCygwin ''
CFLAGS="-O2 -Wall -fomit-frame-pointer -DCYGWIN" CFLAGS="-O2 -Wall -fomit-frame-pointer"
LDFLAGS=-s LDFLAGS=-s
TREE_DEST=tree.exe TREE_DEST=tree.exe
EXTRA_OBJS=strverscmp.o
'' + lib.optionalString (stdenv.isFreeBSD || stdenv.isOpenBSD) '' '' + lib.optionalString (stdenv.isFreeBSD || stdenv.isOpenBSD) ''
CFLAGS="-O2 -Wall -fomit-frame-pointer" CFLAGS="-O2 -Wall -fomit-frame-pointer"
LDFLAGS=-s LDFLAGS=-s
EXTRA_OBJS=strverscmp.o
''; # use linux flags by default ''; # use linux flags by default
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "tree"; pname = "tree";
version = "1.8.0"; version = "2.0.2";
src = fetchurl { src = fetchFromGitLab {
url = "http://mama.indstate.edu/users/ice/tree/src/tree-${version}.tgz"; owner = "OldManProgrammer";
sha256 = "1hmpz6k0mr6salv0nprvm1g0rdjva1kx03bdf1scw8a38d5mspbi"; repo = "unix-tree";
rev = version;
sha256 = "sha256-ex4fD8dZJGplL3oMaSokMBn6PRJ8/s83CnWQaAjBcao=";
}; };
preConfigure = '' preConfigure = ''
sed -i Makefile -e 's|^OBJS=|OBJS=$(EXTRA_OBJS) |' makeFlagsArray+=(${systemFlags})
makeFlagsArray+=(
${systemFlags}
"CC=$CC"
)
''; '';
makeFlags = [ makeFlags = [
"prefix=${placeholder "out"}" "CC=${stdenv.cc.targetPrefix}cc"
"MANDIR=${placeholder "out"}/share/man/man1" "PREFIX=${placeholder "out"}"
]; ];
meta = with lib; { meta = with lib; {