Compare commits
183 Commits
master
...
e73dd52973
Author | SHA1 | Date | |
---|---|---|---|
e73dd52973 | |||
881eec4e02 | |||
bcdfc73767 | |||
0520aa3d40 | |||
c562d17b78 | |||
aee68520b3 | |||
88d8bf63f5 | |||
303887ea37 | |||
51d3d33175 | |||
cdb5ea279d | |||
311e1b318a | |||
31c5b6f1db | |||
a024f81e5d | |||
4089fca87c | |||
99533a9687 | |||
d175a38ad1 | |||
28e918be18 | |||
b4403ff959 | |||
8c548bad92 | |||
6ecad9af72 | |||
df73f9a18f | |||
9b453327a8 | |||
071552ffd5 | |||
33a0b4b295 | |||
21bcd0780c | |||
f6cdf2914c | |||
7698a62c1f | |||
2ae22cdb30 | |||
7705432820 | |||
f150832676 | |||
80c9375d65 | |||
48ddff9e85 | |||
6f64fe02d5 | |||
61ab4d8d58 | |||
3bb962a266 | |||
c286dc4f5c | |||
9d36ded2b3 | |||
71686405e0 | |||
34c4a9c508 | |||
effafd3e91 | |||
5a61bdf2b0 | |||
d21fcfd1c6 | |||
fff9a27362 | |||
ad7872a0e3 | |||
f3ea2ccc21 | |||
e959a9e795 | |||
3fe5eac56d | |||
67191be78d | |||
00cfb67b64 | |||
35aa8f5a94 | |||
f44972b8b3 | |||
94675a3011 | |||
7112fbee7e | |||
ff13633962 | |||
cb93e34de0 | |||
883968f53e | |||
d6d4b579c9 | |||
0e83d84360 | |||
63a6b3bdba | |||
aafa7e112a | |||
804eb7aa5a | |||
eeba641732 | |||
932ea6cb1d | |||
dd4724e374 | |||
e652c9956e | |||
d11767776e | |||
daefa58c0c | |||
7fe7299e7c | |||
0af9c6e8b0 | |||
b9c2113d43 | |||
4fd23de9b6 | |||
3b372ebe86 | |||
d14d149a3b | |||
44acf7dace | |||
da7efdb1a8 | |||
444f39f9ff | |||
fd9c26f016 | |||
7ef9f5cd65 | |||
d3321b3c57 | |||
bbe546008f | |||
5ec91e2d20 | |||
fbe4df0251 | |||
e5c690eb89 | |||
aeedd114a6 | |||
dfa5e0e005 | |||
5911d370e5 | |||
baf769c462 | |||
33e8e0890b | |||
e2e82edefb | |||
da1b5c6953 | |||
629725e262 | |||
6ba4c0091b | |||
99d5261aab | |||
97487cf0c4 | |||
8436f2e2bb | |||
310e436163 | |||
b64477fd7e | |||
782da43114 | |||
37854b693b | |||
7360b72c7b | |||
6f68f268c0 | |||
983587aeb7 | |||
ee415d2e4a | |||
0c075d7fe4 | |||
eec3653c6b | |||
5ac2a24611 | |||
144683d7b3 | |||
9c917a9119 | |||
dc48b84191 | |||
8555d31ddf | |||
cb0dde2a80 | |||
5f5b1f751b | |||
24c5dad929 | |||
f0046fcd57 | |||
3c3e415175 | |||
00d3355f43 | |||
907a14faff | |||
4348e89f99 | |||
7a24cc54f8 | |||
80f6e3c272 | |||
edb1297c4a | |||
1ee157f943 | |||
1b2981b06e | |||
7203fefd33 | |||
d808b2dd19 | |||
ee34a1e361 | |||
1766f91697 | |||
b3aa28d085 | |||
a605d7af11 | |||
19b1a33c48 | |||
04aa511448 | |||
8dc3d4466b | |||
0716a58ff0 | |||
60052081b4 | |||
f11d49b264 | |||
103dae6d08 | |||
821ed7b25e | |||
87f83b6f30 | |||
ace81d797e | |||
57ca2c7c6d | |||
8360d9e045 | |||
560ffbbb6a | |||
72314606f3 | |||
db009b69dd | |||
3ed99dc0ce | |||
762a7c99d5 | |||
4e62156b70 | |||
cc49536755 | |||
54b844dc3b | |||
1e8ba13f66 | |||
93011cee9c | |||
a474a5c73c | |||
17b98ca99d | |||
281eedb71e | |||
1ee533591c | |||
b87e1df140 | |||
f88239a13e | |||
68476cbc00 | |||
f2c1f64f02 | |||
a7209184c8 | |||
ba59e29499 | |||
f94196d865 | |||
bb5a9f9737 | |||
4bc5cf7c64 | |||
639d14452b | |||
e7413fb741 | |||
c0e720498d | |||
383c3b4be6 | |||
e9b202f5c8 | |||
bc3005a6a4 | |||
8cf19e0594 | |||
b137b57dbc | |||
5dff8927da | |||
197e79dd07 | |||
6262aca761 | |||
c156ae704b | |||
a67979ec40 | |||
54bfc11620 | |||
d33c2cd3a2 | |||
3a5f428fb6 | |||
0331152569 | |||
1b7e854f5f | |||
12a945d863 |
@ -99,7 +99,7 @@ PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Right
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SortIncludes: false
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
|
24
.clang-tidy
24
.clang-tidy
@ -1,30 +1,10 @@
|
||||
---
|
||||
Checks: [
|
||||
'-*',
|
||||
'clang-diagnostic-*',
|
||||
'clang-analyzer-*',
|
||||
'bugprone-*',
|
||||
'concurrency-*',
|
||||
'cppcoreguidelines-*',
|
||||
'modernize-*',
|
||||
'readability-*',
|
||||
'-readability-redundant-access-specifiers',
|
||||
'-readability-function-cognitive-complexity'
|
||||
]
|
||||
ExtraArgs: ['-Wno-unknown-warning-option']
|
||||
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,bugprone-*,concurrency-*,cppcoreguidelines-*,modernize-*,readability-*,-readability-redundant-access-specifiers,-readability-function-cognitive-complexity'
|
||||
ExtraArgs: '-Wno-unknown-warning-option'
|
||||
FormatStyle: none
|
||||
HeaderFileExtensions: ['', 'h','hh','hpp','hxx']
|
||||
HeaderFilterRegex: ''
|
||||
ImplementationFileExtensions: ['c','cc','cpp','cxx']
|
||||
CheckOptions:
|
||||
- key: MinimumExceptionNameLength
|
||||
value: 1
|
||||
- key: MinimumLoopCounterNameLength
|
||||
value: 3
|
||||
- key: MinimumParameterNameLength
|
||||
value: 3
|
||||
- key: MinimumVariableNameLength
|
||||
value: 3
|
||||
User: 'scott.e.graves@protonmail.com'
|
||||
WarningsAsErrors: ''
|
||||
...
|
||||
|
5
.clangd
5
.clangd
@ -1,5 +0,0 @@
|
||||
{
|
||||
"CompileFlags": {
|
||||
"Remove": ["-flarge-source-files", "-fext-numeric-literals"]
|
||||
}
|
||||
}
|
@ -1,9 +1,3 @@
|
||||
_lseeki64
|
||||
_mkgmtime
|
||||
_sh_denyno
|
||||
_sh_denyrd
|
||||
_sh_denyrw
|
||||
_spawnv
|
||||
aarch64
|
||||
advapi32
|
||||
armv8
|
||||
@ -22,18 +16,11 @@ cppcoreguidelines
|
||||
cppdbg
|
||||
cppflags
|
||||
cpphttplib
|
||||
cpptrace
|
||||
cppvsdbg
|
||||
create_notraverse
|
||||
crypto_aead_xchacha20poly1305_ietf_npubbytes
|
||||
cstdint
|
||||
curlopt_aws_sigv4
|
||||
cxxflags
|
||||
cxxstd
|
||||
d_largefile64_source
|
||||
d_largefile_source
|
||||
d_ndebug
|
||||
dacl_security_information
|
||||
dbackward_shared
|
||||
dbghelp
|
||||
dboost_root
|
||||
@ -42,9 +29,6 @@ dcli11_warnings_as_errors
|
||||
dcmake_cxx_flags
|
||||
dcpphttplib_openssl_support
|
||||
dcpphttplib_tcp_nodelay
|
||||
dcpptrace_static_define
|
||||
dcpptrace_unwind_with_execinfo
|
||||
dcpptrace_unwind_with_libunwind
|
||||
dcurl_ca_bundle
|
||||
dcurl_ca_fallback
|
||||
dcurl_disable_ldap
|
||||
@ -57,7 +41,6 @@ decmult_gen_prec_bits
|
||||
decmult_window_size
|
||||
degl
|
||||
denable_threaded_resolver
|
||||
deps
|
||||
devent__disable_openssl
|
||||
devent__disable_tests
|
||||
devent__library_type
|
||||
@ -77,12 +60,10 @@ dopenssl_root_dir
|
||||
dopenssl_use_static_libs
|
||||
dportable
|
||||
dproject_static_link
|
||||
drepertory_enable_s3
|
||||
drocksdb_install_on_windows
|
||||
dshared
|
||||
dspdlog_fmt_external
|
||||
dthreads_prefer_pthread_flag
|
||||
dunw_local_only
|
||||
duse_libidn2
|
||||
duuid_build_tests
|
||||
dwith_benchmark
|
||||
@ -94,28 +75,17 @@ ecdh
|
||||
endforeach
|
||||
endfunction
|
||||
eventlib
|
||||
expect_streq
|
||||
fallocate_impl
|
||||
fext
|
||||
fgetattr
|
||||
fgetattr_impl
|
||||
filebase
|
||||
flac_version
|
||||
flag_nopath
|
||||
flarge
|
||||
fontconfig_version
|
||||
freetype2_version
|
||||
fsetattr_x
|
||||
fusermount
|
||||
futimens
|
||||
getxtimes
|
||||
glapi
|
||||
gmock
|
||||
googletest
|
||||
gpath
|
||||
gtest_version
|
||||
has_setxattr
|
||||
hkey
|
||||
httpapi
|
||||
httplib
|
||||
icudata
|
||||
@ -123,15 +93,11 @@ icui18n
|
||||
icuuc
|
||||
iostreams
|
||||
iphlpapi
|
||||
ipstream
|
||||
jthread
|
||||
libbitcoin
|
||||
libbitcoinsystem
|
||||
libcurl
|
||||
libdsm
|
||||
libevent
|
||||
libexample
|
||||
libexpat
|
||||
libfuse3
|
||||
libgmock
|
||||
libgtest
|
||||
@ -142,81 +108,41 @@ libsfml
|
||||
libsodium_type
|
||||
libuuid
|
||||
libuuid_include_dirs
|
||||
libvlc
|
||||
linkflags
|
||||
localappdata
|
||||
lpbyte
|
||||
lptr
|
||||
lpwstr
|
||||
markdownlint
|
||||
mbig
|
||||
minio
|
||||
msvc
|
||||
msvcr120
|
||||
msys2
|
||||
mtune
|
||||
musl-libc
|
||||
nana
|
||||
ncrypt
|
||||
nlohmann
|
||||
nlohmann_json
|
||||
nmakeprg
|
||||
nohup
|
||||
nominmax
|
||||
ntstatus
|
||||
nullptr
|
||||
nuspell_version
|
||||
oleaut32
|
||||
openal_version
|
||||
openssldir
|
||||
pistream
|
||||
pkgconfig
|
||||
plarge_integer
|
||||
plex
|
||||
println
|
||||
project_enable_fontconfig
|
||||
project_enable_gtkmm
|
||||
project_enable_libdsm
|
||||
project_enable_nana
|
||||
propgrid
|
||||
psecurity_descriptor
|
||||
pugi
|
||||
pugixml_project
|
||||
puint32
|
||||
pvoid
|
||||
pwstr
|
||||
rdrw
|
||||
remote_winfsp
|
||||
renterd
|
||||
richtext
|
||||
rocksdb_library
|
||||
rpcrt4
|
||||
s_igid
|
||||
s_isvtx
|
||||
s_iuid
|
||||
sddl_revision_1
|
||||
secp256k1
|
||||
secur32
|
||||
sfml_project
|
||||
shlwapi
|
||||
skynet
|
||||
source_subdir
|
||||
spdlog
|
||||
spdlog_project
|
||||
st_ctim
|
||||
static-libgcc
|
||||
static-libstdc++
|
||||
stbuf
|
||||
stduuid_project
|
||||
strequal
|
||||
ularge_integer
|
||||
uring
|
||||
url
|
||||
userenv
|
||||
utimens_impl
|
||||
utimensat
|
||||
vorbis_version
|
||||
waggressive
|
||||
wall
|
||||
wcast-align
|
||||
wconversion
|
||||
@ -224,7 +150,6 @@ wdouble-promotion
|
||||
wduplicated-branches
|
||||
wduplicated-cond
|
||||
wextra
|
||||
wfloat
|
||||
wformat=2
|
||||
winfsp
|
||||
winhttp
|
||||
@ -242,6 +167,5 @@ wserialization
|
||||
wshadow
|
||||
wsign-conversion
|
||||
wunused
|
||||
wuseless
|
||||
wxwidgets_version
|
||||
xattr
|
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -1,4 +0,0 @@
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -6,8 +6,3 @@ cspell.json
|
||||
support/Dockerfile
|
||||
dist/
|
||||
deps/
|
||||
scripts/cleanup.cmd
|
||||
scripts/cleanup.sh
|
||||
version.rc
|
||||
version.cpp
|
||||
override.sh
|
||||
|
@ -4,9 +4,7 @@ pipeline {
|
||||
agent none
|
||||
|
||||
environment {
|
||||
DEVELOPER_PRIVATE_KEY = "/.ci/repertory/cert/developer.priv"
|
||||
DEVELOPER_PUBLIC_KEY = "/.ci/repertory/cert/developer.pub"
|
||||
PROJECT_TEST_CONFIG_DIR = "/.ci/repertory/test_config"
|
||||
PROJECT_TEST_DIR = "${HOME}/.ci/cfg"
|
||||
}
|
||||
|
||||
options {
|
||||
@ -21,7 +19,7 @@ pipeline {
|
||||
steps {
|
||||
retry(2) {
|
||||
sleep time: 5, unit: 'SECONDS'
|
||||
sh 'scripts/make_unix.sh'
|
||||
sh 'scripts/make_unix.sh x86_64'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -52,9 +50,7 @@ pipeline {
|
||||
agent any
|
||||
|
||||
steps {
|
||||
sh 'scripts/deliver.sh /mnt/repertory "" "" "" "" 1 1'
|
||||
sh 'scripts/deliver.sh /mnt/repertory "" aarch64'
|
||||
sh 'scripts/deliver.sh /mnt/repertory'
|
||||
sh 'echo skipping deliver'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
9
.nvimrc
9
.nvimrc
@ -7,7 +7,7 @@ else
|
||||
let g:nmakeprg="./scripts/make_unix.sh"
|
||||
" let g:gtest#gtest_command = "cd build && ./unittests"
|
||||
endif
|
||||
set path+=.,repertory/**
|
||||
set path+=.,repertory2/**
|
||||
|
||||
lua << EOF
|
||||
if vim.env.NV_DARCULA_ENABLE_DAP then
|
||||
@ -18,14 +18,14 @@ if vim.env.NV_DARCULA_ENABLE_DAP then
|
||||
|
||||
local externalConsole = gos.is_windows
|
||||
local type = "cppdbg"
|
||||
local cwd = gpath.create_path("./dist/debug/shared/linux/x86_64/repertory/")
|
||||
local cwd = gpath.create_path("./build")
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Mount",
|
||||
type = type,
|
||||
request = "launch",
|
||||
program = function()
|
||||
return gpath.create_path(cwd, "bin/repertory")
|
||||
return gpath.create_path(cwd, "repertory2")
|
||||
end,
|
||||
cwd = cwd,
|
||||
stopAtEntry = true,
|
||||
@ -36,9 +36,8 @@ if vim.env.NV_DARCULA_ENABLE_DAP then
|
||||
type = type,
|
||||
request = "launch",
|
||||
program = function()
|
||||
return gpath.create_path(cwd, "bin/repertory_test")
|
||||
return gpath.create_path(cwd, "repertory2_tests")
|
||||
end,
|
||||
args={"--gtest_filter=utils_db*"},
|
||||
cwd = cwd,
|
||||
stopAtEntry = true,
|
||||
externalConsole=externalConsole,
|
||||
|
100
CHANGELOG.md
100
CHANGELOG.md
@ -1,105 +1,20 @@
|
||||
# Changelog
|
||||
|
||||
## v2.0.5-rc
|
||||
|
||||
### Issues
|
||||
|
||||
* \#39 Create management portal in Flutter
|
||||
|
||||
### Changes from v2.0.4-rc
|
||||
|
||||
* Continue documentation updates
|
||||
* Fixed `-status` command erasing active mount information
|
||||
* Fixed overlapping HTTP REST API port's
|
||||
* Refactored/fixed instance locking
|
||||
* Removed passwords and secret key values from API calls
|
||||
* Renamed setting `ApiAuth` to `ApiPassword`
|
||||
* Require `--name,-na` option for encryption provider
|
||||
|
||||
## v2.0.4-rc
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* `renterd` v2.0.0+ is now required. Prior versions will fail to mount.
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
* \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default
|
||||
* \#36 [bug] Max cache size bytes is set to '0' by default
|
||||
|
||||
### Changes from v2.0.3-rc
|
||||
|
||||
* Added Sia API version check prior to mounting
|
||||
* Added back `-cv` (check version) CLI option
|
||||
* Continue documentation updates
|
||||
* Fixed setting `ApiAuth` via `set_value_by_name`
|
||||
* Fixed setting `HostConfig.ApiUser` via `set_value_by_name`
|
||||
* Fixed setting `HostConfig.Path` via `set_value_by_name`
|
||||
* Fixed setting `HostConfig.Protocol` via `set_value_by_name`
|
||||
* Improved ring buffer read-ahead
|
||||
* Integrated `renterd` version 2.0.0
|
||||
* Prefer using local cache file when opening files
|
||||
* Refactored `app_config` unit tests
|
||||
* Refactored polling to be more accurate on scheduling tasks
|
||||
|
||||
## v2.0.3-rc
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
|
||||
* \#29 \[bug\] S3 error responses are not being logged
|
||||
* \#30 \[bug\] Sia provider error responses are not logged
|
||||
* \#31 \[bug\] S3 provider should limit max key size to 1024
|
||||
|
||||
### Changes from v2.0.2-rc
|
||||
|
||||
* Always use direct for read-only providers
|
||||
* Fixed externally removed files not being processed during cleanup
|
||||
* Fixed http headers not being added for requests
|
||||
* Fixed incorrect `stat` values for remote mounts
|
||||
* Fixed invalid directory nullptr error on remote mounts
|
||||
* Fixed memory leak in event system
|
||||
* Refactored application shutdown
|
||||
* Refactored event system
|
||||
* Updated build system to Alpine 3.21.0
|
||||
* Updated build system to MinGW-w64 12.0.0
|
||||
* Updated copyright to 2018-2025
|
||||
|
||||
## v2.0.2-rc
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Refactored `config.json` - will need to verify configuration settings prior to mounting
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
* \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup
|
||||
* \#16 Add support for bucket name in Sia provider
|
||||
* \#17 Update to common c++ build system
|
||||
* A single 64-bit Linux Jenkins server is used to build all Linux and Windows versions
|
||||
* All dependency sources are now included
|
||||
* MSVC is no longer supported
|
||||
* MSYS2 is required for building Windows binaries on Windows
|
||||
* OS X support is temporarily disabled
|
||||
* \#19 \[bug\] Rename file is broken for files that are existing
|
||||
* \#23 \[bug\] Incorrect file size displayed while upload is pending
|
||||
* \#24 RocksDB implementations should be transactional
|
||||
* \#25 Writes should block when maximum cache size is reached
|
||||
* \#26 Complete ring buffer and direct download support
|
||||
* \#12 [Unit Test] Complete all providers unit tests
|
||||
* Switched to common build system
|
||||
|
||||
### Changes from v2.0.1-rc
|
||||
|
||||
* Ability to choose between RocksDB and SQLite databases
|
||||
* Added direct reads and implemented download fallback
|
||||
* Corrected file times on S3 and Sia providers
|
||||
* Corrected handling of `chown()` and `chmod()`
|
||||
* Fixed erroneous download of chunks after resize
|
||||
* Updated `JSON for Modern C++` to v3.11.3
|
||||
|
||||
## v2.0.1-rc
|
||||
|
||||
* Removed legacy win32 build binaries
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
@ -108,17 +23,16 @@
|
||||
|
||||
### Changes from v2.0.0-rc
|
||||
|
||||
* Fixed intermittent deadlock on file close
|
||||
* Refactored Sia, S3 and base provider
|
||||
* Fixed intermittent deadlock on file close
|
||||
* Removed MSVC compilation support (MinGW-64 should be used)
|
||||
* Removed legacy win32 build binaries
|
||||
* Require `c++20`
|
||||
* Switched to Storj over Filebase for hosting binaries
|
||||
* Updated `OpenSSL` to v3.2.0
|
||||
* Updated `boost` to v1.83.0
|
||||
* Updated `cpp-httplib` to v0.14.2
|
||||
* Updated `curl` to v8.4.0
|
||||
* Updated `libsodium` to v1.0.19
|
||||
* Updated `OpenSSL` to v3.2.0
|
||||
|
||||
## v2.0.0-rc
|
||||
|
||||
|
136
CMakeLists.txt
136
CMakeLists.txt
@ -1,67 +1,19 @@
|
||||
cmake_minimum_required(VERSION 3.27)
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
cmake_policy(SET CMP0144 NEW)
|
||||
|
||||
if (NOT PROJECT_INTERFACE)
|
||||
message(FATAL_ERROR "Project must be compiled via 'make_win32.cmd'/'make_win32.sh' or 'make_unix.sh' build scripts. Invoking 'cmake' directly is not supported.")
|
||||
endif()
|
||||
|
||||
project(${PROJECT_NAME}
|
||||
DESCRIPTION ${PROJECT_DESC}
|
||||
HOMEPAGE_URL ${PROJECT_URL}
|
||||
VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_REVISION_VERSION}
|
||||
)
|
||||
include(project_name.cmake)
|
||||
project(${PROJECT_NAME})
|
||||
|
||||
include(CheckIncludeFileCXX)
|
||||
include(CheckIncludeFiles)
|
||||
include(ExternalProject)
|
||||
|
||||
check_include_files(sys/xattr.h HAS_SETXATTR)
|
||||
if(HAS_SETXATTR)
|
||||
add_definitions(-DHAS_SETXATTR)
|
||||
endif()
|
||||
|
||||
include(cmake/hashes.cmake)
|
||||
|
||||
include(cmake/versions.cmake)
|
||||
include(cmake/arch.cmake)
|
||||
include(cmake/os.cmake)
|
||||
include(cmake/options.cmake)
|
||||
|
||||
option(PROJECT_REQUIRE_ALPINE "Require Alpine Linux as build system" OFF)
|
||||
option(PROJECT_STATIC_LINK "Static link executables" OFF)
|
||||
|
||||
if(PROJECT_STATIC_LINK)
|
||||
add_definitions(-DPROJECT_STATIC_LINK)
|
||||
endif()
|
||||
|
||||
if(PROJECT_IS_MINGW)
|
||||
add_definitions(-DPROJECT_IS_MINGW)
|
||||
if(PROJECT_IS_MINGW_UNIX)
|
||||
add_definitions(-DPROJECT_IS_MINGW_UNIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PROJECT_REQUIRE_ALPINE)
|
||||
add_definitions(-DPROJECT_REQUIRE_ALPINE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_IS_ARM64)
|
||||
add_definitions(-DPROJECT_IS_ARM64)
|
||||
endif()
|
||||
|
||||
if(PROJECT_IS_MINGW)
|
||||
option(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES "Enable path sizes of 32767 characters on Windows" OFF)
|
||||
if(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
|
||||
add_definitions(-DPROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (PROJECT_ENABLE_V2_ERRORS)
|
||||
add_definitions(-DPROJECT_ENABLE_V2_ERRORS)
|
||||
endif()
|
||||
|
||||
include(cmake/settings.cmake)
|
||||
|
||||
include(cmake/flags.cmake)
|
||||
@ -70,17 +22,9 @@ include(cmake/functions.cmake)
|
||||
include(cmake/libraries.cmake)
|
||||
|
||||
if(PROJECT_BUILD)
|
||||
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp "")
|
||||
|
||||
if (PROJECT_IS_MINGW)
|
||||
set(PROJECT_WINDOWS_VERSION_RC ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc)
|
||||
file(WRITE ${PROJECT_WINDOWS_VERSION_RC} "")
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE ADDITIONAL_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp
|
||||
${PROJECT_SUPPORT_DIR}/src/*.c
|
||||
${PROJECT_SUPPORT_DIR}/src/*.cpp
|
||||
${PROJECT_3RD_PARTY_DIR}/src/*.c
|
||||
${PROJECT_3RD_PARTY_DIR}/src/*.cpp
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_ADDITIONAL_SOURCES
|
||||
@ -88,33 +32,6 @@ if(PROJECT_BUILD)
|
||||
)
|
||||
|
||||
include(project.cmake)
|
||||
|
||||
string(REPLACE "\\<" "<" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
|
||||
string(REPLACE "\\<" "<" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
|
||||
string(REPLACE "\\<" "<" PROJECT_DESC "${PROJECT_DESC}")
|
||||
string(REPLACE "\\>" ">" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
|
||||
string(REPLACE "\\>" ">" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
|
||||
string(REPLACE "\\>" ">" PROJECT_DESC "${PROJECT_DESC}")
|
||||
|
||||
if (PROJECT_IS_MINGW)
|
||||
if ("${PROJECT_RELEASE_ITER}" STREQUAL "release")
|
||||
set(PROJECT_PRERELEASE 0)
|
||||
else()
|
||||
set(PROJECT_PRERELEASE VS_FF_PRERELEASE)
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc
|
||||
@ONLY
|
||||
)
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp
|
||||
@ONLY
|
||||
)
|
||||
else()
|
||||
message(STATUS "-=[CMake Settings]=-")
|
||||
message(STATUS " C standard: ${CMAKE_C_STANDARD}")
|
||||
@ -124,13 +41,6 @@ if(PROJECT_ENABLE_FUSE)
|
||||
message(STATUS " FUSE version: ${PROJECT_FUSE}")
|
||||
endif()
|
||||
|
||||
string(REPLACE "<" "\\<" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
|
||||
string(REPLACE "<" "\\<" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
|
||||
string(REPLACE "<" "\\<" PROJECT_DESC "${PROJECT_DESC}")
|
||||
string(REPLACE ">" "\\>" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
|
||||
string(REPLACE ">" "\\>" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
|
||||
string(REPLACE ">" "\\>" PROJECT_DESC "${PROJECT_DESC}")
|
||||
|
||||
add_custom_target(project ALL
|
||||
DEPENDS ${PROJECT_DEPENDENCIES}
|
||||
COMMAND cd build && cmake
|
||||
@ -143,46 +53,50 @@ endif()
|
||||
-DPROJECT_BUILD_DIR=${PROJECT_BUILD_DIR}
|
||||
-DPROJECT_BUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DPROJECT_CMAKE_BUILD_TYPE=${PROJECT_CMAKE_BUILD_TYPE}
|
||||
-DPROJECT_COMPANY_NAME=${PROJECT_COMPANY_NAME}
|
||||
-DPROJECT_COPYRIGHT=${PROJECT_COPYRIGHT}
|
||||
-DPROJECT_DESC=${PROJECT_DESC}
|
||||
-DPROJECT_DIST_DIR=${PROJECT_DIST_DIR}
|
||||
-DPROJECT_ENABLE_V2_ERRORS=${PROJECT_ENABLE_V2_ERRORS}
|
||||
-DPROJECT_ENABLE_WIN32_LONG_PATH_NAMES=${PROJECT_ENABLE_WIN32_LONG_PATH_NAMES}
|
||||
-DPROJECT_ENABLE_BOOST=${PROJECT_ENABLE_BOOST}
|
||||
-DPROJECT_ENABLE_CLI11=${PROJECT_ENABLE_CLI11}
|
||||
-DPROJECT_ENABLE_CPP_HTTPLIB=${PROJECT_ENABLE_CPP_HTTPLIB}
|
||||
-DPROJECT_ENABLE_CURL=${PROJECT_ENABLE_CURL}
|
||||
-DPROJECT_ENABLE_DTL=${PROJECT_ENABLE_DTL}
|
||||
-DPROJECT_ENABLE_FLAC=${PROJECT_ENABLE_FLAC}
|
||||
-DPROJECT_ENABLE_FMT=${PROJECT_ENABLE_FMT}
|
||||
-DPROJECT_ENABLE_FONTCONFIG=${PROJECT_ENABLE_FONTCONFIG}
|
||||
-DPROJECT_ENABLE_FREETYPE2=${PROJECT_ENABLE_FREETYPE2}
|
||||
-DPROJECT_ENABLE_FUSE=${PROJECT_ENABLE_FUSE}
|
||||
-DPROJECT_ENABLE_FZF=${PROJECT_ENABLE_FZF}
|
||||
-DPROJECT_ENABLE_GTKMM=${PROJECT_ENABLE_GTKMM}
|
||||
-DPROJECT_ENABLE_JSON=${PROJECT_ENABLE_JSON}
|
||||
-DPROJECT_ENABLE_LIBBITCOIN_SYSTEM=${PROJECT_ENABLE_LIBBITCOIN_SYSTEM}
|
||||
-DPROJECT_ENABLE_LIBEVENT=${PROJECT_ENABLE_LIBEVENT}
|
||||
-DPROJECT_ENABLE_LIBSODIUM=${PROJECT_ENABLE_LIBSODIUM}
|
||||
-DPROJECT_ENABLE_NUSPELL=${PROJECT_ENABLE_NUSPELL}
|
||||
-DPROJECT_ENABLE_OGG=${PROJECT_ENABLE_OGG}
|
||||
-DPROJECT_ENABLE_OPENAL=${PROJECT_ENABLE_OPENAL}
|
||||
-DPROJECT_ENABLE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
|
||||
-DPROJECT_ENABLE_PUGIXML=${PROJECT_ENABLE_PUGIXML}
|
||||
-DPROJECT_ENABLE_ROCKSDB=${PROJECT_ENABLE_ROCKSDB}
|
||||
-DPROJECT_ENABLE_SAGO_PLATFORM_FOLDERS=${PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS}
|
||||
-DPROJECT_ENABLE_SECP256K1=${PROJECT_ENABLE_SECP256K1}
|
||||
-DPROJECT_ENABLE_SFML=${PROJECT_ENABLE_SFML}
|
||||
-DPROJECT_ENABLE_SPDLOG=${PROJECT_ENABLE_SPDLOG}
|
||||
-DPROJECT_ENABLE_SQLITE=${PROJECT_ENABLE_SQLITE}
|
||||
-DPROJECT_ENABLE_STDUUID=${PROJECT_ENABLE_STDUUID}
|
||||
-DPROJECT_ENABLE_TESTING=${PROJECT_ENABLE_TESTING}
|
||||
-DPROJECT_ENABLE_TPL=${PROJECT_ENABLE_TPL}
|
||||
-DPROJECT_ENABLE_VORBIS=${PROJECT_ENABLE_VORBIS}
|
||||
-DPROJECT_ENABLE_WINFSP=${PROJECT_ENABLE_WINFSP}
|
||||
-DPROJECT_ENABLE_WXWIDGETS=${PROJECT_ENABLE_WXWIDGETS}
|
||||
-DPROJECT_EXTERNAL_BUILD_ROOT=${PROJECT_EXTERNAL_BUILD_ROOT}
|
||||
-DPROJECT_FUSE=${PROJECT_FUSE}
|
||||
-DPROJECT_FUSE_INCLUDE_DIRS=${PROJECT_FUSE_INCLUDE_DIRS}
|
||||
-DPROJECT_GIT_REV=${PROJECT_GIT_REV}
|
||||
-DPROJECT_INTERFACE=1
|
||||
-DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE}
|
||||
-DPROJECT_IS_ARM64=${PROJECT_IS_ARM64}
|
||||
-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW}
|
||||
-DPROJECT_IS_MINGW_UNIX=${PROJECT_IS_MINGW_UNIX}
|
||||
-DPROJECT_MAJOR_VERSION=${PROJECT_MAJOR_VERSION}
|
||||
-DPROJECT_MINOR_VERSION=${PROJECT_MINOR_VERSION}
|
||||
-DPROJECT_NAME=${PROJECT_NAME}
|
||||
-DPROJECT_RELEASE_ITER=${PROJECT_RELEASE_ITER}
|
||||
-DPROJECT_RELEASE_NUM=${PROJECT_RELEASE_NUM}
|
||||
-DPROJECT_LINK_TYPE=${PROJECT_LINK_TYPE}
|
||||
-DPROJECT_REQUIRE_ALPINE=${PROJECT_REQUIRE_ALPINE}
|
||||
-DPROJECT_REVISION_VERSION=${PROJECT_REVISION_VERSION}
|
||||
-DPROJECT_STATIC_LINK=${PROJECT_STATIC_LINK}
|
||||
-DPROJECT_SUPPORT_DIR=${PROJECT_SUPPORT_DIR}
|
||||
-DPROJECT_TOOLCHAIN_FILE_CMAKE=${PROJECT_TOOLCHAIN_FILE_CMAKE}
|
||||
-DPROJECT_TOOLCHAIN_FILE_MESON=${PROJECT_TOOLCHAIN_FILE_MESON}
|
||||
-DPROJECT_URL=${PROJECT_URL}
|
||||
)
|
||||
endif()
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Repertory MIT License
|
||||
### Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
### Copyright <2018-2024> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
474
README.md
474
README.md
@ -1,456 +1,47 @@
|
||||
# Repertory
|
||||
|
||||
Repertory allows you to mount S3 and Sia via FUSE on Linux or via WinFSP
|
||||
Repertory allows you to mount AWS S3 and Sia via FUSE on Linux/OS X or via WinFSP
|
||||
on Windows.
|
||||
|
||||
## Contents
|
||||
|
||||
1. [Details and Features](#details-and-features)
|
||||
2. [Minimum Requirements](#minimum-requirements)
|
||||
1. [Supported Operating Systems](#supported-operating-systems)
|
||||
3. [GUI](#gui)
|
||||
4. [Usage](#usage)
|
||||
1. [Important Options](#important-options)
|
||||
2. [Sia](#sia)
|
||||
* [Sia Initial Configuration](#sia-initial-configuration)
|
||||
* [Sia Mounting](#sia-mounting)
|
||||
* [Sia Configuration File](#sia-configuration-file)
|
||||
3. [S3](#s3)
|
||||
* [S3 Initial Configuration](#s3-initial-configuration)
|
||||
* [S3 Mounting](#s3-mounting)
|
||||
* [S3 Configuration File](#s3-configuration-file)
|
||||
5. [Data Directories](#data-directories)
|
||||
1. [Linux Directories](#linux-directories)
|
||||
2. [Windows Directories](#windows-directories)
|
||||
6. [Remote Mounting](#remote-mounting)
|
||||
1. [Server Setup](#server-setup)
|
||||
* [Remote Mount Configuration File Section](#remote-mount-configuration-file-section)
|
||||
2. [Client Setup](#client-setup)
|
||||
* [Client Remote Mounting](#client-remote-mounting)
|
||||
* [Remote Mount Configuration File](#remote-mount-configuration-file)
|
||||
7. [Compiling](#compiling)
|
||||
1. [Linux Compilation](#linux-compilation)
|
||||
2. [Windows Setup](#windows-compilation)
|
||||
8. [Credits](#credits)
|
||||
9. [Developer Public Key](#developer-public-key)
|
||||
10. [Consult the Wiki for additional information](https://git.fifthgrid.com/BlockStorage/repertory/wiki)
|
||||
|
||||
## Details and Features
|
||||
|
||||
* Optimized for [Plex Media Server](https://www.plex.tv/)
|
||||
* Remote mounting of `repertory` instances on Linux and Windows
|
||||
* Securely share your mounts over TCP/IP via `XChaCha20-Poly1305` with other systems on your network or over the internet.
|
||||
* Cross-platform support (Linux 64-bit, Linux arm64/aarch64, Windows 64-bit)
|
||||
* Optionally encrypt file names and file data via `XChaCha20-Poly1305` in S3 mounts
|
||||
* Single application to mount AWS S3 and/or Sia
|
||||
* Only 1 Sia mount and 1 S3 mount (per bucket) per user is supported.
|
||||
* Remote mounting of Repertory instances on Linux, OS X and Windows
|
||||
* Securely share your mounts over TCP/IP (`XChaCha20-Poly1305` stream cipher)
|
||||
* Cross-platform support (Linux 64-bit, Linux arm64/aarch64, OS X, Windows 64-bit)
|
||||
|
||||
## Minimum Requirements
|
||||
|
||||
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v2.0.0+ for Sia support
|
||||
* Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
|
||||
* Windows requires the following dependencies to be installed:
|
||||
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support
|
||||
* Only 64-bit operating systems are supported
|
||||
* Linux requires `fusermount3` or `repertory` must be manually compiled with `libfuse2` support
|
||||
* OS X requires the following dependency to be installed:
|
||||
* [FUSE for macOS v4.5.0](https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.5.0/macfuse-4.5.0.dmg)
|
||||
* Windows requires the following dependencies to be installed:
|
||||
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
|
||||
|
||||
### Supported Operating Systems
|
||||
|
||||
Only 64-bit operating systems are supported
|
||||
## Supported Operating Systems
|
||||
|
||||
* Linux `arm64/aarch64`
|
||||
* Linux `amd64`
|
||||
* OS X Mojave and above
|
||||
* Windows 64-bit 10, 11
|
||||
|
||||
## GUI
|
||||
|
||||
As of `v2.0.5-rc`, mounts can be managed using the `Repertory Management Portal`.
|
||||
To launch the portal, execute the following command:
|
||||
|
||||
* `repertory -ui`
|
||||
* The default username is `repertory`
|
||||
* The default password is `repertory`
|
||||
|
||||
After first launch, `ui.json` will be created in the appropriate data directory.
|
||||
See [Data Directories](#data-directories).
|
||||
You should modify this file directly or use the portal to change the default
|
||||
username and password.
|
||||
|
||||
### Screenshot
|
||||
|
||||
<a href="https://ibb.co/fVyJqnbF"><img src="https://i.ibb.co/fVyJqnbF/repertory-portal.png" alt="repertory-portal" border="0"></a>
|
||||
|
||||
## Usage
|
||||
|
||||
### Important Options
|
||||
|
||||
* `--help`
|
||||
* Display all mount utility options
|
||||
|
||||
* `-f`
|
||||
* Keep process in foreground on Linux.
|
||||
|
||||
* `--name, -na [name]`
|
||||
* Identifies a unique configuration name to support multiple mounts.
|
||||
* The `--name` option can be set to any valid value allowed as a file name for your filesystem.
|
||||
* For Sia, the bucket name will be set to the same value if it is empty in the configuration file.
|
||||
* If the `--name` option is not specified, `default` will be used.
|
||||
* For S3, the `--name` option is required and does not affect the bucket name.
|
||||
|
||||
* `-dc`
|
||||
* Display mount configuration
|
||||
* For Sia, `--name` is optional
|
||||
* For S3, the `-s3` option is required along with `--name`
|
||||
|
||||
### Sia
|
||||
|
||||
#### Sia Initial Configuration
|
||||
|
||||
* Required steps:
|
||||
* Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
|
||||
* To use `default` as the bucket name and configuration name, you only need to set the `renterd` API password:
|
||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
||||
* To specify a different bucket name while using `default` as the configuration name:
|
||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
||||
* `repertory -set SiaConfig.Bucket '<my bucket>'`
|
||||
* For all other configurations:
|
||||
* `repertory --name '<my config name>' -set HostConfig.ApiPassword '<my password>'`
|
||||
* `repertory --name '<my config name>' -set SiaConfig.Bucket '<my bucket name>'`
|
||||
|
||||
* Optional steps:
|
||||
* Set a user name used during `renterd` basic authentication:
|
||||
* `repertory -set HostConfig.ApiUser '<my user>'`
|
||||
* `repertory --name '<my config name>' -set HostConfig.ApiUser '<my user>'`
|
||||
* Set a custom agent string (default `Sia-Agent`):
|
||||
* `repertory -set HostConfig.AgentString '<my agent>'`
|
||||
* `repertory --name '<my config name>' -set HostConfig.AgentString '<my agent>'`
|
||||
* Set the host name or IP of the `renterd` instance (default `localhost`):
|
||||
* `repertory -set HostConfig.HostNameOrIp '<my host name>'`
|
||||
* `repertory --name '<my config name>' -set HostConfig.HostNameOrIp '<my host name>'`
|
||||
* Set the `renterd` API port (default `9980`):
|
||||
* `repertory -set HostConfig.ApiPort 9981`
|
||||
* `repertory --name '<my config name>' -set HostConfig.ApiPort 9981`
|
||||
|
||||
* To verify/view all configuration options:
|
||||
* `repertory -dc`
|
||||
* `repertory --name '<my config name>' -dc`
|
||||
* Example:
|
||||
* `repertory --name default -dc`
|
||||
|
||||
#### Sia Mounting
|
||||
|
||||
* Linux:
|
||||
* `repertory /mnt/location`
|
||||
* `repertory --name '<my config name>' /mnt/location`
|
||||
* Example:
|
||||
* `repertory --name default /mnt/location`
|
||||
|
||||
* Windows:
|
||||
* `repertory t:`
|
||||
* `repertory --name '<my config name>' t:`
|
||||
* Example:
|
||||
* `repertory --name default t:`
|
||||
|
||||
#### Sia Configuration File
|
||||
|
||||
```json
|
||||
{
|
||||
"ApiPassword": "<random generated rpc password>",
|
||||
"ApiPort": 10000,
|
||||
"ApiUser": "repertory",
|
||||
"DatabaseType": "rocksdb",
|
||||
"DownloadTimeoutSeconds": 30,
|
||||
"EnableDownloadTimeout": true,
|
||||
"EnableDriveEvents": false,
|
||||
"EventLevel": "info",
|
||||
"EvictionDelayMinutes": 1,
|
||||
"EvictionUseAccessedTime": false,
|
||||
"HighFreqIntervalSeconds": 30,
|
||||
"HostConfig": {
|
||||
"AgentString": "Sia-Agent",
|
||||
"ApiPassword": "<renterd api password>",
|
||||
"ApiPort": 9980,
|
||||
"ApiUser": "",
|
||||
"HostNameOrIp": "localhost",
|
||||
"Path": "",
|
||||
"Protocol": "http",
|
||||
"TimeoutMs": 60000
|
||||
},
|
||||
"LowFreqIntervalSeconds": 3600,
|
||||
"MaxCacheSizeBytes": 21474836480,
|
||||
"MaxUploadCount": 5,
|
||||
"MedFreqIntervalSeconds": 120,
|
||||
"OnlineCheckRetrySeconds": 60,
|
||||
"PreferredDownloadType": "default",
|
||||
"RemoteMount": {
|
||||
"ApiPort": 20000,
|
||||
"ClientPoolSize": 20,
|
||||
"Enable": false,
|
||||
"EncryptionToken": ""
|
||||
},
|
||||
"RetryReadCount": 6,
|
||||
"RingBufferFileSize": 512,
|
||||
"SiaConfig": {
|
||||
"Bucket": "default"
|
||||
},
|
||||
"TaskWaitMs": 100,
|
||||
"Version": 1
|
||||
}
|
||||
```
|
||||
|
||||
### S3
|
||||
|
||||
#### S3 Initial Configuration
|
||||
|
||||
* Required steps:
|
||||
* Set the appropriate base URL:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.URL '<my url>'`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio -set S3Config.URL 'http://localhost:9000'`
|
||||
* Set the appropriate bucket name:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.Bucket '<my bucket name>'`
|
||||
* Set the appropriate access key:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.AccessKey '<my access key>'`
|
||||
* Set the appropriate secret key:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.SecretKey '<my secret key>'`
|
||||
* For Sia and most local S3 gateway instances, enable path style URL's:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.UsePathStyle true`
|
||||
|
||||
* Optional steps:
|
||||
* Set an appropriate region. Default is set to `any`:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.Region '<my region>'`
|
||||
* Enable encrypted file names and file data. Set a strong, random encryption token and be sure to store it in a secure backup location:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.EncryptionToken '<my strong password>'`
|
||||
|
||||
* To verify/view all configuration options:
|
||||
* `repertory -s3 --name '<my config name>' -dc`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio -dc`
|
||||
|
||||
#### S3 Mounting
|
||||
|
||||
* Linux:
|
||||
* `repertory -s3 --name '<my config name>' /mnt/location`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio /mnt/location`
|
||||
|
||||
* Windows:
|
||||
* `repertory -s3 --name '<my config name>' t:`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio t:`
|
||||
|
||||
#### S3 Configuration File
|
||||
|
||||
```json
|
||||
{
|
||||
"ApiPassword": "<random generated rpc password>",
|
||||
"ApiPort": 10100,
|
||||
"ApiUser": "repertory",
|
||||
"DatabaseType": "rocksdb",
|
||||
"DownloadTimeoutSeconds": 30,
|
||||
"EnableDownloadTimeout": true,
|
||||
"EnableDriveEvents": false,
|
||||
"EventLevel": "info",
|
||||
"EvictionDelayMinutes": 1,
|
||||
"EvictionUseAccessedTime": false,
|
||||
"HighFreqIntervalSeconds": 30,
|
||||
"LowFreqIntervalSeconds": 3600,
|
||||
"MaxCacheSizeBytes": 21474836480,
|
||||
"MaxUploadCount": 5,
|
||||
"MedFreqIntervalSeconds": 120,
|
||||
"OnlineCheckRetrySeconds": 60,
|
||||
"PreferredDownloadType": "default",
|
||||
"RemoteMount": {
|
||||
"ApiPort": 20100,
|
||||
"ClientPoolSize": 20,
|
||||
"Enable": false,
|
||||
"EncryptionToken": ""
|
||||
},
|
||||
"RetryReadCount": 6,
|
||||
"RingBufferFileSize": 512,
|
||||
"S3Config": {
|
||||
"AccessKey": "<my access key>",
|
||||
"Bucket": "<my bucket name>",
|
||||
"EncryptionToken": "",
|
||||
"Region": "any",
|
||||
"SecretKey": "<my secret key>",
|
||||
"TimeoutMs": 60000,
|
||||
"URL": "http://localhost:9000",
|
||||
"UsePathStyle": true,
|
||||
"UseRegionInURL": false
|
||||
},
|
||||
"TaskWaitMs": 100,
|
||||
"Version": 1
|
||||
}
|
||||
```
|
||||
|
||||
### Data Directories
|
||||
|
||||
#### Linux Directories
|
||||
|
||||
* `~/.local/repertory2/s3`
|
||||
* `~/.local/repertory2/sia`
|
||||
|
||||
#### Windows Directories
|
||||
|
||||
* `%LOCALAPPDATA%\repertory2\s3`
|
||||
* `%LOCALAPPDATA%\repertory2\sia`
|
||||
* Examples:
|
||||
* `C:\Users\Tom\AppData\Local\repertory2\s3`
|
||||
* `C:\Users\Tom\AppData\Local\repertory2\sia`
|
||||
* IMPORTANT:
|
||||
* It is highly recommended to exclude this folder from any anti-virus/anti-malware applications as severe performance issues may arise.
|
||||
* Excluding the mounted drive letter is also highly recommended.
|
||||
|
||||
## Remote Mounting
|
||||
|
||||
`repertory` allows local mounts to be shared with other computers on your network
|
||||
or over the internet. This option is referred to as remote mounting.
|
||||
|
||||
### Server Setup
|
||||
|
||||
The following steps must be performed on the mount you wish to share with
|
||||
other systems. Changes to configuration will not take affect while a mount is
|
||||
active, so it is recommended to unmount beforehand.
|
||||
|
||||
* Required steps:
|
||||
* Enable remote mount:
|
||||
* Sia
|
||||
* `repertory -set RemoteMount.Enable true`
|
||||
* `repertory --name '<my config name>' -set RemoteMount.Enable true`
|
||||
* S3:
|
||||
* `repertory -s3 --name '<my config name>' -set RemoteMount.Enable true`
|
||||
* Set a secure encryption token:
|
||||
* Sia:
|
||||
* `repertory -set RemoteMount.EncryptionToken '<my secure password>'`
|
||||
* `repertory --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'`
|
||||
* S3:
|
||||
* `repertory -s3 --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'`
|
||||
|
||||
* Optional steps:
|
||||
* Change the port clients will use to connect to your mount:
|
||||
* Sia:
|
||||
* `repertory -set RemoteMount.ApiPort 20000`
|
||||
* `repertory --name '<my config name>' -set RemoteMount.ApiPort 20000`
|
||||
* S3:
|
||||
* `repertory -s3 --name '<my config name>' -set RemoteMount.ApiPort 20000`
|
||||
|
||||
* IMPORTANT:
|
||||
* Be sure to configure your firewall to allow incoming TCP connections on the port configured in `RemoteMount.ApiPort`.
|
||||
|
||||
#### Remote Mount Configuration File Section
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"RemoteMount": {
|
||||
"ApiPort": 20000,
|
||||
"ClientPoolSize": 20,
|
||||
"Enable": true,
|
||||
"EncryptionToken": "<my secure password>"
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Client Setup
|
||||
|
||||
Client configuration is provider agnostic, so there's no need to specify `-s3`
|
||||
for S3 providers.
|
||||
|
||||
* Required steps:
|
||||
* Set the encryption token to the same value configured during server setup:
|
||||
* `repertory -rm <host name or IP>:<port> -set RemoteConfig.EncryptionToken '<my secure password>'`
|
||||
* Replace `<host name or IP>` with the host name or IP of the server
|
||||
* Replace `<port>` with the value of `RemoteMount.ApiPort` used in the server configuration
|
||||
* Example:
|
||||
* `repertory -rm 192.168.1.10:20000 -set RemoteConfig.EncryptionToken '<my secure password>'`
|
||||
* `repertory -rm my.host.com:20000 -set RemoteConfig.EncryptionToken '<my secure password>'`
|
||||
|
||||
#### Client Remote Mounting
|
||||
|
||||
* Linux:
|
||||
* `repertory -rm <host name or IP>:<port> /mnt/location`
|
||||
* Example:
|
||||
* `repertory -rm 192.168.1.10:20000 /mnt/location`
|
||||
|
||||
* Windows:
|
||||
* `repertory -rm <host name or IP>:<port> t:`
|
||||
* Example:
|
||||
* `repertory -rm 192.168.1.10:20000 t:`
|
||||
|
||||
#### Remote Mount Configuration File
|
||||
|
||||
```json
|
||||
{
|
||||
"ApiPassword": "<random generated rpc password>",
|
||||
"ApiPort": 10010,
|
||||
"ApiUser": "repertory",
|
||||
"EnableDriveEvents": false,
|
||||
"EventLevel": "info",
|
||||
"RemoteConfig": {
|
||||
"ApiPort": 20000,
|
||||
"EncryptionToken": "<my secure password>",
|
||||
"HostNameOrIp": "192.168.1.10",
|
||||
"MaxConnections": 20,
|
||||
"ReceiveTimeoutMs": 120000,
|
||||
"SendTimeoutMs": 30000
|
||||
},
|
||||
"TaskWaitMs": 100,
|
||||
"Version": 1
|
||||
}
|
||||
```
|
||||
|
||||
## Compiling
|
||||
|
||||
Successful compilation will result in all files required for execution to be placed
|
||||
in the `dist/` directory
|
||||
|
||||
### Linux Compilation
|
||||
|
||||
* Ensure `docker` is installed
|
||||
* For x86_64:
|
||||
* RelWithDebInfo: `scripts/make_unix.sh`
|
||||
* Release: `scripts/make_unix.sh x86_64 Release`
|
||||
* Debug: `scripts/make_unix.sh x86_64 Debug`
|
||||
|
||||
* For aarch64:
|
||||
* RelWithDebInfo: `scripts/make_unix.sh aarch64`
|
||||
* Release: `scripts/make_unix.sh aarch64 Release`
|
||||
* Debug: `scripts/make_unix.sh aarch64 Debug`
|
||||
|
||||
### Windows Compilation
|
||||
|
||||
* OFFICIAL: Cross-compiling on Linux
|
||||
* Ensure `docker` is installed
|
||||
* RelWithDebInfo: `scripts/make_win32.sh`
|
||||
* Release: `scripts/make_win32.sh x86_64 Release`
|
||||
* Debug: `scripts/make_win32.sh x86_64 Debug`
|
||||
|
||||
* UNOFFICIAL: Compiling on Windows
|
||||
* Ensure latest [MSYS2](https://www.msys2.org/) is installed
|
||||
* RelWithDebInfo: `scripts\make_win32.cmd`
|
||||
* Release: `scripts\make_win32.cmd x86_64 Release`
|
||||
* Debug: `scripts\make_win32.cmd x86_64 Debug`
|
||||
|
||||
## Credits
|
||||
|
||||
* [binutils](https://www.gnu.org/software/binutils/)
|
||||
* [boost c++ libraries](https://www.boost.org/)
|
||||
* [cpp-httplib](https://github.com/yhirose/cpp-httplib)
|
||||
* [curl](https://curl.haxx.se/)
|
||||
* [docker](https://www.docker.com/)
|
||||
* [FUSE for macOS](https://osxfuse.github.io/)
|
||||
* [Google Test](https://github.com/google/googletest)
|
||||
* [ICU](https://icu.unicode.org/)
|
||||
* [JSON for Modern C++](https://github.com/nlohmann/json)
|
||||
* [libexpat](https://github.com/libexpat/libexpat)
|
||||
* [libfuse](https://github.com/libfuse/libfuse)
|
||||
* [libsodium](https://doc.libsodium.org/)
|
||||
* [mingw-w64](https://www.mingw-w64.org/)
|
||||
* [MSYS2](https://www.msys2.org)
|
||||
* [OpenSSL](https://www.openssl.org/)
|
||||
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
|
||||
* [pugixml](https://pugixml.org/)
|
||||
* [RocksDB](https://rocksdb.org)
|
||||
* [ScPrime](https://scpri.me/)
|
||||
* [Sia Decentralized Cloud Storage](https://sia.tech/)
|
||||
* [spdlog](https://github.com/gabime/spdlog)
|
||||
* [SQLite](https://www.sqlite.org)
|
||||
* [stduuid](https://github.com/mariusbancila/stduuid)
|
||||
* [Storj](https://storj.io/)
|
||||
@ -461,17 +52,28 @@ in the `dist/` directory
|
||||
|
||||
```text
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqXedleDOugdk9sBpgFOA
|
||||
0+MogIbBF7+iXIIHv8CRBbrrf8nxLSgQvbHQIP0EklebDgLZRgyGI3SSQYj7D957
|
||||
uNf1//dpkELNzfuezgAyFer9+iH4Svq46HADp5k+ugaK0mMDZM7OLOgo7415/+z4
|
||||
NIQopv8prMFdxkShr4e4dpR+S6LYMYMVjsi1gnYWaZJMWgzeZouXFSscS1/XDXSE
|
||||
vr1Jfqme+RmB4Q2QqGcDrY2ijumCJYJzQqlwG6liJ4FNg0U3POTCQDhQmuUoEJe0
|
||||
/dyiWlo48WQbBu6gUDHbTCCUSZPs2Lc9l65MqOCpX76+VXPYetZgqpMF4GVzb2y9
|
||||
kETxFNpiMYBlOBZk0I1G33wqVmw46MI5IZMQ2z2F8Mzt1hByUNTgup2IQELCv1a5
|
||||
a2ACs2TBRuAy1REeHhjLgiA/MpoGX7TpoHCGyo8jBChJVpP9ZHltKoChwDC+bIyx
|
||||
rgYH3jYDkl2FFuAUJ8zAZl8U1kjqZb9HGq9ootMk34Dbo3IVkc2azB2orEP9F8QV
|
||||
KxvZZDA9FAFEthSiNf5soJ6mZGLi0es5EWPoKMUEd9tG5bP980DySAWSSRK0AOfE
|
||||
QShT/z7oG79Orxyomwrb8ZJCi7wEfcCuK1NWgqLVUgXhpi2J9WYS6DAbF3Oh3Hhl
|
||||
DYSHlcfFBteqNDlR2uFInIECAwEAAQ==
|
||||
MIIEIjANBgkqhkiG9w0BAQEFAAOCBA8AMIIECgKCBAEKfZmq5mMAtD4kSt2Gc/5J
|
||||
H+HHTYtUZE6YYvsvz8TNG/bNL67ZtNRyaoMyhLTfIN4rPBNLUfD+owNS+u5Yk+lS
|
||||
ZLYyOuhoCZIFefayYqKLr42G8EeuRbx0IMzXmJtN0a4rqxlWhkYufJubpdQ+V4DF
|
||||
oeupcPdIATaadCKVeZC7A0G0uaSwoiAVMG5dZqjQW7F2LoQm3PhNkPvAybIJ6vBy
|
||||
LqdBegS1JrDn43x/pvQHzLO+l+FIG23D1F7iF+yZm3DkzBdcmi/mOMYs/rXZpBym
|
||||
2/kTuSGh5buuJCeyOwR8N3WdvXw6+KHMU/wWU8qTCTT87mYbzH4YR8HgkjkLHxAO
|
||||
5waHK6vMu0TxugCdJmVV6BSbiarJsh66VRosn7+6hlq6AdgksxqCeNELZBS+LBki
|
||||
tb5hKyL+jNZnaHiR0U7USWtmnqZG6FVVRzlCnxP7tZo5O5Ex9AAFGz5JzOzsFNbv
|
||||
xwQ0zqaTQOze+MJbkda7JfRoC6TncD0+3hoXsiaF4mCn8PqUCn0DwhglcRucZlST
|
||||
ZvDNDo1WAtxPJebb3aS6uymNhBIquQbVAWxVO4eTrOYEgutxwkHE3yO3is+ogp8d
|
||||
xot7f/+vzlbsbIDyuZBDe0fFkbTIMTU48QuUUVZpRKmKZTHQloz4EHqminbfX1sh
|
||||
M7wvDkpJEtqbc0VnG/BukUzP6e7Skvgc7eF1sI3+8jH8du2rivZeZAl7Q2f+L9JA
|
||||
BY9pjaxttxsud7V5jeFi4tKuDHi21/XhSjlJK2c2C4AiUEK5/WhtGbQ5JjmcOjRq
|
||||
yXFRqLlerzOcop2kbtU3Ar230wOx3Dj23Wg8++lV3LU4U9vMR/t0qnSbCSGJys7m
|
||||
ax2JpFlTwj/0wYuTlVFoNQHZJ1cdfyRiRBY4Ou7XO0W5hcBBKiYsC+neEeMMHdCe
|
||||
iTDIW/ojcVTdFovl+sq3n1u4SBknE90JC/3H+TPE1s2iB+fwORVg0KPosQSNDS0A
|
||||
7iK6AZCDC3YooFo+OzHkYMt9uLkXiXMSLx70az+qlIwOzVHKxCo7W/QpeKCXUCRZ
|
||||
MMdlYEUs1PC8x2qIRUEVHuJ0XMTKNyOHmzVLuLK93wUWbToh+rdDxnbhX+emuESn
|
||||
XH6aKiUwX4olEVKSylRUQw8nVckZGVWXzLDlgpzDrLHC8J8qHzFt7eCqOdiqsxhZ
|
||||
x1U5LtugxwSWncTZ7vlKl0DuC/AWB7SuDi7bGRMSVp2n+MnD1VLKlsCclHXjIciE
|
||||
W29n3G3lJ/sOta2sxqLd0j1XBQddrFXl5b609sIY81ocHqu8P2hRu5CpqJ/sGZC5
|
||||
mMH3segHBkRj0xJcfOxceRLj1a+ULIIR3xL/3f8s5Id25TDo/nqBoCvu5PeCpo6L
|
||||
9wIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
```
|
||||
|
@ -1,8 +1,5 @@
|
||||
list(APPEND PROJECT_COMMON_FLAG_LIST
|
||||
-D_FILE_OFFSET_BITS=64
|
||||
-D_GNU_SOURCE
|
||||
-D_LARGEFILE64_SOURCE
|
||||
-D_LARGEFILE_SOURCE
|
||||
-D_TIME_BITS=64
|
||||
-march=${PROJECT_MARCH}
|
||||
-mtune=generic
|
||||
@ -59,7 +56,8 @@ list(APPEND PROJECT_CFLAGS_LIST
|
||||
|
||||
list(APPEND PROJECT_CXXFLAGS_LIST
|
||||
${PROJECT_COMMON_FLAG_LIST}
|
||||
-std=gnu++${CMAKE_CXX_STANDARD}
|
||||
-fext-numeric-literals
|
||||
-std=c++${CMAKE_CXX_STANDARD}
|
||||
)
|
||||
|
||||
if(PROJECT_STATIC_LINK)
|
||||
|
@ -26,10 +26,20 @@ function(set_common_target_options name)
|
||||
endif()
|
||||
endfunction(set_common_target_options)
|
||||
|
||||
function(add_project_executable2 name dependencies libraries headers sources is_win32)
|
||||
if (PROJECT_WINDOWS_VERSION_RC)
|
||||
list(APPEND sources ${PROJECT_WINDOWS_VERSION_RC})
|
||||
endif()
|
||||
function(add_project_executable name dependencies libraries)
|
||||
file(GLOB_RECURSE headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hh
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hxx
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cxx
|
||||
)
|
||||
|
||||
add_executable(${name}
|
||||
${headers}
|
||||
@ -48,40 +58,6 @@ function(add_project_executable2 name dependencies libraries headers sources is_
|
||||
endif()
|
||||
|
||||
target_link_libraries(${name} PRIVATE ${libraries})
|
||||
|
||||
if(PROJECT_ENABLE_SDL AND PROJECT_IS_MINGW)
|
||||
target_link_libraries(${name} PRIVATE SDL2::SDL2main)
|
||||
endif ()
|
||||
|
||||
if (is_win32 AND PROJECT_IS_MINGW)
|
||||
target_link_options(${name} PRIVATE -mwindows)
|
||||
endif()
|
||||
endfunction(add_project_executable2)
|
||||
|
||||
function(add_project_executable name dependencies libraries)
|
||||
file(GLOB_RECURSE headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hh
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hxx
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cxx
|
||||
)
|
||||
|
||||
if(PROJECT_ENABLE_WXWIDGETS OR PROJECT_ENABLE_SDL OR PROJECT_ENABLE_SFML OR PROJECT_ENABLE_NANA)
|
||||
set(IS_WIN32 ON)
|
||||
endif()
|
||||
|
||||
add_project_executable2(${name} "${dependencies}" "${libraries}" "${headers}" "${sources}" "${IS_WIN32}")
|
||||
|
||||
if(PROJECT_ENABLE_WXWIDGETS)
|
||||
target_link_libraries(${name} PRIVATE ${wxWidgets_LIBRARIES})
|
||||
endif()
|
||||
endfunction(add_project_executable)
|
||||
|
||||
function(add_project_library name dependencies libraries additional_sources)
|
||||
@ -116,24 +92,7 @@ function(add_project_test_executable name dependencies libraries)
|
||||
find_package(GTest ${GTEST_VERSION} REQUIRED)
|
||||
enable_testing()
|
||||
|
||||
file(GLOB_RECURSE headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/${name}/include/${name}/include/*.hxx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/${name}/include/*.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hh
|
||||
${PROJECT_SUPPORT_DIR}/test/include/*.hpp
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cxx
|
||||
${PROJECT_SUPPORT_DIR}/test/src/*.cpp
|
||||
${additional_sources}
|
||||
)
|
||||
|
||||
add_project_executable2(${name} "${dependencies}" "${libraries}" "${headers}" "${sources}" OFF)
|
||||
add_project_executable(${name} "${dependencies}" "${libraries}")
|
||||
|
||||
target_compile_definitions(${name} PRIVATE -DPROJECT_TESTING)
|
||||
|
||||
@ -141,10 +100,6 @@ function(add_project_test_executable name dependencies libraries)
|
||||
${GTEST_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_include_directories(${name} AFTER PRIVATE
|
||||
${PROJECT_SUPPORT_DIR}/test/include
|
||||
)
|
||||
|
||||
target_link_libraries(${name} PRIVATE
|
||||
GTest::gtest
|
||||
GTest::gmock
|
||||
|
@ -1,20 +0,0 @@
|
||||
set(BINUTILS_HASH b53606f443ac8f01d1d5fc9c39497f2af322d99e14cea5c0b4b124d630379365)
|
||||
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
|
||||
set(BOOST_HASH f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d)
|
||||
set(CPP_HTTPLIB_HASH c9b9e0524666e1cd088f0874c57c1ce7c0eaa8552f9f4e15c755d5201fc8c608)
|
||||
set(CURL_HASH 6edc063d1ebaf9cf3b3b46e9fef2f3cd8932694989ecd43d005d6e828426d09f)
|
||||
set(EXPAT_HASH 372b18f6527d162fa9658f1c74d22a37429b82d822f5a1e1fc7e00f6045a06a2)
|
||||
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293)
|
||||
set(GTEST_HASH 78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399)
|
||||
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
||||
set(JSON_HASH 0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406)
|
||||
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
||||
set(MINGW_HASH cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f)
|
||||
set(OPENSSL_HASH 002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3)
|
||||
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
|
||||
set(PUGIXML_HASH 655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a)
|
||||
set(ROCKSDB_HASH fdccab16133c9d927a183c2648bcea8d956fb41eb1df2aacaa73eb0b95e43724)
|
||||
set(SPDLOG_HASH 25c843860f039a1600f232c6eb9e01e6627f7d030a2ae5e232bdd3c9205d26cc)
|
||||
set(SQLITE_HASH 6cebd1d8403fc58c30e93939b246f3e6e58d0765a5cd50546f16c00fd805d2c3)
|
||||
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
|
||||
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)
|
@ -2,27 +2,45 @@ find_package(PkgConfig REQUIRED)
|
||||
|
||||
set(Boost_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
|
||||
set(CURL_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
|
||||
set(LIBEVENT_STATIC_LINK ${PROJECT_STATIC_LINK})
|
||||
set(OPENSSL_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
|
||||
set(SFML_STATIC_LIBRARIES ${PROJECT_STATIC_LINK})
|
||||
set(ZLIB_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
|
||||
set(wxWidgets_USE_STATIC ${PROJECT_STATIC_LINK})
|
||||
|
||||
include(cmake/libraries/openssl.cmake)
|
||||
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR})
|
||||
|
||||
include(cmake/libraries/boost.cmake)
|
||||
|
||||
include(cmake/libraries/cpp_httplib.cmake)
|
||||
include(cmake/libraries/cli11.cmake)
|
||||
include(cmake/libraries/cpphttplib.cmake)
|
||||
include(cmake/libraries/curl.cmake)
|
||||
include(cmake/libraries/dtl.cmake)
|
||||
include(cmake/libraries/flac.cmake)
|
||||
include(cmake/libraries/fmt.cmake)
|
||||
include(cmake/libraries/fontconfig.cmake)
|
||||
include(cmake/libraries/freetype2.cmake)
|
||||
include(cmake/libraries/fuse.cmake)
|
||||
include(cmake/libraries/gtest.cmake)
|
||||
include(cmake/libraries/gtkmm.cmake)
|
||||
include(cmake/libraries/json.cmake)
|
||||
include(cmake/libraries/libbitcoinsystem.cmake)
|
||||
include(cmake/libraries/libevent.cmake)
|
||||
include(cmake/libraries/libsodium.cmake)
|
||||
include(cmake/libraries/nuspell.cmake)
|
||||
include(cmake/libraries/ogg.cmake)
|
||||
include(cmake/libraries/openal.cmake)
|
||||
include(cmake/libraries/openssl.cmake)
|
||||
include(cmake/libraries/pugixml.cmake)
|
||||
include(cmake/libraries/rocksdb.cmake)
|
||||
include(cmake/libraries/secp256k1.cmake)
|
||||
include(cmake/libraries/sfml.cmake)
|
||||
include(cmake/libraries/spdlog.cmake)
|
||||
include(cmake/libraries/sqlite.cmake)
|
||||
include(cmake/libraries/stduuid.cmake)
|
||||
include(cmake/libraries/testing.cmake)
|
||||
include(cmake/libraries/tpl.cmake)
|
||||
include(cmake/libraries/vorbis.cmake)
|
||||
include(cmake/libraries/winfsp.cmake)
|
||||
include(cmake/libraries/wxwidgets.cmake)
|
||||
|
||||
if(PROJECT_BUILD)
|
||||
find_package(Threads REQUIRED)
|
||||
@ -42,7 +60,6 @@ if(PROJECT_BUILD)
|
||||
httpapi
|
||||
iphlpapi
|
||||
kernel32
|
||||
mswsock
|
||||
ncrypt
|
||||
ole32
|
||||
oleaut32
|
||||
|
@ -1,4 +1,6 @@
|
||||
if(PROJECT_ENABLE_BOOST)
|
||||
add_definitions(-DPROJECT_ENABLE_BOOST)
|
||||
|
||||
if(PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
|
||||
set(BOOST_MAJOR_VERSION ${BOOST2_MAJOR_VERSION})
|
||||
set(BOOST_MINOR_VERSION ${BOOST2_MINOR_VERSION})
|
||||
@ -16,9 +18,6 @@ if(PROJECT_ENABLE_BOOST)
|
||||
)
|
||||
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_BOOST)
|
||||
|
||||
if (PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
|
||||
find_package(Boost ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION} EXACT
|
||||
REQUIRED
|
||||
COMPONENTS
|
||||
@ -38,27 +37,6 @@ if(PROJECT_ENABLE_BOOST)
|
||||
thread
|
||||
wserialization
|
||||
)
|
||||
else()
|
||||
find_package(Boost ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION}
|
||||
REQUIRED
|
||||
COMPONENTS
|
||||
atomic
|
||||
chrono
|
||||
date_time
|
||||
filesystem
|
||||
iostreams
|
||||
locale
|
||||
log
|
||||
log_setup
|
||||
program_options
|
||||
random
|
||||
regex
|
||||
serialization
|
||||
system
|
||||
thread
|
||||
wserialization
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${Boost_INCLUDE_DIRS}
|
||||
@ -68,7 +46,6 @@ if(PROJECT_ENABLE_BOOST)
|
||||
${Boost_LIBRARIES}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
if (PROJECT_ENABLE_LIBBITCOIN_SYSTEM OR NOT CMAKE_HOST_WIN32)
|
||||
if(PROJECT_CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(BOOST_BUILD_TYPE_LOWER debug)
|
||||
else()
|
||||
@ -92,22 +69,20 @@ if(PROJECT_ENABLE_BOOST)
|
||||
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
|
||||
address-model=64
|
||||
architecture=${BOOST_ARCH}
|
||||
cxxstd=20
|
||||
cxxstd-dialect=gnu
|
||||
cxxflags=-std=gnu++${CMAKE_CXX_STANDARD}
|
||||
cxxflags=-std=c++${CMAKE_CXX_STANDARD}
|
||||
cxxstd=${CMAKE_CXX_STANDARD}
|
||||
define=BOOST_ASIO_HAS_STD_STRING_VIEW
|
||||
define=BOOST_SYSTEM_NO_DEPRECATED
|
||||
link=${BOOST_LINK}
|
||||
linkflags=-std=gnu++${CMAKE_CXX_STANDARD}
|
||||
linkflags=-std=c++${CMAKE_CXX_STANDARD}
|
||||
threading=multi
|
||||
variant=${BOOST_BUILD_TYPE_LOWER}
|
||||
)
|
||||
|
||||
if(PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
|
||||
set(BOOST_URL_HASH SHA256=${BOOST2_HASH})
|
||||
set(BOOST_URL_HASH SHA256=7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
|
||||
else()
|
||||
set(BOOST_URL_HASH SHA256=${BOOST_HASH})
|
||||
set(BOOST_URL_HASH SHA256=be0d91732d5b0cc6fbb275c7939974457e79b54d6f07ce2e3dfdd68bef883b0b)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(boost_project
|
||||
@ -120,20 +95,18 @@ if(PROJECT_ENABLE_BOOST)
|
||||
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread
|
||||
BUILD_COMMAND
|
||||
./b2
|
||||
-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
-j1
|
||||
${BOOST_BUILD_ARGS}
|
||||
INSTALL_COMMAND
|
||||
./b2
|
||||
-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
-j1
|
||||
${BOOST_BUILD_ARGS}
|
||||
install
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES boost_project)
|
||||
|
||||
if (NOT CMAKE_HOST_WIN32)
|
||||
add_dependencies(boost_project openssl_project)
|
||||
endif()
|
||||
endif()
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
boost_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
28
cmake/libraries/cli11.cmake
Normal file
28
cmake/libraries/cli11.cmake
Normal file
@ -0,0 +1,28 @@
|
||||
if(PROJECT_ENABLE_CLI11)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(CLI11 ${CLI11_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_CLI11)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(cli11_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/CLI11-${CLI11_VERSION}.tar.gz
|
||||
URL_HASH SHA256=f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DCLI11_WARNINGS_AS_ERRORS=OFF
|
||||
-DCLI11_SINGLE_FILE=ON
|
||||
-DCLI11_BUILD_DOCS=OFF
|
||||
-DCLI11_BUILD_TESTS=OFF
|
||||
-DCLI11_BUILD_EXAMPLES=OFF
|
||||
-DCLI11_INSTALL=ON
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
cli11_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
@ -1,34 +1,40 @@
|
||||
if(PROJECT_ENABLE_CPP_HTTPLIB)
|
||||
if(PROJECT_BUILD)
|
||||
if(PROJECT_ENABLE_OPENSSL)
|
||||
add_definitions(
|
||||
-DCPPHTTPLIB_OPENSSL_SUPPORT
|
||||
)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-DPROJECT_ENABLE_CPP_HTTPLIB
|
||||
-DCPPHTTPLIB_TCP_NODELAY=true
|
||||
-DCPPHTTPLIB_ZLIB_SUPPORT
|
||||
-DPROJECT_ENABLE_CPP_HTTPLIB
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(cpphttplib_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/cpp-httplib-${CPP_HTTPLIB_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${CPP_HTTPLIB_HASH}
|
||||
URL_HASH SHA256=2121bbf38871bb2aafb5f7f2b9b94705366170909f434428352187cb0216124e
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DHTTPLIB_REQUIRE_BROTLI=OFF
|
||||
-DHTTPLIB_REQUIRE_OPENSSL=ON
|
||||
-DHTTPLIB_REQUIRE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
|
||||
-DHTTPLIB_REQUIRE_ZLIB=ON
|
||||
-DHTTPLIB_REQUIRE_BROTLI=OFF
|
||||
-DHTTPLIB_TEST=OFF
|
||||
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF
|
||||
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=ON
|
||||
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON
|
||||
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES cpphttplib_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
cpphttplib_project
|
||||
)
|
||||
|
||||
add_dependencies(cpphttplib_project curl_project)
|
||||
if (NOT CMAKE_HOST_WIN32)
|
||||
|
||||
if(PROJECT_ENABLE_OPENSSL)
|
||||
add_dependencies(cpphttplib_project openssl_project)
|
||||
endif()
|
||||
endif()
|
@ -1,35 +1,30 @@
|
||||
if(PROJECT_ENABLE_CURL)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_CURL)
|
||||
|
||||
find_package(CURL ${CURL_VERSION} REQUIRED)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${CURL_INCLUDE_DIRS})
|
||||
add_definitions(-DPROJECT_ENABLE_CURL)
|
||||
|
||||
link_libraries(CURL::libcurl)
|
||||
include_directories(BEFORE SYSTEM
|
||||
${CURL_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if (EXISTS ${PROJECT_DIST_DIR}/cacert.pem)
|
||||
file(REMOVE ${PROJECT_DIST_DIR}/cacert.pem)
|
||||
endif()
|
||||
file(DOWNLOAD https://curl.haxx.se/ca/cacert.pem ${PROJECT_DIST_DIR}/cacert.pem)
|
||||
link_libraries(
|
||||
CURL::libcurl
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(curl_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/curl-${CURL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${CURL_HASH}
|
||||
URL_HASH SHA256=f91249c87f68ea00cf27c44fdfa5a78423e41e71b7d408e5901a9896d905c495
|
||||
LIST_SEPARATOR |
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_CURL_EXE=OFF
|
||||
-DBUILD_LIBCURL_DOCS=OFF
|
||||
-DBUILD_MISC_DOCS=OFF
|
||||
CMAKE_ARGS
|
||||
${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_CURL_EXE=OFF
|
||||
-DBUILD_STATIC_CURL=ON
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
-DCURL_BROTLI=OFF
|
||||
-DCURL_CA_BUNDLE=./cacert.pem
|
||||
-DCURL_CA_FALLBACK=ON
|
||||
-DCURL_DISABLE_LDAP=ON
|
||||
@ -37,7 +32,6 @@ if(PROJECT_ENABLE_CURL)
|
||||
-DCURL_USE_LIBSSH2=OFF
|
||||
-DCURL_USE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
|
||||
-DCURL_ZLIB=ON
|
||||
-DENABLE_CURL_MANUAL=OFF
|
||||
-DENABLE_THREADED_RESOLVER=ON
|
||||
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
|
||||
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}
|
||||
@ -45,9 +39,12 @@ if(PROJECT_ENABLE_CURL)
|
||||
-DZLIB_USE_STATIC_LIBS=${ZLIB_USE_STATIC_LIBS}
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES curl_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
curl_project
|
||||
)
|
||||
|
||||
if (NOT CMAKE_HOST_WIN32)
|
||||
if(PROJECT_ENABLE_OPENSSL)
|
||||
add_dependencies(curl_project openssl_project)
|
||||
endif()
|
||||
endif()
|
||||
|
20
cmake/libraries/dtl.cmake
Normal file
20
cmake/libraries/dtl.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
if(PROJECT_ENABLE_DTL)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_DTL)
|
||||
else()
|
||||
ExternalProject_Add(dtl_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/dtl-v${DTL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=d6dcc7834b4117b5c14456ea73b907d0e2bafa5058e3a06b2c504d53517438c5
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
dtl_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
37
cmake/libraries/flac.cmake
Normal file
37
cmake/libraries/flac.cmake
Normal file
@ -0,0 +1,37 @@
|
||||
if(PROJECT_ENABLE_FLAC)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(FLAC ${FLAC_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_FLAC)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${FLAC_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
FLAC::FLAC
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(flac_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/flac-${FLAC_VERSION}.tar.gz
|
||||
URL_HASH SHA256=0a4bb82a30609b606650d538a804a7b40205366ce8fc98871b0ecf3fbb0611ee
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_EXAMPLES=ON
|
||||
-DBUILD_PROGRAMS=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
-DBUILD_DOCS=OFF
|
||||
-DINSTALL_MANPAGES=OFF
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
flac_project
|
||||
)
|
||||
|
||||
add_dependencies(flac_project vorbis_project)
|
||||
endif()
|
||||
endif()
|
30
cmake/libraries/fmt.cmake
Normal file
30
cmake/libraries/fmt.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
if(PROJECT_ENABLE_FMT)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(fmt ${FMT_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_FMT)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${FMT_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
fmt::fmt
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(fmt_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/fmt-${FMT_VERSION}.tar.gz
|
||||
URL_HASH SHA256=1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
fmt_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
41
cmake/libraries/fontconfig.cmake
Normal file
41
cmake/libraries/fontconfig.cmake
Normal file
@ -0,0 +1,41 @@
|
||||
if(PROJECT_ENABLE_FONTCONFIG)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(Fontconfig ${FONTCONFIG_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_FONTCONFIG)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${FONTCONFIG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
Fontconfig::Fontconfig
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(fontconfig_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/fontconfig-${FONTCONFIG_VERSION}.tar.gz
|
||||
URL_HASH SHA256=cdebb4b805d33e9bdefcc0ef9743db638d2acb21139bbe1a6a85878d4c3e8c9e
|
||||
BUILD_IN_SOURCE 1
|
||||
LIST_SEPARATOR |
|
||||
CONFIGURE_COMMAND meson
|
||||
setup
|
||||
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
|
||||
_build
|
||||
BUILD_COMMAND meson
|
||||
compile
|
||||
-C _build
|
||||
INSTALL_COMMAND meson
|
||||
install
|
||||
-C _build
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
fontconfig_project
|
||||
)
|
||||
|
||||
add_dependencies(fontconfig_project freetype2_project)
|
||||
endif()
|
||||
endif()
|
||||
|
39
cmake/libraries/freetype2.cmake
Normal file
39
cmake/libraries/freetype2.cmake
Normal file
@ -0,0 +1,39 @@
|
||||
if(PROJECT_ENABLE_FREETYPE2)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(Freetype ${FREETYPE2_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_FREETYPE2)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
Freetype::Freetype
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(freetype2_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/freetype-${FREETYPE2_VERSION}.tar.gz
|
||||
URL_HASH SHA256=1ac27e16c134a7f2ccea177faba19801131116fd682efc1f5737037c5db224b5
|
||||
BUILD_IN_SOURCE 1
|
||||
LIST_SEPARATOR |
|
||||
CONFIGURE_COMMAND meson
|
||||
setup
|
||||
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
|
||||
_build
|
||||
BUILD_COMMAND meson
|
||||
compile
|
||||
-C _build
|
||||
INSTALL_COMMAND meson
|
||||
install
|
||||
-C _build
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
freetype2_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,7 +1,6 @@
|
||||
if(PROJECT_ENABLE_FUSE AND NOT PROJECT_IS_MINGW)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_FUSE)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${PROJECT_FUSE_INCLUDE_DIRS})
|
||||
|
||||
if(PROJECT_FUSE STREQUAL "fuse3")
|
||||
@ -19,6 +18,11 @@ if(PROJECT_ENABLE_FUSE AND NOT PROJECT_IS_MINGW)
|
||||
link_libraries(fuse)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_include_files(sys/xattr.h HAS_SETXATTR)
|
||||
if(HAS_SETXATTR)
|
||||
add_definitions(-DHAS_SETXATTR)
|
||||
endif()
|
||||
else()
|
||||
pkg_check_modules(LIBFUSE3 fuse3>=3.0.0)
|
||||
if(LIBFUSE3_FOUND)
|
||||
|
@ -1,17 +1,18 @@
|
||||
if (PROJECT_ENABLE_TESTING)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_TESTING)
|
||||
elseif(NOT PROJECT_IS_MINGW)
|
||||
if(NOT PROJECT_BUILD AND PROJECT_ENABLE_TESTING)
|
||||
if(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(gtest_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/googletest-${GTEST_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${GTEST_HASH}
|
||||
URL_HASH SHA256=8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES gtest_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
gtest_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
14
cmake/libraries/gtkmm.cmake
Normal file
14
cmake/libraries/gtkmm.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
if(PROJECT_ENABLE_GTKMM)
|
||||
if(PROJECT_BUILD)
|
||||
pkg_check_modules(GTKMM REQUIRED gtkmm-${GTKMM_VERSION})
|
||||
|
||||
add_definitions(
|
||||
-DPROJECT_ENABLE_GTKMM
|
||||
${GTKMM_DEFINITIONS}
|
||||
)
|
||||
|
||||
include_directories(${GTKMM_INCLUDE_DIRS})
|
||||
link_directories(${GTKMM_LIBRARY_DIRS})
|
||||
link_libraries(${GTKMM_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
@ -1,19 +1,23 @@
|
||||
if(PROJECT_ENABLE_JSON)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_JSON)
|
||||
|
||||
find_package(nlohmann_json ${JSON_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_JSON)
|
||||
|
||||
if(PROJECT_IS_MINGW AND PROJECT_IS_MINGW_UNIX)
|
||||
include_directories(BEFORE SYSTEM /mingw64/include/nlohmann)
|
||||
include_directories(BEFORE SYSTEM
|
||||
/mingw64/include/nlohmann
|
||||
)
|
||||
else()
|
||||
include_directories(BEFORE SYSTEM ${PROJECT_EXTERNAL_BUILD_ROOT}/include/nlohmann)
|
||||
include_directories(BEFORE SYSTEM
|
||||
${PROJECT_EXTERNAL_BUILD_ROOT}/include/nlohmann
|
||||
)
|
||||
endif()
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(json_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/json-${JSON_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${JSON_HASH}
|
||||
URL_HASH SHA256=0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
@ -23,6 +27,9 @@ if(PROJECT_ENABLE_JSON)
|
||||
-DJSON_MultipleHeaders=OFF
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES json_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
json_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
72
cmake/libraries/libbitcoinsystem.cmake
Normal file
72
cmake/libraries/libbitcoinsystem.cmake
Normal file
@ -0,0 +1,72 @@
|
||||
if(PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(
|
||||
-DPROJECT_ENABLE_LIBBITCOIN_SYSTEM
|
||||
-DBC_STATIC
|
||||
-DECMULT_GEN_PREC_BITS=4
|
||||
-DECMULT_WINDOW_SIZE=15
|
||||
-DWITH_ICU
|
||||
)
|
||||
|
||||
set(LIBBITCOIN_SYSTEM_ROOT
|
||||
${PROJECT_BUILD_DIR}/external/src/libbitcoinsystem_project
|
||||
)
|
||||
|
||||
include_directories(SYSTEM BEFORE
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/include
|
||||
)
|
||||
|
||||
set(PROJECT_ADDITIONAL_SOURCES
|
||||
${PROJECT_ADDITIONAL_SOURCES}
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/math/external/*.c
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/formats/*.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/config/*.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/math/*.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/unicode/*.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/utility/string.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/dictionary.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/electrum.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/electrum_dictionary.cpp
|
||||
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/mnemonic.cpp
|
||||
)
|
||||
|
||||
if(PROJECT_IS_MINGW)
|
||||
pkg_check_modules(ICU_I18N icu-i18n)
|
||||
pkg_check_modules(ICU_IO icu-io)
|
||||
pkg_check_modules(ICU_UC icu-uc)
|
||||
|
||||
link_libraries(
|
||||
${ICU_I18N_LINK_LIBRARIES}
|
||||
${ICU_IO_LINK_LIBRARIES}
|
||||
${ICU_UC_LINK_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
link_libraries(
|
||||
icui18n
|
||||
icuuc
|
||||
icudata
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
ExternalProject_Add(libbitcoinsystem_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/libbitcoin-system-${LIBBITCOIN_SYSTEM_VERSION}.tar.gz
|
||||
URL_HASH SHA256=0d10d79472e914620223f1ddb9396b0fa92ae5eb0b31acc14b9aa634a01d78b6
|
||||
CONFIGURE_COMMAND echo "No configure"
|
||||
BUILD_COMMAND echo "No build"
|
||||
INSTALL_COMMAND echo "No install"
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
libbitcoinsystem_project
|
||||
)
|
||||
|
||||
if(NOT PROJECT_IS_MINGW_UNIX)
|
||||
add_dependencies(libbitcoinsystem_project
|
||||
boost_project
|
||||
secp256k1_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
40
cmake/libraries/libevent.cmake
Normal file
40
cmake/libraries/libevent.cmake
Normal file
@ -0,0 +1,40 @@
|
||||
if(PROJECT_ENABLE_LIBEVENT)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(Libevent ${LIBEVENT_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_LIBEVENT)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${LIBEVENT_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
${LIBEVENT_LIBRARIES}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
if(PROJECT_BUILD_SHARED_LIBS)
|
||||
set(LIBEVENT_LIBRARY_TYPE BOTH)
|
||||
else()
|
||||
set(LIBEVENT_LIBRARY_TYPE STATIC)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(libevent_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/libevent-${LIBEVENT_VERSION}-stable.tar.gz
|
||||
URL_HASH SHA256=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DEVENT__DISABLE_OPENSSL=ON
|
||||
-DEVENT__DISABLE_SAMPLES=ON
|
||||
-DEVENT__DISABLE_TESTS=ON
|
||||
-DEVENT__LIBRARY_TYPE=${LIBEVENT_LIBRARY_TYPE}
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
libevent_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
@ -1,21 +1,17 @@
|
||||
if(PROJECT_ENABLE_LIBSODIUM)
|
||||
if(PROJECT_BUILD)
|
||||
pkg_check_modules(SODIUM libsodium>=${LIBSODIUM_VERSION} REQUIRED)
|
||||
pkg_check_modules(SODIUM libsodium=${LIBSODIUM_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_LIBSODIUM)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${SODIUM_INCLUDE_DIRS})
|
||||
include_directories(BEFORE SYSTEM
|
||||
${SODIUM_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(PROJECT_IS_MINGW_UNIX)
|
||||
if(PROJECT_STATIC_LINK)
|
||||
link_libraries(/mingw64/lib/libsodium.a)
|
||||
else()
|
||||
link_libraries(/mingw64/lib/libsodium.dll.a)
|
||||
endif()
|
||||
else()
|
||||
link_libraries(${SODIUM_LIBRARIES})
|
||||
endif()
|
||||
elseif(NOT PROJECT_IS_MINGW)
|
||||
link_libraries(
|
||||
${SODIUM_LINK_LIBRARIES}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
if(PROJECT_IS_MINGW)
|
||||
set(LIBSODIUM_TYPE mingw64)
|
||||
else()
|
||||
@ -30,8 +26,8 @@ if(PROJECT_ENABLE_LIBSODIUM)
|
||||
|
||||
ExternalProject_Add(libsodium_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/libsodium-${LIBSODIUM_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${LIBSODIUM_HASH}
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/libsodium-${LIBSODIUM_VERSION}-RELEASE.tar.gz
|
||||
URL_HASH SHA256=4fb996013283f482f46a457c8ff2c1495e797788e78e8ec56b1aa1b19253bf75
|
||||
BUILD_IN_SOURCE 1
|
||||
LIST_SEPARATOR |
|
||||
CONFIGURE_COMMAND ${PROJECT_3RD_PARTY_DIR}/libsodium_configure.sh
|
||||
@ -43,6 +39,9 @@ if(PROJECT_ENABLE_LIBSODIUM)
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES libsodium_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
libsodium_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
32
cmake/libraries/nuspell.cmake
Normal file
32
cmake/libraries/nuspell.cmake
Normal file
@ -0,0 +1,32 @@
|
||||
if(PROJECT_ENABLE_NUSPELL)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(Nuspell ${NUSPELL_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_NUSPELL)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${NUSPELL_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
Nuspell::nuspell
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(nuspell_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/nuspell-v${NUSPELL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=bdf344c5adbcc6797940f8f8cb75cb59f5a3794eb21b9547751a11782a792ef7
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
-DBUILD_TOOLS=OFF
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
nuspell_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
30
cmake/libraries/ogg.cmake
Normal file
30
cmake/libraries/ogg.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
if(PROJECT_ENABLE_OGG)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(Ogg ${OGG_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_OGG)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${OGG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
Ogg::ogg
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(ogg_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/ogg-v${OGG_VERSION}.tar.gz
|
||||
URL_HASH SHA256=f6f1b04cfa4e98b70ffe775d5e302d9c6b98541f05159af6de2d6617817ed7d6
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
ogg_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
30
cmake/libraries/openal.cmake
Normal file
30
cmake/libraries/openal.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
if(PROJECT_ENABLE_OPENAL)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(OpenAL ${OPENAL_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_OPENAL)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${OPENAL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
${OPENAL_LIBRARY}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(openal_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/openal-${OPENAL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=dfddf3a1f61059853c625b7bb03de8433b455f2f79f89548cbcbd5edca3d4a4a
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
openal_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
@ -1,18 +1,18 @@
|
||||
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR})
|
||||
|
||||
if(PROJECT_ENABLE_OPENSSL)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_OPENSSL)
|
||||
|
||||
find_package(OpenSSL ${OPENSSL_VERSION} REQUIRED)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${OPENSSL_INCLUDE_DIR})
|
||||
add_definitions(-DPROJECT_ENABLE_OPENSSL)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
OpenSSL::Crypto
|
||||
OpenSSL::SSL
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
if(PROJECT_IS_MINGW)
|
||||
set(OPENSSL_COMPILE_TYPE mingw64)
|
||||
elseif(PROJECT_IS_ARM64)
|
||||
@ -34,7 +34,7 @@ if(PROJECT_ENABLE_OPENSSL)
|
||||
ExternalProject_Add(openssl_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/openssl-${OPENSSL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${OPENSSL_HASH}
|
||||
URL_HASH SHA256=53e66b043322a606abf0087e7699a0e033a37fa13feb9742df35c3a33b18fb02
|
||||
BUILD_IN_SOURCE 1
|
||||
LIST_SEPARATOR |
|
||||
CONFIGURE_COMMAND ./Configure
|
||||
@ -48,6 +48,9 @@ if(PROJECT_ENABLE_OPENSSL)
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES openssl_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
openssl_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,27 +1,36 @@
|
||||
if(PROJECT_ENABLE_PUGIXML)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_PUGIXML)
|
||||
|
||||
find_package(pugixml ${PUGIXML_VERSION} REQUIRED)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${PUGIXML_INCLUDE_DIR})
|
||||
add_definitions(-DPROJECT_ENABLE_PUGIXML)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${PUGIXML_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if(PROJECT_STATIC_LINK)
|
||||
link_libraries(pugixml::static)
|
||||
link_libraries(
|
||||
pugixml::static
|
||||
)
|
||||
else()
|
||||
link_libraries(pugixml::pugixml)
|
||||
link_libraries(
|
||||
pugixml::pugixml
|
||||
)
|
||||
endif()
|
||||
elseif(NOT PROJECT_IS_MINGW)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(pugixml_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/pugixml-${PUGIXML_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${PUGIXML_HASH}
|
||||
URL_HASH SHA256=2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES pugixml_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
pugixml_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,22 +1,24 @@
|
||||
if(PROJECT_ENABLE_ROCKSDB)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_ROCKSDB)
|
||||
find_library(ROCKSDB_LIBRARY NAMES librocksdb.a REQUIRED)
|
||||
link_libraries(${ROCKSDB_LIBRARY})
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_ROCKSDB)
|
||||
|
||||
link_libraries(
|
||||
${ROCKSDB_LIBRARY}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(rocksdb_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/rocksdb-${ROCKSDB_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${ROCKSDB_HASH}
|
||||
URL_HASH SHA256=54ca90dd782a988cd3ebc3e0e9ba9b4efd563d7eb78c5e690c2403f1b7d4a87a
|
||||
LIST_SEPARATOR |
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DFAIL_ON_WARNINGS=OFF
|
||||
-DPORTABLE=1
|
||||
-DROCKSDB_BUILD_SHARED=OFF
|
||||
-DROCKSDB_BUILD_SHARED=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DROCKSDB_INSTALL_ON_WINDOWS=ON
|
||||
-DWITH_BENCHMARK=OFF
|
||||
-DWITH_BENCHMARK_TOOLS=OFF
|
||||
@ -31,6 +33,9 @@ if(PROJECT_ENABLE_ROCKSDB)
|
||||
-DWITH_ZLIB=ON
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES rocksdb_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
rocksdb_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
41
cmake/libraries/secp256k1.cmake
Normal file
41
cmake/libraries/secp256k1.cmake
Normal file
@ -0,0 +1,41 @@
|
||||
if(PROJECT_ENABLE_SECP256K1)
|
||||
if(PROJECT_BUILD)
|
||||
pkg_check_modules(SECP256K1 libsecp256k1=${SECP256K1_VERSION} REQUIRED)
|
||||
add_definitions(-DPROJECT_ENABLE_SECP256K1)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${SECP256K1_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
${SECP256K1_LINK_LIBRARIES}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
if(PROJECT_BUILD_SHARED_LIBS)
|
||||
set(SECP256K1_ENABLE_SHARED yes)
|
||||
else()
|
||||
set(SECP256K1_ENABLE_SHARED no)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(secp256k1_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/secp256k1-${SECP256K1_VERSION}.tar.gz
|
||||
URL_HASH SHA256=61583939f1f25b92e6401e5b819e399da02562de663873df3056993b40148701
|
||||
BUILD_IN_SOURCE 1
|
||||
LIST_SEPARATOR |
|
||||
CONFIGURE_COMMAND ./autogen.sh && ./configure
|
||||
--enable-shared=${SECP256K1_ENABLE_SHARED}
|
||||
--enable-static=yes
|
||||
--enable-module-ecdh
|
||||
--enable-module-recovery
|
||||
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
|
||||
BUILD_COMMAND make -j1
|
||||
INSTALL_COMMAND make install
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
secp256k1_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
66
cmake/libraries/sfml.cmake
Normal file
66
cmake/libraries/sfml.cmake
Normal file
@ -0,0 +1,66 @@
|
||||
if(PROJECT_ENABLE_SFML)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(X11 REQUIRED)
|
||||
|
||||
find_package(SFML ${SFML_VERSION}
|
||||
COMPONENTS
|
||||
audio
|
||||
graphics
|
||||
network
|
||||
system
|
||||
window
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_SFML)
|
||||
|
||||
if(PROJECT_BUILD_SHARED_LIBS)
|
||||
link_libraries(
|
||||
${X11_LIBRARIES}
|
||||
sfml-audio
|
||||
sfml-graphics
|
||||
sfml-network
|
||||
sfml-system
|
||||
sfml-window
|
||||
)
|
||||
else()
|
||||
link_libraries(
|
||||
${X11_LIBRARIES}
|
||||
sfml-audio-s
|
||||
sfml-graphics-s
|
||||
sfml-network-s
|
||||
sfml-system-s
|
||||
sfml-window-s
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${X11_INCLUDE_DIR}
|
||||
${SFML_INCLUDE_DIR}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(sfml_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/SFML-${SFML_VERSION}.tar.gz
|
||||
URL_HASH SHA256=82535db9e57105d4f3a8aedabd138631defaedc593cab589c924b7d7a11ffb9d
|
||||
PATCH_COMMAND ${PROJECT_3RD_PARTY_DIR}/SFML_patch.sh
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
sfml_project
|
||||
)
|
||||
|
||||
add_dependencies(sfml_project
|
||||
flac_project
|
||||
fontconfig_project
|
||||
freetype2_project
|
||||
openal_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
@ -1,25 +1,33 @@
|
||||
if(PROJECT_ENABLE_SPDLOG)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_SPDLOG)
|
||||
|
||||
find_package(spdlog ${SPDLOG_VERSION} REQUIRED)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${SPDLOG_INCLUDE_DIRS})
|
||||
add_definitions(-DPROJECT_ENABLE_SPDLOG)
|
||||
|
||||
link_libraries(spdlog::spdlog)
|
||||
include_directories(BEFORE SYSTEM
|
||||
${SPDLOG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
spdlog::spdlog
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(spdlog_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/spdlog-${SPDLOG_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${SPDLOG_HASH}
|
||||
URL_HASH SHA256=1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DSPDLOG_BUILD_EXAMPLE=OFF
|
||||
-DSPDLOG_FMT_EXTERNAL=OFF
|
||||
-DSPDLOG_FMT_EXTERNAL_HO=OFF
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES spdlog_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
spdlog_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,29 +1,32 @@
|
||||
if(PROJECT_ENABLE_SQLITE)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_SQLITE)
|
||||
if (PROJECT_IS_MINGW AND NOT PROJECT_IS_MINGW_UNIX)
|
||||
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
|
||||
include_directories(SYSTEM BEFORE ${SQLITE3_INCLUDE_DIRS})
|
||||
link_libraries(${SQLITE3_LIBRARIES})
|
||||
else()
|
||||
set(SQLITE_SYSTEM_ROOT ${PROJECT_BUILD_DIR}/external/src/sqlite_project)
|
||||
|
||||
include_directories(SYSTEM BEFORE ${SQLITE_SYSTEM_ROOT})
|
||||
set(SQLITE_SYSTEM_ROOT
|
||||
${PROJECT_BUILD_DIR}/external/src/sqlite_project
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_ADDITIONAL_SOURCES
|
||||
include_directories(SYSTEM BEFORE
|
||||
${SQLITE_SYSTEM_ROOT}
|
||||
)
|
||||
|
||||
set(PROJECT_ADDITIONAL_SOURCES
|
||||
${PROJECT_ADDITIONAL_SOURCES}
|
||||
${SQLITE_SYSTEM_ROOT}/sqlite3.c
|
||||
)
|
||||
endif()
|
||||
elseif(NOT PROJECT_IS_MINGW OR PROJECT_IS_MINGW_UNIX)
|
||||
else()
|
||||
ExternalProject_Add(sqlite_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/sqlite-amalgamation-${SQLITE_VERSION}.zip
|
||||
URL_HASH SHA256=${SQLITE_HASH}
|
||||
URL_HASH SHA256=712a7d09d2a22652fb06a49af516e051979a3984adb067da86760e60ed51a7f5
|
||||
CONFIGURE_COMMAND echo "No configure"
|
||||
BUILD_COMMAND echo "No build"
|
||||
INSTALL_COMMAND echo "No install"
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES sqlite_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
sqlite_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,17 +1,21 @@
|
||||
if(PROJECT_ENABLE_STDUUID)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_STDUUID)
|
||||
|
||||
find_package(stduuid REQUIRED)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${stduuid_INCLUDE_DIRS})
|
||||
add_definitions(-DPROJECT_ENABLE_STDUUID)
|
||||
|
||||
link_libraries(${stduuid_LIBRARIES})
|
||||
include_directories(BEFORE SYSTEM
|
||||
${stduuid_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
${stduuid_LIBRARIES}
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(stduuid_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/stduuid-${STDUUID_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${STDUUID_HASH}
|
||||
URL_HASH SHA256=b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
@ -21,6 +25,9 @@ if(PROJECT_ENABLE_STDUUID)
|
||||
-DUUID_USING_CXX20_SPAN=ON
|
||||
)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES stduuid_project)
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
stduuid_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
27
cmake/libraries/tpl.cmake
Normal file
27
cmake/libraries/tpl.cmake
Normal file
@ -0,0 +1,27 @@
|
||||
if(PROJECT_ENABLE_TPL)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(tiny-process-library REQUIRED)
|
||||
add_definitions(-DPROJECT_ENABLE_TPL)
|
||||
|
||||
link_libraries(
|
||||
tiny-process-library::tiny-process-library
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(tpl_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/tiny-process-library.tar.gz
|
||||
URL_HASH SHA256=82e46657e697aff5bf980387c86ef3aa05bb184622abbd75663a4df549c68f73
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
tpl_project
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
33
cmake/libraries/vorbis.cmake
Normal file
33
cmake/libraries/vorbis.cmake
Normal file
@ -0,0 +1,33 @@
|
||||
if(PROJECT_ENABLE_VORBIS)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(Vorbis ${VORBIS_VERSION} REQUIRED)
|
||||
|
||||
add_definitions(-DPROJECT_ENABLE_VORBIS)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${VORBIS_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_libraries(
|
||||
Vorbis::vorbis
|
||||
)
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(vorbis_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/vorbis-v${VORBIS_VERSION}.tar.gz
|
||||
URL_HASH SHA256=270c76933d0934e42c5ee0a54a36280e2d87af1de3cc3e584806357e237afd13
|
||||
PATCH_COMMAND ${PROJECT_3RD_PARTY_DIR}/vorbis_patch.sh ${PROJECT_3RD_PARTY_DIR} ${CMAKE_BINARY_DIR}/external/src/vorbis_project
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
vorbis_project
|
||||
)
|
||||
|
||||
add_dependencies(vorbis_project ogg_project)
|
||||
endif()
|
||||
endif()
|
@ -2,9 +2,13 @@ if(PROJECT_ENABLE_WINFSP AND PROJECT_IS_MINGW)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_WINFSP)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/inc)
|
||||
include_directories(BEFORE SYSTEM
|
||||
${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/inc
|
||||
)
|
||||
|
||||
link_directories(BEFORE ${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/lib)
|
||||
link_directories(BEFORE
|
||||
${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/lib
|
||||
)
|
||||
|
||||
if(PROJECT_IS_ARM64)
|
||||
link_libraries(winfsp-a64)
|
||||
|
47
cmake/libraries/wxwidgets.cmake
Normal file
47
cmake/libraries/wxwidgets.cmake
Normal file
@ -0,0 +1,47 @@
|
||||
if(PROJECT_ENABLE_WXWIDGETS)
|
||||
if(PROJECT_BUILD)
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(wxWidgets ${WXWIDGETS_VERSION} REQUIRED
|
||||
COMPONENTS
|
||||
net
|
||||
core
|
||||
base
|
||||
gl
|
||||
adv
|
||||
xml
|
||||
aui
|
||||
html
|
||||
media
|
||||
propgrid
|
||||
qa
|
||||
ribbon
|
||||
richtext
|
||||
stc
|
||||
webview
|
||||
xrc
|
||||
)
|
||||
if(wxWidgets_USE_FILE)
|
||||
include(${wxWidgets_USE_FILE})
|
||||
endif()
|
||||
link_libraries(${wxWidgets_LIBRARIES})
|
||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||
ExternalProject_Add(wxwidgets_project
|
||||
PREFIX external
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/wxWidgets-${WXWIDGETS_VERSION}.tar.bz2
|
||||
URL_HASH SHA256=0ad86a3ad3e2e519b6a705248fc9226e3a09bbf069c6c692a02acf7c2d1c6b51
|
||||
LIST_SEPARATOR |
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DwxBUILD_MONOLITHIC=OFF
|
||||
-DwxBUILD_SHARED=${PROJECT_BUILD_SHARED_LIBS}
|
||||
)
|
||||
|
||||
set(PROJECT_DEPENDENCIES
|
||||
${PROJECT_DEPENDENCIES}
|
||||
wxwidgets_project
|
||||
)
|
||||
|
||||
add_dependencies(wxwidgets_project curl_project)
|
||||
endif()
|
||||
endif()
|
@ -1,14 +1,64 @@
|
||||
option(PROJECT_ENABLE_BOOST "Enable boost libraries" ON)
|
||||
option(PROJECT_ENABLE_CPP_HTTPLIB "Enable cpp-httplib" ON)
|
||||
option(PROJECT_ENABLE_CURL "Enable curl library" ON)
|
||||
option(PROJECT_ENABLE_FUSE "Enable FUSE" ON)
|
||||
option(PROJECT_ENABLE_JSON "Enable JSON for Modern C++ library" ON)
|
||||
option(PROJECT_ENABLE_LIBSODIUM "Enable libsodium library" ON)
|
||||
option(PROJECT_ENABLE_OPENSSL "Enable OpenSSL library" ON)
|
||||
option(PROJECT_ENABLE_PUGIXML "Enable PugiXML library" ON)
|
||||
option(PROJECT_ENABLE_ROCKSDB "Enable RocksDB library" ON)
|
||||
option(PROJECT_ENABLE_SPDLOG "Enable spdlog library" ON)
|
||||
option(PROJECT_ENABLE_SQLITE "Enable SQLite" ON)
|
||||
option(PROJECT_ENABLE_STDUUID "Enable stduuid library" ON)
|
||||
option(PROJECT_ENABLE_TESTING "Enable building unit tests" ON)
|
||||
option(PROJECT_ENABLE_WINFSP "Enable WinFSP" ON)
|
||||
option(PROJECT_ENABLE_BOOST "Enable boost libraries" OFF)
|
||||
option(PROJECT_ENABLE_CLI11 "Enable CLI11 library" OFF)
|
||||
option(PROJECT_ENABLE_CPP_HTTPLIB "Enable cpp-httplib" OFF)
|
||||
option(PROJECT_ENABLE_CURL "Enable curl library" OFF)
|
||||
option(PROJECT_ENABLE_DTL "Enable DTL" OFF)
|
||||
option(PROJECT_ENABLE_FLAC "Enable FLAC library" OFF)
|
||||
option(PROJECT_ENABLE_FMT "Enable fmt library" OFF)
|
||||
option(PROJECT_ENABLE_FONTCONFIG "Enable fontconfig library" OFF)
|
||||
option(PROJECT_ENABLE_FREETYPE2 "Enable freetype2 library" OFF)
|
||||
option(PROJECT_ENABLE_FUSE "Enable FUSE" OFF)
|
||||
option(PROJECT_ENABLE_FZF "Enable fzf" OFF)
|
||||
option(PROJECT_ENABLE_GTKMM "Enable gtkmm" OFF)
|
||||
option(PROJECT_ENABLE_JSON "Enable JSON for Modern C++ library" OFF)
|
||||
option(PROJECT_ENABLE_LIBBITCOIN_SYSTEM "Enable libbitcoin-system library" OFF)
|
||||
option(PROJECT_ENABLE_LIBEVENT "Enable libevent library" OFF)
|
||||
option(PROJECT_ENABLE_LIBSODIUM "Enable libsodium library" OFF)
|
||||
option(PROJECT_ENABLE_NUSPELL "Enable nuspell" OFF)
|
||||
option(PROJECT_ENABLE_OGG "Enable OGG library" OFF)
|
||||
option(PROJECT_ENABLE_OPENAL "Enable OpenAL" OFF)
|
||||
option(PROJECT_ENABLE_OPENSSL "Enable OpenSSL library" OFF)
|
||||
option(PROJECT_ENABLE_PUGIXML "Enable PugiXML library" OFF)
|
||||
option(PROJECT_ENABLE_ROCKSDB "Enable RocksDB library" OFF)
|
||||
option(PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS "Enable Sago platform folders" OFF)
|
||||
option(PROJECT_ENABLE_SECP256K1 "Enable secp256k1 library" OFF)
|
||||
option(PROJECT_ENABLE_SFML "Enable SFML" OFF)
|
||||
option(PROJECT_ENABLE_SPDLOG "Enable spdlog library" OFF)
|
||||
option(PROJECT_ENABLE_SQLITE "Enable SQLite" OFF)
|
||||
option(PROJECT_ENABLE_STDUUID "Enable stduuid library" OFF)
|
||||
option(PROJECT_ENABLE_TESTING "Enable building unit tests" OFF)
|
||||
option(PROJECT_ENABLE_TPL "Enable tiny process library" OFF)
|
||||
option(PROJECT_ENABLE_VORBIS "Enable Vorbis library" OFF)
|
||||
option(PROJECT_ENABLE_WINFSP "Enable WinFSP" OFF)
|
||||
option(PROJECT_ENABLE_WXWIDGETS "Enable wxWidgets library" OFF)
|
||||
|
||||
option(PROJECT_REQUIRE_ALPINE "Require Alpine Linux as build system" OFF)
|
||||
option(PROJECT_STATIC_LINK "Static link executables" OFF)
|
||||
|
||||
if(PROJECT_ENABLE_FZF)
|
||||
add_definitions(-DPROJECT_ENABLE_FZF)
|
||||
endif()
|
||||
|
||||
if(PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS)
|
||||
add_definitions(-DPROJECT_ENABLE_SAGO_PLATFORM_FOLDERS)
|
||||
endif()
|
||||
|
||||
if(PROJECT_ENABLE_TESTING)
|
||||
add_definitions(-DPROJECT_ENABLE_TESTING)
|
||||
endif()
|
||||
|
||||
if(PROJECT_STATIC_LINK)
|
||||
add_definitions(-DPROJECT_STATIC_LINK)
|
||||
endif()
|
||||
|
||||
if(PROJECT_IS_MINGW)
|
||||
add_definitions(-DPROJECT_IS_MINGW)
|
||||
endif()
|
||||
|
||||
if(PROJECT_REQUIRE_ALPINE)
|
||||
add_definitions(-DPROJECT_REQUIRE_ALPINE)
|
||||
endif()
|
||||
|
||||
if(PROJECT_IS_ARM64)
|
||||
add_definitions(-DPROJECT_IS_ARM64)
|
||||
endif()
|
||||
|
@ -41,7 +41,7 @@ if(PROJECT_IS_MINGW)
|
||||
endif()
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${PROJECT_SUPPORT_DIR}/include
|
||||
${PROJECT_3RD_PARTY_DIR}/include
|
||||
${PROJECT_EXTERNAL_BUILD_ROOT}/include
|
||||
)
|
||||
|
||||
|
@ -1,28 +1,41 @@
|
||||
set(BINUTILS_VERSION 2.43)
|
||||
set(BINUTILS_VERSION 2.41)
|
||||
set(BOOST2_MAJOR_VERSION 1)
|
||||
set(BOOST2_MINOR_VERSION 76)
|
||||
set(BOOST2_PATCH_VERSION 0)
|
||||
set(BOOST_MAJOR_VERSION 1)
|
||||
set(BOOST_MINOR_VERSION 87)
|
||||
set(BOOST_MINOR_VERSION 85)
|
||||
set(BOOST_PATCH_VERSION 0)
|
||||
set(CPP_HTTPLIB_VERSION 0.19.0)
|
||||
set(CURL2_VERSION 8_12_1)
|
||||
set(CURL_VERSION 8.12.1)
|
||||
set(EXPAT2_VERSION 2_6_4)
|
||||
set(EXPAT_VERSION 2.6.4)
|
||||
set(GCC_VERSION 14.2.0)
|
||||
set(GTEST_VERSION 1.16.0)
|
||||
set(ICU_VERSION 76-1)
|
||||
set(CLI11_VERSION 2.4.2)
|
||||
set(CPP_HTTPLIB_VERSION 0.15.3)
|
||||
set(CURL_VERSION 8.7.1)
|
||||
set(DTL_VERSION 2.01)
|
||||
set(EXPAT_VERSION 2.6.2)
|
||||
set(FLAC_VERSION 1.4.3)
|
||||
set(FMT_VERSION 10.2.1)
|
||||
set(FONTCONFIG_VERSION 2.15.0)
|
||||
set(FREETYPE2_VERSION 2.13.2)
|
||||
set(GCC_VERSION 13.2.0)
|
||||
set(GTEST_VERSION 1.14.0)
|
||||
set(GTKMM_VERSION 3.0)
|
||||
set(ICU_VERSION 75-1)
|
||||
set(JSON_VERSION 3.11.3)
|
||||
set(LIBSODIUM_VERSION 1.0.20)
|
||||
set(LIBBITCOIN_SYSTEM_VERSION 3.8.0)
|
||||
set(LIBEVENT_VERSION 2.1.12)
|
||||
set(LIBSODIUM_VERSION 1.0.19)
|
||||
set(MESA_VERSION 23.3.3)
|
||||
set(MINGW_VERSION 12.0.0)
|
||||
set(OPENSSL_VERSION 3.4.1)
|
||||
set(MINGW_VERSION 11.0.1)
|
||||
set(NUSPELL_VERSION 5.1.4)
|
||||
set(OGG_VERSION 1.3.5)
|
||||
set(OPENAL_VERSION 1.23.1)
|
||||
set(OPENSSL_VERSION 3.3.0)
|
||||
set(PKG_CONFIG_VERSION 0.29.2)
|
||||
set(PUGIXML_VERSION 1.15)
|
||||
set(ROCKSDB_VERSION 9.10.0)
|
||||
set(SPDLOG_VERSION 1.15.1)
|
||||
set(SQLITE2_VERSION 3.49.1)
|
||||
set(SQLITE_VERSION 3490100)
|
||||
set(PUGIXML_VERSION 1.14)
|
||||
set(ROCKSDB_VERSION 9.1.1)
|
||||
set(SECP256K1_VERSION 0.1.0.20)
|
||||
set(SFML_VERSION 2.6.1)
|
||||
set(SPDLOG_VERSION 1.14.1)
|
||||
set(SQLITE_VERSION 3460000)
|
||||
set(STDUUID_VERSION 1.2.3)
|
||||
set(VORBIS_VERSION 1.3.7)
|
||||
set(WXWIDGETS_VERSION 3.2.5)
|
||||
set(ZLIB_VERSION 1.3.1)
|
||||
|
33
config.sh
33
config.sh
@ -1,29 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
PROJECT_NAME="repertory"
|
||||
PROJECT_APP_NAME="repertory2"
|
||||
|
||||
PROJECT_COMPANY_NAME="https://git.fifthgrid.com/blockstorage"
|
||||
PROJECT_URL="${PROJECT_COMPANY_NAME}/repertory"
|
||||
|
||||
PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
|
||||
PROJECT_DESC="Mount utility for Sia and S3"
|
||||
|
||||
PROJECT_MAJOR_VERSION=2
|
||||
PROJECT_MINOR_VERSION=0
|
||||
PROJECT_REVISION_VERSION=5
|
||||
PROJECT_RELEASE_NUM=0
|
||||
PROJECT_RELEASE_ITER=rc
|
||||
|
||||
PROJECT_APP_LIST=(${PROJECT_NAME})
|
||||
|
||||
PROJECT_PRIVATE_KEY=${DEVELOPER_PRIVATE_KEY}
|
||||
PROJECT_PUBLIC_KEY=${DEVELOPER_PUBLIC_KEY}
|
||||
|
||||
PROJECT_FLUTTER_BASE_HREF="/ui/"
|
||||
|
||||
PROJECT_ENABLE_WIN32_LONG_PATH_NAMES=OFF
|
||||
|
||||
PROJECT_ENABLE_BACKWARD_CPP=OFF
|
||||
PROJECT_ENABLE_BOOST=ON
|
||||
PROJECT_ENABLE_CPP_HTTPLIB=ON
|
||||
PROJECT_ENABLE_CURL=ON
|
||||
@ -32,8 +10,6 @@ PROJECT_ENABLE_JSON=ON
|
||||
PROJECT_ENABLE_LIBSODIUM=ON
|
||||
PROJECT_ENABLE_OPENSSL=ON
|
||||
PROJECT_ENABLE_PUGIXML=ON
|
||||
PROJECT_ENABLE_ROCKSDB=ON
|
||||
PROJECT_ENABLE_SPDLOG=ON
|
||||
PROJECT_ENABLE_SQLITE=ON
|
||||
PROJECT_ENABLE_STDUUID=ON
|
||||
PROJECT_ENABLE_TESTING=ON
|
||||
@ -44,10 +20,7 @@ PROJECT_STATIC_LINK=ON
|
||||
PROJECT_MINGW64_COPY_DEPENDENCIES+=()
|
||||
PROJECT_MSYS2_PACKAGE_LIST+=()
|
||||
|
||||
PROJECT_APP_LIST=(${PROJECT_APP_NAME})
|
||||
if [ "${PROJECT_ENABLE_TESTING}" == "ON" ]; then
|
||||
PROJECT_APP_LIST+=(${PROJECT_NAME}_test)
|
||||
fi
|
||||
|
||||
if [ -f "./override.sh" ]; then
|
||||
. ./override.sh
|
||||
PROJECT_APP_LIST+=(${PROJECT_APP_NAME}_test)
|
||||
fi
|
||||
|
@ -1,14 +0,0 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqXedleDOugdk9sBpgFOA
|
||||
0+MogIbBF7+iXIIHv8CRBbrrf8nxLSgQvbHQIP0EklebDgLZRgyGI3SSQYj7D957
|
||||
uNf1//dpkELNzfuezgAyFer9+iH4Svq46HADp5k+ugaK0mMDZM7OLOgo7415/+z4
|
||||
NIQopv8prMFdxkShr4e4dpR+S6LYMYMVjsi1gnYWaZJMWgzeZouXFSscS1/XDXSE
|
||||
vr1Jfqme+RmB4Q2QqGcDrY2ijumCJYJzQqlwG6liJ4FNg0U3POTCQDhQmuUoEJe0
|
||||
/dyiWlo48WQbBu6gUDHbTCCUSZPs2Lc9l65MqOCpX76+VXPYetZgqpMF4GVzb2y9
|
||||
kETxFNpiMYBlOBZk0I1G33wqVmw46MI5IZMQ2z2F8Mzt1hByUNTgup2IQELCv1a5
|
||||
a2ACs2TBRuAy1REeHhjLgiA/MpoGX7TpoHCGyo8jBChJVpP9ZHltKoChwDC+bIyx
|
||||
rgYH3jYDkl2FFuAUJ8zAZl8U1kjqZb9HGq9ootMk34Dbo3IVkc2azB2orEP9F8QV
|
||||
KxvZZDA9FAFEthSiNf5soJ6mZGLi0es5EWPoKMUEd9tG5bP980DySAWSSRK0AOfE
|
||||
QShT/z7oG79Orxyomwrb8ZJCi7wEfcCuK1NWgqLVUgXhpi2J9WYS6DAbF3Oh3Hhl
|
||||
DYSHlcfFBteqNDlR2uFInIECAwEAAQ==
|
||||
-----END PUBLIC KEY-----
|
@ -1,5 +1,4 @@
|
||||
#comment
|
||||
FROM arm64v8/alpine:3.21.3
|
||||
FROM arm64v8/alpine:3.19
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
@ -11,13 +10,10 @@ RUN apk add \
|
||||
bash \
|
||||
binutils \
|
||||
binutils-dev \
|
||||
bison \
|
||||
boost-dev \
|
||||
bzip2-static \
|
||||
cmake \
|
||||
diffutils \
|
||||
elfutils-dev \
|
||||
file \
|
||||
fontconfig-dev \
|
||||
fontconfig-static \
|
||||
freetype \
|
||||
@ -31,7 +27,6 @@ RUN apk add \
|
||||
gflags \
|
||||
gflags-dev \
|
||||
git \
|
||||
git-lfs \
|
||||
icu-dev \
|
||||
icu-libs \
|
||||
icu-static \
|
||||
@ -67,9 +62,6 @@ RUN apk add \
|
||||
perl \
|
||||
pkgconfig \
|
||||
rsync \
|
||||
tcl \
|
||||
tcl-dev \
|
||||
texinfo \
|
||||
wget \
|
||||
xz \
|
||||
xz-dev \
|
||||
@ -82,6 +74,3 @@ RUN apk add \
|
||||
zstd-libs \
|
||||
zstd-static \
|
||||
xz-static
|
||||
|
||||
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
|
||||
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16
|
||||
|
@ -1,5 +1,4 @@
|
||||
#comment
|
||||
FROM alpine:3.21.3
|
||||
FROM alpine:3.19
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
@ -11,13 +10,10 @@ RUN apk add \
|
||||
bash \
|
||||
binutils \
|
||||
binutils-dev \
|
||||
bison \
|
||||
boost-dev \
|
||||
bzip2-static \
|
||||
cmake \
|
||||
diffutils \
|
||||
elfutils-dev \
|
||||
file \
|
||||
fontconfig-dev \
|
||||
fontconfig-static \
|
||||
freetype \
|
||||
@ -31,7 +27,6 @@ RUN apk add \
|
||||
gflags \
|
||||
gflags-dev \
|
||||
git \
|
||||
git-lfs \
|
||||
icu-dev \
|
||||
icu-libs \
|
||||
icu-static \
|
||||
@ -67,9 +62,6 @@ RUN apk add \
|
||||
perl \
|
||||
pkgconfig \
|
||||
rsync \
|
||||
tcl \
|
||||
tcl-dev \
|
||||
texinfo \
|
||||
wget \
|
||||
xz \
|
||||
xz-dev \
|
||||
@ -82,6 +74,3 @@ RUN apk add \
|
||||
zstd-libs \
|
||||
zstd-static \
|
||||
xz-static
|
||||
|
||||
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
|
||||
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16
|
||||
|
@ -1,48 +0,0 @@
|
||||
FROM debian:latest
|
||||
|
||||
ARG UID=0
|
||||
ARG GID=0
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
bash \
|
||||
curl \
|
||||
fonts-droid-fallback \
|
||||
gdb \
|
||||
git \
|
||||
lib32stdc++6 \
|
||||
libgconf-2-4 \
|
||||
libglu1-mesa \
|
||||
libstdc++6 \
|
||||
python3 \
|
||||
unzip \
|
||||
wget
|
||||
RUN apt-get clean
|
||||
|
||||
RUN git clone https://github.com/flutter/flutter.git /flutter
|
||||
RUN git config --system --add safe.directory /flutter
|
||||
|
||||
ENV PATH="/flutter/bin:/flutter/bin/cache/dart-sdk/bin:${PATH}"
|
||||
|
||||
RUN flutter doctor -v
|
||||
RUN flutter channel master
|
||||
RUN flutter upgrade
|
||||
RUN flutter --disable-analytics
|
||||
|
||||
RUN flutter config --no-analytics
|
||||
RUN flutter config --enable-web
|
||||
RUN flutter config --no-cli-animations
|
||||
|
||||
RUN mkdir /nonexistent
|
||||
RUN chown -R $UID:$GID /nonexistent
|
||||
|
||||
RUN mkdir /.config
|
||||
RUN chown -R $UID:$GID /.config
|
||||
|
||||
RUN mkdir /.dart-tool
|
||||
RUN chown -R $UID:$GID /.dart-tool
|
||||
|
||||
RUN mkdir /.pub-cache
|
||||
RUN chown -R $UID:$GID /.pub-cache
|
||||
|
||||
RUN chown -R $UID:$GID /flutter
|
@ -1,5 +1,5 @@
|
||||
#comment
|
||||
FROM alpine:3.21.3
|
||||
# comment
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN apk update
|
||||
RUN apk upgrade
|
||||
@ -12,13 +12,11 @@ RUN apk add \
|
||||
bzip2 \
|
||||
clang17-extra-tools \
|
||||
cmake \
|
||||
file \
|
||||
flex \
|
||||
g++ \
|
||||
gcc \
|
||||
gettext \
|
||||
git \
|
||||
git-lfs \
|
||||
gmp \
|
||||
gmp-dev \
|
||||
gperf \
|
||||
@ -41,7 +39,6 @@ RUN apk add \
|
||||
python3 \
|
||||
rsync \
|
||||
ruby \
|
||||
texinfo \
|
||||
unzip \
|
||||
wget \
|
||||
wine \
|
||||
@ -61,9 +58,6 @@ ENV MY_MINGW_PREFIX=${MINGW_PREFIX}
|
||||
ARG NUM_JOBS=2
|
||||
ENV MY_NUM_JOBS=${NUM_JOBS}
|
||||
|
||||
ARG CXX_STANDARD=20
|
||||
ENV MY_CXX_STANDARD=${CXX_STANDARD}
|
||||
|
||||
ARG TOOLCHAIN_FILE_CMAKE=/cmake_toolchain.cmake
|
||||
ENV MY_TOOLCHAIN_FILE_CMAKE=${TOOLCHAIN_FILE_CMAKE}
|
||||
RUN echo -e \
|
||||
@ -93,8 +87,8 @@ RUN echo -e \
|
||||
"windres = '${MY_MINGW_PREFIX}-windres'\n"\
|
||||
"exe_wrapper = 'wine64'\n"\
|
||||
"[properties]\n"\
|
||||
"c_args = ['-I${MY_MINGW_DIR}/include']\n"\
|
||||
"c_link_args = ['-L${MY_MINGW_DIR}/lib', '-L${MY_MINGW_DIR}/lib64']\n"\
|
||||
"c_args = []\n"\
|
||||
"c_link_args = []\n"\
|
||||
"[host_machine]\n"\
|
||||
"cpu = 'x86_64'\n"\
|
||||
"cpu_family = 'x86_64'\n"\
|
||||
@ -110,12 +104,15 @@ RUN mkdir -p \
|
||||
${MY_MINGW_DIR}/lib/pkgconfig \
|
||||
${MY_MINGW_DIR}/lib64/pkgconfig
|
||||
|
||||
ENV LDFLAGS="-L${MY_MINGW_DIR}/lib -L${MY_MINGW_DIR}/lib64"
|
||||
ENV PATH="${MY_MINGW_DIR}/bin:/usr/local/bin:${PATH}"
|
||||
ENV PKG_CONFIG_PATH="${MY_MINGW_DIR}/lib/pkgconfig:${MY_MINGW_DIR}/lib64/pkgconfig"
|
||||
|
||||
ADD ./3rd_party /3rd_party
|
||||
|
||||
ARG BINUTILS_VERSION
|
||||
ENV MY_BINUTILS_VERSION=${BINUTILS_VERSION}
|
||||
RUN cd /3rd_party/mingw64 && sha256sum -c ./binutils-${MY_BINUTILS_VERSION}.tar.xz.sha256 && cd - \
|
||||
&& tar xvJf /3rd_party/mingw64/binutils-${MY_BINUTILS_VERSION}.tar.xz \
|
||||
RUN tar xvJf /3rd_party/mingw64/binutils-${MY_BINUTILS_VERSION}.tar.xz \
|
||||
&& cd binutils-${MY_BINUTILS_VERSION} \
|
||||
&& ./configure \
|
||||
--disable-lto \
|
||||
@ -135,11 +132,10 @@ RUN cd /3rd_party/mingw64 && sha256sum -c ./binutils-${MY_BINUTILS_VERSION}.tar.
|
||||
|
||||
ARG MINGW_VERSION
|
||||
ENV MY_MINGW_VERSION=${MINGW_VERSION}
|
||||
RUN cd /3rd_party/mingw64 && sha256sum -c ./mingw-w64-v${MY_MINGW_VERSION}.tar.bz2.sha256 && cd - \
|
||||
&& tar xvjf /3rd_party/mingw64/mingw-w64-v${MY_MINGW_VERSION}.tar.bz2 \
|
||||
RUN tar xvzf /3rd_party/mingw64/mingw-w64-${MY_MINGW_VERSION}.tar.gz \
|
||||
&& mkdir mingw-w64 \
|
||||
&& cd mingw-w64 \
|
||||
&& ../mingw-w64-v${MY_MINGW_VERSION}/mingw-w64-headers/configure \
|
||||
&& ../mingw-w64-${MY_MINGW_VERSION}/mingw-w64-headers/configure \
|
||||
--enable-sdk=all \
|
||||
--host=${MY_MINGW_PREFIX} \
|
||||
--prefix=/usr/local/${MY_MINGW_PREFIX} \
|
||||
@ -147,8 +143,7 @@ RUN cd /3rd_party/mingw64 && sha256sum -c ./mingw-w64-v${MY_MINGW_VERSION}.tar.b
|
||||
|
||||
ARG GCC_VERSION
|
||||
ENV MY_GCC_VERSION=${GCC_VERSION}
|
||||
RUN cd /3rd_party/mingw64 && sha256sum -c ./gcc-${MY_GCC_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/mingw64/gcc-${MY_GCC_VERSION}.tar.gz \
|
||||
RUN tar xvzf /3rd_party/mingw64/gcc-${MY_GCC_VERSION}.tar.gz \
|
||||
&& (mv gcc-releases-gcc-${MY_GCC_VERSION} gcc-${MY_GCC_VERSION} || echo "") \
|
||||
&& mkdir gcc \
|
||||
&& cd gcc \
|
||||
@ -191,7 +186,7 @@ RUN cd /3rd_party/mingw64 && sha256sum -c ./gcc-${MY_GCC_VERSION}.tar.gz.sha256
|
||||
&& make install-gcc
|
||||
|
||||
RUN cd mingw-w64 \
|
||||
&& ../mingw-w64-v${MY_MINGW_VERSION}/mingw-w64-crt/configure \
|
||||
&& ../mingw-w64-${MY_MINGW_VERSION}/mingw-w64-crt/configure \
|
||||
--disable-lib32 \
|
||||
--enable-lib64 \
|
||||
--enable-wildcard \
|
||||
@ -201,7 +196,7 @@ RUN cd mingw-w64 \
|
||||
&& make install
|
||||
|
||||
RUN cd mingw-w64 \
|
||||
&& ../mingw-w64-v${MY_MINGW_VERSION}/mingw-w64-libraries/winpthreads/configure \
|
||||
&& ../mingw-w64-${MY_MINGW_VERSION}/mingw-w64-libraries/winpthreads/configure \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--host=${MY_MINGW_PREFIX} \
|
||||
@ -216,12 +211,11 @@ RUN cd gcc \
|
||||
RUN cp /usr/local/${MY_MINGW_PREFIX}/lib/*.dll ${MY_MINGW_DIR}/bin \
|
||||
&& cp /usr/local/${MY_MINGW_PREFIX}/bin/*.dll ${MY_MINGW_DIR}/bin \
|
||||
&& rm -r gcc gcc-${MY_GCC_VERSION} \
|
||||
&& rm -r mingw-w64 mingw-w64-v${MY_MINGW_VERSION}
|
||||
&& rm -r mingw-w64 mingw-w64-${MY_MINGW_VERSION}
|
||||
|
||||
ARG PKG_CONFIG_VERSION
|
||||
ENV MY_PKG_CONFIG_VERSION=${PKG_CONFIG_VERSION}
|
||||
RUN cd /3rd_party/mingw64 && sha256sum -c ./pkg-config-${MY_PKG_CONFIG_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/mingw64/pkg-config-${MY_PKG_CONFIG_VERSION}.tar.gz \
|
||||
RUN tar xvzf /3rd_party/mingw64/pkg-config-${MY_PKG_CONFIG_VERSION}.tar.gz \
|
||||
&& cd pkg-config-${MY_PKG_CONFIG_VERSION} \
|
||||
&& ./configure \
|
||||
--disable-nls \
|
||||
@ -238,83 +232,25 @@ RUN python3 -m pip install --break-system-packages -U mako
|
||||
RUN python3 -m pip install --break-system-packages -U meson
|
||||
RUN python3 -m pip install --break-system-packages -U packaging
|
||||
|
||||
ENV CXXFLAGS="-std=gnu++20"
|
||||
ENV LDFLAGS="-L${MY_MINGW_DIR}/lib -L${MY_MINGW_DIR}/lib64"
|
||||
ENV PATH="${MY_MINGW_DIR}/bin:/usr/local/bin:${PATH}"
|
||||
ENV PKG_CONFIG_PATH="${MY_MINGW_DIR}/lib/pkgconfig:${MY_MINGW_DIR}/lib64/pkgconfig"
|
||||
|
||||
ARG ZLIB_VERSION
|
||||
ENV MY_ZLIB_VERSION=${ZLIB_VERSION}
|
||||
RUN cd /3rd_party/mingw64 && sha256sum -c ./zlib-${MY_ZLIB_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/mingw64/zlib-${MY_ZLIB_VERSION}.tar.gz \
|
||||
RUN tar xvzf /3rd_party/mingw64/zlib-${MY_ZLIB_VERSION}.tar.gz \
|
||||
&& cd zlib-${MY_ZLIB_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r zlib-${MY_ZLIB_VERSION}
|
||||
|
||||
ARG LIBJPEG_TURBO_VERSION
|
||||
ENV MY_LIBJPEG_TURBO_VERSION=${LIBJPEG_TURBO_VERSION}
|
||||
RUN if [ -f "/3rd_party/libjpeg_turbo-${MY_LIBJPEG_TURBO_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./libjpeg_turbo-${MY_LIBJPEG_TURBO_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/libjpeg_turbo-${MY_LIBJPEG_TURBO_VERSION}.tar.gz \
|
||||
&& cd libjpeg-turbo-${MY_LIBJPEG_TURBO_VERSION} \
|
||||
&& mkdir _build \
|
||||
&& cd _build \
|
||||
&& cmake .. \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=AMD64 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DENABLE_SHARED=ON \
|
||||
-DENABLE_STATIC=ON \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libjpeg-turbo-${MY_LIBJPEG_TURBO_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG LIBPNG_VERSION
|
||||
ENV MY_LIBPNG_VERSION=${LIBPNG_VERSION}
|
||||
RUN if [ -f "/3rd_party/libpng-v${MY_LIBPNG_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./libpng-v${MY_LIBPNG_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/libpng-v${MY_LIBPNG_VERSION}.tar.gz \
|
||||
&& cd libpng-${MY_LIBPNG_VERSION} \
|
||||
&& mkdir _build \
|
||||
&& cd _build \
|
||||
&& cmake .. \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DPNG_SHARED=ON \
|
||||
-DPNG_STATIC=ON \
|
||||
-DPNG_TESTS=OFF \
|
||||
-DPNG_TOOLS=OFF \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libpng-${MY_LIBPNG_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG FREETYPE2_VERSION
|
||||
ENV MY_FREETYPE2_VERSION=${FREETYPE2_VERSION}
|
||||
RUN if [ -f "/3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./freetype-${MY_FREETYPE2_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz \
|
||||
&& cd freetype-${MY_FREETYPE2_VERSION} \
|
||||
&& meson setup \
|
||||
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \
|
||||
@ -330,30 +266,26 @@ RUN if [ -f "/3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz" ]; then \
|
||||
|
||||
ARG EXPAT_VERSION
|
||||
ENV MY_EXPAT_VERSION=${EXPAT_VERSION}
|
||||
RUN cd /3rd_party/mingw64 && sha256sum -c ./expat-${MY_EXPAT_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/mingw64/expat-${MY_EXPAT_VERSION}.tar.gz \
|
||||
&& cd libexpat-*/expat \
|
||||
RUN tar xvzf /3rd_party/mingw64/expat-${MY_EXPAT_VERSION}.tar.gz \
|
||||
&& cd expat-${MY_EXPAT_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DEXPAT_BUILD_DOCS=OFF \
|
||||
-DEXPAT_BUILD_EXAMPLES=OFF \
|
||||
-DEXPAT_BUILD_TESTS=OFF \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libexpat-*
|
||||
&& rm -r expat-${MY_EXPAT_VERSION}
|
||||
|
||||
ARG FONTCONFIG_VERSION
|
||||
ENV MY_FONTCONFIG_VERSION=${FONTCONFIG_VERSION}
|
||||
RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz \
|
||||
&& cd fontconfig-${MY_FONTCONFIG_VERSION} \
|
||||
&& meson setup \
|
||||
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \
|
||||
@ -373,15 +305,12 @@ RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz" ]; then \
|
||||
ARG OPENAL_VERSION
|
||||
ENV MY_OPENAL_VERSION=${OPENAL_VERSION}
|
||||
RUN if [ -f "/3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./openal-${MY_OPENAL_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz \
|
||||
&& cd openal-soft-${MY_OPENAL_VERSION} \
|
||||
&& mkdir _build \
|
||||
&& cd _build \
|
||||
&& cmake .. \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& mv ${MY_MINGW_DIR}/bin/OpenAL32.dll ${MY_MINGW_DIR}/bin/openal32.dll \
|
||||
@ -391,11 +320,10 @@ RUN if [ -f "/3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz" ]; then \
|
||||
|
||||
ARG ICU_VERSION
|
||||
ENV MY_ICU_VERSION=${ICU_VERSION}
|
||||
RUN cd /3rd_party/mingw64 && sha256sum -c ./icu-release-${MY_ICU_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/mingw64/icu-release-${MY_ICU_VERSION}.tar.gz \
|
||||
RUN tar xvzf /3rd_party/mingw64/icu-release-${MY_ICU_VERSION}.tar.gz \
|
||||
&& cp -r icu-release-${MY_ICU_VERSION} icu-release-${MY_ICU_VERSION}-cross \
|
||||
&& cd icu-release-${MY_ICU_VERSION}-cross/icu4c/source \
|
||||
&& CXXFLAGS="-std=gnu++17" ./configure \
|
||||
&& ./configure \
|
||||
--disable-samples \
|
||||
--disable-tests \
|
||||
--enable-shared \
|
||||
@ -406,7 +334,7 @@ RUN cd /3rd_party/mingw64 && sha256sum -c ./icu-release-${MY_ICU_VERSION}.tar.gz
|
||||
|
||||
RUN cd ${MY_WORKDIR} \
|
||||
&& cd icu-release-${MY_ICU_VERSION}/icu4c/source \
|
||||
&& CXXFLAGS="-std=gnu++17" ./configure \
|
||||
&& ./configure \
|
||||
--build=x86_64-alpine-linux-musl \
|
||||
--disable-samples \
|
||||
--disable-tests \
|
||||
@ -425,14 +353,12 @@ RUN cd ${MY_WORKDIR} \
|
||||
ARG OPENSSL_VERSION
|
||||
ENV MY_OPENSSL_VERSION=${OPENSSL_VERSION}
|
||||
RUN if [ -f "/3rd_party/openssl-${MY_OPENSSL_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./openssl-${MY_OPENSSL_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/openssl-${MY_OPENSSL_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/openssl-${MY_OPENSSL_VERSION}.tar.gz \
|
||||
&& cd openssl-${MY_OPENSSL_VERSION} \
|
||||
&& ./Configure \
|
||||
--cross-compile-prefix=${MY_MINGW_PREFIX}- \
|
||||
--prefix=${MY_MINGW_DIR} \
|
||||
mingw64 \
|
||||
no-shared \
|
||||
no-apps \
|
||||
no-docs \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
@ -449,14 +375,11 @@ ARG BOOST2_PATCH_VERSION
|
||||
ENV MY_BOOST2_PATCH_VERSION=${BOOST2_PATCH_VERSION}
|
||||
ENV MY_BOOST2_VERSION=${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}
|
||||
RUN if [ -f "/3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz \
|
||||
&& cd boost_${MY_BOOST2_VERSION} \
|
||||
&& ./bootstrap.sh \
|
||||
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread \
|
||||
address-model=64 \
|
||||
cxxstd=${MY_CXX_STANDARD} \
|
||||
cxxstd-dialect=gnu \
|
||||
architecture=x86 \
|
||||
link=static,shared \
|
||||
target-os=windows \
|
||||
@ -469,8 +392,6 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSI
|
||||
--prefix=${MY_MINGW_DIR} \
|
||||
-j${MY_NUM_JOBS} \
|
||||
address-model=64 \
|
||||
cxxstd=${MY_CXX_STANDARD} \
|
||||
cxxstd-dialect=gnu \
|
||||
architecture=x86 \
|
||||
link=static,shared \
|
||||
target-os=windows \
|
||||
@ -490,8 +411,7 @@ ARG BOOST_PATCH_VERSION
|
||||
ENV MY_BOOST_PATCH_VERSION=${BOOST_PATCH_VERSION}
|
||||
ENV MY_BOOST_VERSION=${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}
|
||||
RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz \
|
||||
&& cd boost_${MY_BOOST_VERSION} \
|
||||
&& echo "using gcc : gcc : ${MY_MINGW_PREFIX}-g++ ;" \
|
||||
>./user-config.jam \
|
||||
@ -499,8 +419,6 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION
|
||||
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread \
|
||||
address-model=64 \
|
||||
architecture=x86 \
|
||||
cxxstd=${MY_CXX_STANDARD} \
|
||||
cxxstd-dialect=gnu \
|
||||
link=static,shared \
|
||||
target-os=windows \
|
||||
threading=multi \
|
||||
@ -512,8 +430,6 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION
|
||||
-j${MY_NUM_JOBS} \
|
||||
address-model=64 \
|
||||
architecture=x86 \
|
||||
cxxstd=${MY_CXX_STANDARD} \
|
||||
cxxstd-dialect=gnu \
|
||||
link=static,shared \
|
||||
target-os=windows \
|
||||
threading=multi \
|
||||
@ -526,37 +442,30 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION
|
||||
ARG OGG_VERSION
|
||||
ENV MY_OGG_VERSION=${OGG_VERSION}
|
||||
RUN if [ -f "/3rd_party/ogg-v${MY_OGG_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./ogg-v${MY_OGG_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/ogg-v${MY_OGG_VERSION}.tar.gz \
|
||||
&& cd libogg-${MY_OGG_VERSION} \
|
||||
tar xvzf /3rd_party/ogg-v${MY_OGG_VERSION}.tar.gz \
|
||||
&& cd ogg-${MY_OGG_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libogg-${MY_OGG_VERSION} \
|
||||
&& rm -r ogg-${MY_OGG_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG VORBIS_VERSION
|
||||
ENV MY_VORBIS_VERSION=${VORBIS_VERSION}
|
||||
RUN if [ -f "/3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./vorbis-v${MY_VORBIS_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz \
|
||||
&& cd vorbis-${MY_VORBIS_VERSION} \
|
||||
&& /3rd_party/vorbis_patch.sh /3rd_party . \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -566,21 +475,18 @@ RUN if [ -f "/3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz" ]; then \
|
||||
ARG FLAC_VERSION
|
||||
ENV MY_FLAC_VERSION=${FLAC_VERSION}
|
||||
RUN if [ -f "/3rd_party/flac-${MY_FLAC_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./flac-${MY_FLAC_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/flac-${MY_FLAC_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/flac-${MY_FLAC_VERSION}.tar.gz \
|
||||
&& cd flac-${MY_FLAC_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
-DBUILD_DOCS=OFF \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DBUILD_PROGRAMS=OFF \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_EXAMPLES=ON \
|
||||
-DBUILD_PROGRAMS=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DBUILD_DOCS=OFF \
|
||||
-DINSTALL_MANPAGES=OFF \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
@ -591,8 +497,7 @@ RUN if [ -f "/3rd_party/flac-${MY_FLAC_VERSION}.tar.gz" ]; then \
|
||||
ARG SFML_VERSION
|
||||
ENV MY_SFML_VERSION=${SFML_VERSION}
|
||||
RUN if [ -f "/3rd_party/SFML-${MY_SFML_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./SFML-${MY_SFML_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/SFML-${MY_SFML_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/SFML-${MY_SFML_VERSION}.tar.gz \
|
||||
&& cd SFML-${MY_SFML_VERSION} \
|
||||
&& sed -i s/set_target_properties\(\$\{target\}\ PROPERTIES\ PREFIX\ \"\"\)// \
|
||||
cmake/Macros.cmake \
|
||||
@ -600,13 +505,10 @@ RUN if [ -f "/3rd_party/SFML-${MY_SFML_VERSION}.tar.gz" ]; then \
|
||||
cmake/Macros.cmake \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=AMD64 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -616,16 +518,14 @@ RUN if [ -f "/3rd_party/SFML-${MY_SFML_VERSION}.tar.gz" ]; then \
|
||||
ARG SPDLOG_VERSION
|
||||
ENV MY_SPDLOG_VERSION=${SPDLOG_VERSION}
|
||||
RUN if [ -f "/3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./spdlog-${MY_SPDLOG_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz \
|
||||
&& cd spdlog-${MY_SPDLOG_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DSPDLOG_BUILD_SHARED=ON \
|
||||
-DSPDLOG_BUILD_STATIC=ON \
|
||||
-DSPDLOG_BUILD_EXAMPLE=OFF \
|
||||
-DSPDLOG_FMT_EXTERNAL=OFF \
|
||||
-DSPDLOG_FMT_EXTERNAL_HO=OFF \
|
||||
@ -638,22 +538,19 @@ RUN if [ -f "/3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz" ]; then \
|
||||
ARG CLI11_VERSION
|
||||
ENV MY_CLI11_VERSION=${CLI11_VERSION}
|
||||
RUN if [ -f "/3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./CLI11-${MY_CLI11_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz \
|
||||
&& cd CLI11-${MY_CLI11_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
-DCLI11_BUILD_DOCS=OFF \
|
||||
-DCLI11_BUILD_EXAMPLES=OFF \
|
||||
-DCLI11_BUILD_TESTS=OFF \
|
||||
-DCLI11_INSTALL=ON \
|
||||
-DCLI11_SINGLE_FILE=ON \
|
||||
-DCLI11_WARNINGS_AS_ERRORS=OFF \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCLI11_WARNINGS_AS_ERRORS=OFF \
|
||||
-DCLI11_SINGLE_FILE=ON \
|
||||
-DCLI11_BUILD_DOCS=OFF \
|
||||
-DCLI11_BUILD_TESTS=OFF \
|
||||
-DCLI11_BUILD_EXAMPLES=OFF \
|
||||
-DCLI11_INSTALL=ON \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -662,25 +559,17 @@ RUN if [ -f "/3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz" ]; then \
|
||||
|
||||
ARG CURL_VERSION
|
||||
ENV MY_CURL_VERSION=${CURL_VERSION}
|
||||
ARG CURL2_VERSION
|
||||
ENV MY_CURL2_VERSION=${CURL2_VERSION}
|
||||
RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./curl-${MY_CURL_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/curl-${MY_CURL_VERSION}.tar.gz \
|
||||
&& cd curl-curl-${MY_CURL2_VERSION} \
|
||||
tar xvzf /3rd_party/curl-${MY_CURL_VERSION}.tar.gz \
|
||||
&& cd curl-${MY_CURL_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_CURL_EXE=ON \
|
||||
-DBUILD_LIBCURL_DOCS=OFF \
|
||||
-DBUILD_MISC_DOCS=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCURL_BROTLI=OFF \
|
||||
-DCURL_CA_BUNDLE=./cacert.pem \
|
||||
-DCURL_CA_FALLBACK=ON \
|
||||
-DCURL_DISABLE_LDAP=ON \
|
||||
@ -688,7 +577,6 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
|
||||
-DCURL_USE_LIBSSH2=OFF \
|
||||
-DCURL_USE_OPENSSL=ON \
|
||||
-DCURL_ZLIB=ON \
|
||||
-DENABLE_CURL_MANUAL=OFF \
|
||||
-DENABLE_THREADED_RESOLVER=ON \
|
||||
-DOPENSSL_USE_STATIC_LIBS=ON \
|
||||
-DUSE_LIBIDN2=OFF \
|
||||
@ -696,29 +584,22 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r curl-curl-${MY_CURL2_VERSION} \
|
||||
&& rm -r curl-${MY_CURL_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG CPP_HTTPLIB_VERSION
|
||||
ENV MY_CPP_HTTPLIB_VERSION=${CPP_HTTPLIB_VERSION}
|
||||
RUN if [ -f "/3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz \
|
||||
&& cd cpp-httplib-${MY_CPP_HTTPLIB_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DHTTPLIB_REQUIRE_BROTLI=OFF \
|
||||
-DHTTPLIB_REQUIRE_OPENSSL=ON \
|
||||
-DHTTPLIB_REQUIRE_ZLIB=ON \
|
||||
-DHTTPLIB_REQUIRE_BROTLI=OFF \
|
||||
-DHTTPLIB_TEST=OFF \
|
||||
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF \
|
||||
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=YES \
|
||||
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -728,17 +609,14 @@ RUN if [ -f "/3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz" ]; then \
|
||||
ARG FMT_VERSION
|
||||
ENV MY_FMT_VERSION=${FMT_VERSION}
|
||||
RUN if [ -f "/3rd_party/fmt-${MY_FMT_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./fmt-${MY_FMT_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/fmt-${MY_FMT_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/fmt-${MY_FMT_VERSION}.tar.gz \
|
||||
&& cd fmt-${MY_FMT_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DFMT_DOC=OFF \
|
||||
-DFMT_TEST=OFF \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
@ -750,16 +628,13 @@ RUN if [ -f "/3rd_party/fmt-${MY_FMT_VERSION}.tar.gz" ]; then \
|
||||
ARG GTEST_VERSION
|
||||
ENV MY_GTEST_VERSION=${GTEST_VERSION}
|
||||
RUN if [ -f "/3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./googletest-${MY_GTEST_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz \
|
||||
&& cd googletest-${MY_GTEST_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -769,16 +644,13 @@ RUN if [ -f "/3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz" ]; then \
|
||||
ARG JSON_VERSION
|
||||
ENV MY_JSON_VERSION=${JSON_VERSION}
|
||||
RUN if [ -f "/3rd_party/json-${MY_JSON_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./json-${MY_JSON_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/json-${MY_JSON_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/json-${MY_JSON_VERSION}.tar.gz \
|
||||
&& cd json-${MY_JSON_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DJSON_BuildTests=OFF \
|
||||
-DJSON_Install=ON \
|
||||
-DJSON_MultipleHeaders=OFF \
|
||||
@ -791,16 +663,13 @@ RUN if [ -f "/3rd_party/json-${MY_JSON_VERSION}.tar.gz" ]; then \
|
||||
ARG LIBEVENT_VERSION
|
||||
ENV MY_LIBEVENT_VERSION=${LIBEVENT_VERSION}
|
||||
RUN if [ -f "/3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz \
|
||||
&& cd libevent-release-${MY_LIBEVENT_VERSION}-stable \
|
||||
tar xvzf /3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz \
|
||||
&& cd libevent-${MY_LIBEVENT_VERSION}-stable \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DEVENT__DISABLE_OPENSSL=ON \
|
||||
-DEVENT__DISABLE_SAMPLES=ON \
|
||||
-DEVENT__DISABLE_TESTS=ON \
|
||||
@ -808,18 +677,17 @@ RUN if [ -f "/3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz" ]; then \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libevent-release-${MY_LIBEVENT_VERSION}-stable \
|
||||
&& rm -r libevent-${MY_LIBEVENT_VERSION}-stable \
|
||||
; fi
|
||||
|
||||
ARG LIBSODIUM_VERSION
|
||||
ENV MY_LIBSODIUM_VERSION=${LIBSODIUM_VERSION}
|
||||
RUN if [ -f "/3rd_party/libsodium-${MY_LIBSODIUM_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./libsodium-${MY_LIBSODIUM_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/libsodium-${MY_LIBSODIUM_VERSION}.tar.gz \
|
||||
RUN if [ -f "/3rd_party/libsodium-${MY_LIBSODIUM_VERSION}-RELEASE.tar.gz" ]; then \
|
||||
tar xvzf /3rd_party/libsodium-${MY_LIBSODIUM_VERSION}-RELEASE.tar.gz \
|
||||
&& cd libsodium-${MY_LIBSODIUM_VERSION}-RELEASE \
|
||||
&& CFLAGS="-O3 -fomit-frame-pointer -m64 -mtune=generic" ./configure \
|
||||
--enable-shared=yes \
|
||||
--enable-static=yes \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--host=${MY_MINGW_PREFIX} \
|
||||
--prefix=${MY_MINGW_DIR} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
@ -831,19 +699,15 @@ RUN if [ -f "/3rd_party/libsodium-${MY_LIBSODIUM_VERSION}.tar.gz" ]; then \
|
||||
ARG NUSPELL_VERSION
|
||||
ENV MY_NUSPELL_VERSION=${NUSPELL_VERSION}
|
||||
RUN if [ -f "/3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./nuspell-v${MY_NUSPELL_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz \
|
||||
&& cd nuspell-${MY_NUSPELL_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
-DBUILD_DOCS=OFF \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DBUILD_TOOLS=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -853,16 +717,13 @@ RUN if [ -f "/3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz" ]; then \
|
||||
ARG PUGIXML_VERSION
|
||||
ENV MY_PUGIXML_VERSION=${PUGIXML_VERSION}
|
||||
RUN if [ -f "/3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./pugixml-${MY_PUGIXML_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz \
|
||||
&& cd pugixml-${MY_PUGIXML_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -872,17 +733,14 @@ RUN if [ -f "/3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz" ]; then \
|
||||
ARG ROCKSDB_VERSION
|
||||
ENV MY_ROCKSDB_VERSION=${ROCKSDB_VERSION}
|
||||
RUN if [ -f "/3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./rocksdb-${MY_ROCKSDB_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz \
|
||||
&& cd rocksdb-${MY_ROCKSDB_VERSION} \
|
||||
&& echo -e "add_definitions(-include cstdint)">>CMakeLists.txt \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DFAIL_ON_WARNINGS=OFF \
|
||||
-DPORTABLE=1 \
|
||||
-DROCKSDB_INSTALL_ON_WINDOWS=ON \
|
||||
@ -906,8 +764,7 @@ RUN if [ -f "/3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz" ]; then \
|
||||
ARG SECP256K1_VERSION
|
||||
ENV MY_SECP256K1_VERSION=${SECP256K1_VERSION}
|
||||
RUN if [ -f "/3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./secp256k1-${MY_SECP256K1_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz \
|
||||
&& cd secp256k1-${MY_SECP256K1_VERSION} \
|
||||
&& ./autogen.sh && ./configure \
|
||||
--host=${MY_MINGW_PREFIX} \
|
||||
@ -925,16 +782,13 @@ RUN if [ -f "/3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz" ]; then \
|
||||
ARG STDUUID_VERSION
|
||||
ENV MY_STDUUID_VERSION=${STDUUID_VERSION}
|
||||
RUN if [ -f "/3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./stduuid-${MY_STDUUID_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz \
|
||||
tar xvzf /3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz \
|
||||
&& cd stduuid-${MY_STDUUID_VERSION} \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DUUID_BUILD_TESTS=OFF \
|
||||
-DUUID_ENABLE_INSTALL=ON \
|
||||
-DUUID_USING_CXX20_SPAN=ON \
|
||||
@ -945,19 +799,16 @@ RUN if [ -f "/3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz" ]; then \
|
||||
; fi
|
||||
|
||||
RUN if [ -f "/3rd_party/tiny-process-library.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./tiny-process-library.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/tiny-process-library.tar.gz \
|
||||
tar xvzf /3rd_party/tiny-process-library.tar.gz \
|
||||
&& cd tiny-process-library-master \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
@ -967,18 +818,15 @@ RUN if [ -f "/3rd_party/tiny-process-library.tar.gz" ]; then \
|
||||
ARG WXWIDGETS_VERSION
|
||||
ENV MY_WXWIDGETS_VERSION=${WXWIDGETS_VERSION}
|
||||
RUN if [ -f "/3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2.sha256 && cd - \
|
||||
&& tar xvjf /3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2 \
|
||||
tar xvjf /3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2 \
|
||||
&& cd wxWidgets-${MY_WXWIDGETS_VERSION} \
|
||||
&& mkdir _build \
|
||||
&& cd _build \
|
||||
&& cmake .. \
|
||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DwxBUILD_MONOLITHIC=OFF \
|
||||
-DwxBUILD_SHARED=ON \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
@ -987,138 +835,6 @@ RUN if [ -f "/3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2" ]; then \
|
||||
&& rm -r wxWidgets-${MY_WXWIDGETS_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG CXXOPTS_VERSION
|
||||
ENV MY_CXXOPTS_VERSION=${CXXOPTS_VERSION}
|
||||
RUN if [ -f "/3rd_party/cxxopts-v${MY_CXXOPTS_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./cxxopts-v${MY_CXXOPTS_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/cxxopts-v${MY_CXXOPTS_VERSION}.tar.gz \
|
||||
&& cd cxxopts-${MY_CXXOPTS_VERSION} \
|
||||
&& mkdir _build \
|
||||
&& cd _build \
|
||||
&& cmake .. \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCXXOPTS_BUILD_EXAMPLES=OFF \
|
||||
-DCXXOPTS_BUILD_TESTS=OFF \
|
||||
-DCXXOPTS_ENABLE_INSTALL=ON \
|
||||
-DCXXOPTS_ENABLE_WARNINGS=OFF \
|
||||
-DCXXOPTS_USE_UNICODE_HELP=ON \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r cxxopts-${MY_CXXOPTS_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG NANA_VERSION
|
||||
ENV MY_NANA_VERSION=${NANA_VERSION}
|
||||
RUN if [ -f "/3rd_party/nana-v${MY_NANA_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./nana-v${MY_NANA_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/nana-v${MY_NANA_VERSION}.tar.gz \
|
||||
&& cd nana-${MY_NANA_VERSION} \
|
||||
&& /3rd_party/nana_patch.sh /3rd_party . \
|
||||
&& mkdir _build \
|
||||
&& cd _build \
|
||||
&& cmake .. \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_STATIC_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DNANA_CMAKE_ENABLE_AUDIO=OFF \
|
||||
-DNANA_CMAKE_ENABLE_JPEG=ON \
|
||||
-DNANA_CMAKE_ENABLE_PNG=ON \
|
||||
-DNANA_CMAKE_INSTALL=ON \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r nana-${MY_NANA_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG SDL_VERSION
|
||||
ENV MY_SDL_VERSION=${SDL_VERSION}
|
||||
RUN if [ -f "/3rd_party/sdl-${MY_SDL_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./sdl-${MY_SDL_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/sdl-${MY_SDL_VERSION}.tar.gz \
|
||||
&& cd SDL-release-${MY_SDL_VERSION} \
|
||||
&& ./configure \
|
||||
--host=${MY_MINGW_PREFIX} \
|
||||
--enable-shared=yes \
|
||||
--enable-static=yes \
|
||||
--prefix=${MY_MINGW_DIR} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r SDL-release-${MY_SDL_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG LIBTASN_VERSION
|
||||
ENV MY_LIBTASN_VERSION=${LIBTASN_VERSION}
|
||||
RUN if [ -f "/3rd_party/libtasn1-${MY_LIBTASN_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./libtasn1-${MY_LIBTASN_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/libtasn1-${MY_LIBTASN_VERSION}.tar.gz \
|
||||
&& cd libtasn1-${MY_LIBTASN_VERSION} \
|
||||
&& ./configure \
|
||||
--disable-doc \
|
||||
--enable-static=yes \
|
||||
--enable-shared=no \
|
||||
--host=${MY_MINGW_PREFIX} \
|
||||
--prefix=${MY_MINGW_DIR} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libtasn1-${MY_LIBTASN_VERSION} \
|
||||
&& echo -e \
|
||||
"#!/bin/bash\n"\
|
||||
"\n"\
|
||||
"wine ${MY_MINGW_DIR}/bin/asn1Parser.exe \$@\n"\
|
||||
> ${MY_MINGW_DIR}/bin/asn1Parser \
|
||||
&& chmod +x ${MY_MINGW_DIR}/bin/asn1Parser \
|
||||
; fi
|
||||
|
||||
ARG LIBICONV_VERSION
|
||||
ENV MY_LIBICONV_VERSION=${LIBICONV_VERSION}
|
||||
RUN if [ -f "/3rd_party/libiconv-${MY_LIBICONV_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./libiconv-${MY_LIBICONV_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/libiconv-${MY_LIBICONV_VERSION}.tar.gz \
|
||||
&& cd libiconv-${MY_LIBICONV_VERSION} \
|
||||
&& ./configure \
|
||||
--enable-static=yes \
|
||||
--enable-shared=no \
|
||||
--host=${MY_MINGW_PREFIX} \
|
||||
--prefix=${MY_MINGW_DIR} \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libiconv-${MY_LIBICONV_VERSION} \
|
||||
; fi
|
||||
|
||||
ARG LIBDSM_VERSION
|
||||
ENV MY_LIBDSM_VERSION=${LIBDSM_VERSION}
|
||||
RUN if [ -f "/3rd_party/libdsm-${MY_LIBDSM_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./libdsm-${MY_LIBDSM_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/libdsm-${MY_LIBDSM_VERSION}.tar.gz \
|
||||
&& cd libdsm-${MY_LIBDSM_VERSION} \
|
||||
&& /3rd_party/libdsm_patch.sh /3rd_party . \
|
||||
&& meson setup \
|
||||
--bindir=${MY_MINGW_DIR}/bin \
|
||||
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \
|
||||
--prefix=${MY_MINGW_DIR} \
|
||||
-Dbinaries=false \
|
||||
-Ddefault_library=static \
|
||||
_build \
|
||||
&& meson compile \
|
||||
-C _build \
|
||||
&& meson install \
|
||||
-C _build \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
&& rm -r libdsm-${MY_LIBDSM_VERSION} \
|
||||
; fi
|
||||
|
||||
RUN (mv ${MY_MINGW_DIR}/lib/*.dll ${MY_MINGW_DIR}/bin || echo "no dll's found") \
|
||||
&& chmod 0777 -R ${MY_MINGW_DIR} \
|
||||
&& rm -rf /3rd_party
|
||||
|
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
CURRENT_DIR=$(realpath ${CURRENT_DIR})
|
||||
|
||||
rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \
|
||||
${PROJECT_BUILD_DIR}/build/test_input/
|
||||
|
||||
rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \
|
||||
${PROJECT_DIST_DIR}/test_input/
|
@ -1,3 +1,27 @@
|
||||
set(REPERTORY_MAJOR 2)
|
||||
set(REPERTORY_MINOR 0)
|
||||
set(REPERTORY_REV 2)
|
||||
set(REPERTORY_RELEASE_NUM 0)
|
||||
set(REPERTORY_RELEASE_ITER rc)
|
||||
set(REPERTORY_VERSION ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}-${REPERTORY_RELEASE_ITER})
|
||||
|
||||
set(REPERTORY_VER_FILEVERSION ${REPERTORY_MAJOR},${REPERTORY_MINOR},${REPERTORY_REV},${REPERTORY_RELEASE_NUM})
|
||||
set(REPERTORY_VER_FILEVERSION_STR ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}.${REPERTORY_RELEASE_NUM})
|
||||
set(REPERTORY_VER_PRODUCTVERSION ${REPERTORY_MAJOR},${REPERTORY_MINOR},${REPERTORY_REV},${REPERTORY_RELEASE_NUM})
|
||||
set(REPERTORY_VER_PRODUCTVERSION_STR ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}.${REPERTORY_RELEASE_NUM})
|
||||
set(REPERTORY_VER_PRERELEASE VS_FF_PRERELEASE)
|
||||
set(REPERTORY_VER_COMPANYNAME_STR "https://git.fifthgrid.com/blockstorage")
|
||||
set(REPERTORY_VER_LEGALCOPYRIGHT_STR "Copyright <2018-2024> <MIT License> <https://git.fifthgrid.com/blockstorage/repertory>")
|
||||
set(REPERTORY_VER_FILEDESCRIPTION_STR "Mount utility for Sia and S3")
|
||||
|
||||
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version.rc @ONLY)
|
||||
# set(WINDOWS_VERSION_RC ${CMAKE_CURRENT_SOURCE_DIR}/src/version.rc)
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/repertory2/librepertory2/src/common.cpp.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/repertory2/librepertory2/src/common.cpp
|
||||
@ONLY
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "-include common.hpp ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
add_project_library(lib${PROJECT_NAME} "" "" "${PROJECT_ADDITIONAL_SOURCES}")
|
||||
|
1
project_name.cmake
Normal file
1
project_name.cmake
Normal file
@ -0,0 +1 @@
|
||||
set(PROJECT_NAME repertory2)
|
@ -1,264 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_APP_CONFIG_HPP_
|
||||
#define REPERTORY_INCLUDE_APP_CONFIG_HPP_
|
||||
|
||||
#include "types/remote.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config final {
|
||||
private:
|
||||
static stop_type stop_requested;
|
||||
|
||||
public:
|
||||
[[nodiscard]] static auto default_agent_name(const provider_type &prov)
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] static auto default_api_port(const provider_type &prov)
|
||||
-> std::uint16_t;
|
||||
|
||||
[[nodiscard]] static auto default_data_directory(const provider_type &prov)
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] static auto default_remote_api_port(const provider_type &prov)
|
||||
-> std::uint16_t;
|
||||
|
||||
[[nodiscard]] static auto default_rpc_port() -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] static auto get_provider_display_name(const provider_type &prov)
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] static auto get_provider_name(const provider_type &prov)
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] static auto get_root_data_directory() -> std::string;
|
||||
|
||||
public:
|
||||
[[nodiscard]] static auto get_stop_requested() -> bool;
|
||||
|
||||
static void set_stop_requested();
|
||||
|
||||
public:
|
||||
app_config(const provider_type &prov, std::string_view data_directory = "");
|
||||
|
||||
app_config() = delete;
|
||||
app_config(app_config &&) = delete;
|
||||
app_config(const app_config &) = delete;
|
||||
|
||||
~app_config() { save(); }
|
||||
|
||||
auto operator=(const app_config &) -> app_config & = delete;
|
||||
auto operator=(app_config &&) -> app_config & = delete;
|
||||
|
||||
private:
|
||||
provider_type prov_;
|
||||
atomic<std::string> api_password_;
|
||||
std::atomic<std::uint16_t> api_port_;
|
||||
atomic<std::string> api_user_;
|
||||
std::atomic<bool> config_changed_;
|
||||
std::atomic<database_type> db_type_{database_type::rocksdb};
|
||||
std::atomic<std::uint8_t> download_timeout_secs_;
|
||||
std::atomic<bool> enable_download_timeout_;
|
||||
std::atomic<bool> enable_drive_events_;
|
||||
#if defined(_WIN32)
|
||||
std::atomic<bool> enable_mount_manager_;
|
||||
#endif // defined(_WIN32)
|
||||
std::atomic<event_level> event_level_;
|
||||
std::atomic<std::uint32_t> eviction_delay_mins_;
|
||||
std::atomic<bool> eviction_uses_accessed_time_;
|
||||
std::atomic<std::uint16_t> high_freq_interval_secs_;
|
||||
std::atomic<std::uint16_t> low_freq_interval_secs_;
|
||||
std::atomic<std::uint64_t> max_cache_size_bytes_;
|
||||
std::atomic<std::uint8_t> max_upload_count_;
|
||||
std::atomic<std::uint16_t> med_freq_interval_secs_;
|
||||
std::atomic<std::uint16_t> online_check_retry_secs_;
|
||||
std::atomic<download_type> preferred_download_type_;
|
||||
std::atomic<std::uint16_t> retry_read_count_;
|
||||
std::atomic<std::uint16_t> ring_buffer_file_size_;
|
||||
std::atomic<std::uint16_t> task_wait_ms_;
|
||||
|
||||
private:
|
||||
std::string cache_directory_;
|
||||
std::string data_directory_;
|
||||
atomic<encrypt_config> encrypt_config_;
|
||||
atomic<host_config> host_config_;
|
||||
std::string log_directory_;
|
||||
mutable std::recursive_mutex read_write_mutex_;
|
||||
atomic<remote::remote_config> remote_config_;
|
||||
atomic<remote::remote_mount> remote_mount_;
|
||||
atomic<s3_config> s3_config_;
|
||||
atomic<sia_config> sia_config_;
|
||||
std::unordered_map<std::string, std::function<std::string()>>
|
||||
value_get_lookup_;
|
||||
std::unordered_map<std::string,
|
||||
std::function<std::string(const std::string &)>>
|
||||
value_set_lookup_;
|
||||
std::uint64_t version_{REPERTORY_CONFIG_VERSION};
|
||||
|
||||
private:
|
||||
[[nodiscard]] auto load() -> bool;
|
||||
|
||||
template <typename dest, typename source>
|
||||
auto set_value(dest &dst, const source &src) -> bool;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_api_password() const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_api_port() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_api_user() const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_cache_directory() const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_config_file_path() const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_database_type() const -> database_type;
|
||||
|
||||
[[nodiscard]] auto get_data_directory() const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_download_timeout_secs() const -> std::uint8_t;
|
||||
|
||||
[[nodiscard]] auto get_enable_download_timeout() const -> bool;
|
||||
|
||||
[[nodiscard]] auto get_enable_drive_events() const -> bool;
|
||||
|
||||
[[nodiscard]] auto get_encrypt_config() const -> encrypt_config;
|
||||
|
||||
#if defined(_WIN32)
|
||||
[[nodiscard]] auto get_enable_mount_manager() const -> bool;
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level;
|
||||
|
||||
[[nodiscard]] auto get_eviction_delay_mins() const -> std::uint32_t;
|
||||
|
||||
[[nodiscard]] auto get_eviction_uses_accessed_time() const -> bool;
|
||||
|
||||
[[nodiscard]] auto get_high_frequency_interval_secs() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_host_config() const -> host_config;
|
||||
|
||||
[[nodiscard]] auto get_json() const -> json;
|
||||
|
||||
[[nodiscard]] auto get_log_directory() const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_low_frequency_interval_secs() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_max_cache_size_bytes() const -> std::uint64_t;
|
||||
|
||||
[[nodiscard]] auto get_max_upload_count() const -> std::uint8_t;
|
||||
|
||||
[[nodiscard]] auto get_med_frequency_interval_secs() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_online_check_retry_secs() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_preferred_download_type() const -> download_type;
|
||||
|
||||
[[nodiscard]] auto get_provider_type() const -> provider_type;
|
||||
|
||||
[[nodiscard]] auto get_remote_config() const -> remote::remote_config;
|
||||
|
||||
[[nodiscard]] auto get_remote_mount() const -> remote::remote_mount;
|
||||
|
||||
[[nodiscard]] auto get_retry_read_count() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_ring_buffer_file_size() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_s3_config() const -> s3_config;
|
||||
|
||||
[[nodiscard]] auto get_sia_config() const -> sia_config;
|
||||
|
||||
[[nodiscard]] auto get_task_wait_ms() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_value_by_name(const std::string &name) const
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] auto get_raw_value_by_name(const std::string &name) const
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] auto get_version() const -> std::uint64_t;
|
||||
|
||||
void save();
|
||||
|
||||
void set_api_password(const std::string &value);
|
||||
|
||||
void set_api_port(std::uint16_t value);
|
||||
|
||||
void set_api_user(const std::string &value);
|
||||
|
||||
void set_download_timeout_secs(std::uint8_t value);
|
||||
|
||||
void set_database_type(const database_type &value);
|
||||
|
||||
void set_enable_download_timeout(bool value);
|
||||
|
||||
void set_enable_drive_events(bool value);
|
||||
|
||||
#if defined(_WIN32)
|
||||
void set_enable_mount_manager(bool value);
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
void set_event_level(const event_level &value);
|
||||
|
||||
void set_encrypt_config(encrypt_config value);
|
||||
|
||||
void set_eviction_delay_mins(std::uint32_t value);
|
||||
|
||||
void set_eviction_uses_accessed_time(bool value);
|
||||
|
||||
void set_high_frequency_interval_secs(std::uint16_t value);
|
||||
|
||||
void set_host_config(host_config value);
|
||||
|
||||
void set_low_frequency_interval_secs(std::uint16_t value);
|
||||
|
||||
void set_max_cache_size_bytes(std::uint64_t value);
|
||||
|
||||
void set_max_upload_count(std::uint8_t value);
|
||||
|
||||
void set_med_frequency_interval_secs(std::uint16_t value);
|
||||
|
||||
void set_online_check_retry_secs(std::uint16_t value);
|
||||
|
||||
void set_preferred_download_type(const download_type &value);
|
||||
|
||||
void set_remote_config(remote::remote_config value);
|
||||
|
||||
void set_remote_mount(remote::remote_mount value);
|
||||
|
||||
void set_retry_read_count(std::uint16_t value);
|
||||
|
||||
void set_ring_buffer_file_size(std::uint16_t value);
|
||||
|
||||
void set_s3_config(s3_config value);
|
||||
|
||||
void set_sia_config(sia_config value);
|
||||
|
||||
void set_task_wait_ms(std::uint16_t value);
|
||||
|
||||
[[nodiscard]] auto set_value_by_name(const std::string &name,
|
||||
const std::string &value) -> std::string;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_APP_CONFIG_HPP_
|
@ -1,100 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_I_FILE_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_I_FILE_DB_HPP_
|
||||
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class i_file_db {
|
||||
INTERFACE_SETUP(i_file_db);
|
||||
|
||||
public:
|
||||
struct file_info final {
|
||||
std::string api_path;
|
||||
bool directory{};
|
||||
std::string source_path;
|
||||
};
|
||||
|
||||
struct file_data final {
|
||||
std::string api_path;
|
||||
std::uint64_t file_size{};
|
||||
std::vector<
|
||||
std::array<unsigned char, crypto_aead_xchacha20poly1305_IETF_NPUBBYTES>>
|
||||
iv_list{};
|
||||
std::string source_path;
|
||||
};
|
||||
|
||||
public:
|
||||
[[nodiscard]] virtual auto add_directory(const std::string &api_path,
|
||||
const std::string &source_path)
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto add_or_update_file(const file_data &data)
|
||||
-> api_error = 0;
|
||||
|
||||
virtual void clear() = 0;
|
||||
|
||||
[[nodiscard]] virtual auto count() const -> std::uint64_t = 0;
|
||||
|
||||
virtual void enumerate_item_list(
|
||||
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
|
||||
stop_type_callback stop_requested_cb) const = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
get_directory_api_path(const std::string &source_path,
|
||||
std::string &api_path) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
get_directory_source_path(const std::string &api_path,
|
||||
std::string &source_path) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_file_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_file_data(const std::string &api_path,
|
||||
file_data &data) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
get_file_source_path(const std::string &api_path,
|
||||
std::string &source_path) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
get_item_list(stop_type_callback stop_requested_cb) const
|
||||
-> std::vector<file_info> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto remove_item(const std::string &api_path)
|
||||
-> api_error = 0;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_I_FILE_DB_HPP_
|
@ -1,83 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_I_FILE_MGR_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_I_FILE_MGR_DB_HPP_
|
||||
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class i_file_mgr_db {
|
||||
INTERFACE_SETUP(i_file_mgr_db);
|
||||
|
||||
public:
|
||||
struct resume_entry final {
|
||||
std::string api_path;
|
||||
std::uint64_t chunk_size{};
|
||||
boost::dynamic_bitset<> read_state;
|
||||
std::string source_path;
|
||||
};
|
||||
|
||||
struct upload_active_entry final {
|
||||
std::string api_path;
|
||||
std::string source_path;
|
||||
};
|
||||
|
||||
using upload_entry = upload_active_entry;
|
||||
|
||||
public:
|
||||
[[nodiscard]] virtual auto add_resume(const resume_entry &entry) -> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto add_upload(const upload_entry &entry) -> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto add_upload_active(const upload_active_entry &entry)
|
||||
-> bool = 0;
|
||||
|
||||
virtual void clear() = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_next_upload() const
|
||||
-> std::optional<upload_entry> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_resume_list() const
|
||||
-> std::vector<resume_entry> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_upload(const std::string &api_path) const
|
||||
-> std::optional<upload_entry> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_upload_active_list() const
|
||||
-> std::vector<upload_active_entry> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto remove_resume(const std::string &api_path)
|
||||
-> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto remove_upload(const std::string &api_path)
|
||||
-> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto remove_upload_active(const std::string &api_path)
|
||||
-> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto rename_resume(const std::string &from_api_path,
|
||||
const std::string &to_api_path)
|
||||
-> bool = 0;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_I_FILE_MGR_DB_HPP_
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_I_META_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_I_META_DB_HPP_
|
||||
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class i_meta_db {
|
||||
INTERFACE_SETUP(i_meta_db);
|
||||
|
||||
public:
|
||||
virtual void clear() = 0;
|
||||
|
||||
virtual void enumerate_api_path_list(
|
||||
std::function<void(const std::vector<std::string> &)> callback,
|
||||
stop_type_callback stop_requested_cb) const = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_api_path_list() const
|
||||
-> std::vector<std::string> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
|
||||
api_meta_map &meta) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
|
||||
const std::string &key,
|
||||
std::string &value) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_pinned_files() const
|
||||
-> std::vector<std::string> = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_total_item_count() const -> std::uint64_t = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_total_size() const -> std::uint64_t = 0;
|
||||
|
||||
virtual void remove_api_path(const std::string &api_path) = 0;
|
||||
|
||||
[[nodiscard]] virtual auto remove_item_meta(const std::string &api_path,
|
||||
const std::string &key)
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto rename_item_meta(const std::string &from_api_path,
|
||||
const std::string &to_api_path)
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto set_item_meta(const std::string &api_path,
|
||||
const std::string &key,
|
||||
const std::string &value)
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto set_item_meta(const std::string &api_path,
|
||||
const api_meta_map &meta)
|
||||
-> api_error = 0;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_I_META_DB_HPP_
|
@ -1,121 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_DB_HPP_
|
||||
|
||||
#include "db/i_file_db.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
|
||||
class rdb_file_db final : public i_file_db {
|
||||
public:
|
||||
rdb_file_db(const app_config &cfg);
|
||||
~rdb_file_db() override;
|
||||
|
||||
rdb_file_db(const rdb_file_db &) = delete;
|
||||
rdb_file_db(rdb_file_db &&) = delete;
|
||||
auto operator=(const rdb_file_db &) -> rdb_file_db & = delete;
|
||||
auto operator=(rdb_file_db &&) -> rdb_file_db & = delete;
|
||||
|
||||
private:
|
||||
const app_config &cfg_;
|
||||
|
||||
private:
|
||||
std::unique_ptr<rocksdb::TransactionDB> db_{nullptr};
|
||||
rocksdb::ColumnFamilyHandle *directory_family_{};
|
||||
rocksdb::ColumnFamilyHandle *file_family_{};
|
||||
rocksdb::ColumnFamilyHandle *path_family_{};
|
||||
rocksdb::ColumnFamilyHandle *source_family_{};
|
||||
|
||||
private:
|
||||
void create_or_open(bool clear);
|
||||
|
||||
[[nodiscard]] auto create_iterator(rocksdb::ColumnFamilyHandle *family) const
|
||||
-> std::shared_ptr<rocksdb::Iterator>;
|
||||
|
||||
[[nodiscard]] static auto
|
||||
perform_action(std::string_view function_name,
|
||||
std::function<rocksdb::Status()> action) -> api_error;
|
||||
|
||||
[[nodiscard]] auto perform_action(
|
||||
std::string_view function_name,
|
||||
std::function<rocksdb::Status(rocksdb::Transaction *txn)> action)
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] auto remove_item(const std::string &api_path,
|
||||
const std::string &source_path,
|
||||
rocksdb::Transaction *txn) -> rocksdb::Status;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto add_directory(const std::string &api_path,
|
||||
const std::string &source_path)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto add_or_update_file(const i_file_db::file_data &data)
|
||||
-> api_error override;
|
||||
|
||||
void clear() override;
|
||||
|
||||
[[nodiscard]] auto count() const -> std::uint64_t override;
|
||||
|
||||
void enumerate_item_list(
|
||||
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
|
||||
stop_type_callback stop_requested_cb) const override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_directory_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_directory_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_file_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_file_data(const std::string &api_path,
|
||||
i_file_db::file_data &data) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_file_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const
|
||||
-> std::vector<i_file_db::file_info> override;
|
||||
|
||||
[[nodiscard]] auto get_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto remove_item(const std::string &api_path)
|
||||
-> api_error override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_DB_HPP_
|
@ -1,109 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_MGR_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_MGR_DB_HPP_
|
||||
|
||||
#include "db/i_file_mgr_db.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
|
||||
class rdb_file_mgr_db final : public i_file_mgr_db {
|
||||
public:
|
||||
rdb_file_mgr_db(const app_config &cfg);
|
||||
~rdb_file_mgr_db() override;
|
||||
|
||||
rdb_file_mgr_db(const rdb_file_mgr_db &) = delete;
|
||||
rdb_file_mgr_db(rdb_file_mgr_db &&) = delete;
|
||||
auto operator=(const rdb_file_mgr_db &) -> rdb_file_mgr_db & = delete;
|
||||
auto operator=(rdb_file_mgr_db &&) -> rdb_file_mgr_db & = delete;
|
||||
|
||||
private:
|
||||
const app_config &cfg_;
|
||||
|
||||
private:
|
||||
std::unique_ptr<rocksdb::TransactionDB> db_{nullptr};
|
||||
std::atomic<std::uint64_t> id_{0U};
|
||||
rocksdb::ColumnFamilyHandle *resume_family_{};
|
||||
rocksdb::ColumnFamilyHandle *upload_active_family_{};
|
||||
rocksdb::ColumnFamilyHandle *upload_family_{};
|
||||
|
||||
private:
|
||||
void create_or_open(bool clear);
|
||||
|
||||
[[nodiscard]] auto create_iterator(rocksdb::ColumnFamilyHandle *family) const
|
||||
-> std::shared_ptr<rocksdb::Iterator>;
|
||||
|
||||
[[nodiscard]] static auto
|
||||
perform_action(std::string_view function_name,
|
||||
std::function<rocksdb::Status()> action) -> bool;
|
||||
|
||||
[[nodiscard]] auto perform_action(
|
||||
std::string_view function_name,
|
||||
std::function<rocksdb::Status(rocksdb::Transaction *txn)> action) -> bool;
|
||||
|
||||
[[nodiscard]] auto remove_resume(const std::string &api_path,
|
||||
rocksdb::Transaction *txn)
|
||||
-> rocksdb::Status;
|
||||
|
||||
[[nodiscard]] auto add_resume(const resume_entry &entry,
|
||||
rocksdb::Transaction *txn) -> rocksdb::Status;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto add_resume(const resume_entry &entry) -> bool override;
|
||||
|
||||
[[nodiscard]] auto add_upload(const upload_entry &entry) -> bool override;
|
||||
|
||||
[[nodiscard]] auto add_upload_active(const upload_active_entry &entry)
|
||||
-> bool override;
|
||||
|
||||
void clear() override;
|
||||
|
||||
[[nodiscard]] auto get_next_upload() const
|
||||
-> std::optional<upload_entry> override;
|
||||
|
||||
[[nodiscard]] auto get_resume_list() const
|
||||
-> std::vector<resume_entry> override;
|
||||
|
||||
[[nodiscard]] auto get_upload(const std::string &api_path) const
|
||||
-> std::optional<upload_entry> override;
|
||||
|
||||
[[nodiscard]] auto get_upload_active_list() const
|
||||
-> std::vector<upload_active_entry> override;
|
||||
|
||||
[[nodiscard]] auto remove_resume(const std::string &api_path)
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto remove_upload(const std::string &api_path)
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto remove_upload_active(const std::string &api_path)
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto rename_resume(const std::string &from_api_path,
|
||||
const std::string &to_api_path)
|
||||
-> bool override;
|
||||
};
|
||||
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_MGR_DB_HPP_
|
@ -1,131 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_IMPL_RDB_META_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_IMPL_RDB_META_DB_HPP_
|
||||
|
||||
#include "db/i_meta_db.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
|
||||
class rdb_meta_db final : public i_meta_db {
|
||||
public:
|
||||
rdb_meta_db(const app_config &cfg);
|
||||
~rdb_meta_db() override;
|
||||
|
||||
rdb_meta_db(const rdb_meta_db &) = delete;
|
||||
rdb_meta_db(rdb_meta_db &&) = delete;
|
||||
auto operator=(const rdb_meta_db &) -> rdb_meta_db & = delete;
|
||||
auto operator=(rdb_meta_db &&) -> rdb_meta_db & = delete;
|
||||
|
||||
private:
|
||||
const app_config &cfg_;
|
||||
|
||||
private:
|
||||
std::unique_ptr<rocksdb::TransactionDB> db_{nullptr};
|
||||
rocksdb::ColumnFamilyHandle *meta_family_{};
|
||||
rocksdb::ColumnFamilyHandle *pinned_family_{};
|
||||
rocksdb::ColumnFamilyHandle *size_family_{};
|
||||
rocksdb::ColumnFamilyHandle *source_family_{};
|
||||
|
||||
private:
|
||||
[[nodiscard]] auto create_iterator(rocksdb::ColumnFamilyHandle *family) const
|
||||
-> std::shared_ptr<rocksdb::Iterator>;
|
||||
|
||||
void create_or_open(bool clear);
|
||||
|
||||
[[nodiscard]] auto get_item_meta_json(const std::string &api_path,
|
||||
json &json_data) const -> api_error;
|
||||
|
||||
[[nodiscard]] static auto
|
||||
perform_action(std::string_view function_name,
|
||||
std::function<rocksdb::Status()> action) -> api_error;
|
||||
|
||||
[[nodiscard]] auto perform_action(
|
||||
std::string_view function_name,
|
||||
std::function<rocksdb::Status(rocksdb::Transaction *txn)> action)
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] auto remove_api_path(const std::string &api_path,
|
||||
const std::string &source_path,
|
||||
rocksdb::Transaction *txn)
|
||||
-> rocksdb::Status;
|
||||
|
||||
[[nodiscard]] auto update_item_meta(const std::string &api_path,
|
||||
json json_data,
|
||||
rocksdb::Transaction *base_txn = nullptr,
|
||||
rocksdb::Status *status = nullptr)
|
||||
-> api_error;
|
||||
|
||||
public:
|
||||
void clear() override;
|
||||
|
||||
void enumerate_api_path_list(
|
||||
std::function<void(const std::vector<std::string> &)> callback,
|
||||
stop_type_callback stop_requested_cb) const override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_api_path_list() const
|
||||
-> std::vector<std::string> override;
|
||||
|
||||
[[nodiscard]] auto get_item_meta(const std::string &api_path,
|
||||
api_meta_map &meta) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_item_meta(const std::string &api_path,
|
||||
const std::string &key,
|
||||
std::string &value) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_pinned_files() const
|
||||
-> std::vector<std::string> override;
|
||||
|
||||
[[nodiscard]] auto get_total_item_count() const -> std::uint64_t override;
|
||||
|
||||
[[nodiscard]] auto get_total_size() const -> std::uint64_t override;
|
||||
|
||||
void remove_api_path(const std::string &api_path) override;
|
||||
|
||||
[[nodiscard]] auto remove_item_meta(const std::string &api_path,
|
||||
const std::string &key)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto rename_item_meta(const std::string &from_api_path,
|
||||
const std::string &to_api_path)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto set_item_meta(const std::string &api_path,
|
||||
const std::string &key,
|
||||
const std::string &value)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto set_item_meta(const std::string &api_path,
|
||||
const api_meta_map &meta)
|
||||
-> api_error override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_IMPL_RDB_META_DB_HPP_
|
@ -1,96 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_DB_HPP_
|
||||
|
||||
#include "db/i_file_db.hpp"
|
||||
#include "utils/db/sqlite/db_common.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
|
||||
class sqlite_file_db final : public i_file_db {
|
||||
public:
|
||||
sqlite_file_db(const app_config &cfg);
|
||||
~sqlite_file_db() override;
|
||||
|
||||
sqlite_file_db(const sqlite_file_db &) = delete;
|
||||
sqlite_file_db(sqlite_file_db &&) = delete;
|
||||
auto operator=(const sqlite_file_db &) -> sqlite_file_db & = delete;
|
||||
auto operator=(sqlite_file_db &&) -> sqlite_file_db & = delete;
|
||||
|
||||
private:
|
||||
utils::db::sqlite::db3_t db_;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto add_directory(const std::string &api_path,
|
||||
const std::string &source_path)
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto add_or_update_file(const i_file_db::file_data &data)
|
||||
-> api_error override;
|
||||
|
||||
void clear() override;
|
||||
|
||||
[[nodiscard]] auto count() const -> std::uint64_t override;
|
||||
|
||||
void enumerate_item_list(
|
||||
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
|
||||
stop_type_callback stop_requested_cb) const override;
|
||||
|
||||
[[nodiscard]] auto get_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_directory_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_directory_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_file_api_path(const std::string &source_path,
|
||||
std::string &api_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_file_data(const std::string &api_path,
|
||||
i_file_db::file_data &data) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_file_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const
|
||||
-> std::vector<i_file_db::file_info> override;
|
||||
|
||||
[[nodiscard]] auto get_source_path(const std::string &api_path,
|
||||
std::string &source_path) const
|
||||
-> api_error override;
|
||||
|
||||
[[nodiscard]] auto remove_item(const std::string &api_path)
|
||||
-> api_error override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_DB_HPP_
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_MGR_DB_HPP_
|
||||
#define REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_MGR_DB_HPP_
|
||||
|
||||
#include "db/i_file_mgr_db.hpp"
|
||||
#include "utils/db/sqlite/db_common.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
|
||||
class sqlite_file_mgr_db final : public i_file_mgr_db {
|
||||
public:
|
||||
sqlite_file_mgr_db(const app_config &cfg);
|
||||
~sqlite_file_mgr_db() override;
|
||||
|
||||
sqlite_file_mgr_db(const sqlite_file_mgr_db &) = delete;
|
||||
sqlite_file_mgr_db(sqlite_file_mgr_db &&) = delete;
|
||||
auto operator=(const sqlite_file_mgr_db &) -> sqlite_file_mgr_db & = delete;
|
||||
auto operator=(sqlite_file_mgr_db &&) -> sqlite_file_mgr_db & = delete;
|
||||
|
||||
private:
|
||||
utils::db::sqlite::db3_t db_;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto add_resume(const resume_entry &entry) -> bool override;
|
||||
|
||||
[[nodiscard]] auto add_upload(const upload_entry &entry) -> bool override;
|
||||
|
||||
[[nodiscard]] auto add_upload_active(const upload_active_entry &entry)
|
||||
-> bool override;
|
||||
|
||||
void clear() override;
|
||||
|
||||
[[nodiscard]] auto get_next_upload() const
|
||||
-> std::optional<upload_entry> override;
|
||||
|
||||
[[nodiscard]] auto get_resume_list() const
|
||||
-> std::vector<resume_entry> override;
|
||||
|
||||
[[nodiscard]] auto get_upload(const std::string &api_path) const
|
||||
-> std::optional<upload_entry> override;
|
||||
|
||||
[[nodiscard]] auto get_upload_active_list() const
|
||||
-> std::vector<upload_active_entry> override;
|
||||
|
||||
[[nodiscard]] auto remove_resume(const std::string &api_path)
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto remove_upload(const std::string &api_path)
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto remove_upload_active(const std::string &api_path)
|
||||
-> bool override;
|
||||
|
||||
[[nodiscard]] auto rename_resume(const std::string &from_api_path,
|
||||
const std::string &to_api_path)
|
||||
-> bool override;
|
||||
};
|
||||
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_MGR_DB_HPP_
|
@ -1,329 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_HPP_
|
||||
#define REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_HPP_
|
||||
#if !defined(_WIN32)
|
||||
|
||||
#include "drives/fuse/fuse_drive_base.hpp"
|
||||
#include "file_manager/file_manager.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
class console_consumer;
|
||||
class directory_cache;
|
||||
class eviction;
|
||||
class full_server;
|
||||
class i_provider;
|
||||
class lock_data;
|
||||
class logging_consumer;
|
||||
namespace remote_fuse {
|
||||
class remote_server;
|
||||
}
|
||||
|
||||
class fuse_drive final : public fuse_drive_base {
|
||||
public:
|
||||
fuse_drive(app_config &config, lock_data &lock_data, i_provider &provider);
|
||||
|
||||
~fuse_drive() override = default;
|
||||
|
||||
public:
|
||||
fuse_drive(const fuse_drive &) = delete;
|
||||
fuse_drive(fuse_drive &&) = delete;
|
||||
|
||||
auto operator=(const fuse_drive &) -> fuse_drive & = delete;
|
||||
auto operator=(fuse_drive &&) -> fuse_drive & = delete;
|
||||
|
||||
private:
|
||||
lock_data &lock_data_;
|
||||
i_provider &provider_;
|
||||
|
||||
std::shared_ptr<console_consumer> console_consumer_;
|
||||
std::shared_ptr<directory_cache> directory_cache_;
|
||||
std::shared_ptr<eviction> eviction_;
|
||||
std::shared_ptr<file_manager> fm_;
|
||||
std::shared_ptr<logging_consumer> logging_consumer_;
|
||||
std::shared_ptr<remote_fuse::remote_server> remote_server_;
|
||||
std::shared_ptr<full_server> server_;
|
||||
std::mutex stop_all_mtx_;
|
||||
bool was_mounted_{false};
|
||||
|
||||
private:
|
||||
void update_accessed_time(const std::string &api_path);
|
||||
|
||||
void stop_all();
|
||||
|
||||
protected:
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto chflags_impl(std::string api_path,
|
||||
uint32_t flags) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
chmod_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto chmod_impl(std::string api_path,
|
||||
mode_t mode) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
chown_impl(std::string api_path, uid_t uid, gid_t gid,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid,
|
||||
gid_t gid) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto
|
||||
create_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
void destroy_impl(void *ptr) override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
fallocate_impl(std::string api_path, int mode, off_t offset, off_t length,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
fgetattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
fsetattr_x_impl(std::string api_path, struct setattr_x *attr,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] auto
|
||||
fsync_impl(std::string api_path, int datasync,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto
|
||||
ftruncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
getattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto getattr_impl(std::string api_path,
|
||||
struct stat *unix_st) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
getxtimes_impl(std::string api_path, struct timespec *bkuptime,
|
||||
struct timespec *crtime) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
auto init_impl(struct fuse_conn_info *conn,
|
||||
struct fuse_config *cfg) -> void * override;
|
||||
#else
|
||||
auto init_impl(struct fuse_conn_info *conn) -> void * override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto mkdir_impl(std::string api_path,
|
||||
mode_t mode) -> api_error override;
|
||||
|
||||
void notify_fuse_main_exit(int &ret) override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
open_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
opendir_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto read_impl(std::string api_path, char *buffer,
|
||||
size_t read_size, off_t read_offset,
|
||||
struct fuse_file_info *file_info,
|
||||
std::size_t &bytes_read) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset, struct fuse_file_info *file_info,
|
||||
fuse_readdir_flags flags) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto
|
||||
release_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
releasedir_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto rename_impl(std::string from_api_path,
|
||||
std::string to_api_path,
|
||||
unsigned int flags) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto rename_impl(std::string from_api_path,
|
||||
std::string to_api_path) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto rmdir_impl(std::string api_path) -> api_error override;
|
||||
|
||||
#if defined(HAS_SETXATTR)
|
||||
[[nodiscard]] auto getxattr_common(std::string api_path, const char *name,
|
||||
char *value, size_t size,
|
||||
int &attribute_size,
|
||||
uint32_t *position) -> api_error;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto getxattr_impl(std::string api_path, const char *name,
|
||||
char *value, size_t size, uint32_t position,
|
||||
int &attribute_size) -> api_error override;
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] auto getxattr_impl(std::string api_path, const char *name,
|
||||
char *value, size_t size,
|
||||
int &attribute_size) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] auto listxattr_impl(std::string api_path, char *buffer,
|
||||
size_t size, int &required_size,
|
||||
bool &return_size) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto removexattr_impl(std::string api_path,
|
||||
const char *name) -> api_error override;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
|
||||
const char *value, size_t size, int flags,
|
||||
uint32_t position) -> api_error override;
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
|
||||
const char *value, size_t size,
|
||||
int flags) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
#endif // HAS_SETXATTR
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
setattr_x_impl(std::string api_path,
|
||||
struct setattr_x *attr) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
setbkuptime_impl(std::string api_path,
|
||||
const struct timespec *bkuptime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
setchgtime_impl(std::string api_path,
|
||||
const struct timespec *chgtime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
setcrtime_impl(std::string api_path,
|
||||
const struct timespec *crtime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto setvolname_impl(const char *volname) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto statfs_x_impl(std::string api_path,
|
||||
struct statfs *stbuf) -> api_error override;
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] auto statfs_impl(std::string api_path,
|
||||
struct statvfs *stbuf) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
truncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto truncate_impl(std::string api_path,
|
||||
off_t size) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto unlink_impl(std::string api_path) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
utimens_impl(std::string api_path, const struct timespec tv[2],
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
utimens_impl(std::string api_path,
|
||||
const struct timespec tv[2]) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto
|
||||
write_impl(std::string api_path, const char *buffer, size_t write_size,
|
||||
off_t write_offset, struct fuse_file_info *file_info,
|
||||
std::size_t &bytes_written) -> api_error override;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_directory_item_count(const std::string &api_path) const
|
||||
-> std::uint64_t override;
|
||||
|
||||
[[nodiscard]] auto get_directory_items(const std::string &api_path) const
|
||||
-> directory_item_list override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_file_size(const std::string &api_path) const -> std::uint64_t override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_item_meta(const std::string &api_path,
|
||||
api_meta_map &meta) const -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_item_meta(const std::string &api_path, const std::string &name,
|
||||
std::string &value) const -> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_total_drive_space() const -> std::uint64_t override;
|
||||
|
||||
[[nodiscard]] auto get_total_item_count() const -> std::uint64_t override;
|
||||
|
||||
[[nodiscard]] auto get_used_drive_space() const -> std::uint64_t override;
|
||||
|
||||
void get_volume_info(UINT64 &total_size, UINT64 &free_size,
|
||||
std::string &volume_label) const override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
is_processing(const std::string &api_path) const -> bool override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
rename_directory(const std::string &from_api_path,
|
||||
const std::string &to_api_path) -> int override;
|
||||
|
||||
[[nodiscard]] auto rename_file(const std::string &from_api_path,
|
||||
const std::string &to_api_path,
|
||||
bool overwrite) -> int override;
|
||||
|
||||
void set_item_meta(const std::string &api_path, const std::string &key,
|
||||
const std::string &value) override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // _WIN32
|
||||
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_HPP_
|
@ -1,199 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DRIVES_FUSE_REMOTEFUSE_I_REMOTE_INSTANCE_HPP_
|
||||
#define REPERTORY_INCLUDE_DRIVES_FUSE_REMOTEFUSE_I_REMOTE_INSTANCE_HPP_
|
||||
|
||||
#include "drives/remote/i_remote_json.hpp"
|
||||
#include "types/remote.hpp"
|
||||
|
||||
namespace repertory::remote_fuse {
|
||||
class i_remote_instance : public virtual i_remote_json {
|
||||
INTERFACE_SETUP(i_remote_instance);
|
||||
|
||||
public:
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_access(const char *path,
|
||||
const std::int32_t &mask) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_chflags(const char *path, std::uint32_t flags) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_chmod(const char *path,
|
||||
const remote::file_mode &mode) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_chown(const char *path, const remote::user_id &uid,
|
||||
const remote::group_id &gid) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_create(const char *path, const remote::file_mode &mode,
|
||||
const remote::open_flags &flags,
|
||||
remote::file_handle &handle) -> packet::error_type = 0;
|
||||
[[nodiscard]] virtual auto fuse_destroy() -> packet::error_type = 0;
|
||||
|
||||
/*[[nodiscard]] virtual packet::error_type fuse_fallocate(const char *path,
|
||||
const std::int32_t &mode, const remote::file_offset &offset, const
|
||||
remote::file_offset &length, const remote::file_offset &length, const
|
||||
remote::file_handle &handle) = 0;*/
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_fgetattr(const char *path, remote::stat &r_stat, bool &directory,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_fsetattr_x(const char *path, const remote::setattr_x &attr,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_fsync(const char *path, const std::int32_t &datasync,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_ftruncate(const char *path, const remote::file_offset &size,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_getattr(const char *path, remote::stat &r_stat,
|
||||
bool &directory) -> packet::error_type = 0;
|
||||
|
||||
/*[[nodiscard]] virtual packet::error_type fuse_getxattr(const char *path,
|
||||
const char *name, char *value, const remote::file_size &size) = 0;
|
||||
|
||||
[[nodiscard]] virtual packet::error_type fuse_getxattrOSX(const char *path,
|
||||
const char *name, char *value, const remote::file_size &size, std::uint32_t
|
||||
position) = 0;*/
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_getxtimes(const char *path, remote::file_time &bkuptime,
|
||||
remote::file_time &crtime) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto fuse_init() -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] /*virtual packet::error_type fuse_listxattr(const char *path,
|
||||
char *buffer, const remote::file_size &size) = 0;*/
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_mkdir(const char *path,
|
||||
const remote::file_mode &mode) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_open(const char *path, const remote::open_flags &flags,
|
||||
remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_opendir(const char *path,
|
||||
remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_read(const char *path, char *buffer, const remote::file_size &read_size,
|
||||
const remote::file_offset &read_offset,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_readdir(const char *path, const remote::file_offset &offset,
|
||||
const remote::file_handle &handle,
|
||||
std::string &item_path) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_release(const char *path,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_releasedir(const char *path,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
//[[nodiscard]] virtual packet::error_type fuse_removexattr(const char *path,
|
||||
// const char *name) =
|
||||
// 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_rename(const char *from, const char *to) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_rmdir(const char *path) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_setattr_x(const char *path,
|
||||
remote::setattr_x &attr) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_setbkuptime(const char *path,
|
||||
const remote::file_time &bkuptime) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_setchgtime(const char *path,
|
||||
const remote::file_time &chgtime) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_setcrtime(const char *path,
|
||||
const remote::file_time &crtime) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_setvolname(const char *volname) -> packet::error_type = 0;
|
||||
|
||||
/*[[nodiscard]] virtual packet::error_type fuse_setxattr(const char *path,
|
||||
const char *name, const char *value, const remote::file_size &size, const
|
||||
std::int32_t &flags) = 0;
|
||||
[[nodiscard]] virtual packet::error_type fuse_setxattr_osx(const char *path,
|
||||
const char *name, const char *value, const remote::file_size &size, const
|
||||
std::int32_t &flags, std::uint32_t position) = 0;*/
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_statfs(const char *path, std::uint64_t frsize,
|
||||
remote::statfs &r_stat) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_statfs_x(const char *path, std::uint64_t bsize,
|
||||
remote::statfs_x &r_stat) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_truncate(const char *path,
|
||||
const remote::file_offset &size) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_unlink(const char *path) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_utimens(const char *path, const remote::file_time *tv, std::uint64_t op0,
|
||||
std::uint64_t op1) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fuse_write(const char *path, const char *buffer,
|
||||
const remote::file_size &writeSize,
|
||||
const remote::file_offset &writeOffset,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto fuse_write_base64(
|
||||
const char *path, const char *buffer, const remote::file_size &writeSize,
|
||||
const remote::file_offset &writeOffset,
|
||||
const remote::file_handle &handle) -> packet::error_type = 0;
|
||||
|
||||
virtual void set_fuse_uid_gid(const remote::user_id &uid,
|
||||
const remote::group_id &gid) = 0;
|
||||
};
|
||||
|
||||
using remote_instance_factory =
|
||||
std::function<std::unique_ptr<i_remote_instance>()>;
|
||||
} // namespace repertory::remote_fuse
|
||||
|
||||
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_REMOTEFUSE_I_REMOTE_INSTANCE_HPP_
|
@ -1,241 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_DRIVES_FUSE_REMOTEFUSE_REMOTE_FUSE_DRIVE_HPP_
|
||||
#define REPERTORY_INCLUDE_DRIVES_FUSE_REMOTEFUSE_REMOTE_FUSE_DRIVE_HPP_
|
||||
#if !defined(_WIN32)
|
||||
|
||||
#include "drives/fuse/fuse_base.hpp"
|
||||
#include "drives/fuse/remotefuse/i_remote_instance.hpp"
|
||||
#include "events/event_system.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
class console_consumer;
|
||||
class logging_consumer;
|
||||
class lock_data;
|
||||
class server;
|
||||
|
||||
namespace remote_fuse {
|
||||
class remote_fuse_drive final : public fuse_base {
|
||||
public:
|
||||
remote_fuse_drive(app_config &config, remote_instance_factory factory,
|
||||
lock_data &lock)
|
||||
: fuse_base(config), factory_(std::move(factory)), lock_data_(lock) {}
|
||||
|
||||
~remote_fuse_drive() override = default;
|
||||
|
||||
private:
|
||||
remote_instance_factory factory_;
|
||||
lock_data &lock_data_;
|
||||
std::shared_ptr<console_consumer> console_consumer_;
|
||||
std::shared_ptr<logging_consumer> logging_consumer_;
|
||||
std::shared_ptr<i_remote_instance> remote_instance_;
|
||||
std::shared_ptr<server> server_;
|
||||
bool was_mounted_ = false;
|
||||
|
||||
private:
|
||||
static void populate_stat(const remote::stat &r_stat, bool directory,
|
||||
struct stat &unix_st);
|
||||
|
||||
protected:
|
||||
[[nodiscard]] auto access_impl(std::string api_path,
|
||||
int mask) -> api_error override;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto chflags_impl(std::string api_path,
|
||||
uint32_t flags) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
chmod_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto chmod_impl(std::string api_path,
|
||||
mode_t mode) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
chown_impl(std::string api_path, uid_t uid, gid_t gid,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid,
|
||||
gid_t gid) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto
|
||||
create_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
|
||||
void destroy_impl(void * /*ptr*/) override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
fgetattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
fsetattr_x_impl(std::string api_path, struct setattr_x *attr,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] auto
|
||||
fsync_impl(std::string api_path, int datasync,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto
|
||||
ftruncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
getattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto getattr_impl(std::string api_path,
|
||||
struct stat *unix_st) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
getxtimes_impl(std::string api_path, struct timespec *bkuptime,
|
||||
struct timespec *crtime) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
auto init_impl(struct fuse_conn_info *conn,
|
||||
struct fuse_config *cfg) -> void * override;
|
||||
#else
|
||||
auto init_impl(struct fuse_conn_info *conn) -> void * override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto mkdir_impl(std::string api_path,
|
||||
mode_t mode) -> api_error override;
|
||||
|
||||
void notify_fuse_main_exit(int &ret) override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
open_impl(std::string api_path,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
opendir_impl(std::string api_path,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto read_impl(std::string api_path, char *buffer,
|
||||
size_t read_size, off_t read_offset,
|
||||
struct fuse_file_info *f_info,
|
||||
std::size_t &bytes_read) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset, struct fuse_file_info *f_info,
|
||||
fuse_readdir_flags flags) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto
|
||||
release_impl(std::string api_path,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
releasedir_impl(std::string api_path,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto rename_impl(std::string from_api_path,
|
||||
std::string to_api_path,
|
||||
unsigned int flags) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto rename_impl(std::string from_api_path,
|
||||
std::string to_api_path) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto rmdir_impl(std::string api_path) -> api_error override;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
setattr_x_impl(std::string api_path,
|
||||
struct setattr_x *attr) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
setbkuptime_impl(std::string api_path,
|
||||
const struct timespec *bkuptime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
setchgtime_impl(std::string api_path,
|
||||
const struct timespec *chgtime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
setcrtime_impl(std::string api_path,
|
||||
const struct timespec *crtime) -> api_error override;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
setvolname_impl(const char *volname) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto statfs_x_impl(std::string api_path,
|
||||
struct statfs *stbuf) -> api_error override;
|
||||
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] auto statfs_impl(std::string api_path,
|
||||
struct statvfs *stbuf) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
truncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto truncate_impl(std::string api_path,
|
||||
off_t size) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto unlink_impl(std::string api_path) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
utimens_impl(std::string api_path, const struct timespec tv[2],
|
||||
struct fuse_file_info *f_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
utimens_impl(std::string api_path,
|
||||
const struct timespec tv[2]) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto
|
||||
write_impl(std::string api_path, const char *buffer, size_t write_size,
|
||||
off_t write_offset, struct fuse_file_info *f_info,
|
||||
std::size_t &bytes_written) -> api_error override;
|
||||
};
|
||||
} // namespace remote_fuse
|
||||
} // namespace repertory
|
||||
|
||||
#endif // _WIN32
|
||||
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_REMOTEFUSE_REMOTE_FUSE_DRIVE_HPP_
|
@ -1,141 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_
|
||||
|
||||
namespace repertory {
|
||||
class i_event;
|
||||
|
||||
class event_system final {
|
||||
private:
|
||||
static constexpr const std::uint8_t max_queue_retry{
|
||||
30U,
|
||||
};
|
||||
|
||||
const std::uint32_t max_queue_size{
|
||||
std::thread::hardware_concurrency() * 4U,
|
||||
};
|
||||
|
||||
static constexpr const std::chrono::seconds queue_wait_secs{
|
||||
5s,
|
||||
};
|
||||
|
||||
public:
|
||||
event_system(const event_system &) = delete;
|
||||
event_system(event_system &&) = delete;
|
||||
auto operator=(const event_system &) -> event_system & = delete;
|
||||
auto operator=(event_system &&) -> event_system & = delete;
|
||||
|
||||
protected:
|
||||
event_system() = default;
|
||||
|
||||
~event_system() { stop(); }
|
||||
|
||||
public:
|
||||
class event_consumer final {
|
||||
public:
|
||||
explicit event_consumer(std::function<void(const i_event &)> callback)
|
||||
: callback_(std::move(callback)) {
|
||||
event_system::instance().attach(this);
|
||||
}
|
||||
|
||||
event_consumer(std::string_view event_name,
|
||||
std::function<void(const i_event &)> callback)
|
||||
: callback_(std::move(callback)) {
|
||||
event_system::instance().attach(event_name, this);
|
||||
}
|
||||
|
||||
~event_consumer() { event_system::instance().release(this); }
|
||||
|
||||
public:
|
||||
event_consumer(const event_consumer &) = delete;
|
||||
event_consumer(event_consumer &&) = delete;
|
||||
auto operator=(const event_consumer &) -> event_consumer & = delete;
|
||||
auto operator=(event_consumer &&) -> event_consumer & = delete;
|
||||
|
||||
private:
|
||||
std::function<void(const i_event &)> callback_;
|
||||
|
||||
public:
|
||||
void notify_event(const i_event &event) { callback_(event); }
|
||||
};
|
||||
|
||||
private:
|
||||
static event_system instance_;
|
||||
|
||||
public:
|
||||
[[nodiscard]] static auto instance() -> event_system &;
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::deque<event_consumer *>>
|
||||
event_consumers_;
|
||||
std::recursive_mutex consumer_mutex_;
|
||||
std::vector<std::shared_ptr<i_event>> event_list_;
|
||||
std::condition_variable event_notify_;
|
||||
std::mutex event_mutex_;
|
||||
std::unique_ptr<std::thread> event_thread_;
|
||||
std::mutex run_mutex_;
|
||||
stop_type stop_requested_{false};
|
||||
|
||||
private:
|
||||
[[nodiscard]] auto get_stop_requested() const -> bool;
|
||||
|
||||
void process_events();
|
||||
|
||||
void queue_event(std::shared_ptr<i_event> evt);
|
||||
|
||||
public:
|
||||
void attach(event_consumer *consumer);
|
||||
|
||||
void attach(std::string_view event_name, event_consumer *consumer);
|
||||
|
||||
template <typename evt_t, typename... arg_t> void raise(arg_t &&...args) {
|
||||
queue_event(std::make_shared<evt_t>(std::forward<arg_t>(args)...));
|
||||
}
|
||||
|
||||
void release(event_consumer *consumer);
|
||||
|
||||
void start();
|
||||
|
||||
void stop();
|
||||
};
|
||||
|
||||
using event_consumer = event_system::event_consumer;
|
||||
|
||||
#define E_CONSUMER() \
|
||||
private: \
|
||||
std::vector<std::shared_ptr<repertory::event_consumer>> event_consumers_
|
||||
|
||||
#define E_CONSUMER_RELEASE() event_consumers_.clear()
|
||||
|
||||
#define E_SUBSCRIBE(event, callback) \
|
||||
event_consumers_.emplace_back(std::make_shared<repertory::event_consumer>( \
|
||||
event::name, [this](const i_event &evt) { \
|
||||
callback(dynamic_cast<const event &>(evt)); \
|
||||
}))
|
||||
|
||||
#define E_SUBSCRIBE_ALL(callback) \
|
||||
event_consumers_.emplace_back(std::make_shared<repertory::event_consumer>( \
|
||||
[this](const i_event &evt) { callback(evt); }))
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_EVENT_SYSTEM_HPP_
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_CURL_ERROR_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_CURL_ERROR_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct curl_error final : public i_event {
|
||||
curl_error() = default;
|
||||
curl_error(CURLcode code_, std::string_view function_name_, std::string url_)
|
||||
: code(code_),
|
||||
function_name(std::string{function_name_}),
|
||||
url(std::move(url_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"curl_error"};
|
||||
|
||||
CURLcode code{};
|
||||
std::string function_name;
|
||||
std::string url;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|url|{}|code|{}", name, function_name, url,
|
||||
static_cast<int>(code));
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::curl_error> {
|
||||
static void to_json(json &data, const repertory::curl_error &value) {
|
||||
data["code"] = value.code;
|
||||
data["function_name"] = value.function_name;
|
||||
data["url"] = value.url;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::curl_error &value) {
|
||||
data.at("code").get_to<CURLcode>(value.code);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("url").get_to<std::string>(value.url);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_CURL_ERROR_HPP_
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DEBUG_LOG_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DEBUG_LOG_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct debug_log final : public i_event {
|
||||
debug_log() = default;
|
||||
debug_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"debug_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|msg|{}", name, function_name, msg);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::debug_log> {
|
||||
static void to_json(json &data, const repertory::debug_log &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["msg"] = value.msg;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::debug_log &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("msg").get_to<std::string>(value.msg);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DEBUG_LOG_HPP_
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVE_FAILED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVE_FAILED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct directory_remove_failed final : public i_event {
|
||||
directory_remove_failed() = default;
|
||||
directory_remove_failed(std::string api_path_, api_error error_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"directory_remove_failed"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|error|{}", name, function_name,
|
||||
api_path, api_error_to_string(error));
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::directory_remove_failed> {
|
||||
static void to_json(json &data,
|
||||
const repertory::directory_remove_failed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["error"] = repertory::api_error_to_string(value.error);
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::directory_remove_failed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
value.error =
|
||||
repertory::api_error_from_string(data.at("error").get<std::string>());
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVE_FAILED_HPP_
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct directory_removed final : public i_event {
|
||||
directory_removed() = default;
|
||||
directory_removed(std::string api_path_, std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"directory_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::directory_removed> {
|
||||
static void to_json(json &data, const repertory::directory_removed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::directory_removed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_HPP_
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_EXTERNALLY_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_EXTERNALLY_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct directory_removed_externally final : public i_event {
|
||||
directory_removed_externally() = default;
|
||||
directory_removed_externally(std::string api_path_,
|
||||
std::string_view function_name_,
|
||||
std::string source_path_)
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"directory_removed_externally"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|src|{}", name, function_name, api_path,
|
||||
source_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::directory_removed_externally> {
|
||||
static void to_json(json &data,
|
||||
const repertory::directory_removed_externally &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["function_name"] = value.function_name;
|
||||
data["source_path"] = value.source_path;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::directory_removed_externally &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("source_path").get_to<std::string>(value.source_path);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DIRECTORY_REMOVED_EXTERNALLY_HPP_
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_BEGIN_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_BEGIN_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_begin final : public i_event {
|
||||
download_begin() = default;
|
||||
download_begin(std::string api_path_, std::string dest_path_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_begin"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
|
||||
dest_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_begin> {
|
||||
static void to_json(json &data, const repertory::download_begin &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::download_begin &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_BEGIN_HPP_
|
@ -1,80 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_END_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_END_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_end final : public i_event {
|
||||
download_end() = default;
|
||||
download_end(std::string api_path_, std::string dest_path_, api_error error_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_end"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
api_error error{};
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}|error|{}", name, function_name,
|
||||
api_path, dest_path, api_error_to_string(error));
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_end> {
|
||||
static void to_json(json &data, const repertory::download_end &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["error"] = repertory::api_error_to_string(value.error);
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::download_end &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
value.error =
|
||||
repertory::api_error_from_string(data.at("error").get<std::string>());
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_END_HPP_
|
@ -1,79 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_PROGRESS_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_PROGRESS_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_progress final : public i_event {
|
||||
download_progress() = default;
|
||||
download_progress(std::string api_path_, std::string dest_path_,
|
||||
std::string_view function_name_, double progress_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)),
|
||||
progress(progress_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_progress"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string function_name;
|
||||
double progress{};
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}|prog|{}", name, function_name,
|
||||
api_path, dest_path, progress);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_progress> {
|
||||
static void to_json(json &data, const repertory::download_progress &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["function_name"] = value.function_name;
|
||||
data["progress"] = value.progress;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::download_progress &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("progress").get_to<double>(value.progress);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_PROGRESS_HPP_
|
@ -1,81 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORE_FAILED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORE_FAILED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_restore_failed final : public i_event {
|
||||
download_restore_failed() = default;
|
||||
download_restore_failed(std::string api_path_, std::string dest_path_,
|
||||
std::string error_, std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
error(std::move(error_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"download_restore_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string error;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}|error|{}", name, function_name,
|
||||
api_path, dest_path, error);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_restore_failed> {
|
||||
static void to_json(json &data,
|
||||
const repertory::download_restore_failed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["error"] = value.error;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::download_restore_failed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("error").get_to<std::string>(value.error);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORE_FAILED_HPP_
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_restored final : public i_event {
|
||||
download_restored() = default;
|
||||
download_restored(std::string api_path_, std::string dest_path_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_restored"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
|
||||
dest_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_restored> {
|
||||
static void to_json(json &data, const repertory::download_restored &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::download_restored &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESTORED_HPP_
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADD_FAILED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADD_FAILED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_resume_add_failed final : public i_event {
|
||||
download_resume_add_failed() = default;
|
||||
download_resume_add_failed(std::string api_path_, std::string dest_path_,
|
||||
std::string error_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
error(std::move(error_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"download_resume_add_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string error;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}|error|{}", name, function_name,
|
||||
api_path, dest_path, error);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_resume_add_failed> {
|
||||
static void to_json(json &data,
|
||||
const repertory::download_resume_add_failed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["error"] = value.error;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::download_resume_add_failed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("error").get_to<std::string>(value.error);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADD_FAILED_HPP_
|
@ -1,77 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADDED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADDED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_resume_added final : public i_event {
|
||||
download_resume_added() = default;
|
||||
download_resume_added(std::string api_path_, std::string dest_path_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_resume_added"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
|
||||
dest_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_resume_added> {
|
||||
static void to_json(json &data,
|
||||
const repertory::download_resume_added &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::download_resume_added &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_ADDED_HPP_
|
@ -1,77 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_REMOVED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_REMOVED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_resume_removed final : public i_event {
|
||||
download_resume_removed() = default;
|
||||
download_resume_removed(std::string api_path_, std::string dest_path_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_resume_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}", name, function_name, api_path,
|
||||
dest_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_resume_removed> {
|
||||
static void to_json(json &data,
|
||||
const repertory::download_resume_removed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::download_resume_removed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_RESUME_REMOVED_HPP_
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_TYPE_SELECTED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_TYPE_SELECTED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct download_type_selected final : public i_event {
|
||||
download_type_selected() = default;
|
||||
download_type_selected(std::string api_path_, std::string dest_path_,
|
||||
std::string_view function_name_, download_type type_)
|
||||
: api_path(std::move(api_path_)),
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)),
|
||||
type(type_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_type_selected"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
std::string function_name;
|
||||
download_type type{};
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|dp|{}|type|{}", name, function_name,
|
||||
api_path, dest_path, download_type_to_string(type));
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::download_type_selected> {
|
||||
static void to_json(json &data,
|
||||
const repertory::download_type_selected &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["dest_path"] = value.dest_path;
|
||||
data["function_name"] = value.function_name;
|
||||
data["type"] = repertory::download_type_to_string(value.type);
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::download_type_selected &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("dest_path").get_to<std::string>(value.dest_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
value.type = repertory::download_type_from_string(
|
||||
data.at("type").get<std::string>());
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DOWNLOAD_TYPE_SELECTED_HPP_
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_FAILED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_FAILED_HPP_
|
||||
#if defined(_WIN32)
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct drive_mount_failed final : public i_event {
|
||||
drive_mount_failed() = default;
|
||||
drive_mount_failed(NTSTATUS error_, std::string_view function_name_,
|
||||
std::string mount_location_)
|
||||
: error(error_),
|
||||
function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"drive_mount_failed"};
|
||||
|
||||
NTSTATUS error{};
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|location|{}|status|{}", name, function_name,
|
||||
mount_location, error);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::drive_mount_failed> {
|
||||
static void to_json(json &data, const repertory::drive_mount_failed &value) {
|
||||
data["error"] = value.error;
|
||||
data["function_name"] = value.function_name;
|
||||
data["mount_location"] = value.mount_location;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::drive_mount_failed &value) {
|
||||
data.at("error").get_to<NTSTATUS>(value.error);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("mount_location").get_to<std::string>(value.mount_location);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // defined(_WIN32)
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_FAILED_HPP_
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_RESULT_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_RESULT_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct drive_mount_result final : public i_event {
|
||||
drive_mount_result() = default;
|
||||
drive_mount_result(std::string_view function_name_,
|
||||
std::string mount_location_, std::string result_)
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)),
|
||||
result(std::move(result_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_mount_result"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
std::string result;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|location|{}|result|{}", name, function_name,
|
||||
mount_location, result);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::drive_mount_result> {
|
||||
static void to_json(json &data, const repertory::drive_mount_result &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["mount_location"] = value.mount_location;
|
||||
data["result"] = value.result;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::drive_mount_result &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("mount_location").get_to<std::string>(value.mount_location);
|
||||
data.at("result").get_to<std::string>(value.result);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNT_RESULT_HPP_
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNTED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNTED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct drive_mounted final : public i_event {
|
||||
drive_mounted() = default;
|
||||
drive_mounted(std::string_view function_name_, std::string mount_location_)
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_mounted"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|location|{}", name, function_name,
|
||||
mount_location);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::drive_mounted> {
|
||||
static void to_json(json &data, const repertory::drive_mounted &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["mount_location"] = value.mount_location;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::drive_mounted &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("mount_location").get_to<std::string>(value.mount_location);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_MOUNTED_HPP_
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_STOP_TIMED_OUT_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_STOP_TIMED_OUT_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct drive_stop_timed_out final : public i_event {
|
||||
drive_stop_timed_out() = default;
|
||||
drive_stop_timed_out(std::string_view function_name_)
|
||||
: function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"drive_stop_timed_out"};
|
||||
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}", name, function_name);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::drive_stop_timed_out> {
|
||||
static void to_json(json &data,
|
||||
const repertory::drive_stop_timed_out &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::drive_stop_timed_out &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_STOP_TIMED_OUT_HPP_
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNT_PENDING_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNT_PENDING_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct drive_unmount_pending final : public i_event {
|
||||
drive_unmount_pending() = default;
|
||||
drive_unmount_pending(std::string_view function_name_,
|
||||
std::string mount_location_)
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_unmount_pending"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|location|{}", name, function_name,
|
||||
mount_location);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::drive_unmount_pending> {
|
||||
static void to_json(json &data,
|
||||
const repertory::drive_unmount_pending &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["mount_location"] = value.mount_location;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::drive_unmount_pending &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("mount_location").get_to<std::string>(value.mount_location);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNT_PENDING_HPP_
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNTED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNTED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct drive_unmounted final : public i_event {
|
||||
drive_unmounted() = default;
|
||||
drive_unmounted(std::string_view function_name_, std::string mount_location_)
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_unmounted"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|location|{}", name, function_name,
|
||||
mount_location);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::drive_unmounted> {
|
||||
static void to_json(json &data, const repertory::drive_unmounted &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["mount_location"] = value.mount_location;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::drive_unmounted &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("mount_location").get_to<std::string>(value.mount_location);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_DRIVE_UNMOUNTED_HPP_
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_EVENT_LEVEL_CHANGED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_EVENT_LEVEL_CHANGED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct event_level_changed final : public i_event {
|
||||
event_level_changed() = default;
|
||||
event_level_changed(std::string_view function_name_, event_level new_level_)
|
||||
: function_name(std::string(function_name_)), new_level(new_level_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"event_level_changed"};
|
||||
|
||||
std::string function_name;
|
||||
event_level new_level{};
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|level|{}", name, function_name,
|
||||
event_level_to_string(new_level));
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::event_level_changed> {
|
||||
static void to_json(json &data, const repertory::event_level_changed &value) {
|
||||
data["new_level"] = repertory::event_level_to_string(value.new_level);
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::event_level_changed &value) {
|
||||
value.new_level = repertory::event_level_from_string(
|
||||
data.at("new_level").get<std::string>());
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_EVENT_LEVEL_CHANGED_HPP_
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_PINNED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_PINNED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct file_pinned final : public i_event {
|
||||
file_pinned() = default;
|
||||
file_pinned(std::string api_path_, std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_pinned"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::file_pinned> {
|
||||
static void to_json(json &data, const repertory::file_pinned &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::file_pinned &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_PINNED_HPP_
|
@ -1,77 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVE_FAILED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVE_FAILED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct file_remove_failed final : public i_event {
|
||||
file_remove_failed() = default;
|
||||
file_remove_failed(std::string api_path_, api_error error_,
|
||||
std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"file_remove_failed"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|error|{}", name, function_name,
|
||||
api_path, api_error_to_string(error));
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::file_remove_failed> {
|
||||
static void to_json(json &data, const repertory::file_remove_failed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["error"] = repertory::api_error_to_string(value.error);
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::file_remove_failed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
value.error =
|
||||
repertory::api_error_from_string(data.at("error").get<std::string>());
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVE_FAILED_HPP_
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct file_removed final : public i_event {
|
||||
file_removed() = default;
|
||||
file_removed(std::string api_path_, std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"file_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::file_removed> {
|
||||
static void to_json(json &data, const repertory::file_removed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::file_removed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_HPP_
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_EXTERNALLY_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_EXTERNALLY_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct file_removed_externally final : public i_event {
|
||||
file_removed_externally() = default;
|
||||
file_removed_externally(std::string api_path_,
|
||||
std::string_view function_name_,
|
||||
std::string source_path_)
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_removed_externally"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|src|{}", name, function_name, api_path,
|
||||
source_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::file_removed_externally> {
|
||||
static void to_json(json &data,
|
||||
const repertory::file_removed_externally &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["function_name"] = value.function_name;
|
||||
data["source_path"] = value.source_path;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::file_removed_externally &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("source_path").get_to<std::string>(value.source_path);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_REMOVED_EXTERNALLY_HPP_
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UNPINNED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UNPINNED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct file_unpinned final : public i_event {
|
||||
file_unpinned() = default;
|
||||
file_unpinned(std::string api_path_, std::string_view function_name_)
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_unpinned"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}", name, function_name, api_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::file_unpinned> {
|
||||
static void to_json(json &data, const repertory::file_unpinned &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["function_name"] = value.function_name;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::file_unpinned &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UNPINNED_HPP_
|
@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_COMPLETED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_COMPLETED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct file_upload_completed final : public i_event {
|
||||
file_upload_completed() = default;
|
||||
file_upload_completed(std::string api_path_, bool cancelled_,
|
||||
api_error error_, std::string_view function_name_,
|
||||
std::string source_path_)
|
||||
: api_path(std::move(api_path_)),
|
||||
cancelled(cancelled_),
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_upload_completed"};
|
||||
|
||||
std::string api_path;
|
||||
bool cancelled{};
|
||||
api_error error{};
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|cancelled|{}|error|{}|sp|{}", name,
|
||||
function_name, api_path, cancelled,
|
||||
api_error_to_string(error), source_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::file_upload_completed> {
|
||||
static void to_json(json &data,
|
||||
const repertory::file_upload_completed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["cancelled"] = value.cancelled;
|
||||
data["error"] = repertory::api_error_to_string(value.error);
|
||||
data["function_name"] = value.function_name;
|
||||
data["source_path"] = value.source_path;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::file_upload_completed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("cancelled").get_to<bool>(value.cancelled);
|
||||
value.error =
|
||||
repertory::api_error_from_string(data.at("error").get<std::string>());
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("source_path").get_to<std::string>(value.source_path);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_COMPLETED_HPP_
|
@ -1,80 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_FAILED_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_FAILED_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct file_upload_failed final : public i_event {
|
||||
file_upload_failed() = default;
|
||||
file_upload_failed(std::string api_path_, std::string error_,
|
||||
std::string_view function_name_, std::string source_path_)
|
||||
: api_path(std::move(api_path_)),
|
||||
error(std::move(error_)),
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_upload_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string error;
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|ap|{}|error|{}|sp|{}", name, function_name,
|
||||
api_path, error, source_path);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::file_upload_failed> {
|
||||
static void to_json(json &data, const repertory::file_upload_failed &value) {
|
||||
data["api_path"] = value.api_path;
|
||||
data["error"] = value.error;
|
||||
data["function_name"] = value.function_name;
|
||||
data["source_path"] = value.source_path;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::file_upload_failed &value) {
|
||||
data.at("api_path").get_to<std::string>(value.api_path);
|
||||
data.at("error").get_to<std::string>(value.error);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("source_path").get_to<std::string>(value.source_path);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_FILE_UPLOAD_FAILED_HPP_
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user