Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-libs/udt/files/, net-libs/udt/
Date: Sun, 05 Jun 2022 20:58:08
Message-Id: 1654462678.98be88532ca077ae5ab22aa3b7702fa0987121c7.Alessandro-Barbieri@gentoo
1 commit: 98be88532ca077ae5ab22aa3b7702fa0987121c7
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Sun Jun 5 19:31:55 2022 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Sun Jun 5 20:57:58 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=98be8853
7
8 net-libs/udt: new package, add 4.11
9
10 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
11
12 net-libs/udt/Manifest | 1 +
13 net-libs/udt/files/udt-4.11-makefiles.patch | 93 +++++++++++++++++++++++++++++
14 net-libs/udt/metadata.xml | 13 ++++
15 net-libs/udt/udt-4.11.ebuild | 67 +++++++++++++++++++++
16 4 files changed, 174 insertions(+)
17
18 diff --git a/net-libs/udt/Manifest b/net-libs/udt/Manifest
19 new file mode 100644
20 index 000000000..9fc9480c7
21 --- /dev/null
22 +++ b/net-libs/udt/Manifest
23 @@ -0,0 +1 @@
24 +DIST udt.sdk.4.11.tar.gz 147707 BLAKE2B 2be5c280d73138e7d508199aaaecc52ff5824266a92ab8718606c8c2688231ea609ff77d22dc85d2ee99c14edc170559cf9a544fd16bdc98953e1a871d257632 SHA512 fc555ce1ddde2a8bd92c8adf470fd69a9a35d0a679def32b6ddbb18d67dc8b7d9dd928d772dc8598f08b350130f1e90bb4be58c46252a0a79ecc99f61eca8a92
25
26 diff --git a/net-libs/udt/files/udt-4.11-makefiles.patch b/net-libs/udt/files/udt-4.11-makefiles.patch
27 new file mode 100644
28 index 000000000..9ede4fc70
29 --- /dev/null
30 +++ b/net-libs/udt/files/udt-4.11-makefiles.patch
31 @@ -0,0 +1,93 @@
32 +--- a/app/Makefile
33 ++++ b/app/Makefile
34 +@@ -1,4 +1,4 @@
35 +-C++ = g++
36 ++C++ = $(CXX)
37 +
38 + ifndef os
39 + os = LINUX
40 +@@ -8,7 +8,7 @@
41 + arch = IA32
42 + endif
43 +
44 +-CCFLAGS = -Wall -D$(os) -I../src -finline-functions -O3
45 ++CCFLAGS = -Wall -D$(os) -I../src $(CXXFLAGS)
46 +
47 + ifeq ($(arch), IA32)
48 + CCFLAGS += -DIA32 #-mcpu=pentiumpro -march=pentiumpro -mmmx -msse
49 +@@ -26,7 +26,7 @@
50 + CCFLAGS += -DSPARC
51 + endif
52 +
53 +-LDFLAGS = -L../src -ludt -lstdc++ -lpthread -lm
54 ++LDFLAGS += -L../src -ludt -lstdc++ -lpthread -lm
55 +
56 + ifeq ($(os), UNIX)
57 + LDFLAGS += -lsocket
58 +@@ -43,18 +43,18 @@
59 + all: $(APP)
60 +
61 + %.o: %.cpp
62 +- $(C++) $(CCFLAGS) $< -c
63 ++ $(C++) $(CCFLAGS) -fPIC $< -c
64 +
65 + appserver: appserver.o
66 +- $(C++) $^ -o $@ $(LDFLAGS)
67 ++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
68 + appclient: appclient.o
69 +- $(C++) $^ -o $@ $(LDFLAGS)
70 ++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
71 + sendfile: sendfile.o
72 +- $(C++) $^ -o $@ $(LDFLAGS)
73 ++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
74 + recvfile: recvfile.o
75 +- $(C++) $^ -o $@ $(LDFLAGS)
76 ++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
77 + test: test.o
78 +- $(C++) $^ -o $@ $(LDFLAGS)
79 ++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
80 +
81 + clean:
82 + rm -f *.o $(APP)
83 +--- a/src/Makefile
84 ++++ b/src/Makefile
85 +@@ -1,4 +1,4 @@
86 +-C++ = g++
87 ++C++ = $(CXX)
88 +
89 + ifndef os
90 + os = LINUX
91 +@@ -8,7 +8,7 @@
92 + arch = IA32
93 + endif
94 +
95 +-CCFLAGS = -fPIC -Wall -Wextra -D$(os) -finline-functions -O3 -fno-strict-aliasing -fvisibility=hidden
96 ++CCFLAGS = -fPIC -Wall -Wextra -D$(os) -fno-strict-aliasing -fvisibility=hidden $(CXXFLAGS)
97 +
98 + ifeq ($(arch), IA32)
99 + CCFLAGS += -DIA32
100 +@@ -33,21 +33,18 @@
101 + OBJS = api.o buffer.o cache.o ccc.o channel.o common.o core.o epoll.o list.o md5.o packet.o queue.o window.o
102 + DIR = $(shell pwd)
103 +
104 +-all: libudt.so libudt.a udt
105 ++all: libudt.so udt
106 +
107 + %.o: %.cpp %.h udt.h
108 +- $(C++) $(CCFLAGS) $< -c
109 ++ $(C++) $(CCFLAGS) -fPIC $< -c
110 +
111 + libudt.so: $(OBJS)
112 + ifneq ($(os), OSX)
113 +- $(C++) -shared -o $@ $^
114 ++ $(C++) $(CCFLAGS) $(LDFLAGS) -shared -fPIC -lpthread -Wl,-soname,libudt.so.0 -o $@ $^
115 + else
116 + $(C++) -dynamiclib -o libudt.dylib -lstdc++ -lpthread -lm $^
117 + endif
118 +
119 +-libudt.a: $(OBJS)
120 +- ar -rcs $@ $^
121 +-
122 + udt:
123 + cp udt.h udt
124 +
125
126 diff --git a/net-libs/udt/metadata.xml b/net-libs/udt/metadata.xml
127 new file mode 100644
128 index 000000000..73510438f
129 --- /dev/null
130 +++ b/net-libs/udt/metadata.xml
131 @@ -0,0 +1,13 @@
132 +<?xml version="1.0" encoding="UTF-8"?>
133 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
134 +<pkgmetadata>
135 + <maintainer type="person">
136 + <description>co-maintainers welcome</description>
137 + <email>lssndrbarbieri@×××××.com</email>
138 + <name>Alessandro Barbieri</name>
139 + </maintainer>
140 + <upstream>
141 + <bugs-to>https://sourceforge.net/p/udt/bugs/</bugs-to>
142 + <remote-id type="sourceforge">udt</remote-id>
143 + </upstream>
144 +</pkgmetadata>
145
146 diff --git a/net-libs/udt/udt-4.11.ebuild b/net-libs/udt/udt-4.11.ebuild
147 new file mode 100644
148 index 000000000..bace7a3c5
149 --- /dev/null
150 +++ b/net-libs/udt/udt-4.11.ebuild
151 @@ -0,0 +1,67 @@
152 +# Copyright 1999-2022 Gentoo Authors
153 +# Distributed under the terms of the GNU General Public License v2
154 +
155 +EAPI=8
156 +
157 +inherit toolchain-funcs
158 +
159 +DESCRIPTION="UDT is a UDP based data transport protocol"
160 +HOMEPAGE="http://udt.sourceforge.net"
161 +SRC_URI="mirror://sourceforge/${PN}/${PN}.sdk.${PV}.tar.gz"
162 +S="${WORKDIR}/${PN}4"
163 +
164 +LICENSE="BSD"
165 +SLOT="4"
166 +KEYWORDS="~amd64"
167 +
168 +DOCS=( README.txt RELEASE_NOTES.txt draft-gg-udt-xx.txt )
169 +PATCHES=( "${FILESDIR}/${P}-makefiles.patch" )
170 +
171 +src_compile(){
172 + tc-export CXX
173 +
174 + # IA32 isn't a typo
175 + case ${ARCH} in
176 + x86) PLATFORM="IA32";;
177 + ppc|ppc64) PLATFORM="POWERPC";;
178 + amd64) PLATFORM="AMD64";;
179 + ia64) PLATFORM="IA64";;
180 + esac
181 +
182 + case ${CHOST} in
183 + *-freebsd*|*-netbsd*|*-openbsd*|*-dragonfly*) OSNAME="BSD" ;;
184 + *-darwin*) OSNAME="OSX" ;;
185 + *) OSNAME="LINUX" ;;
186 + esac
187 +
188 + MAKEOPTS="-j1" emake os="${OSNAME}" arch="${PLATFORM}"
189 +}
190 +
191 +src_install(){
192 + dolib.so src/libudt.so
193 + dosym ./libudt.so /usr/$(get_libdir)/libudt.so.0
194 + exeinto "/usr/libexec/udt"
195 + doexe app/{appserver,appclient,sendfile,recvfile}
196 +
197 + insinto /usr/include/udt
198 + doins src/udt.h
199 +
200 + local HTML_DOCS=( doc/* )
201 + einstalldocs
202 +
203 + cat <<EOF > udt.pc
204 +prefix=/usr
205 +libdir=\${prefix}/$(get_libdir)
206 +includedir=\${prefix}/include
207 +
208 +Name: ${PN}
209 +Description: ${DESCRIPTION}
210 +Version: ${PV}
211 +URL: ${HOMEPAGE}
212 +Libs: -L\${libdir} -ludt
213 +Cflags: -I\${includedir}/udt
214 +EOF
215 +
216 + insinto "/usr/$(get_libdir)/pkgconfig"
217 + doins udt.pc
218 +}