Skip to content

Commit

Permalink
Merge pull request #70 from saturneric/dev/2.0.8/saturneric
Browse files Browse the repository at this point in the history
Develop 2.0.9.1
  • Loading branch information
saturneric authored Jul 23, 2022
2 parents 3685bb4 + 7e34813 commit b244320
Show file tree
Hide file tree
Showing 114 changed files with 1,344 additions and 1,047 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-10.15', 'windows-latest' ]
os: [ 'ubuntu-latest', 'macos-10.15', 'macos-11', 'macos-12', 'windows-latest' ]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:

- name: Set git to use LF(Windows) or CRLF(MacOS) line endings
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/release-deb-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-20.04' ]
os: [ 'ubuntu-20.04', 'ubuntu-22.04' ]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:

- uses: actions/checkout@v2
Expand All @@ -35,6 +36,22 @@ jobs:
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: Install Dependence (Ubuntu 18.04)
run: |
sudo apt-get update
sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo qt5-default
sudo apt-get -y install gcc-8 g++-8 ninja-build
sudo apt-get -y install libconfig++-dev libboost-all-dev libarchive-dev libssl-dev
sudo apt-get -y install gpgsm libxcb-xinerama0 libxcb-icccm4-dev libcups2-dev libdrm-dev libegl1-mesa-dev
sudo apt-get -y install libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev libxtst-dev gyp
sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxcb-image0
sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxcb-*
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
sudo update-alternatives --set gcc "/usr/bin/gcc-8"
sudo update-alternatives --set g++ "/usr/bin/g++-8"
if: matrix.os == 'ubuntu-18.04'

- name: Install Dependence (Ubuntu 20.04)
run: |
sudo apt-get update
Expand All @@ -44,14 +61,23 @@ jobs:
sudo apt-get -y install gpg
if: matrix.os == 'ubuntu-20.04'

- name: Install Dependence (Ubuntu 22.04)
run: |
sudo apt-get update
sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
sudo apt-get -y install gcc g++ ninja-build
sudo apt-get -y install libarchive-dev libconfig++-dev libboost-all-dev libssl-dev
sudo apt-get -y install gpg
if: matrix.os == 'ubuntu-22.04'

- name: Build gpg-error (Linux)
run: |
cd ${{github.workspace}}/third_party/libgpg-error
./autogen.sh
./configure --enable-maintainer-mode --enable-static=yes && make -j2
sudo make install
cd ${{github.workspace}}
if: matrix.os == 'ubuntu-20.04'
- name: Build assuan (Linux)
run: |
Expand All @@ -60,7 +86,6 @@ jobs:
./configure --enable-maintainer-mode && make -j2
sudo make install
cd ${{github.workspace}}
if: matrix.os == 'ubuntu-20.04'
- name: Build GpgME (Linux)
run: |
Expand All @@ -69,7 +94,6 @@ jobs:
./configure --enable-maintainer-mode --enable-languages=cpp && make -j2
sudo make install
cd ${{github.workspace}}
if: matrix.os == 'ubuntu-20.04'
- name: Build & Package GpgFrontend (Linux DEB Package)
# Build your program with the given configuration
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
os: [ 'ubuntu-18.04', 'macos-10.15', 'macos-11', 'macos-12', 'windows-2019' ]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: Set git to use LF(Windows) or CRLF(MacOS) line endings
run: |
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
cmake_minimum_required(VERSION 3.16)

# define project
project(GpgFrontend VERSION 2.0.8 LANGUAGES CXX)
project(GpgFrontend VERSION 2.0.9 LANGUAGES CXX)

# show cmake version
message(STATUS "GpgFrontend Build Configuration Started CMAKE Version ${CMAKE_VERSION}")
Expand Down Expand Up @@ -433,7 +433,7 @@ find_package(OpenSSL REQUIRED)
# Introduce Qt
if (QT5_ENV_SUPPORT)
# Support Qt version Both 5.12.x and 5.15.x
find_package(Qt5 5.12 COMPONENTS Core Test Widgets PrintSupport Network REQUIRED)
find_package(Qt5 5.9 COMPONENTS Core Test Widgets PrintSupport Network REQUIRED)

# Qt configuration
set(CMAKE_AUTOMOC ON)
Expand Down
1 change: 1 addition & 0 deletions gpgfrontend.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<file alias="format-line-spacing-double.png">resource/icons/format-line-spacing-double.png</file>
<file alias="format-line-spacing-normal.png">resource/icons/format-line-spacing-normal.png</file>
<file alias="format-line-spacing-triple.png">resource/icons/format-line-spacing-triple.png</file>
<file alias="gnupg.png">resource/icons/gnupg.png</file>
<file alias="gpgfrontend.png">resource/icons/gpgfrontend.png</file>
<file alias="importance.png">resource/icons/importance.png</file>
<file alias="importkey_editor.png">resource/icons/importkey_editor.png</file>
Expand Down
Binary file added resource/icons/gnupg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 37 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ if (BASIC_ENV_CONFIG)
configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontend.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h @ONLY)
if(APPLE)
if (APPLE)
configure_file(${CMAKE_SOURCE_DIR}/resource/plist/ExportOptions.plist.in ${CMAKE_BINARY_DIR}/ExportOptions.plist @ONLY)
endif ()
endif ()
Expand Down Expand Up @@ -183,7 +183,7 @@ if (APPLICATION_BUILD)
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
if (MINGW)
add_executable(${AppName} WIN32 ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
# custom app bundle packing
# custom app bundle packing
elseif (APPLE AND NOT XCODE_BUILD)
add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
set_target_properties(${AppName} PROPERTIES
Expand Down Expand Up @@ -212,7 +212,7 @@ if (APPLICATION_BUILD)
COMMAND /bin/mkdir -p ./gpgfrontend/usr/lib
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
COMMENT "Complement to build the required architecture")
# app bundle packing using xcode
# app bundle packing using xcode
elseif (APPLE AND XCODE_BUILD)
add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
set_target_properties(${AppName} PROPERTIES
Expand Down Expand Up @@ -272,10 +272,10 @@ if (APPLICATION_BUILD)
message(STATUS "Link Application Library For Linux")
target_link_libraries(${AppName} crypto pthread)
# issue on filesystem support of gcc
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9.0)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9.0)
target_link_libraries(${AppName} stdc++fs)
endif ()
endif()
endif ()
endif ()

# using c++ standard 17
Expand Down Expand Up @@ -314,6 +314,14 @@ if (LINUX AND LINUX_INSTALL_SOFTWARE)
install(DIRECTORY ${LOCALE_OUTPUT_PATH}/
DESTINATION ${CMAKE_INSTALL_FULL_LOCALEDIR})
endif ()

cmake_host_system_information(RESULT PRETTY_NAME QUERY DISTRIB_PRETTY_NAME)
cmake_host_system_information(RESULT DISTRO QUERY DISTRIB_INFO)

foreach(VAR IN LISTS DISTRO)
message(STATUS "${VAR}=`${${VAR}}`")
endforeach()

if (APP_PACKAGE_DEB)
message(STATUS "Configure Deb Package")
SET(CPACK_GENERATOR "DEB")
Expand All @@ -323,7 +331,30 @@ if (LINUX AND LINUX_INSTALL_SOFTWARE)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_PACKAGE_CONTACT "[email protected]")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Saturneric")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "gpg (>= 2.2), libqt5core5a (>= 5.9), libqt5gui5 (>= 5.9), libqt5widgets5 (>= 5.9), libqt5network5 (>= 5.9), libqt5printsupport5 (>= 5.9), libconfig++9v5 (>=1.5), libarchive13(>= 3.4), openssl(>= 1.1.1), libicu66")

if (${DISTRO_NAME} MATCHES "Ubuntu")
if (${DISTRO_VERSION_ID} STREQUAL "22.04")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "gpg (>= 2.2), libqt5core5a (>= 5.9), libqt5gui5 (>= 5.9), libqt5widgets5 (>= 5.9), libqt5network5 (>= 5.9), libqt5printsupport5 (>= 5.9), libconfig++9v5 (>=1.5), libarchive13(>= 3.4), openssl(>= 1.1.1), libicu70")
elseif (${DISTRO_VERSION_ID} STREQUAL "20.04")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "gpg (>= 2.2), libqt5core5a (>= 5.9), libqt5gui5 (>= 5.9), libqt5widgets5 (>= 5.9), libqt5network5 (>= 5.9), libqt5printsupport5 (>= 5.9), libconfig++9v5 (>=1.5), libarchive13(>= 3.4), openssl(>= 1.1.1), libicu66")
endif ()
endif ()

set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
include(CPack)
endif ()
if (APP_PACKAGE_RPM)
message(STATUS "Configure Rpm Package")
SET(CPACK_GENERATOR "RPM")
set(CPACK_INSTALL_PREFIX "/usr/local/")
set(CPACK_PACKAGE_NAME "gpgfrontend")
set(CPACK_DEBIAN_PACKAGE_NAME "gpgfrontend")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_PACKAGE_CONTACT "[email protected]")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Saturneric")

set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
Expand Down
4 changes: 1 addition & 3 deletions src/before_exit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,4 @@
* @brief Actions performed before exiting the application
*
*/
void before_exit() {
LOG(INFO) << "called";
}
void before_exit() { LOG(INFO) << "called"; }
6 changes: 3 additions & 3 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ aux_source_directory(${CMAKE_SOURCE_DIR}/third_party/encoding-detect ENCODING_DE
target_sources(gpgfrontend_core PUBLIC ${ENCODING_DETECT_SOURCE_CODE})

# icu
if(APPLE)
if (APPLE)
target_include_directories(gpgfrontend_core PRIVATE /usr/local/opt/icu4c/include)
target_link_directories(gpgfrontend_core PRIVATE /usr/local/opt/icu4c/lib)
target_link_libraries(gpgfrontend_core PRIVATE icui18n icuuc icudata)
Expand All @@ -77,10 +77,10 @@ target_link_libraries(gpgfrontend_core PRIVATE gpgme assuan gpg-error)
target_link_libraries(gpgfrontend_core PUBLIC OpenSSL::SSL OpenSSL::Crypto)
# link boost libraries
target_link_libraries(gpgfrontend_core PUBLIC ${Boost_LIBRARIES})
if(MINGW)
if (MINGW)
# for uuid ability in mingw
target_link_libraries(gpgfrontend_core PUBLIC bcrypt)
endif()
endif ()

# link libarchive
target_link_libraries(gpgfrontend_core PRIVATE archive)
Expand Down
5 changes: 4 additions & 1 deletion src/core/GpgContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ GpgContext::GpgContext(const GpgContextInitArgs &args) : args_(args) {
: engine_info->file_name)
<< std::string(engine_info->home_dir == nullptr
? "null"
: engine_info->home_dir);
: engine_info->home_dir)
<< std::string(engine_info->version ? "null"
: engine_info->version);

switch (engine_info->protocol) {
case GPGME_PROTOCOL_OpenPGP:
Expand All @@ -110,6 +112,7 @@ GpgContext::GpgContext(const GpgContextInitArgs &args) : args_(args) {
info_.GpgConfPath = engine_info->file_name;
break;
case GPGME_PROTOCOL_ASSUAN:
info_.AssuanPath = engine_info->file_name;
break;
case GPGME_PROTOCOL_G13:
break;
Expand Down
1 change: 1 addition & 0 deletions src/core/GpgInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class GpgInfo {
std::string DatabasePath; ///<
std::string GnupgVersion; ///<
std::string GpgConfPath; ///<
std::string AssuanPath; ///<
std::string CMSPath; ///<
std::string GpgMEVersion; ///<
};
Expand Down
12 changes: 6 additions & 6 deletions src/core/function/ArchiveFileOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ void GpgFrontend::ArchiveFileOperator::CreateArchive(

#ifdef WINDOWS
auto entry_path =
QString::fromStdWString(std::wstring(archive_entry_pathname_w(entry))).toUtf8()
QString::fromStdWString(std::wstring(archive_entry_pathname_w(entry)))
.toUtf8()
.toStdString();
#else
auto entry_path = std::string(archive_entry_pathname_utf8(entry));
Expand All @@ -161,7 +162,6 @@ void GpgFrontend::ArchiveFileOperator::CreateArchive(
<< archive_entry_size(entry) << " bytes"
<< "file type" << archive_entry_filetype(entry);


r = archive_write_header(a, entry);
if (r < ARCHIVE_OK) {
LOG(ERROR) << "archive_write_header() failed: "
Expand Down Expand Up @@ -231,11 +231,11 @@ void GpgFrontend::ArchiveFileOperator::ExtractArchive(
LOG(ERROR) << "cannot read from stdin";
}
#ifdef WINDOWS
if (archive_read_open_filename_w(a, archive_path.wstring().c_str(),
10240) != ARCHIVE_OK) {
if (archive_read_open_filename_w(a, archive_path.wstring().c_str(), 10240) !=
ARCHIVE_OK) {
#else
if (archive_read_open_filename(a, archive_path.u8string().c_str(),
10240) != ARCHIVE_OK) {
if (archive_read_open_filename(a, archive_path.u8string().c_str(), 10240) !=
ARCHIVE_OK) {
#endif
LOG(ERROR) << "archive_read_open_filename() failed: "
<< archive_error_string(a);
Expand Down
10 changes: 4 additions & 6 deletions src/core/function/ArchiveFileOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ class GPGFRONTEND_CORE_EXPORT ArchiveFileOperator {
public:
static void ListArchive(const std::filesystem::path &archive_path);

static void CreateArchive(
const std::filesystem::path &base_path,
const std::filesystem::path &archive_path,
static void CreateArchive(const std::filesystem::path &base_path,
const std::filesystem::path &archive_path,
int compress,
const std::vector<std::filesystem::path> &files);

static void ExtractArchive(
const std::filesystem::path &archive_path,
const std::filesystem::path &base_path);
static void ExtractArchive(const std::filesystem::path &archive_path,
const std::filesystem::path &base_path);
};
} // namespace GpgFrontend

Expand Down
1 change: 1 addition & 0 deletions src/core/function/DataObjectOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "DataObjectOperator.h"

#include <qt-aes/qaesencryption.h>

#include <boost/date_time.hpp>

#include "core/function/FileOperator.h"
Expand Down
Loading

0 comments on commit b244320

Please sign in to comment.