--- /dev/null
+# $OpenBSD$
+
+COMMENT = C/C++/ObjC language server
+HOMEPAGE = https://github.com/MaskRay/ccls
+MAINTAINER = Nick Gasson <nick@nickg.me.uk>
+CATEGORIES = devel
+
+GH_ACCOUNT = MaskRay
+GH_PROJECT = ccls
+GH_TAGNAME = 0.20210330
+
+MODULES = devel/cmake
+
+# Apache 2.0
+PERMIT_PACKAGE = Yes
+
+COMPILER = base-clang
+COMPILER_LANGS = c++
+
+BUILD_DEPENDS = devel/llvm devel/rapidjson
+RUN_DEPENDS = devel/llvm
+
+WANTLIB = c clang-cpp m pthread ${COMPILER_LIBCXX}
+
+CONFIGURE_ARGS = -DUSE_SYSTEM_RAPIDJSON=ON -DCLANG_LINK_CLANG_DYLIB=ON \
+ -DLLVM_LINK_LLVM_DYLIB=ON \
+ -DCCLS_VERSION=$(GH_TAGNAME)
+
+.include <bsd.port.mk>
--- /dev/null
+SHA256 (ccls-0.20210330.tar.gz) = KMIo9J38DyPLXVgbfeNXkmSPMsOfTKNfaP+MnLXOVsI=
+SIZE (ccls-0.20210330.tar.gz) = 160487
--- /dev/null
+ccls is a C/C++/Objective-C language server supporting most features of
+the LSP protocol including code completion, cross references,
+formatting, caller/callee hierarchies, symbol renaming, diagnostics,
+semantic highlighting, and more.
--- /dev/null
+@comment $OpenBSD: PLIST,v$
+@bin bin/ccls
--- /dev/null
+# $OpenBSD$
+
+COMMENT = fast header only JSON parser/generator for C++
+HOMEPAGE = https://rapidjson.org/
+MAINTAINER = Nick Gasson <nick@nickg.me.uk>
+CATEGORIES = devel
+
+GH_ACCOUNT = Tencent
+GH_PROJECT = rapidjson
+GH_TAGNAME = v1.1.0
+
+MODULES = devel/cmake
+
+# MIT
+PERMIT_PACKAGE = Yes
+
+COMPILER = base-clang ports-gcc
+
+CONFIGURE_ARGS = -DRAPIDJSON_BUILD_DOC=NO -DRAPIDJSON_BUILD_EXAMPLES=NO
+
+# Needs gtest source
+NO_TEST = Yes
+
+.include <bsd.port.mk>
--- /dev/null
+SHA256 (rapidjson-1.1.0.tar.gz) = v3ztKXBKHmlvvM8qK06gaOd3T6N/bX3UA50Hh/i+2Y4=
+SIZE (rapidjson-1.1.0.tar.gz) = 1019402
--- /dev/null
+RapidJSON is a self-contained and header-only JSON parser and generator
+for C++ with both SAX and DOM style APIs. It fully supports UTF-8,
+UTF-16, UTF-32 (LE & BE) and also optionally supports SSE2/SSE4.2 for
+acceleration.
--- /dev/null
+@comment $OpenBSD: PLIST,v$
+include/rapidjson/
+include/rapidjson/allocators.h
+include/rapidjson/document.h
+include/rapidjson/encodedstream.h
+include/rapidjson/encodings.h
+include/rapidjson/error/
+include/rapidjson/error/en.h
+include/rapidjson/error/error.h
+include/rapidjson/filereadstream.h
+include/rapidjson/filewritestream.h
+include/rapidjson/fwd.h
+include/rapidjson/internal/
+include/rapidjson/internal/biginteger.h
+include/rapidjson/internal/diyfp.h
+include/rapidjson/internal/dtoa.h
+include/rapidjson/internal/ieee754.h
+include/rapidjson/internal/itoa.h
+include/rapidjson/internal/meta.h
+include/rapidjson/internal/pow10.h
+include/rapidjson/internal/regex.h
+include/rapidjson/internal/stack.h
+include/rapidjson/internal/strfunc.h
+include/rapidjson/internal/strtod.h
+include/rapidjson/internal/swap.h
+include/rapidjson/istreamwrapper.h
+include/rapidjson/memorybuffer.h
+include/rapidjson/memorystream.h
+include/rapidjson/msinttypes/
+include/rapidjson/msinttypes/inttypes.h
+include/rapidjson/msinttypes/stdint.h
+include/rapidjson/ostreamwrapper.h
+include/rapidjson/pointer.h
+include/rapidjson/prettywriter.h
+include/rapidjson/rapidjson.h
+include/rapidjson/reader.h
+include/rapidjson/schema.h
+include/rapidjson/stream.h
+include/rapidjson/stringbuffer.h
+include/rapidjson/writer.h
+lib/cmake/
+lib/cmake/RapidJSON/
+lib/cmake/RapidJSON/RapidJSONConfig.cmake
+lib/cmake/RapidJSON/RapidJSONConfigVersion.cmake
+lib/pkgconfig/RapidJSON.pc
+share/doc/RapidJSON/
+share/doc/RapidJSON/examples/
+share/doc/RapidJSON/examples/CMakeLists.txt
+share/doc/RapidJSON/examples/capitalize/
+share/doc/RapidJSON/examples/capitalize/capitalize.cpp
+share/doc/RapidJSON/examples/condense/
+share/doc/RapidJSON/examples/condense/condense.cpp
+share/doc/RapidJSON/examples/filterkey/
+share/doc/RapidJSON/examples/filterkey/filterkey.cpp
+share/doc/RapidJSON/examples/filterkeydom/
+share/doc/RapidJSON/examples/filterkeydom/filterkeydom.cpp
+share/doc/RapidJSON/examples/jsonx/
+share/doc/RapidJSON/examples/jsonx/jsonx.cpp
+share/doc/RapidJSON/examples/messagereader/
+share/doc/RapidJSON/examples/messagereader/messagereader.cpp
+share/doc/RapidJSON/examples/parsebyparts/
+share/doc/RapidJSON/examples/parsebyparts/parsebyparts.cpp
+share/doc/RapidJSON/examples/pretty/
+share/doc/RapidJSON/examples/pretty/pretty.cpp
+share/doc/RapidJSON/examples/prettyauto/
+share/doc/RapidJSON/examples/prettyauto/prettyauto.cpp
+share/doc/RapidJSON/examples/schemavalidator/
+share/doc/RapidJSON/examples/schemavalidator/schemavalidator.cpp
+share/doc/RapidJSON/examples/serialize/
+share/doc/RapidJSON/examples/serialize/serialize.cpp
+share/doc/RapidJSON/examples/simpledom/
+share/doc/RapidJSON/examples/simpledom/simpledom.cpp
+share/doc/RapidJSON/examples/simplereader/
+share/doc/RapidJSON/examples/simplereader/simplereader.cpp
+share/doc/RapidJSON/examples/simplewriter/
+share/doc/RapidJSON/examples/simplewriter/simplewriter.cpp
+share/doc/RapidJSON/examples/tutorial/
+share/doc/RapidJSON/examples/tutorial/tutorial.cpp
+share/doc/RapidJSON/readme.md
--- /dev/null
+# $OpenBSD$
+#
+
+COMMENT = unidentifiable mechanism for bypassing GFW
+CATEGORIES = net
+
+GH_ACCOUNT = trojan-gfw
+GH_PROJECT = trojan
+GH_TAGNAME = v1.16.0
+
+MODULES = devel/cmake
+
+HOMEPAGE = https://trojan-gfw.github.io/trojan/
+
+MAINTAINER = Nick Gasson <nick@nickg.me.uk>
+
+# GPLv3
+PERMIT_PACKAGE = Yes
+
+# If pledge is used, annotate with `uses pledge()' in a comment
+
+WANTLIB += ${COMPILER_LIBCXX} c crypto m ssl
+WANTLIB += boost_program_options-mt boost_system-mt
+
+COMPILER = base-clang ports-gcc
+
+#BUILD_DEPENDS = devel/boost
+#RUN_DEPENDS = ???
+LIB_DEPENDS = devel/boost
+#TEST_DEPENDS = ???
+
+CONFIGURE_ARGS = -DENABLE_MYSQL=OFF \
+ -DENABLE_TLS13_CIPHERSUITES=OFF \
+ -DENABLE_SSL_KEYLOG=OFF \
+ -DDEFAULT_CONFIG="${SYSCONFDIR}/trojan/config.json"
+
+.include <bsd.port.mk>
--- /dev/null
+SHA256 (trojan-1.16.0.tar.gz) = hs2yaFuwOmO2LOBlRcQRiZUvHsSgzZFHRQMS7XCVbLw=
+SIZE (trojan-1.16.0.tar.gz) = 51669
--- /dev/null
+$OpenBSD$
+
+Index: CMakeLists.txt
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -107,7 +107,7 @@ else()
+
+ include(GNUInstallDirs)
+ install(TARGETS trojan DESTINATION ${CMAKE_INSTALL_BINDIR})
+- install(FILES examples/server.json-example DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/trojan RENAME config.json)
++ #install(FILES examples/server.json-example DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/trojan RENAME config.json)
+ set(DEFAULT_CONFIG ${CMAKE_INSTALL_FULL_SYSCONFDIR}/trojan/config.json CACHE STRING "Default config path")
+ add_definitions(-DDEFAULT_CONFIG="${DEFAULT_CONFIG}")
+ install(FILES docs/trojan.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+@@ -119,6 +119,12 @@ else()
+ set(CONFIG_NAME %i)
+ configure_file(examples/trojan.service-example trojan@.service)
+ install(FILES ${CMAKE_BINARY_DIR}/trojan.service ${CMAKE_BINARY_DIR}/trojan@.service DESTINATION ${SYSTEMD_SERVICE_PATH})
++ endif()
++
++ include(CheckSymbolExists)
++ check_symbol_exists(daemon "stdlib.h;unistd.h" HAVE_DAEMON)
++ if(HAVE_DAEMON)
++ add_definitions(-DHAVE_DAEMON)
+ endif()
+
+ enable_testing()
--- /dev/null
+$OpenBSD$
+
+Index: docs/trojan.1
+--- docs/trojan.1.orig
++++ docs/trojan.1
+@@ -14,6 +14,9 @@ and start either a proxy client or a proxy server.
+ .BR \-c, " " \-\-config=\fICONFIG\fR
+ Set the config file to be loaded. Default is \fI/etc/trojan/config.json\fR.
+ .TP
++.BR \-d, " " \-\-daemon
++Detach from the terminal and run in the background as a daemon.
++.TP
+ .BR \-h, " " \-\-help
+ Print help message.
+ .TP
--- /dev/null
+$OpenBSD$
+
+Index: docs/usage.md
+--- docs/usage.md.orig
++++ docs/usage.md
+@@ -4,6 +4,7 @@
+ usage: ./trojan [-htv] [-l LOG] [-k KEYLOG] [[-c] CONFIG]
+ options:
+ -c [ --config ] CONFIG specify config file
++ -d [ --daemon ] fork into background
+ -h [ --help ] print help message
+ -k [ --keylog ] KEYLOG specify keylog file location (OpenSSL >= 1.1.1)
+ -l [ --log ] LOG specify log file location
--- /dev/null
+$OpenBSD$
+
+Index: src/main.cpp
+--- src/main.cpp.orig
++++ src/main.cpp
+@@ -26,6 +26,9 @@
+ #ifdef ENABLE_MYSQL
+ #include <mysql.h>
+ #endif // ENABLE_MYSQL
++#ifdef HAVE_DAEMON
++#include <unistd.h>
++#endif // HAVE_DAEMON
+ #include "core/service.h"
+ #include "core/version.h"
+ using namespace std;
+@@ -68,9 +71,11 @@ int main(int argc, const char *argv[]) {
+ string log_file;
+ string keylog_file;
+ bool test;
++ bool do_daemon;
+ po::options_description desc("options");
+ desc.add_options()
+ ("config,c", po::value<string>(&config_file)->default_value(DEFAULT_CONFIG)->value_name("CONFIG"), "specify config file")
++ ("daemon,d", po::bool_switch(&do_daemon), "fork into background")
+ ("help,h", "print help message")
+ ("keylog,k", po::value<string>(&keylog_file)->value_name("KEYLOG"), "specify keylog file location (OpenSSL >= 1.1.1)")
+ ("log,l", po::value<string>(&log_file)->value_name("LOG"), "specify log file location")
+@@ -83,7 +88,7 @@ int main(int argc, const char *argv[]) {
+ po::store(po::command_line_parser(argc, argv).options(desc).positional(pd).run(), vm);
+ po::notify(vm);
+ if (vm.count("help")) {
+- Log::log(string("usage: ") + argv[0] + " [-htv] [-l LOG] [-k KEYLOG] [[-c] CONFIG]", Log::FATAL);
++ Log::log(string("usage: ") + argv[0] + " [-hdtv] [-l LOG] [-k KEYLOG] [[-c] CONFIG]", Log::FATAL);
+ cerr << desc;
+ exit(EXIT_SUCCESS);
+ }
+@@ -137,6 +142,16 @@ int main(int argc, const char *argv[]) {
+ if (vm.count("keylog")) {
+ Log::redirect_keylog(keylog_file);
+ }
++#ifdef HAVE_DAEMON
++ if (do_daemon && daemon(0, 0) == -1) {
++ Log::log(string("Failed to fork into background: ") + strerror(errno), Log::FATAL);
++ exit(EXIT_FAILURE);
++ }
++#else // HAVE_DAEMON
++ if (do_daemon) {
++ Log::log("Daemon mode not supported on this system", Log::FATAL);
++ }
++#endif // HAVE_DAEMON
+ bool restart;
+ Config config;
+ do {
--- /dev/null
+An unidentifiable mechanism that helps you bypass GFW.
+
+On penetrating GFW, people assume that strong encryption and random
+obfuscation may cheat GFW’s filtration mechanism. However, trojan
+implements the direct opposite: it imitates the most common protocol
+across the wall, HTTPS, to trick GFW into thinking that it is HTTPS.
\ No newline at end of file
--- /dev/null
+@comment $OpenBSD: PLIST,v$
+@rcscript ${RCDIR}/trojan
+@bin bin/trojan
+@man man/man1/trojan.1
+share/doc/trojan/
+share/doc/trojan/README.md
+share/doc/trojan/authenticator.md
+share/doc/trojan/build.md
+share/doc/trojan/config.md
+share/doc/trojan/examples/
+share/doc/trojan/examples/client.json-example
+share/doc/trojan/examples/forward.json-example
+share/doc/trojan/examples/nat.json-example
+share/doc/trojan/examples/server.json-example
+share/doc/trojan/overview.md
+share/doc/trojan/protocol.md
+share/doc/trojan/usage.md
--- /dev/null
+#!/bin/ksh
+#
+# $OpenBSD$
+
+daemon="${TRUEPREFIX}/bin/trojan -d"
+
+. /etc/rc.d/rc.subr
+
+rc_pre() {
+ true
+ #install -d -o _mpd /var/run/mpd
+}
+
+rc_cmd $1