From nobody Sat Sep 21 21:42:47 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XB2mS2bZTz5WhlY; Sat, 21 Sep 2024 21:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XB2mS0m1Gz4mlX; Sat, 21 Sep 2024 21:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726954968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b3WBQt0nltw4s6QvqA3PlRAYNvb6Yg1tN6U7v6CpthU=; b=W8KfNqAigJtASDMVVDu7BDRsZ4b1vl3kyKlT8+N0RcEK0y9ViCksBDz+Flz8NAKuV396g8 VSYboHeA+xTZq9oVYZuVUZyp5GIh2EAi21gva12ClVgBSwuDkTHeyguo5AiJnMbQ/iTsY/ 8H6fhqr4yrBVLPi+LzvzxjOrvLZdOpm7z/gmH521Qq8xTBysXVoNb+juY44kRlwPKVXptT b2+sp8iqvegEEkBOwWJ+K9LMPovOv+xA49b22GlrI4jwwir6R7+FkLDMBU3ZmPynPrvm2A EMFxIioF1CxpF1HWKT7TqBDR0I8XWuu2oTFFQ6mfuxUTVmUuvT80HW7Qee9g4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726954968; a=rsa-sha256; cv=none; b=lAObnIq3k9Y+mdRPN0No/53IcdNaB46wgShD9063egg6EwtycqiNwe+PHBVjuYoBoQ9YtW J+rmjQdUgrN1fJiKaaMS6EQfDe1vm/FV38o70+juTuPtvmg68TdXGTY6bZG7u9EcjumuEq V/6DYy3p9g/AtSRtDXFf4mRSGv3VI47qA35wBcTfJdGX5i2qG8hIQX0AezY3bFnu+jskuh pVoNxYyv2+AC4AyhlDD7a/p4rOpFGEQ20hEO+Vs3dNDkiLiBdfV+DCAHVhj2KMWvZY68ab VhgX0e0d0BT6AwhmZ2Cx7AUcurt6nOeZdFOLLvA/VLswdqpMscLINmKPAMA9dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726954968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b3WBQt0nltw4s6QvqA3PlRAYNvb6Yg1tN6U7v6CpthU=; b=X0j1FXZdgomNKlGaUeeYIVCE4+kATFztnaa4W1AVRuMizDUIgrfThe24okSsD625MHnC+v pEsGw0SqgJN3WfNu+pBnN1vEHfqBFynm/cvXzn8A29YYQOiMw2k+jzqp9inX8DkFfm96be Z/NSalacz7++2m9CBAV9kg+yz9orRAybBY8BCkoj658rtixv5JhaHSRS8/wjQ9QyEzJMkt H19EgKmjEv29wy8smdhz6RQRcgAyzVOqpPhOKmuhP+7W4olpKL2g24GJ7P1h3resmriaJm 7AomX9W4ZE1//I/vrB4sKVEjWu6n9/bcaWD8Jv5mA2F7p2hY4m6LwuswNZSZHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XB2mS0MGYzqGq; Sat, 21 Sep 2024 21:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48LLglb3092671; Sat, 21 Sep 2024 21:42:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48LLgl5L092668; Sat, 21 Sep 2024 21:42:47 GMT (envelope-from git) Date: Sat, 21 Sep 2024 21:42:47 GMT Message-Id: <202409212142.48LLgl5L092668@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Vladimir Druzenko Subject: git: 97d2f200cd1f - main - net-im/concord: New port: Discord library written in C List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vvd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97d2f200cd1f21f86c92d2644f563a86a89d5c65 Auto-Submitted: auto-generated The branch main has been updated by vvd: URL: https://cgit.FreeBSD.org/ports/commit/?id=97d2f200cd1f21f86c92d2644f563a86a89d5c65 commit 97d2f200cd1f21f86c92d2644f563a86a89d5c65 Author: Souji Thenria AuthorDate: 2024-09-21 21:40:55 +0000 Commit: Vladimir Druzenko CommitDate: 2024-09-21 21:42:33 +0000 net-im/concord: New port: Discord library written in C Concord is an asynchronous C99 Discord API library with minimal external dependencies, and a low-level translation of the Discord official documentation to C code. https://github.com/Cogmasters/concord PR: 279553 --- net-im/Makefile | 1 + net-im/concord/Makefile | 52 +++++++++++++++++++ net-im/concord/distinfo | 3 ++ net-im/concord/files/Makefile.examples | 48 ++++++++++++++++++ net-im/concord/files/config.json.examples | 21 ++++++++ net-im/concord/files/patch-src_Makefile | 10 ++++ net-im/concord/pkg-descr | 3 ++ net-im/concord/pkg-plist | 84 +++++++++++++++++++++++++++++++ 8 files changed, 222 insertions(+) diff --git a/net-im/Makefile b/net-im/Makefile index 75794ba362eb..9a079739aafe 100644 --- a/net-im/Makefile +++ b/net-im/Makefile @@ -4,6 +4,7 @@ SUBDIR += biboumi SUBDIR += chatterino2 SUBDIR += coccinella + SUBDIR += concord SUBDIR += conduit SUBDIR += convey SUBDIR += coyim diff --git a/net-im/concord/Makefile b/net-im/concord/Makefile new file mode 100644 index 000000000000..628a4052dd5c --- /dev/null +++ b/net-im/concord/Makefile @@ -0,0 +1,52 @@ +PORTNAME= concord +DISTVERSIONPREFIX= v +DISTVERSION= 2.3.0 +CATEGORIES= net-im devel + +MAINTAINER= mail@souji-thenria.net +COMMENT= Discord library written in C +WWW= https://github.com/Cogmasters/concord + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= curl>=7.56.1:ftp/curl +RUN_DEPENDS= curl>=7.56.1:ftp/curl + +USE_GITHUB= yes +GH_ACCOUNT= Cogmasters + +MAKE_ARGS= DESTINCLUDE_DIR=${STAGEDIR}${PREFIX}/include/concord \ + DESTLIBDIR=${STAGEDIR}${PREFIX}/lib + +OPTIONS_DEFINE= DEBUG_HTTP DEBUG_WEBSOCKETS EXAMPLES SIGINTCATCH +OPTIONS_DEFAULT= EXAMPLES SHARED +OPTIONS_SINGLE= TARGETS +OPTIONS_SINGLE_TARGETS= DEBUG SHARED STATIC +OPTIONS_SUB= yes + +DEBUG_HTTP_DESC= Verbose debugging for HTTP communication +DEBUG_WEBSOCKETS_DESC= Verbose debugging for WebSockets communication +SHARED_DESC= Build dynamically linked version +SIGINTCATCH_DESC= Shutdown gracefully when a SIGINT is received +STATIC_DESC= Build statically linked version + +DEBUG_VARS= ALL_TARGET=debug +DEBUG_HTTP_CFLAGS= -DCCORD_DEBUG_HTTP +DEBUG_WEBSOCKETS_CFLAGS= -DCCORD_DEBUG_WEBSOCKETS +SHARED_LIB_DEPENDS= libcurl.so:ftp/curl +SHARED_VARS= ALL_TARGET=shared +SIGINTCATCH_CFLAGS= -DCCORD_SIGINTCATCH +STATIC_VARS= ALL_TARGET=static + +post-install-EXAMPLES-on: + ${REINPLACE_CMD} -e 's|#include "\([^"]*\)\.h"|#include |; \ + s|\.\./config\.json|config.json|' ${WRKSRC}/examples/*.c + cd ${WRKSRC}/examples && ${COPYTREE_SHARE} "*.c" ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${FILESDIR}/Makefile.examples ${STAGEDIR}${EXAMPLESDIR}/Makefile + ${INSTALL_DATA} ${FILESDIR}/config.json.examples ${STAGEDIR}${EXAMPLESDIR}/config.json + +post-install-SHARED-on: + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libdiscord.so + +.include diff --git a/net-im/concord/distinfo b/net-im/concord/distinfo new file mode 100644 index 000000000000..4a4b7a418c54 --- /dev/null +++ b/net-im/concord/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1726788532 +SHA256 (Cogmasters-concord-v2.3.0_GH0.tar.gz) = 3e789e6c6f9f3b5c480aaf4fb337819043c53fcce8b50966e95d7b5daef38d4d +SIZE (Cogmasters-concord-v2.3.0_GH0.tar.gz) = 775124 diff --git a/net-im/concord/files/Makefile.examples b/net-im/concord/files/Makefile.examples new file mode 100644 index 000000000000..0866c1e421d0 --- /dev/null +++ b/net-im/concord/files/Makefile.examples @@ -0,0 +1,48 @@ +CC ?= cc + +STD_BOTS = 8ball \ + audit-log \ + ban \ + cache \ + channel \ + components \ + copycat \ + embed \ + emoji \ + fetch-messages \ + guild-template \ + guild \ + invite \ + manual-dm \ + pin \ + ping-pong \ + presence \ + reaction \ + shell \ + slash-commands \ + slash-commands2 \ + spam \ + webhook \ + timers +VOICE_BOTS = voice-join + +BOTS += $(STD_BOTS) + +CFLAGS += -O0 -g -pthread -Wall -I/usr/local/include +LDFLAGS = -L/usr/local/lib +LDLIBS = -ldiscord -lcurl + +all: $(BOTS) + +voice: + @ CFLAGS=-DCCORD_VOICE BOTS=$(VOICE_BOTS) $(MAKE) + +echo: + @ echo -e 'CC: $(CC)\n' + @ echo -e 'STD_BOTS: $(STD_BOTS)\n' + @ echo -e 'VOICE_BOTS: $(VOICE_BOTS)\n' + +clean: + @ rm -f $(STD_BOTS) $(VOICE_BOTS) + +.PHONY: all echo clean diff --git a/net-im/concord/files/config.json.examples b/net-im/concord/files/config.json.examples new file mode 100644 index 000000000000..04cbe0bbe0f2 --- /dev/null +++ b/net-im/concord/files/config.json.examples @@ -0,0 +1,21 @@ +{ + "logging": { + "level": "trace", + "filename": "bot.log", + "quiet": false, + "overwrite": true, + "use_color": true, + "http": { + "enable": true, + "filename": "http.log" + }, + "disable_modules": ["WEBSOCKETS", "USER_AGENT"] + }, + "discord": { + "token": "YOUR-BOT-TOKEN", + "default_prefix": { + "enable": false, + "prefix": "YOUR-COMMANDS-PREFIX" + } + } +} diff --git a/net-im/concord/files/patch-src_Makefile b/net-im/concord/files/patch-src_Makefile new file mode 100644 index 000000000000..1b36f1549d7c --- /dev/null +++ b/net-im/concord/files/patch-src_Makefile @@ -0,0 +1,10 @@ +--- src/Makefile.orig 2024-09-20 12:42:26 UTC ++++ src/Makefile +@@ -82,7 +82,7 @@ $(SOLIB): deps + $(ARLIB): deps + $(AR) $(ARFLAGS) $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) + $(SOLIB): deps +- $(CC) -shared -lcurl -o $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) ++ $(CC) -shared -L$(PREFIX)/lib -lcurl -o $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) + $(DYLIB): deps + $(CC) -dynamiclib $(DYFLAGS) -o $@ $(OBJS) $(GENCODECS_OBJ) $(CORE_OBJS) diff --git a/net-im/concord/pkg-descr b/net-im/concord/pkg-descr new file mode 100644 index 000000000000..f9ff3432b28b --- /dev/null +++ b/net-im/concord/pkg-descr @@ -0,0 +1,3 @@ +Concord is an asynchronous C99 Discord API library with minimal external +dependencies, and a low-level translation of the Discord official documentation +to C code. diff --git a/net-im/concord/pkg-plist b/net-im/concord/pkg-plist new file mode 100644 index 000000000000..b7d737740297 --- /dev/null +++ b/net-im/concord/pkg-plist @@ -0,0 +1,84 @@ +include/concord/all.PRE.h +include/concord/anomap.h +include/concord/application_command.h +include/concord/attributes.h +include/concord/audit_log.h +include/concord/auto_moderation.h +include/concord/carray.h +include/concord/channel.h +include/concord/chash.h +include/concord/clock.h +include/concord/cog-utils.h +include/concord/concord-once.h +include/concord/curl-websocket.h +include/concord/discord-cache.h +include/concord/discord-events.h +include/concord/discord-internal.h +include/concord/discord-request.h +include/concord/discord-response.h +include/concord/discord-voice.h +include/concord/discord-worker.h +include/concord/discord.h +include/concord/discord_codecs.PRE.h +include/concord/discord_codecs.h +include/concord/emoji.h +include/concord/error.h +include/concord/gateway.h +include/concord/gencodecs-process.PRE.h +include/concord/gencodecs.h +include/concord/guild.h +include/concord/guild_scheduled_event.h +include/concord/guild_template.h +include/concord/interaction.h +include/concord/invite.h +include/concord/io_poller.h +include/concord/jsmn-find.h +include/concord/jsmn.h +include/concord/json-build.h +include/concord/log.h +include/concord/logconf.h +include/concord/oauth2.h +include/concord/osname.h +include/concord/priority_queue.h +include/concord/queriec.h +include/concord/queue.h +include/concord/sha1.h +include/concord/stage_instance.h +include/concord/sticker.h +include/concord/threadpool.h +include/concord/types.h +include/concord/user-agent.h +include/concord/user.h +include/concord/voice.h +include/concord/webhook.h +include/concord/websockets.h +%%DEBUG%%lib/libdiscord.a +%%STATIC%%lib/libdiscord.a +%%SHARED%%lib/libdiscord.so +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/8ball.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/audit-log.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ban.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cache.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/channel.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/components.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/config.json +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copycat.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/embed.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/emoji.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fetch-messages.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/guild-template.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/guild.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/invite.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/manual-dm.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pin.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ping-pong.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/presence.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/reaction.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shell.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/slash-commands.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/slash-commands2.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/spam.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/timers.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/voice-join.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/webhook.c