Compare commits

..

9 Commits

Author SHA1 Message Date
02f87e1604 Bump liberty
All checks were successful
Alpine 3.20 Success
Arch Linux AUR Success
OpenBSD 7.5 Success
2024-08-08 09:45:51 +02:00
042bd29094 CMakeLists.txt: declare compatibility with 3.27
All checks were successful
Arch Linux AUR Success
Alpine 3.19 Success
OpenBSD 7.3 Success
Sadly, the 3.5 deprecation warning doesn't go away after this.
2023-08-01 03:24:46 +02:00
d0af81c08d Try harder to find ncursesw 2023-07-24 09:14:31 +02:00
cabd2bad9b CMakeLists.txt: link properly 2023-07-04 08:06:31 +02:00
f0583e3d1a README.adoc: update package information 2023-07-01 21:59:45 +02:00
c420e3ce86 Fix plugin search path on Nix
Even its non-full GNUInstallDirs paths are absolute,
which is apparently allowed.
2023-06-29 02:25:23 +02:00
11567dc05c Update http-parser submodule URL 2023-06-29 01:50:21 +02:00
462280fd2f Update .gitignore 2021-10-30 03:28:13 +02:00
c8eb6433cb Add clang-format configuration 2021-10-30 03:02:16 +02:00
9 changed files with 52 additions and 13 deletions

32
.clang-format Normal file
View File

@@ -0,0 +1,32 @@
# clang-format is fairly limited, and these rules are approximate:
# - array initializers can get terribly mangled with clang-format 12.0,
# - sometimes it still aligns with space characters,
# - struct name NL { NL ... NL } NL name; is unachievable.
BasedOnStyle: GNU
ColumnLimit: 80
IndentWidth: 4
TabWidth: 4
UseTab: ForContinuationAndIndentation
BreakBeforeBraces: Allman
SpaceAfterCStyleCast: true
AlignAfterOpenBracket: DontAlign
AlignOperands: DontAlign
AlignConsecutiveMacros: Consecutive
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
IndentGotoLabels: false
# IncludeCategories has some potential, but it may also break the build.
# Note that the documentation says the value should be "Never".
SortIncludes: false
# This is a compromise, it generally works out aesthetically better.
BinPackArguments: false
# Unfortunately, this can't be told to align to column 40 or so.
SpacesBeforeTrailingComments: 2
# liberty-specific macro body wrappers.
MacroBlockBegin: "BLOCK_START"
MacroBlockEnd: "BLOCK_END"
ForEachMacros: ["LIST_FOR_EACH"]

2
.gitignore vendored
View File

@@ -7,3 +7,5 @@
/ponymap.files
/ponymap.creator*
/ponymap.includes
/ponymap.cflags
/ponymap.cxxflags

2
.gitmodules vendored
View File

@@ -1,6 +1,6 @@
[submodule "http-parser"]
path = http-parser
url = git://github.com/joyent/http-parser.git
url = https://github.com/nodejs/http-parser.git
[submodule "liberty"]
path = liberty
url = https://git.janouch.name/p/liberty.git

View File

@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.0...3.27)
project (ponymap VERSION 0.1.0 LANGUAGES C)
# Moar warnings
@@ -13,10 +13,10 @@ set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/liberty/cmake)
include (AddThreads)
find_package (Curses)
find_package (Ncursesw)
find_package (PkgConfig REQUIRED)
pkg_check_modules (jansson REQUIRED jansson)
pkg_check_modules (libssl REQUIRED libssl libcrypto)
pkg_check_modules (ncursesw ncursesw)
if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
# Need this in FreeBSD and OpenBSD respectively;
@@ -24,10 +24,10 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
endif ()
if (ncursesw_FOUND)
set (project_libraries ${ncursesw_LIBRARIES})
include_directories (${ncursesw_INCLUDE_DIRS})
link_directories (${ncursesw_LIBRARY_DIRS})
if (Ncursesw_FOUND)
set (project_libraries ${Ncursesw_LIBRARIES})
include_directories (${Ncursesw_INCLUDE_DIRS})
link_directories (${Ncursesw_LIBRARY_DIRS})
elseif (CURSES_FOUND)
set (project_libraries ${CURSES_LIBRARY})
include_directories (${CURSES_INCLUDE_DIR})
@@ -59,7 +59,7 @@ link_directories (${libssl_LIBRARY_DIRS} ${jansson_LIBRARY_DIRS})
foreach (extra iconv dl rt)
find_library (extra_lib_${extra} ${extra})
if (extra_lib_${extra})
list (APPEND project_libraries ${extra})
list (APPEND project_libraries ${extra_lib_${extra}})
endif ()
endforeach ()
@@ -70,6 +70,7 @@ set (project_headers ${PROJECT_BINARY_DIR}/config.h)
# Generate a configuration file
include (GNUInstallDirs)
set (plugin_dir ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
set (full_plugin_dir ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
configure_file (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h)
include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})

View File

@@ -17,8 +17,10 @@ the maximum number of concurrent connections.
Packages
--------
Regular releases are sporadic. git master should be stable enough. You can get
a package with the latest development version from Archlinux's AUR.
Regular releases are sporadic. git master should be stable enough.
You can get a package with the latest development version using Arch Linux's
https://aur.archlinux.org/packages/ponymap-git[AUR],
or as a https://git.janouch.name/p/nixexprs[Nix derivation].
Building and Usage
------------------

View File

@@ -5,6 +5,6 @@
#define PROGRAM_VERSION "${PROJECT_VERSION}"
#cmakedefine WITH_LUA
#define PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${plugin_dir}"
#define PLUGIN_DIR "${full_plugin_dir}"
#endif // ! CONFIG_H

Submodule liberty updated: d71c47f8ce...49d7cb12bb

View File

@@ -840,6 +840,7 @@ load_one_plugin (struct app_context *ctx, const char *name, const char *path)
void *table = dlopen (path, RTLD_LAZY | RTLD_LOCAL);
if (!table)
{
print_debug ("%s", path);
print_error ("could not load `%s': %s", name, dlerror ());
return false;
}
@@ -874,6 +875,7 @@ load_plugins (struct app_context *ctx)
DIR *dir = opendir (plugin_dir);
if (!dir)
{
print_debug ("%s", plugin_dir);
print_fatal ("%s: %s",
"cannot open plugin directory", strerror (errno));
return false;