1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# Building
This section contains the instruction on how to build the library and associated wrappers. We first explain how to build the Go library and then further explain the wrapper specific building process. As the Python wrapper is the only wrapper at the moment, this only consists of this wrapper language for now.
## Building the Go library
To build the Go library, you need the dependencies for your system installed. We will go over the needed dependencies for Linux. Afterwards, we explain the basic commands to build the library.
### Dependencies
#### Linux
To build the Go shared library using Linux you need the following dependencies:
- [Go](https://go.dev/doc/install) 1.18 or later
- [Gcc](https://gcc.gnu.org/)
- [GNU Make](https://www.gnu.org/software/make/)
- Dependencies for the Python wrapper if you want to build that as well
### Commands
Before we can begin building the wrapper code, we need to build the Go code as a shared library. This section will tell you how to do so.
To build the shared library for the current platform issue the following command in the root directory:
```bash
make
```
The shared library will be output in `lib/`.
#### Cleaning
To clean build the library and wrapper, issue the following command in the root directory:
```bash
make clean
```
## Python wrapper
To build the python wrapper issue the following command (in the root directory of the eduvpn-common project):
```bash
make -C wrappers/python
```
This uses the makefile in `wrappers/python/Makefile` to build the python file into a wheel placed in `wrappers/python/dist/eduvpncommon-[version]-py3-none-[platform].whl`. Where version is the version of the library and platform is your current platform.
The wheel can be installed with `pip`:
```bash
pip install ./wrappers/python/dist/eduvpncommon-[version]-py3-none-[platform].whl
```
## Notes on building for release
To build for release, make sure you obtain the tarball artifacts in the release (ending with `.tar.xz`) at <https://codeberg.org/eduVPN/eduvpn-common/releases>.
These are signed with minisign and gpg keys, make sure to verify these signatures using the public keys available here: <https://codeberg.org/eduVPN/eduvpn-common/src/branch/main/keys>, they are also available externally:
- <https://app.eduvpn.org/linux/v4/deb/app+linux@eduvpn.org.asc>
- <https://git.sr.ht/~jwijenbergh/python3-eduvpn-common.rpm/tree/main/item/SOURCES/minisign-CA9409316AC93C07.pub>
To build for release, make sure to extract the tarball, and then build:
```bash
make
```
To upload the releases to Codeberg, run:
```bash
./make_release.sh
```
For pre-releases:
```bash
./make_release.sh -p
```
### Package formats
We support the following additional package formats: RPM (Linux, Fedora), Deb (Linux, Debian derivatives) and Pip. These are build in the CI and for production build on a separate non-public host.
|