aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuhang Zeng <unlsycn@unlsycn.com>2024-04-01 16:30:24 +0800
committerYuhang Zeng <unlsycn@unlsycn.com>2024-04-01 08:53:21 +0800
commit0e71f03fe68682fccab80d6d2072b4896253daf0 (patch)
tree0cf760dfd96978afb8fb25cf7808e29b160ec1cd /net-misc/graftcp
parentx11-terms/mlterm-canna: treeclean (diff)
downloadguru-0e71f03fe68682fccab80d6d2072b4896253daf0.tar.gz
guru-0e71f03fe68682fccab80d6d2072b4896253daf0.tar.bz2
guru-0e71f03fe68682fccab80d6d2072b4896253daf0.zip
net-misc/graftcp: fix QA notice
Signed-off-by: Yuhang Zeng <unlsycn@unlsycn.com>
Diffstat (limited to 'net-misc/graftcp')
-rw-r--r--net-misc/graftcp/files/0004-fix-parallel-build-dependency.patch37
-rw-r--r--net-misc/graftcp/files/0005-let-graftcp-respect-LDFLAGS.patch25
-rw-r--r--net-misc/graftcp/graftcp-0.7.1.ebuild8
3 files changed, 69 insertions, 1 deletions
diff --git a/net-misc/graftcp/files/0004-fix-parallel-build-dependency.patch b/net-misc/graftcp/files/0004-fix-parallel-build-dependency.patch
new file mode 100644
index 000000000..c2905009d
--- /dev/null
+++ b/net-misc/graftcp/files/0004-fix-parallel-build-dependency.patch
@@ -0,0 +1,37 @@
+From 2c1a891d5e11f0faf49e6a33a566342590ab62df Mon Sep 17 00:00:00 2001
+From: "mingang.he" <dustgle@gmail.com>
+Date: Thu, 22 Feb 2024 12:09:00 +0000
+Subject: [PATCH] Fix parallel build dependency, close #65
+
+This commit corrects the dependency issue in the Makefile which was causing errors during parallel builds. Specifically, it addresses the following changes:
+
+- Separate build rules for local/graftcp-local and local/mgraftcp to individually specify their dependencies and build commands.
+- Ensure local/mgraftcp explicitly depends on libgraftcp.a, and build it prior to local/mgraftcp to resolve potential race conditions.
+- The local/graftcp-local target does not depend on libgraftcp.a, hence a separate rule is created without this dependency.
+
+These adjustments ensure that each binary is built correctly respecting their precise dependencies, and thus preventing errors that may occur due to incorrect builds when using the -j option for parallel execution in make.
+---
+ Makefile | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 64d088a..22c46ab 100644
+--- a/Makefile
++++ b/Makefile
+@@ -67,8 +67,11 @@ libgraftcp.a: graftcp.o util.o cidr-trie.o conf.o
+ %.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+-$(GRAFTCP_LOCAL_BIN)::
+- $(MAKE) -C local VERSION=$(VERSION) CC=$(CC) CXX=$(CXX) AR=$(AR)
++local/graftcp-local:
++ $(MAKE) -C $(dir $@) VERSION=$(VERSION) CC=$(CC) CXX=$(CXX) AR=$(AR) $(notdir $@)
++
++local/mgraftcp: libgraftcp.a
++ $(MAKE) -C $(dir $@) VERSION=$(VERSION) CC=$(CC) CXX=$(CXX) AR=$(AR) $(notdir $@)
+
+ install:: graftcp $(GRAFTCP_LOCAL_BIN)
+ $(INSTALL) $< $(DESTDIR)$(BINDIR)/$<
+--
+2.44.0
+
diff --git a/net-misc/graftcp/files/0005-let-graftcp-respect-LDFLAGS.patch b/net-misc/graftcp/files/0005-let-graftcp-respect-LDFLAGS.patch
new file mode 100644
index 000000000..fd3969f29
--- /dev/null
+++ b/net-misc/graftcp/files/0005-let-graftcp-respect-LDFLAGS.patch
@@ -0,0 +1,25 @@
+From 17e60d1a6e9a1a8ee4e2c6016388a6ee5f1b2284 Mon Sep 17 00:00:00 2001
+From: unlsycn <unlsycn@unlsycn.com>
+Date: Mon, 1 Apr 2024 16:22:53 +0800
+Subject: [PATCH] let graftcp respect LDFLAGS
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 22c46ab..a9a6776 100644
+--- a/Makefile
++++ b/Makefile
+@@ -59,7 +59,7 @@ all:: $(TARGET)
+
+
+ graftcp: main.o graftcp.o util.o cidr-trie.o conf.o
+- $(CC) $^ -o $@
++ $(CC) $^ -o $@ $(LDFLAGS)
+
+ libgraftcp.a: graftcp.o util.o cidr-trie.o conf.o
+ $(AR) rcs $@ $^
+--
+2.44.0
+
diff --git a/net-misc/graftcp/graftcp-0.7.1.ebuild b/net-misc/graftcp/graftcp-0.7.1.ebuild
index 6bee869a1..e9dc3322d 100644
--- a/net-misc/graftcp/graftcp-0.7.1.ebuild
+++ b/net-misc/graftcp/graftcp-0.7.1.ebuild
@@ -33,9 +33,15 @@ PATCHES="
${FILESDIR}/0001-build-not-enabling-service-in-install_systemd.patch
${FILESDIR}/0002-build-no-longer-strip-symbols.patch
${FILESDIR}/0003-version-v0.7.patch
+ ${FILESDIR}/0004-fix-parallel-build-dependency.patch
+ ${FILESDIR}/0005-let-graftcp-respect-LDFLAGS.patch
"
-MAKEOPTS="${MAKEOPTS} -j1"
+# Generated by nim
+QA_FLAGS_IGNORED="
+ /usr/bin/graftcp-local
+ /usr/bin/mgraftcp
+ "
src_prepare() {
default