Skip to content

Commit

Permalink
Add desktop vpn app project
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneschepke committed Nov 16, 2023
1 parent 2c63518 commit b1a43b0
Show file tree
Hide file tree
Showing 236 changed files with 44,552 additions and 7,195 deletions.
4 changes: 4 additions & 0 deletions nym-vpn/desktop/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/*
data/*
dist/*
target/*
32 changes: 32 additions & 0 deletions nym-vpn/desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Cargo
# will have compiled files and executables
target

# These are backup files generated by rustfmt
**/*.rs.bk

node_modules

data

build
.cargo

.DS_Store

# generated Typescript types from Rust
bindings

staging-config

dist
.nymvpn
windows/x86_64*
*.wixobj
*.wixpdb
*.msi
mkcert*

nymvpn-oss-licenses.html
nymvpn-oss-licenses-rust.html
third-party-licenses.txt
3 changes: 3 additions & 0 deletions nym-vpn/desktop/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"svg.preview.background": "editor"
}
123 changes: 123 additions & 0 deletions nym-vpn/desktop/Build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Building nymvpn app

## Install build dependencies

### Common for all Platforms

```
cargo install cargo-deb
cargo install cargo-generate-rpm
cargo install --force cargo-make
cargo install sd
cargo install ripgrep
cargo install cargo-about
```

### Linux

```
apt install build-essential \
pkg-config \
libgtk-3-dev \
libssl-dev \
libsoup2.4-dev \
libjavascriptcoregtk-4.0-dev \
libwebkit2gtk-4.0-dev \
libmnl-dev \
libnftnl-dev \
protobuf-compiler \
zip \
```

Install protoc on x86_64/amd64 machines
```
# x86_64
curl -Lo protoc-3.19.1-linux-x86_64.zip \
https://github.com/protocolbuffers/protobuf/releases/download/v3.19.1/protoc-3.19.1-linux-x86_64.zip && \
unzip protoc-3.19.1-linux-x86_64.zip -d /tmp && \
mv /tmp/bin/protoc /usr/bin/protoc && \
rm protoc-3.19.1-linux-x86_64.zip
```

Install protoc on arm64 machines
```
# aarch64
curl -Lo protoc-3.19.1-linux-aarch_64.zip \
https://github.com/protocolbuffers/protobuf/releases/download/v3.19.1/protoc-3.19.1-linux-aarch_64.zip && \
unzip protoc-3.19.1-linux-aarch_64.zip -d /tmp && \
sudo mv /tmp/bin/protoc /usr/bin/protoc && \
rm protoc-3.19.1-linux-aarch_64.zip
```

### macOS
```
brew install protobuf
```

### Windows
TODO

## Build Debian package

```
cargo make deb
```

## Build RPM package

```
cargo make rpm
```

## Build macOS package

```
cargo make pkg
```

To codesign for distribution provide following environment variables:

```
APPLE_TEAM_ID=...
APPLICATION_SIGNING_IDENTITY=...
INSTALLER_SIGNING_IDENTITY=...
cargo make pkg
```

## Build installer for Windows

```
cargo make msi
```

To codesign for distribution:

```
SIGN=true cargo make msi
```

## Building for Production for Linux

### Build the Builder

Build the Docker image to build nymvpn app.
```
cd nymvpn-packages
cargo make builder
```

This will output `tag.txt`, commit it into source code.

### Build .deb and .rpm

This step uses builder Docker image with tag in `nymvpn-packages/tag.txt`. The final rpm and deb packages will be stored in `dist` directory.

```
# For host platform
cargo make linux
# For target platform
cargo make -e TARGET=aarch64-unknown-linux-gnu linux
```
Loading

0 comments on commit b1a43b0

Please sign in to comment.