Anton Bolshakov 2022-07-11 22:52:13 +08:00
parent ebacd923be
commit b4e9babc53
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
4 changed files with 85 additions and 17 deletions

2
net-vpn/tuntox/Manifest Normal file
View file

@ -0,0 +1,2 @@
DIST tuntox-0.0.10.tar.gz 219818 BLAKE2B d9bc8590dfc455246c68be26b959cd0e11f10025d129b8837c5d8fb5809e2abf0a76112311d3849b125896d535d4791376d166c7201ca32dcd245275ce326ca0 SHA512 25536fc8fbccc6e25aab42131a9973422a0e3313669d5fe5aa7317162250aa96d05d42b8eea239f4e621856ff2ba3a2d886c35ff77b0f5cdb82fd4263794bf82
DIST tuntox-0.0.9.tar.gz 68533 BLAKE2B faa26410e7e1a6987abab3e2093f538204b038c27ad337526fb54bd16e26d5a0af6d0d414687a3f01d4859f339e25b3ef1c16f394cd4bd5711fdc89f1542576d SHA512 9322e816478e92dbb368b21e88d0730e94caf9da123b81fa6d5284820e9147697519fdf2ccdb9a2eeef11b3d3f8af03c80b1032237b5bb803404b88c44040f15

View file

@ -0,0 +1,66 @@
--- a/Makefile.orig 2021-12-07 16:58:46.000000000 +0800
+++ b/Makefile 2022-07-11 22:33:39.759028800 +0800
@@ -1,12 +1,10 @@
SOURCES = $(wildcard *.c)
DEPS=toxcore
-CC=gcc
-CFLAGS=-g -Wall #-std=c99
+CC?=gcc
+CFLAGS +=-g -Wall #-std=c99
CFLAGS += $(shell pkg-config --cflags $(DEPS))
-LDFLAGS=-g -pthread -lm -static -lrt
-LDFLAGS += $(shell pkg-config --static --libs $(DEPS))
-DSO_LDFLAGS=-g -pthread -lm -lrt
-DSO_LDFLAGS += $(shell pkg-config --libs $(DEPS))
+LDFLAGS +=-g -pthread -lm -lrt
+LDFLAGS += $(shell pkg-config --libs $(DEPS))
OBJECTS=$(SOURCES:.c=.o)
INCLUDES = $(wildcard *.h)
PYTHON = /usr/bin/env python3
@@ -16,36 +14,31 @@
prefix ?= /usr
bindir ?= $(prefix)/bin
-# Targets
-all: tuntox tuntox_nostatic
-
-gitversion.h: FORCE
- @if [ -f .git/HEAD ] ; then echo " GEN $@"; echo "#define GITVERSION \"$(shell git rev-parse HEAD)\"" > $@; fi
-
-FORCE:
+.PHONY: all clean tuntox tuntox_nostatic install
-tox_bootstrap.h:
- $(PYTHON) generate_tox_bootstrap.py
+# Targets
+all: tuntox_nostatic
-%.o: %.c $(INCLUDES) gitversion.h tox_bootstrap.h
+%.o: %.c $(INCLUDES)
@echo " CC $@"
@$(CC) -c $(CFLAGS) $< -o $@
+tuntox: LDFLAGS += -static
tuntox: $(OBJECTS) $(INCLUDES)
- $(CC) -o $@ $(OBJECTS) -lpthread $(LDFLAGS)
+ $(CC) -o $@ $(OBJECTS) -lpthread $(LDFLAGS)
+tuntox_nostatic: CFLAGS += -fPIC
+tuntox_nostatic: LDFLAGS += -shared
tuntox_nostatic: $(OBJECTS) $(INCLUDES)
- $(CC) -o $@ $(OBJECTS) -lpthread $(DSO_LDFLAGS)
+ $(CC) -o $@ $(OBJECTS) -lpthread $(LDFLAGS)
cscope.out:
@echo " GEN $@"
@cscope -bv ./*.[ch] &> /dev/null
clean:
- rm -f *.o tuntox cscope.out gitversion.h tox_bootstrap.h
+ rm -f *.o tuntox cscope.out
install: tuntox_nostatic
$(INSTALL_MKDIR) -d $(DESTDIR)$(bindir)
cp tuntox_nostatic $(DESTDIR)$(bindir)/tuntox
-
-.PHONY: all clean tuntox

View file

@ -0,0 +1 @@
tuntox-9999.ebuild

View file

@ -1,22 +1,26 @@
# Copyright 1999-2019 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit eutils git-r3 systemd toolchain-funcs user
inherit systemd user
DESCRIPTION="Tunnel TCP connections over the Tox protocol"
HOMEPAGE="https://gdr.name/tuntox https://github.com/gjedeer/tuntox"
EGIT_REPO_URI="https://github.com/gjedeer/tuntox"
if [[ ${PV} != *9999 ]]; then
EGIT_COMMIT="${PV}"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
if [[ "${PV}" == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/gjedeer/tuntox"
KEYWORDS=""
else
KEYWORDS="amd64 x86"
SRC_URI="https://github.com/gjedeer/tuntox/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
fi
LICENSE="GPL-3"
SLOT="0"
IUSE="systemd static"
IUSE="systemd"
RDEPEND="
dev-libs/libevent:=[threads]
@ -31,9 +35,11 @@ pkg_setup() {
}
src_prepare() {
# eapply ${FILESDIR}/makefile.patch
# Do not rename binary files
sed -e "s/\$(CC) -o \$@/\$(CC) -o ${PN}/" \
-i Makefile || die "sed failed!"
# sed -e "s/\$(CC) -o \$@/\$(CC) -o ${PN}/" \
# -i Makefile || die "sed failed!"
use systemd && (
sed -e "s/#User=proxy/User=${PN}/" \
@ -45,13 +51,6 @@ src_prepare() {
eapply_user
}
src_compile() {
emake CC=$(tc-getCC) \
tox_bootstrap.h \
gitversion.h \
$(usex static "tuntox" "tuntox_nostatic")
}
src_install() {
for d in lib log; do
keepdir "/var/${d}/${PN}"
@ -70,7 +69,7 @@ src_install() {
newconfd "${FILESDIR}"/tuntox.confd ${PN}
use systemd && systemd_dounit scripts/tuntox.service
dobin ${PN}
newbin tuntox_nostatic ${PN}
dobin scripts/tokssh
dodoc README.md VPN.md BUILD.md