aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Barbieri <lssndrbarbieri@gmail.com>2022-06-05 21:31:55 +0200
committerAlessandro Barbieri <lssndrbarbieri@gmail.com>2022-06-05 22:57:58 +0200
commit98be88532ca077ae5ab22aa3b7702fa0987121c7 (patch)
tree92325a8d6ac54ea66e98d2c10d5376123a1870ec /net-libs
parentdev-libs/dill: new package, add 2.4.1 (diff)
downloadguru-98be88532ca077ae5ab22aa3b7702fa0987121c7.tar.gz
guru-98be88532ca077ae5ab22aa3b7702fa0987121c7.tar.bz2
guru-98be88532ca077ae5ab22aa3b7702fa0987121c7.zip
net-libs/udt: new package, add 4.11
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/udt/Manifest1
-rw-r--r--net-libs/udt/files/udt-4.11-makefiles.patch93
-rw-r--r--net-libs/udt/metadata.xml13
-rw-r--r--net-libs/udt/udt-4.11.ebuild67
4 files changed, 174 insertions, 0 deletions
diff --git a/net-libs/udt/Manifest b/net-libs/udt/Manifest
new file mode 100644
index 000000000..9fc9480c7
--- /dev/null
+++ b/net-libs/udt/Manifest
@@ -0,0 +1 @@
+DIST udt.sdk.4.11.tar.gz 147707 BLAKE2B 2be5c280d73138e7d508199aaaecc52ff5824266a92ab8718606c8c2688231ea609ff77d22dc85d2ee99c14edc170559cf9a544fd16bdc98953e1a871d257632 SHA512 fc555ce1ddde2a8bd92c8adf470fd69a9a35d0a679def32b6ddbb18d67dc8b7d9dd928d772dc8598f08b350130f1e90bb4be58c46252a0a79ecc99f61eca8a92
diff --git a/net-libs/udt/files/udt-4.11-makefiles.patch b/net-libs/udt/files/udt-4.11-makefiles.patch
new file mode 100644
index 000000000..9ede4fc70
--- /dev/null
+++ b/net-libs/udt/files/udt-4.11-makefiles.patch
@@ -0,0 +1,93 @@
+--- a/app/Makefile
++++ b/app/Makefile
+@@ -1,4 +1,4 @@
+-C++ = g++
++C++ = $(CXX)
+
+ ifndef os
+ os = LINUX
+@@ -8,7 +8,7 @@
+ arch = IA32
+ endif
+
+-CCFLAGS = -Wall -D$(os) -I../src -finline-functions -O3
++CCFLAGS = -Wall -D$(os) -I../src $(CXXFLAGS)
+
+ ifeq ($(arch), IA32)
+ CCFLAGS += -DIA32 #-mcpu=pentiumpro -march=pentiumpro -mmmx -msse
+@@ -26,7 +26,7 @@
+ CCFLAGS += -DSPARC
+ endif
+
+-LDFLAGS = -L../src -ludt -lstdc++ -lpthread -lm
++LDFLAGS += -L../src -ludt -lstdc++ -lpthread -lm
+
+ ifeq ($(os), UNIX)
+ LDFLAGS += -lsocket
+@@ -43,18 +43,18 @@
+ all: $(APP)
+
+ %.o: %.cpp
+- $(C++) $(CCFLAGS) $< -c
++ $(C++) $(CCFLAGS) -fPIC $< -c
+
+ appserver: appserver.o
+- $(C++) $^ -o $@ $(LDFLAGS)
++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
+ appclient: appclient.o
+- $(C++) $^ -o $@ $(LDFLAGS)
++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
+ sendfile: sendfile.o
+- $(C++) $^ -o $@ $(LDFLAGS)
++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
+ recvfile: recvfile.o
+- $(C++) $^ -o $@ $(LDFLAGS)
++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
+ test: test.o
+- $(C++) $^ -o $@ $(LDFLAGS)
++ $(C++) $^ -o $@ $(CCFLAGS) -fPIE $(LDFLAGS)
+
+ clean:
+ rm -f *.o $(APP)
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -1,4 +1,4 @@
+-C++ = g++
++C++ = $(CXX)
+
+ ifndef os
+ os = LINUX
+@@ -8,7 +8,7 @@
+ arch = IA32
+ endif
+
+-CCFLAGS = -fPIC -Wall -Wextra -D$(os) -finline-functions -O3 -fno-strict-aliasing -fvisibility=hidden
++CCFLAGS = -fPIC -Wall -Wextra -D$(os) -fno-strict-aliasing -fvisibility=hidden $(CXXFLAGS)
+
+ ifeq ($(arch), IA32)
+ CCFLAGS += -DIA32
+@@ -33,21 +33,18 @@
+ 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
+ DIR = $(shell pwd)
+
+-all: libudt.so libudt.a udt
++all: libudt.so udt
+
+ %.o: %.cpp %.h udt.h
+- $(C++) $(CCFLAGS) $< -c
++ $(C++) $(CCFLAGS) -fPIC $< -c
+
+ libudt.so: $(OBJS)
+ ifneq ($(os), OSX)
+- $(C++) -shared -o $@ $^
++ $(C++) $(CCFLAGS) $(LDFLAGS) -shared -fPIC -lpthread -Wl,-soname,libudt.so.0 -o $@ $^
+ else
+ $(C++) -dynamiclib -o libudt.dylib -lstdc++ -lpthread -lm $^
+ endif
+
+-libudt.a: $(OBJS)
+- ar -rcs $@ $^
+-
+ udt:
+ cp udt.h udt
+
diff --git a/net-libs/udt/metadata.xml b/net-libs/udt/metadata.xml
new file mode 100644
index 000000000..73510438f
--- /dev/null
+++ b/net-libs/udt/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <description>co-maintainers welcome</description>
+ <email>lssndrbarbieri@gmail.com</email>
+ <name>Alessandro Barbieri</name>
+ </maintainer>
+ <upstream>
+ <bugs-to>https://sourceforge.net/p/udt/bugs/</bugs-to>
+ <remote-id type="sourceforge">udt</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-libs/udt/udt-4.11.ebuild b/net-libs/udt/udt-4.11.ebuild
new file mode 100644
index 000000000..bace7a3c5
--- /dev/null
+++ b/net-libs/udt/udt-4.11.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="UDT is a UDP based data transport protocol"
+HOMEPAGE="http://udt.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${PN}.sdk.${PV}.tar.gz"
+S="${WORKDIR}/${PN}4"
+
+LICENSE="BSD"
+SLOT="4"
+KEYWORDS="~amd64"
+
+DOCS=( README.txt RELEASE_NOTES.txt draft-gg-udt-xx.txt )
+PATCHES=( "${FILESDIR}/${P}-makefiles.patch" )
+
+src_compile(){
+ tc-export CXX
+
+ # IA32 isn't a typo
+ case ${ARCH} in
+ x86) PLATFORM="IA32";;
+ ppc|ppc64) PLATFORM="POWERPC";;
+ amd64) PLATFORM="AMD64";;
+ ia64) PLATFORM="IA64";;
+ esac
+
+ case ${CHOST} in
+ *-freebsd*|*-netbsd*|*-openbsd*|*-dragonfly*) OSNAME="BSD" ;;
+ *-darwin*) OSNAME="OSX" ;;
+ *) OSNAME="LINUX" ;;
+ esac
+
+ MAKEOPTS="-j1" emake os="${OSNAME}" arch="${PLATFORM}"
+}
+
+src_install(){
+ dolib.so src/libudt.so
+ dosym ./libudt.so /usr/$(get_libdir)/libudt.so.0
+ exeinto "/usr/libexec/udt"
+ doexe app/{appserver,appclient,sendfile,recvfile}
+
+ insinto /usr/include/udt
+ doins src/udt.h
+
+ local HTML_DOCS=( doc/* )
+ einstalldocs
+
+ cat <<EOF > udt.pc
+prefix=/usr
+libdir=\${prefix}/$(get_libdir)
+includedir=\${prefix}/include
+
+Name: ${PN}
+Description: ${DESCRIPTION}
+Version: ${PV}
+URL: ${HOMEPAGE}
+Libs: -L\${libdir} -ludt
+Cflags: -I\${includedir}/udt
+EOF
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ doins udt.pc
+}