diff options
author | Saturneric <[email protected]> | 2022-05-07 18:19:28 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-05-07 18:47:03 +0000 |
commit | 038bfab9a5f1e616891286b8d735d5b72c26c87b (patch) | |
tree | 761a5a93a756cf9e92a7dca6c674183da965a842 | |
parent | fix: add GenerateExportHeader for all platfrom (diff) | |
download | GpgFrontend-038bfab9a5f1e616891286b8d735d5b72c26c87b.tar.gz GpgFrontend-038bfab9a5f1e616891286b8d735d5b72c26c87b.zip |
fix: use custom build gpgme lib
1. gpgme version of apt is too old.
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 27 | ||||
-rw-r--r-- | .github/workflows/debug.yml | 29 | ||||
-rw-r--r-- | .github/workflows/release-deb-package.yml | 29 | ||||
-rw-r--r-- | .github/workflows/release.yml | 47 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 13 | ||||
-rw-r--r-- | src/core/GpgFrontendCoreExport.h | 42 |
6 files changed, 172 insertions, 15 deletions
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 31588de3..f196e58c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -63,8 +63,33 @@ jobs: sudo apt-get update sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo sudo apt-get -y install gcc g++ ninja-build - sudo apt-get -y install libarchive-dev libconfig++-dev libboost-all-dev libgpgme-dev + sudo apt-get -y install libarchive-dev libconfig++-dev libboost-all-dev sudo apt-get -y install gpg + + - name: Build gpg-error (Linux) + run: | + cd ${{github.workspace}}/third_party/libgpg-error + ./autogen.sh + ./configure --enable-maintainer-mode && make -j2 + sudo make install + cd ${{github.workspace}} + + - name: Build assuan (Linux) + run: | + cd ${{github.workspace}}/third_party/libassuan + ./autogen.sh + ./configure --enable-maintainer-mode && make -j2 + sudo make install + cd ${{github.workspace}} + + - name: Build GpgME (Linux) + run: | + cd ${{github.workspace}}/third_party/gpgme + ./autogen.sh + ./configure --enable-maintainer-mode --enable-languages=cpp && make -j2 + sudo make install + cd ${{github.workspace}} + - name: Cache Qt id: cache-qt uses: actions/cache@v1 diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index d3d7ac41..29598935 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -42,7 +42,7 @@ jobs: sudo apt-get update sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo sudo apt-get -y install gcc g++ ninja-build - sudo apt-get -y install libarchive-dev libconfig++-dev libboost-all-dev libgpgme-dev + sudo apt-get -y install libarchive-dev libconfig++-dev libboost-all-dev sudo apt-get -y install gpg if: matrix.os == 'ubuntu-latest' @@ -69,6 +69,33 @@ jobs: brew link [email protected] --force if: matrix.os == 'macos-10.15' + - name: Build gpg-error (Linux) + run: | + cd ${{github.workspace}}/third_party/libgpg-error + ./autogen.sh + ./configure --enable-maintainer-mode && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-latest' + + - name: Build assuan (Linux) + run: | + cd ${{github.workspace}}/third_party/libassuan + ./autogen.sh + ./configure --enable-maintainer-mode && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-latest' + + - name: Build GpgME (Linux) + run: | + cd ${{github.workspace}}/third_party/gpgme + ./autogen.sh + ./configure --enable-maintainer-mode --enable-languages=cpp && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-latest' + - name: Cache Qt id: cache-qt uses: actions/cache@v1 diff --git a/.github/workflows/release-deb-package.yml b/.github/workflows/release-deb-package.yml index b25ec355..c0332d96 100644 --- a/.github/workflows/release-deb-package.yml +++ b/.github/workflows/release-deb-package.yml @@ -40,10 +40,37 @@ jobs: 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 g++ ninja-build - sudo apt-get -y install libarchive-dev libconfig++-dev libboost-all-dev libgpgme-dev + sudo apt-get -y install libarchive-dev libconfig++-dev libboost-all-dev sudo apt-get -y install gpg if: matrix.os == 'ubuntu-20.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: | + cd ${{github.workspace}}/third_party/libassuan + ./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 GpgME (Linux) + run: | + cd ${{github.workspace}}/third_party/gpgme + ./autogen.sh + ./configure --enable-maintainer-mode --enable-languages=cpp --enable-static=yes && 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 run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd01a54d..efa4c263 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,14 +23,14 @@ jobs: build: strategy: matrix: - os: [ 'ubuntu-18.04', 'macos-11', 'windows-2019' ] + os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ] runs-on: ${{ matrix.os }} steps: - name: Set git to use LF(Windows) or CRLF(MacOS) line endings run: | git config --global core.autocrlf false git config --global core.eol lf - if: matrix.os == 'windows-2019' || matrix.os == 'macos-11' + if: matrix.os == 'windows-2019' || matrix.os == 'macos-10.15' - uses: actions/checkout@v2 with: @@ -45,7 +45,7 @@ jobs: sudo apt-get update sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo sudo apt-get -y install gcc-8 g++-8 ninja-build - sudo apt-get -y install libconfig++-dev libboost-all-dev libarchive-dev libgpgme-dev + sudo apt-get -y install libconfig++-dev libboost-all-dev libarchive-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 @@ -65,7 +65,7 @@ jobs: security import certificate.p12 -k build.keychain -P ${{secrets.MAOS_CERTIFICATE_PWD}} -T /usr/bin/codesign security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k gpgfrontend build.keychain security set-keychain-settings -lut 3600 - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-10.15' - name: Install Dependence (macOS) run: | @@ -74,7 +74,34 @@ jobs: brew unlink gettext && brew link --force gettext brew link qt@5 brew link [email protected] --force - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-10.15' + + - name: Build gpg-error (Linux) + run: | + cd ${{github.workspace}}/third_party/libgpg-error + ./autogen.sh + ./configure --enable-maintainer-mode && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-18.04' + + - name: Build assuan (Linux) + run: | + cd ${{github.workspace}}/third_party/libassuan + ./autogen.sh + ./configure --enable-maintainer-mode && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-18.04' + + - name: Build GpgME (Linux) + run: | + cd ${{github.workspace}}/third_party/gpgme + ./autogen.sh + ./configure --enable-maintainer-mode --enable-languages=cpp && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-18.04' - name: Cache Qt id: cache-qt @@ -127,7 +154,7 @@ jobs: run: | cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DOPENSSL_ROOT_DIR=/usr/local/opt/[email protected] cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-10.15' - name: Build & Sign App Bundle (macOS) run: | @@ -135,7 +162,7 @@ jobs: macdeployqt ${{github.workspace}}/build/release/GpgFrontend.app codesign --deep --force --options=runtime -s "Developer ID Application: Yu Hu (4279AWUL3X)" ${{github.workspace}}/build/release/GpgFrontend.app -v mkdir ${{github.workspace}}/build/tmp/ - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-10.15' - name: Package & Sign App Bundle (macOS) run: | @@ -145,12 +172,12 @@ jobs: hdiutil convert ${{github.workspace}}/build/tmp/tmp.dmg -format UDZO -o ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg codesign -s "Developer ID Application: Yu Hu (4279AWUL3X)" ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg mv ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg ${{github.workspace}}/build/artifactOut/GpgFrontend-${{steps.vars.outputs.sha_short}}-x86_64.dmg - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-10.15' - name: Notarize Release Build (macOS) run: | xcrun altool --notarize-app -f ${{github.workspace}}/build/artifactOut/GpgFrontend-${{steps.vars.outputs.sha_short}}-x86_64.dmg --primary-bundle-id pub.gpgfrontend.gpgfrontend -u ${{secrets.APPLE_DEVELOPER_ID}} -p ${{secrets.APPLE_DEVELOPER_ID_SECRET}} - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-10.15' - name: Package App Image (Linux) run: | @@ -183,7 +210,7 @@ jobs: with: name: gpgfrontend-${{matrix.os}}-${{env.BUILD_TYPE}}-${{steps.vars.outputs.sha_short}} path: ${{github.workspace}}/build/artifactOut/* - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-10.15' - name: Upload Artifact(Windows) uses: actions/upload-artifact@master diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 78f0b546..81078d4f 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -50,8 +50,17 @@ target_include_directories(gpgfrontend_core PUBLIC ${CMAKE_SOURCE_DIR}/third_party/easyloggingpp/src) target_sources(gpgfrontend_core PUBLIC ${CMAKE_SOURCE_DIR}/third_party/easyloggingpp/src/easylogging++.cc) -# link gnupg libraries -target_link_libraries(gpgfrontend_core gpgme assuan gpg-error) + +if(LINUX AND GPGFRONTEND_GENERATE_LINUX_INSTALL_SOFTWARE) + # froce to link gnupg static libraries for deb + find_library(GPG_ERROR_LIB libgpg-error.a) + find_library(ASSUAN_LIB libassuan.a) + find_library(GPGME_LIB libgpgme.a) + target_link_libraries(gpgfrontend_core ${GPGME_LIB} ${ASSUAN_LIB} ${GPG_ERROR_LIB}) +else() + # link gnupg libraries + target_link_libraries(gpgfrontend_core gpgme assuan gpg-error) +endif() # link openssl target_link_libraries(gpgfrontend_core OpenSSL::SSL OpenSSL::Crypto) # link Qt AES diff --git a/src/core/GpgFrontendCoreExport.h b/src/core/GpgFrontendCoreExport.h new file mode 100644 index 00000000..1422bddb --- /dev/null +++ b/src/core/GpgFrontendCoreExport.h @@ -0,0 +1,42 @@ + +#ifndef GPGFRONTEND_CORE_EXPORT_H +#define GPGFRONTEND_CORE_EXPORT_H + +#ifdef GPGFRONTEND_CORE_STATIC_DEFINE +# define GPGFRONTEND_CORE_EXPORT +# define GPGFRONTEND_CORE_NO_EXPORT +#else +# ifndef GPGFRONTEND_CORE_EXPORT +# ifdef gpgfrontend_core_EXPORTS + /* We are building this library */ +# define GPGFRONTEND_CORE_EXPORT __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define GPGFRONTEND_CORE_EXPORT __attribute__((visibility("default"))) +# endif +# endif + +# ifndef GPGFRONTEND_CORE_NO_EXPORT +# define GPGFRONTEND_CORE_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +#endif + +#ifndef GPGFRONTEND_CORE_DEPRECATED +# define GPGFRONTEND_CORE_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef GPGFRONTEND_CORE_DEPRECATED_EXPORT +# define GPGFRONTEND_CORE_DEPRECATED_EXPORT GPGFRONTEND_CORE_EXPORT GPGFRONTEND_CORE_DEPRECATED +#endif + +#ifndef GPGFRONTEND_CORE_DEPRECATED_NO_EXPORT +# define GPGFRONTEND_CORE_DEPRECATED_NO_EXPORT GPGFRONTEND_CORE_NO_EXPORT GPGFRONTEND_CORE_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef GPGFRONTEND_CORE_NO_DEPRECATED +# define GPGFRONTEND_CORE_NO_DEPRECATED +# endif +#endif + +#endif /* GPGFRONTEND_CORE_EXPORT_H */ |