Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/netperf/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TERMUX_PKG_HOMEPAGE=https://hewlettpackard.github.io/netperf/
TERMUX_PKG_DESCRIPTION="Benchmarking tool for many different types of networking"
TERMUX_PKG_LICENSE="MIT"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release 2.7.0 is not licensed under the MIT License1.

The old license is a slightly modified BSD 4-Clause license2, which is so old and uncommon that we don't even have a specific License specifier for it in the build script linter3.

Suggested change
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_LICENSE="BSD" # Modified BSD 4-Clause License

Footnotes

  1. https://github.com/HewlettPackard/netperf/blob/netperf-2.7.0/COPYING

  2. https://choosealicense.com/licenses/bsd-4-clause/

  3. https://github.com/termux/termux-packages/blob/3df94276a0de5b2b81c67c631c479e27841d338e/scripts/lint-packages.sh#L19-L40

TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.7.0
TERMUX_PKG_SRCURL=https://github.com/HewlettPackard/netperf/archive/netperf-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=4569bafa4cca3d548eb96a486755af40bd9ceb6ab7c6abd81cc6aa4875007c4e
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-demo --enable-unixdomain --enable-dccp --enable-sctp ac_cv_func_setpgrp_void=yes"

termux_step_pre_configure() {
# avoid duplicated symbol errors
CFLAGS+=" -fcommon"

# replace config.sub and config.guess with newer versions
curl -L 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -o config.sub
curl -L 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -o config.guess
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does autoreconf -ifv work as a shorter way to write these two lines?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if it doesn't, it's plain incorrect.
This gets the config.sub and config.guess from the HEAD commit of the master branch of a completely different repo.
There's no expectation that wouldn't break.


# apply 001-fix-inlining.patch from ArchLinux package
curl -L 'https://gitlab.archlinux.org/archlinux/packaging/packages/netperf/-/raw/main/001-fix-inlining.patch' -o 001-fix-inlining.patch
patch -Np1 -i 001-fix-inlining.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please download this patch onto your computer and copy and paste it into the packages/netperf folder, then delete these two lines and paste the URL into your commit message instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's gonna break as soon as the package version in our repo and the Arch repo do not match.

As already mentioned above, Arch Linux's 001-fix-inlining.patch should be placed in the package directory for this package.
If you want to keep it numbered please be aware we use 4 digits for numbered patches in this repo so that should be 0001-fix-inlining.patch.

}
29 changes: 29 additions & 0 deletions packages/netperf/fix-imports.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/src/net_uuid.c b/src/net_uuid.c
index 8701120..cb061b2 100644
--- a/src/net_uuid.c
+++ b/src/net_uuid.c
@@ -24,6 +24,7 @@
#include "config.h"
#endif

+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/netlib.c b/src/netlib.c
index f3a3fe5..7ef0eac 100644
--- a/src/netlib.c
+++ b/src/netlib.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hunk should probably be moved to just above #ifdef HAVE_CONFIG_H instead.

A copyright banner was added at the top of this file over 5 years ago and this would likely cause the patch to stop applying in a future release.
https://github.com/HewlettPackard/netperf/blame/master/src/netlib.c#L1-L22

char netlib_id[]="\
@(#)netlib.c (c) Copyright 1993-2012 Hewlett-Packard Company. Version 2.6.0";

@@ -71,6 +72,7 @@ char netlib_id[]="\
# define NSIG _NSIG
#endif /* MPE */
#include <sys/types.h>
+#include <sys/sendfile.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>