moreutils: add recipe for 0.70 (#11761)

This commit is contained in:
augiedoggie
2025-02-10 14:54:19 -07:00
committed by GitHub
parent ecff97c595
commit 4d56664b70
2 changed files with 190 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
SUMMARY="Collection of tools that nobody thought to write when Unix was young"
DESCRIPTION="What's included...
* combine: combine the lines in two files using boolean operations
* errno: look up errno names and descriptions
* ifdata: get network interface info without parsing ifconfig output
* ifne: run a program if the standard input is not empty
* isutf8: check if a file or standard input is utf-8
* lckdo: execute a program with a lock held
* mispipe: pipe two commands, returning the exit status of the first
* parallel-moreutils: run multiple jobs at once
* pee: tee standard input to pipes
* sponge: soak up standard input and write to a file
* vidir: edit a directory in your text editor
* vipe: insert a text editor into a pipe
* zrun: automatically uncompress arguments to command
"
HOMEPAGE="https://joeyh.name/code/moreutils/"
COPYRIGHT="2006-2015 Joey Hess
2016 Julien Palard
2006-2008 Tollef Fog Heen
2002 Benjamin BAYART
2006 Miek Gieben
2006 Chung-chieh Shan
2004 Nathanael Nerode
Michael Tokarev
2008 Javier Merino
2012 Lars Wirzenius
2000-2006 Free Software Foundation, Inc.
"
LICENSE="GNU GPL v2
BSD (2-clause)
Public Domain
"
REVISION="1"
SOURCE_URI="https://git.joeyh.name/index.cgi/moreutils.git/snapshot/moreutils-0.70.tar.gz"
CHECKSUM_SHA256="f2bf46d410ba567cc8d01507e94916994e48742722e690dc498fab59f5250132"
PATCHES="moreutils-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
moreutils$secondaryArchSuffix = $portVersion
cmd:combine
cmd:errno
cmd:ifdata
cmd:ifne
cmd:isutf8
cmd:lckdo
cmd:mispipe
cmd:parallel_moreutils
cmd:pee
cmd:sponge
cmd:vidir
cmd:vipe
cmd:zrun
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:perl
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
docbook_xsl_stylesheets
"
BUILD_PREREQUIRES="
cmd:awk
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pod2man
cmd:xmllint
cmd:xsltproc
"
defineDebugInfoPackage moreutils$secondaryArchSuffix \
"$prefix/bin/errno" \
"$prefix/bin/ifdata" \
"$prefix/bin/ifne" \
"$prefix/bin/isutf8" \
"$prefix/bin/lckdo" \
"$prefix/bin/mispipe" \
"$prefix/bin/parallel-moreutils" \
"$prefix/bin/pee" \
"$prefix/bin/sponge"
BUILD()
{
make \
LDFLAGS="-Wl,--as-needed" \
LDLIBS="-lnetwork" \
DOCBOOKXSL="http://docbook.sourceforge.net/release/xsl/current"
}
INSTALL()
{
make PREFIX=$prefix install
# man page cleanup
mkdir -pv $manDir
mv -v $prefix/share/man/man1 $manDir
rm -r $prefix/share
# remove some commands that we don't have perl modules for
rm $prefix/bin/chronic $manDir/man1/chronic.1 \
$prefix/bin/ts $manDir/man1/ts.1
# move parallel so we don't conflict with GNU parallel
mv -v $prefix/bin/parallel $prefix/bin/parallel-moreutils
mv -v $manDir/man1/parallel.1 $manDir/man1/parallel-moreutils.1
}
TEST()
{
make check
}

View File

@@ -0,0 +1,72 @@
From d66566b2abbac8b7b29b9454ab7408d11064415d Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Mon, 10 Feb 2025 12:43:50 -0700
Subject: include <sys/sockio.h> on Haiku
diff --git a/ifdata.c b/ifdata.c
index 6e0bd0b..2660e5c 100644
--- a/ifdata.c
+++ b/ifdata.c
@@ -29,6 +29,10 @@
#include <sys/sockio.h>
#endif
+#if defined(__HAIKU__)
+ #include <sys/sockio.h>
+#endif
+
#include <netinet/in.h>
#include <errno.h>
#include <fcntl.h>
--
2.45.2
From 11efd3d3c3242d58b29e887424904f0e1608d052 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Mon, 10 Feb 2025 12:46:38 -0700
Subject: add fake getloadavg() function for Haiku
diff --git a/parallel.c b/parallel.c
index 004c203..96567dc 100644
--- a/parallel.c
+++ b/parallel.c
@@ -266,6 +266,10 @@ int getloadavg(double loadavg[], int nelem) {
}
return elem == 0 ? -1 : elem;
}
+#elif defined(__HAIKU__)
+int getloadavg(double loadavg[], int nelem) {
+ return -0.0f;
+}
#endif
int main(int argc, char **argv) {
--
2.45.2
From 148dc73c4ed5769b649acd525b917e30f6fb780a Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Mon, 10 Feb 2025 13:54:56 -0700
Subject: add --nonet to the xsltproc command
diff --git a/Makefile b/Makefile
index 35c33b9..be94edc 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ else
DOCBOOKXSL?=/usr/share/xml/docbook/stylesheet/docbook-xsl
endif
-DOCBOOK2XMAN=xsltproc --param man.authors.section.enabled 0 $(DOCBOOKXSL)/manpages/docbook.xsl
+DOCBOOK2XMAN=xsltproc --nonet --param man.authors.section.enabled 0 $(DOCBOOKXSL)/manpages/docbook.xsl
all: $(BINS) $(MANS)
--
2.45.2