Skip to content

Commit

Permalink
Build C# bindings on other platforms
Browse files Browse the repository at this point in the history
IB-7574

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Dec 7, 2022
1 parent 0bc9978 commit 1df5638
Show file tree
Hide file tree
Showing 18 changed files with 151 additions and 58 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: CI
on: [push, pull_request]
permissions:
contents: write
env:
RUN_TESTS: ALL
BUILD_NUMBER: ${{ github.run_number }}
Expand Down Expand Up @@ -64,19 +66,19 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
container: ['fedora:35', 'fedora:36']
container: ['fedora:35', 'fedora:36', 'fedora:37']
env:
MAKEFLAGS: -j3
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install Deps
run: |
dnf install -y \
gcc-c++ cmake rpm-build xml-security-c-devel zlib-devel vim-common doxygen boost-test swig python3-devel java-1.8.0-openjdk-devel \
git gcc-c++ cmake rpm-build xml-security-c-devel zlib-devel vim-common doxygen boost-test swig python3-devel java-1.8.0-openjdk-devel \
https://www.codesynthesis.com/download/xsd/4.0/linux-gnu/x86_64/xsd-4.0.0-1.x86_64.rpm
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
run: |
cmake -DCMAKE_INSTALL_SYSCONFDIR=/etc -B build -S .
Expand All @@ -93,7 +95,7 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
container: ['ubuntu:18.04', 'ubuntu:20.04', 'ubuntu:22.04']
container: ['ubuntu:18.04', 'ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:22.10']
env:
DEBIAN_FRONTEND: noninteractive
DEBFULLNAME: github-actions
Expand All @@ -110,7 +112,7 @@ jobs:
curl https://installer.id.ee/media/install-scripts/C6C83D68.pub | gpg --dearmor | tee /etc/apt/trusted.gpg.d/ria-repository.gpg > /dev/null
echo "deb https://installer.id.ee/media/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ria-repository.list
- name: Install dependencies
run: apt update -qq && apt install --no-install-recommends -y lsb-release dh-make fakeroot build-essential devscripts cdbs cmake vim-common xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-distutils libboost-test-dev lintian
run: apt update -qq && apt install --no-install-recommends -y lsb-release fakeroot build-essential devscripts cdbs cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-distutils libboost-test-dev lintian
- name: Setup changelog
run: |
export VERSION=$(grep project CMakeLists.txt | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")
Expand All @@ -136,7 +138,7 @@ jobs:
include:
- toolset: 143
image: windows-2022
vcver: 14.33
vcver: 14.34
vcvars: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat"
- toolset: 142
image: windows-2019
Expand Down
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
1. Install dependencies

# Ubuntu
sudo apt install cmake libxml-security-c-dev xsdcxx libssl-dev zlib1g-dev
sudo apt install cmake xxd libxml-security-c-dev xsdcxx libssl-dev zlib1g-dev
# Fedora
sudo dnf install cmake openssl-devel xerces-c-devel xml-security-c-devel zlib-devel vim-common https://www.codesynthesis.com/download/xsd/4.0/linux-gnu/x86_64/xsd-4.0.0-1.x86_64.rpm

* doxygen - Optional, for API documentation
* libboost-test-dev - Optional, for unittests
* swig - Optional, for C#, Java and python bindings
* libpython3-dev, python3-distutils - Optional, for python bindings
* openjdk-8-jdk-headless - Optional, for Java bindings

2. Fetch the source

Expand All @@ -30,17 +33,15 @@

3. Configure

mkdir build
cd build
cmake ..
cmake -B build -S .

4. Build

make
cmake --build build

5. Install

sudo make install
sudo cmake --build build --target install

6. Execute

Expand All @@ -51,6 +52,7 @@
1. Install dependencies from
* [XCode](https://itunes.apple.com/en/app/xcode/id497799835?mt=12)
* [CMake](http://www.cmake.org)
* [Homebrew](https://brew.sh)

2. Fetch the source

Expand All @@ -61,11 +63,21 @@

sh prepare_osx_build_environment.sh osx all

4. Configure, build and install (available targets: osx, ios, iossimulator, androidarm, androidarm64, androidx86)
4. Install dependencies

brew install xsd
brew unlink xerces-c

* doxygen - Optional, for API documentation
* boost - Optional, for unittests
* swig - Optional, for C# and Java bindings
* openjdk - Optional, for Java bindings

5. Configure, build and install (available targets: osx, ios, iossimulator, androidarm, androidarm64, androidx86)

./build-library.sh osx install

5. Execute
6. Execute

/Library/Frameworks/digidocpp.framework/Resources/digidoc-tool

Expand All @@ -77,6 +89,8 @@
* [Swig](http://swig.org/download.html) - Optional, for C# and Java bindings
* [Doxygen](https://www.doxygen.nl/download.html) - Optional, for generationg documentation
* [Wix toolset](http://wixtoolset.org/releases/) - Optional, for creating Windows installation packages
* [Python](https://www.python.org/downloads/) - Optional, for Python bindings
* [Java](https://www.oracle.com/java/technologies/downloads/) - Optional, for Java bindings

Toolset:
* 141 - Visual Studio 2017
Expand Down
37 changes: 35 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Build-Depends:
cmake,
libxml-security-c-dev,
xsdcxx (>= 4.0) | xsd (>= 4.0),
vim-common,
xxd,
doxygen,
swig,
libpython3-dev,
Expand Down Expand Up @@ -67,13 +67,46 @@ Architecture: any
Section: libdevel
Depends:
libdigidocpp1 (= ${binary:Version}),
python3,
${misc:Depends},
${shlibs:Depends}
Description: DigiDoc digital signature library development files
This package contains files necessary for developing applications with the
DigiDoc digital signature library.

Package: libdigidocpp-csharp
Architecture: any
Section: libdevel
Depends:
libdigidocpp1 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Description: DigiDoc digital signature C# bindings
This package contains files necessary for developing applications with the
DigiDoc digital signature library using C# bindings.

Package: libdigidocpp-java
Architecture: any
Section: libdevel
Depends:
libdigidocpp1 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Description: DigiDoc digital signature java bindings
This package contains files necessary for developing applications with the
DigiDoc digital signature library using java bindings.

Package: libdigidocpp-python
Architecture: any
Section: libdevel
Depends:
libdigidocpp1 (= ${binary:Version}),
python3,
${misc:Depends},
${shlibs:Depends}
Description: DigiDoc digital signature python bindings
This package contains files necessary for developing applications with the
DigiDoc digital signature library using python bindings.

Package: libdigidocpp-doc
Architecture: all
Section: doc
Expand Down
2 changes: 2 additions & 0 deletions debian/libdigidocpp-csharp.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/include/digidocpp_csharp/
usr/lib/*/libdigidoc_csharp.so
1 change: 1 addition & 0 deletions debian/libdigidocpp-csharp.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libdigidocpp-csharp: sharedobject-in-library-directory-missing-soname
File renamed without changes.
5 changes: 2 additions & 3 deletions debian/libdigidocpp-dev.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
usr/include
usr/lib/*/lib*.so
usr/include/digidocpp/
usr/lib/*/libdigidocpp.so
usr/lib/*/pkgconfig
usr/lib/python*/dist-packages
1 change: 0 additions & 1 deletion debian/libdigidocpp-dev.lintian-overrides

This file was deleted.

2 changes: 2 additions & 0 deletions debian/libdigidocpp-java.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/include/ee/ria/libdigidocpp/
usr/lib/*/libdigidoc_java.so
1 change: 1 addition & 0 deletions debian/libdigidocpp-java.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libdigidocpp-java: sharedobject-in-library-directory-missing-soname
1 change: 1 addition & 0 deletions debian/libdigidocpp-java.triggers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
activate-noawait ldconfig
1 change: 1 addition & 0 deletions debian/libdigidocpp-python.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/python3/dist-packages/
2 changes: 1 addition & 1 deletion debian/libdigidocpp1.install
Original file line number Diff line number Diff line change
@@ -1 +1 @@
usr/lib/*/lib*.so.*
usr/lib/*/libdigidocpp.so.*
4 changes: 4 additions & 0 deletions examples/DigiDocCSharp/DigiDocCSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<DefineConstants>_WINDOWS</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
Loading

0 comments on commit 1df5638

Please sign in to comment.