cryfs: un-vendor, build with None build type

This commit is contained in:
Đoàn Trần Công Danh 2021-03-15 23:26:33 +07:00
parent 24bc38de36
commit 203bdffbe1
6 changed files with 319 additions and 3 deletions

View file

@ -0,0 +1,33 @@
Index: cryfs-0.10.2/doc/CMakeLists.txt
===================================================================
--- cryfs-0.10.2.orig/doc/CMakeLists.txt
+++ cryfs-0.10.2/doc/CMakeLists.txt
@@ -15,6 +15,5 @@ ELSE (WIN32)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cryfs.1.gz
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
- CONFIGURATIONS Release
)
ENDIF(WIN32)
Index: cryfs-0.10.2/src/cryfs-cli/CMakeLists.txt
===================================================================
--- cryfs-0.10.2.orig/src/cryfs-cli/CMakeLists.txt
+++ cryfs-0.10.2/src/cryfs-cli/CMakeLists.txt
@@ -27,6 +27,5 @@ target_enable_style_warnings(${PROJECT_N
target_activate_cpp14(${PROJECT_NAME}_bin)
install(TARGETS ${PROJECT_NAME}_bin
- CONFIGURATIONS Debug Release RelWithDebInfo
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
Index: cryfs-0.10.2/src/cryfs-unmount/CMakeLists.txt
===================================================================
--- cryfs-0.10.2.orig/src/cryfs-unmount/CMakeLists.txt
+++ cryfs-0.10.2/src/cryfs-unmount/CMakeLists.txt
@@ -19,6 +19,5 @@ target_enable_style_warnings(${PROJECT_N
target_activate_cpp14(${PROJECT_NAME}_bin)
install(TARGETS ${PROJECT_NAME}_bin
- CONFIGURATIONS Debug Release RelWithDebInfo
DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View file

@ -0,0 +1,180 @@
Index: cryfs-0.10.2/src/blockstore/implementations/compressing/compressors/Gzip.cpp
===================================================================
--- cryfs-0.10.2.orig/src/blockstore/implementations/compressing/compressors/Gzip.cpp
+++ cryfs-0.10.2/src/blockstore/implementations/compressing/compressors/Gzip.cpp
@@ -1,6 +1,6 @@
#include "cpp-utils/crypto/cryptopp_byte.h"
#include "Gzip.h"
-#include <vendor_cryptopp/gzip.h>
+#include <cryptopp/gzip.h>
using cpputils::Data;
Index: cryfs-0.10.2/src/cpp-utils/crypto/cryptopp_byte.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/crypto/cryptopp_byte.h
+++ cryfs-0.10.2/src/cpp-utils/crypto/cryptopp_byte.h
@@ -2,7 +2,7 @@
#ifndef _CPPUTILS_CRYPTO_CRYPTOPP_BYTE_H
#define _CPPUTILS_CRYPTO_CRYPTOPP_BYTE_H
-#include <vendor_cryptopp/cryptlib.h>
+#include <cryptopp/cryptlib.h>
// If we're running an older CryptoPP version, CryptoPP::byte isn't defined yet.
// Define it. Refer to "byte" type in the global namespace (placed by CryptoPP).
Index: cryfs-0.10.2/src/cpp-utils/crypto/hash/Hash.cpp
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/crypto/hash/Hash.cpp
+++ cryfs-0.10.2/src/cpp-utils/crypto/hash/Hash.cpp
@@ -1,6 +1,6 @@
#include "Hash.h"
#include <cpp-utils/random/Random.h>
-#include <vendor_cryptopp/sha.h>
+#include <cryptopp/sha.h>
using cpputils::Random;
using CryptoPP::SHA512;
Index: cryfs-0.10.2/src/cpp-utils/crypto/kdf/Scrypt.cpp
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/crypto/kdf/Scrypt.cpp
+++ cryfs-0.10.2/src/cpp-utils/crypto/kdf/Scrypt.cpp
@@ -1,5 +1,5 @@
#include "Scrypt.h"
-#include <vendor_cryptopp/scrypt.h>
+#include <cryptopp/scrypt.h>
using std::string;
Index: cryfs-0.10.2/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
+++ cryfs-0.10.2/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
@@ -7,7 +7,7 @@
#include "../../data/Data.h"
#include "../../random/Random.h"
#include <boost/optional.hpp>
-#include <vendor_cryptopp/modes.h>
+#include <cryptopp/modes.h>
#include "Cipher.h"
#include "EncryptionKey.h"
Index: cryfs-0.10.2/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
+++ cryfs-0.10.2/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
@@ -6,7 +6,7 @@
#include "../../data/FixedSizeData.h"
#include "../../data/Data.h"
#include "../../random/Random.h"
-#include <vendor_cryptopp/gcm.h>
+#include <cryptopp/gcm.h>
#include "Cipher.h"
#include "EncryptionKey.h"
Index: cryfs-0.10.2/src/cpp-utils/crypto/symmetric/ciphers.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/crypto/symmetric/ciphers.h
+++ cryfs-0.10.2/src/cpp-utils/crypto/symmetric/ciphers.h
@@ -2,11 +2,11 @@
#ifndef MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CIPHERS_H_
#define MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CIPHERS_H_
-#include <vendor_cryptopp/aes.h>
-#include <vendor_cryptopp/twofish.h>
-#include <vendor_cryptopp/serpent.h>
-#include <vendor_cryptopp/cast.h>
-#include <vendor_cryptopp/mars.h>
+#include <cryptopp/aes.h>
+#include <cryptopp/twofish.h>
+#include <cryptopp/serpent.h>
+#include <cryptopp/cast.h>
+#include <cryptopp/mars.h>
#include "GCM_Cipher.h"
#include "CFB_Cipher.h"
Index: cryfs-0.10.2/src/cpp-utils/data/Data.cpp
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/data/Data.cpp
+++ cryfs-0.10.2/src/cpp-utils/data/Data.cpp
@@ -1,6 +1,6 @@
#include "Data.h"
#include <stdexcept>
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <cpp-utils/crypto/cryptopp_byte.h>
using std::istream;
Index: cryfs-0.10.2/src/cpp-utils/data/FixedSizeData.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/data/FixedSizeData.h
+++ cryfs-0.10.2/src/cpp-utils/data/FixedSizeData.h
@@ -2,7 +2,7 @@
#ifndef MESSMER_CPPUTILS_DATA_FIXEDSIZEDATA_H_
#define MESSMER_CPPUTILS_DATA_FIXEDSIZEDATA_H_
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <string>
#include <cstring>
#include "../assert/assert.h"
Index: cryfs-0.10.2/src/cpp-utils/random/OSRandomGenerator.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/random/OSRandomGenerator.h
+++ cryfs-0.10.2/src/cpp-utils/random/OSRandomGenerator.h
@@ -4,7 +4,7 @@
#include "cpp-utils/crypto/cryptopp_byte.h"
#include "RandomGenerator.h"
-#include <vendor_cryptopp/osrng.h>
+#include <cryptopp/osrng.h>
namespace cpputils {
class OSRandomGenerator final : public RandomGenerator {
Index: cryfs-0.10.2/src/cpp-utils/random/RandomGeneratorThread.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/random/RandomGeneratorThread.h
+++ cryfs-0.10.2/src/cpp-utils/random/RandomGeneratorThread.h
@@ -4,7 +4,7 @@
#include "../thread/LoopThread.h"
#include "ThreadsafeRandomDataBuffer.h"
-#include <vendor_cryptopp/osrng.h>
+#include <cryptopp/osrng.h>
namespace cpputils {
//TODO Test
Index: cryfs-0.10.2/src/cryfs/localstate/BasedirMetadata.cpp
===================================================================
--- cryfs-0.10.2.orig/src/cryfs/localstate/BasedirMetadata.cpp
+++ cryfs-0.10.2/src/cryfs/localstate/BasedirMetadata.cpp
@@ -1,7 +1,7 @@
#include "BasedirMetadata.h"
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
-#include <vendor_cryptopp/sha.h>
+#include <cryptopp/sha.h>
#include <boost/filesystem/operations.hpp>
#include "LocalStateDir.h"
#include <cpp-utils/logging/logging.h>
Index: cryfs-0.10.2/test/cryfs/config/CompatibilityTest.cpp
===================================================================
--- cryfs-0.10.2.orig/test/cryfs/config/CompatibilityTest.cpp
+++ cryfs-0.10.2/test/cryfs/config/CompatibilityTest.cpp
@@ -3,7 +3,7 @@
#include <vector>
#include <boost/filesystem.hpp>
#include <cpp-utils/data/Data.h>
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <cpp-utils/crypto/symmetric/ciphers.h>
#include <cpp-utils/tempfile/TempFile.h>
#include <cryfs/config/CryConfigFile.h>
Index: cryfs-0.10.2/vendor/CMakeLists.txt
===================================================================
--- cryfs-0.10.2.orig/vendor/CMakeLists.txt
+++ cryfs-0.10.2/vendor/CMakeLists.txt
@@ -1,3 +1 @@
add_subdirectory(googletest)
-add_subdirectory(spdlog)
-add_subdirectory(cryptopp)

View file

@ -0,0 +1,22 @@
Index: cryfs-0.10.2/test/cpp-utils/logging/testutils/LoggingTest.h
===================================================================
--- cryfs-0.10.2.orig/test/cpp-utils/logging/testutils/LoggingTest.h
+++ cryfs-0.10.2/test/cpp-utils/logging/testutils/LoggingTest.h
@@ -11,8 +11,7 @@ class MockLogger final {
public:
MockLogger():
_capturedLogData(),
- _sink(std::make_shared<spdlog::sinks::ostream_sink<std::mutex>>(_capturedLogData, true)),
- _logger(spdlog::create("MockLogger", {_sink})) {
+ _logger(spdlog::create<spdlog::sinks::ostream_sink_mt>("MockLogger", _capturedLogData, true)) {
}
~MockLogger() {
@@ -28,7 +27,6 @@ public:
}
private:
std::ostringstream _capturedLogData;
- std::shared_ptr<spdlog::sinks::ostream_sink<std::mutex>> _sink;
std::shared_ptr<spdlog::logger> _logger;
};

View file

@ -0,0 +1,21 @@
Index: cryfs-0.10.2/src/cryfs-cli/Cli.cpp
===================================================================
--- cryfs-0.10.2.orig/src/cryfs-cli/Cli.cpp
+++ cryfs-0.10.2/src/cryfs-cli/Cli.cpp
@@ -27,6 +27,7 @@
#include "Environment.h"
#include <cryfs/CryfsException.h>
#include <cpp-utils/thread/debugging.h>
+#include <spdlog/sinks/basic_file_sink.h>
//TODO Many functions accessing the ProgramOptions object. Factor out into class that stores it as a member.
//TODO Factor out class handling askPassword
@@ -310,7 +311,7 @@ namespace cryfs_cli {
//TODO Test that --logfile parameter works. Should be: file if specified, otherwise stderr if foreground, else syslog.
if (options.logFile() != none) {
cpputils::logging::setLogger(
- spdlog::create<spdlog::sinks::simple_file_sink<std::mutex>>("cryfs", options.logFile()->string()));
+ spdlog::create<spdlog::sinks::basic_file_sink<std::mutex>>("cryfs", options.logFile()->string()));
} else if (options.foreground()) {
cpputils::logging::setLogger(spdlog::stderr_logger_mt("cryfs"));
} else {

View file

@ -0,0 +1,33 @@
Index: cryfs-0.10.2/src/cpp-utils/logging/Logger.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/logging/Logger.h
+++ cryfs-0.10.2/src/cpp-utils/logging/Logger.h
@@ -7,6 +7,7 @@
#endif
#include <spdlog/spdlog.h>
+#include <spdlog/sinks/stdout_sinks.h>
#include "../macros.h"
namespace cpputils {
Index: cryfs-0.10.2/src/cpp-utils/logging/logging.h
===================================================================
--- cryfs-0.10.2.orig/src/cpp-utils/logging/logging.h
+++ cryfs-0.10.2/src/cpp-utils/logging/logging.h
@@ -5,6 +5,7 @@
#include "Logger.h"
#include <stdexcept>
#include <spdlog/fmt/ostr.h>
+#include <spdlog/sinks/syslog_sink.h>
#if defined(_MSC_VER)
#include <spdlog/sinks/msvc_sink.h>
@@ -75,7 +76,7 @@ namespace cpputils {
#if defined(_MSC_VER)
return spdlog::create<spdlog::sinks::msvc_sink_mt>(name);
#else
- return spdlog::syslog_logger(name, name, LOG_PID);
+ return spdlog::syslog_logger_mt(name, name, LOG_PID);
#endif
}
}

View file

@ -4,9 +4,11 @@ version=0.10.2
revision=1
create_wrksrc=yes
build_style=cmake
configure_args="-DCRYFS_UPDATE_CHECKS=off"
hostmakedepends="git python"
makedepends="boost-devel fuse-devel libcurl-devel libgomp-devel"
configure_args="-DCRYFS_UPDATE_CHECKS=off -DCMAKE_BUILD_TYPE=None
-DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_STANDARD_LIBRARIES=-lfmt"
hostmakedepends="pkg-config python3"
makedepends="boost-devel fuse-devel libcurl-devel libgomp-devel crypto++-devel
spdlog"
depends="fuse"
short_desc="Cryptographic filesystem for the cloud"
maintainer="Andy Weidenbaum <atweiden@tutanota.de>"
@ -15,7 +17,32 @@ homepage="https://www.cryfs.org"
changelog="https://github.com/cryfs/cryfs/raw/master/ChangeLog.txt"
distfiles="https://github.com/cryfs/cryfs/releases/download/${version}/${pkgname}-${version}.tar.gz"
checksum=004c7fdf537062e197aaa0bcdafd2682904a279802441bb6063cb72c1fba52d2
patch_args=-Np1
if [ "${XBPS_CHECK_PKGS}" ]; then
configure_args+=" -DBUILD_TESTING=on"
fi
post_patch() {
rm -rf vendor/cryptopp
rm -rf vendor/spdlog
}
pre_configure() {
local _pkg_config="$($PKG_CONFIG --cflags spdlog)"
CFLAGS+=" $_pkg_config"
CXXFLAGS+=" $_pkg_config"
}
do_check() {
cd ${wrksrc}/build
# XXX: check their Travis-CI script on update
./test/gitversion/gitversion-test
./test/cpp-utils/cpp-utils-test
./test/parallelaccessstore/parallelaccessstore-test
./test/blockstore/blockstore-test
./test/blobstore/blobstore-test
./test/cryfs/cryfs-test
# ./test/cryfs-cli/cryfs-cli-test
cd ${wrksrc}
}