SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,43 @@
BROKEN = needs an update for LLVM 13
COMMENT = generator for the woboq code browser
DISTNAME = woboq_codebrowser-2.1pl2
GH_ACCOUNT = woboq
GH_PROJECT = woboq_codebrowser
# support LLVM version we have in ports
GH_COMMIT = 19b823ba36993d7ca2e06cbebcac39fb1c8059f3
CATEGORIES = devel
HOMEPAGE = https://woboq.com/codebrowser.html
# Commercial or CC-BY-NC-SA 3.0
# (you may not use the material for commercial purposes)
#
# https://woboq.com/codebrowser.html
# "If you are interested in hosting a browsable version of your own C/C++
# source code on your website or intranet, you can purchase a license of
# our code browser generator."
#
PERMIT_PACKAGE = Yes
# uses pledge()
WANTLIB = ${COMPILER_LIBCXX} c m
COMPILER = base-clang ports-clang
MODULES = devel/cmake
BUILD_DEPENDS = devel/llvm
RUN_DEPENDS = devel/llvm
NO_TEST = Yes
SUBST_VARS += VARBASE
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/${GH_PROJECT}
${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/doc/${GH_PROJECT}
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (woboq_codebrowser-2.1pl2-19b823ba.tar.gz) = HTnT2czZ3zJNhzf7Mh8X1laGgQoqidiM1nwkza5+tKU=
SIZE (woboq_codebrowser-2.1pl2-19b823ba.tar.gz) = 206782

View file

@ -0,0 +1,31 @@
add pledge(2) and unveil(2) to codebrowser_generator
Index: generator/main.cpp
--- generator/main.cpp.orig
+++ generator/main.cpp
@@ -43,6 +43,8 @@
#include "compat.h"
#include <ctime>
+#include <unistd.h>
+
#include "embedded_includes.h"
namespace cl = llvm::cl;
@@ -325,6 +327,16 @@ int main(int argc, const char **argv) {
}
llvm::cl::ParseCommandLineOptions(argc, argv);
+
+ create_directories(OutputPath);
+ if ((unveil(OutputPath.c_str(), "rwc") == -1) || (unveil("/", "r") == -1)) {
+ std::cerr << "error: unveil" << std::endl;
+ return EXIT_FAILURE;
+ }
+ if (pledge("stdio rpath wpath cpath tty", "") == -1) {
+ std::cerr << "error: pledge" << std::endl;
+ return EXIT_FAILURE;
+ }
#ifdef _WIN32
make_forward_slashes(OutputPath._Get_data()._Myptr());

View file

@ -0,0 +1,29 @@
add pledge(2) and unveil(2) to codebrowser_indexgenerator.
Index: indexgenerator/indexer.cpp
--- indexgenerator/indexer.cpp.orig
+++ indexgenerator/indexer.cpp
@@ -28,6 +28,8 @@
#include <map>
#include <ctime>
+#include <unistd.h>
+
#include "../global.h"
const char *data_url = "../data";
@@ -228,6 +230,14 @@ int main(int argc, char **argv) {
if (root.empty()) {
std::cerr << "Usage: " << argv[0] << " <path> [-d data_url] [-p project_definition]" << std::endl;
return -1;
+ }
+ if ((unveil(root.c_str(), "rwc") == -1) || (unveil("/", "r") == -1)) {
+ std::cerr << "error: unveil" << std::endl;
+ return EXIT_FAILURE;
+ }
+ if (pledge("stdio rpath wpath cpath tty", "") == -1) {
+ std::cerr << "error: pledge" << std::endl;
+ return EXIT_FAILURE;
}
std::ifstream fileIndex(root + "/" + "fileIndex");
std::string line;

View file

@ -0,0 +1,21 @@
The generator generates static HTML pages that can be served by any web
server. It can be run automatically manually or with a hook on your
version control or CI system.
It functions as the source code indexer (using libclang). In contrast to
other solutions (LXR, OpenGrok) it semantically analyzes the code as a
compile step.
The generation is a two-step process: First is a compile step that
creates a .h.html and .cpp.html (and some other) files from the syntax
tree (AST) of the source source. The second step generates an index.html
for each directory.
A server-side database or CGI script are currently not needed, so it is
easy to host. Your normal HTML5 web browser is the source code navigator
(from your local machine or your network).
Please note that the license does not allow you to use the code browser
to assist the development of your commercial software. If you intent to
do so, consider purchasing a commercial licence.

View file

@ -0,0 +1,40 @@
@bin bin/codebrowser_generator
@bin bin/codebrowser_indexgenerator
share/doc/pkg-readmes/${PKGSTEM}
share/doc/woboq_codebrowser/
share/doc/woboq_codebrowser/README.md
share/woboq/
share/woboq/data/
share/woboq/data/back.png
share/woboq/data/codebrowser.js
share/woboq/data/common.css
share/woboq/data/folder.png
share/woboq/data/indexscript.js
share/woboq/data/indexstyle.css
share/woboq/data/jquery/
share/woboq/data/jquery/images/
share/woboq/data/jquery/images/ui-bg_diagonals-thick_18_b81900_40x40.png
share/woboq/data/jquery/images/ui-bg_diagonals-thick_20_666666_40x40.png
share/woboq/data/jquery/images/ui-bg_glass_100_f6f6f6_1x400.png
share/woboq/data/jquery/images/ui-bg_glass_100_fdf5ce_1x400.png
share/woboq/data/jquery/images/ui-bg_glass_65_ffffff_1x400.png
share/woboq/data/jquery/images/ui-bg_gloss-wave_35_f6a828_500x100.png
share/woboq/data/jquery/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
share/woboq/data/jquery/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
share/woboq/data/jquery/images/ui-icons_222222_256x240.png
share/woboq/data/jquery/images/ui-icons_228ef1_256x240.png
share/woboq/data/jquery/images/ui-icons_ef8c08_256x240.png
share/woboq/data/jquery/images/ui-icons_ffd27a_256x240.png
share/woboq/data/jquery/images/ui-icons_ffffff_256x240.png
share/woboq/data/jquery/jquery-ui.css
share/woboq/data/jquery/jquery-ui.min.js
share/woboq/data/jquery/jquery.min.js
share/woboq/data/jquery/js/
share/woboq/data/jquery/js/jquery-1.8.0.min.js
share/woboq/data/jquery/js/jquery-ui-1.8.23.custom.min.js
share/woboq/data/kdevelop.css
share/woboq/data/qtcreator.css
share/woboq/data/solarized.css
share/woboq/data/symbol.html
share/woboq/data/txt.png
share/woboq/data/woboq-48.png

View file

@ -0,0 +1,45 @@
+-------------------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-------------------------------------------------------------------------------
Licence information
-------------------
Licensees holding valid commercial licenses provided by Woboq may use
this software in accordance with the terms contained in a written
agreement between the licensee and Woboq. For further information see
https://woboq.com/codebrowser.html
Alternatively, this work may be used under a Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 (CC-BY-NC-SA 3.0) License.
http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US
This license does not allow you to use the code browser to assist
the development of your commercial software. If you intent to do so,
consider purchasing a commercial licence.
Example of usage with OpenBSD kernel (~1.5Go)
---------------------------------------------
Compile and generate compile_commands.json
$ cd /sys/arch/amd64/compile/GENERIC.MP
$ make obj
$ make config
$ make COPTS='-MJ $@.json -O2'
$ sed -e '1s/^/[/' -e '$s/,$/]/' obj/*.o.json > compile_commands.json
Generate static HTML from compile_commands.json
$ codebrowser_generator -a -b /sys/arch/amd64/compile/GENERIC.MP \
-o ${VARBASE}/www/htdocs/openbsd \
-p sys:/sys \
-d http://localhost/data
$ codebrowser_indexgenerator ${VARBASE}/www/htdocs/openbsd \
-p sys:/sys \
-d http://localhost/data
$ cp -R ${LOCALBASE}/share/woboq/data ${VARBASE}/www/htdocs