diff options
author | Xin Yang <yangmame@icloud.com> | 2024-02-29 11:51:23 +0800 |
---|---|---|
committer | David Roman <davidroman96@gmail.com> | 2024-02-29 16:42:56 +0100 |
commit | edb423f1db1df4f7ef36c155987979d7b37cbdfb (patch) | |
tree | 81cc99e73ac43b7ac66cac2680cefb9a17ce098b /net-vpn | |
parent | dev-lang/hare: fix harec version (diff) | |
download | guru-edb423f1db1df4f7ef36c155987979d7b37cbdfb.tar.gz guru-edb423f1db1df4f7ef36c155987979d7b37cbdfb.tar.bz2 guru-edb423f1db1df4f7ef36c155987979d7b37cbdfb.zip |
net-vpn/candy: new 4.0 ebuild with version and cflags env patch
Closes: https://github.com/gentoo/guru/pull/145
Signed-off-by: Xin Yang <yangmame@icloud.com>
Signed-off-by: David Roman <davidroman96@gmail.com>
Diffstat (limited to 'net-vpn')
-rw-r--r-- | net-vpn/candy/Manifest | 1 | ||||
-rw-r--r-- | net-vpn/candy/candy-4.0.ebuild | 43 | ||||
-rw-r--r-- | net-vpn/candy/files/candy-4.0-show-version-and-use-cflags-env.patch | 80 |
3 files changed, 124 insertions, 0 deletions
diff --git a/net-vpn/candy/Manifest b/net-vpn/candy/Manifest index f87e317a7..ae1de07b3 100644 --- a/net-vpn/candy/Manifest +++ b/net-vpn/candy/Manifest @@ -1 +1,2 @@ DIST candy-3.9.1.tar.gz 37847 BLAKE2B af7c857a8a41f0e98bd744162be563b973e20a630fb505de91155ab9fb7a17679a2bb9f69db8c737258d1293c5d77ad96a65a2b22455512b8f97390a7368165f SHA512 aa9727c74ab7c9536331098f11a2837daa51aa58503cbf5b43536afedf5eea8d30db296f515c4689cf44c980eea5a88e06ad161836fe64d4146de4fdce9d99ac +DIST candy-4.0.tar.gz 43112 BLAKE2B 84c3fbab30dc1d40ba73e7c90a02bf6c13b9bb0de2339fe128c958242213986dc2c490c680032c98f9a3a849e237f1f22274b600e55ed94aea91d9529bf972bf SHA512 9f76ab338cec381e1421040055ba73882a32f6b2b9bebe8fbc289c1c0e418506a57698fa8e551a31a918dfbcfa668dbb6c1d82390a2496a7fe35d6a17adacd64 diff --git a/net-vpn/candy/candy-4.0.ebuild b/net-vpn/candy/candy-4.0.ebuild new file mode 100644 index 000000000..70b9c5a55 --- /dev/null +++ b/net-vpn/candy/candy-4.0.ebuild @@ -0,0 +1,43 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake systemd + +DESCRIPTION="Another virtual private network that supports peer-to-peer connections" +HOMEPAGE="https://github.com/lanthora/candy" +SRC_URI="https://github.com/lanthora/candy/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND=" + dev-libs/uriparser + dev-libs/libconfig + net-libs/ixwebsocket[ws] + dev-libs/openssl + sys-libs/zlib + dev-libs/libfmt + dev-libs/spdlog +" +RDEPEND="${DEPEND}" + +src_prepare() { + eapply "${FILESDIR}/${P}-show-version-and-use-cflags-env.patch" + cmake_src_prepare + default +} + +src_install(){ + cmake_src_install + default + + insinto /etc + doins candy.conf + fperms 0644 /etc/candy.conf + + systemd_dounit candy.service + systemd_dounit candy@.service +} diff --git a/net-vpn/candy/files/candy-4.0-show-version-and-use-cflags-env.patch b/net-vpn/candy/files/candy-4.0-show-version-and-use-cflags-env.patch new file mode 100644 index 000000000..c0e0121f1 --- /dev/null +++ b/net-vpn/candy/files/candy-4.0-show-version-and-use-cflags-env.patch @@ -0,0 +1,80 @@ +From de8f5a3109ee3bdc472fbc7fcb1572aaad0b8cb9 Mon Sep 17 00:00:00 2001 +From: lanthora <lanthora@outlook.com> +Date: Thu, 29 Feb 2024 05:16:53 +0000 +Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=98=BE=E7=A4=BA=E7=89=88?= + =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + CMakeLists.txt | 10 ++++++---- + src/main/main.cc | 13 +++++++++++++ + 2 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1ebf2c0..dffc31d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,10 +1,12 @@ + cmake_minimum_required(VERSION 3.18.4) + +-project(candy CXX) ++project(candy LANGUAGES CXX VERSION 4.0) + +-set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++2b -Wall -Werror -Wfatal-errors -Wno-unknown-pragmas") +-set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -fsanitize=address") +-set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O2") ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2b -Wall -Werror -Wfatal-errors -Wno-unknown-pragmas") ++set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address") ++set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2") ++ ++add_compile_definitions(VERSION="${CMAKE_PROJECT_VERSION}") + + include_directories(${CMAKE_SOURCE_DIR}/src) + +diff --git a/src/main/main.cc b/src/main/main.cc +index 286d24d..65cdc4f 100644 +--- a/src/main/main.cc ++++ b/src/main/main.cc +@@ -21,6 +21,10 @@ + + #include <argp.h> + ++#ifndef VERSION ++#define VERSION "unknown" ++#endif ++ + namespace { + + struct arguments { +@@ -54,6 +58,7 @@ struct argp_option options[] = { + {"config", 'c', "PATH", 0, "Configuration file path"}, + {"discovery", OPT_DISCOVERY_INTERVAL, "SECONDS", 0, "Active discovery broadcast interval"}, + {"route", 'r', "COST", 0, "Cost of routing"}, ++ {"version", 'v', 0, 0, "Show version"}, + {"no-timestamp", OPT_NO_TIMESTAMP, 0, 0, "Log does not show time"}, + {"debug", OPT_LOG_LEVEL_DEBUG, 0, 0, "Show debug level logs"}, + {"auto-restart", OPT_AUTO_RESTART, 0, 0, "Automatic restart"}, +@@ -72,6 +77,11 @@ int setLogLevelDebug() { + return 0; + } + ++void showVersion() { ++ std::cout << VERSION << std::endl; ++ exit(0); ++} ++ + bool needShowUsage(struct arguments *arguments, struct argp_state *state) { + if (state->arg_num > 0) + return true; +@@ -141,6 +151,9 @@ int parseOption(int key, char *arg, struct argp_state *state) { + case 'c': + parseConfigFile(arguments, arg); + break; ++ case 'v': ++ showVersion(); ++ break; + case OPT_NO_TIMESTAMP: + disableLogTimestamp(); + break; |