diff options
-rw-r--r-- | .SRCINFO | 59 | ||||
-rw-r--r-- | .gitignore | 14 | ||||
-rw-r--r-- | .nvchecker.toml | 5 | ||||
-rw-r--r-- | PKGBUILD | 184 | ||||
-rw-r--r-- | protonmail-bridge.desktop | 8 | ||||
-rw-r--r-- | protonmail-bridge.service | 26 | ||||
-rw-r--r-- | remove-vcpkg-dependency.patch | 28 |
7 files changed, 259 insertions, 65 deletions
@@ -1,25 +1,52 @@ pkgbase = protonmail-bridge pkgdesc = Integrate ProtonMail paid account with any program that supports IMAP and SMTP - pkgver = 1.8.10 - pkgrel = 2 - url = https://protonmail.com/bridge + pkgver = 3.10.0 + pkgrel = 1 + url = https://github.com/ProtonMail/proton-bridge arch = x86_64 - license = GPL3 + license = GPL-3.0-only + makedepends = abseil-cpp + makedepends = cmake + makedepends = gcc-libs + makedepends = glib2 + makedepends = glibc makedepends = go - makedepends = gcc - makedepends = git - depends = hicolor-icon-theme + makedepends = grpc + makedepends = libsecret + makedepends = protobuf + makedepends = qt6-base + makedepends = qt6-declarative + makedepends = qt6-svg + makedepends = sentry-native + source = protonmail-bridge-core-3.10.0.tar.gz::https://github.com/ProtonMail/proton-bridge/archive/v3.10.0.tar.gz + source = protonmail-bridge.desktop + source = protonmail-bridge.service + source = remove-vcpkg-dependency.patch + sha256sums = fe2b048eb3a442a571e469ed376697a7c038189a29f824ffefc00d6fc36ba766 + sha256sums = 404db600803b9be875365d84e0726c3f7aedceaf122a795ca2248ee9f005753b + sha256sums = d51fb6efde22354d84b894b979a685d06fcc9cf3040d999d1cd6ebf5242a5043 + sha256sums = 436a9a293424fb7d48a8fd61fff7d63985dec56d6170cd2fbae24fe03ef98136 + +pkgname = protonmail-bridge-core + pkgdesc = Integrate ProtonMail paid account with any program that supports IMAP and SMTP (core executable and daemon) + depends = glib2 + depends = glibc depends = libsecret - depends = qt5-multimedia - depends = ttf-dejavu optdepends = gnome-keyring: gnome-keyring support + optdepends = org.freedesktop.secrets: Applications that support Freedesktop secrets api optdepends = pass: pass support - conflicts = protonmail-bridge-bin - options = !emptydirs - options = !strip - source = git+https://github.com/ProtonMail/proton-bridge.git#commit=a219ecf3cbe4fa31517136131fc585e93b86c3dd - source = protonmail-bridge.desktop - sha256sums = SKIP - sha256sums = 226bc140ec5c34cfdff42b33058d045446a4006518d2660db932c7f51632b48a pkgname = protonmail-bridge + pkgdesc = Integrate ProtonMail paid account with any program that supports IMAP and SMTP (Qt desktop application) + depends = protonmail-bridge-core + depends = abseil-cpp + depends = gcc-libs + depends = glibc + depends = grpc + depends = hicolor-icon-theme + depends = protobuf + depends = qt6-base + depends = qt6-declarative + depends = qt6-svg + depends = sentry-native + optdepends = qt6-wayland: Wayland support diff --git a/.gitignore b/.gitignore index 7df8f1f73436..baccd9a7a5f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ -proton-bridge -pkg/ -src/ -*.tar.gz -*.tar.xz -*.tar.zst +* +!.gitignore +!.nvchecker.toml +!.SRCINFO +!PKGBUILD +!protonmail-bridge.desktop +!protonmail-bridge.service +!remove-vcpkg-dependency.patch diff --git a/.nvchecker.toml b/.nvchecker.toml new file mode 100644 index 000000000000..d3302a457c12 --- /dev/null +++ b/.nvchecker.toml @@ -0,0 +1,5 @@ +[protonmail-bridge] +source = "github" +github = "ProtonMail/proton-bridge" +prefix = "v" +use_latest_release = true @@ -1,53 +1,161 @@ +# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com> # Maintainer: Ali Molaei <ali dot molaei at protonmail dot com> +# Maintainer: Ben Westover <me at benthetechguy dot net> # Contributor: Lenovsky <lenovsky at pm dot me> # Contributor: aimileus <me at aimileus dot nl> -pkgname=protonmail-bridge -pkgver=1.8.10 -pkgrel=2 +pkgbase=protonmail-bridge +_basename=proton-bridge +pkgname=( + protonmail-bridge-core + protonmail-bridge +) +pkgver=3.10.0 +pkgrel=1 pkgdesc="Integrate ProtonMail paid account with any program that supports IMAP and SMTP" -arch=('x86_64') -url="https://protonmail.com/bridge" -license=('GPL3') -makedepends=('go' 'gcc' 'git') -depends=('hicolor-icon-theme' 'libsecret' 'qt5-multimedia' 'ttf-dejavu') -optdepends=( - 'gnome-keyring: gnome-keyring support' - 'pass: pass support' +arch=(x86_64) +url="https://github.com/ProtonMail/proton-bridge" +license=(GPL-3.0-only) +makedepends=( + abseil-cpp + cmake + gcc-libs + glib2 + glibc + go + grpc + libsecret + protobuf + qt6-base + qt6-declarative + qt6-svg + sentry-native +) +source=( + "$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz" + "protonmail-bridge.desktop" + "protonmail-bridge.service" + "remove-vcpkg-dependency.patch" +) +sha256sums=( + 'fe2b048eb3a442a571e469ed376697a7c038189a29f824ffefc00d6fc36ba766' + '404db600803b9be875365d84e0726c3f7aedceaf122a795ca2248ee9f005753b' + 'd51fb6efde22354d84b894b979a685d06fcc9cf3040d999d1cd6ebf5242a5043' + '436a9a293424fb7d48a8fd61fff7d63985dec56d6170cd2fbae24fe03ef98136' ) -conflicts=('protonmail-bridge-bin') -options=('!emptydirs' '!strip') -# Source to compile to a specific tag -#source=("git://github.com/ProtonMail/proton-bridge.git#tag=br-${pkgver}" -# "protonmail-bridge.desktop") +_archive="$_basename-$pkgver" -# Source to compile to a specific commit -source=("git+https://github.com/ProtonMail/proton-bridge.git#commit=a219ecf3cbe4fa31517136131fc585e93b86c3dd" - "protonmail-bridge.desktop") +prepare() { + cd "$_archive" -sha256sums=('SKIP' - '226bc140ec5c34cfdff42b33058d045446a4006518d2660db932c7f51632b48a') + patch --forward --strip 1 --input "$srcdir/remove-vcpkg-dependency.patch" -prepare() { - cd ${srcdir}/proton-bridge/ - sed -i s/1.8.0+git/1.8.1+git/ Makefile - export PATH=$PATH:$(go env GOPATH)/bin/ - make clean + # Use system Qt rather than bundling it + rm internal/frontend/bridge-gui/bridge-gui/DeployLinux.cmake + touch internal/frontend/bridge-gui/bridge-gui/DeployLinux.cmake + + # Avoid downloading Go dependencies in build() by doing it here instead + go mod download -x +} + +build() { + cd "$_archive" + + pushd utils/ + ./credits.sh bridge + popd + + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" + + local ld_flags=" \ + -X github.com/ProtonMail/proton-bridge/v3/internal/constants.Version=$pkgver \ + -X github.com/ProtonMail/proton-bridge/v3/internal/constants.Revision=NOGIT \ + -X github.com/ProtonMail/proton-bridge/v3/internal/constants.Tag=$pkgver \ + -X github.com/ProtonMail/proton-bridge/v3/internal/constants.BuildTime= \ + -X 'github.com/ProtonMail/proton-bridge/v3/internal/constants.FullAppName=Proton Mail Bridge' \ + -X 'github.com/ProtonMail/proton-bridge/v3/internal/constants.BuildEnv=Arch Linux' \ + " + go build -v -buildvcs=false \ + -ldflags "$ld_flags" \ + -o bridge \ + ./cmd/Desktop-Bridge/ + + cmake \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_SKIP_RPATH=YES \ + -Wno-dev \ + -DBRIDGE_APP_FULL_NAME='Proton Mail Bridge' \ + -DBRIDGE_VENDOR='Proton AG' \ + -DBRIDGE_REVISION=NOGIT \ + -DBRIDGE_TAG=$pkgver \ + -DBRIDGE_DSN_SENTRY= \ + -DBRIDGE_BUILD_ENV='Arch Linux' \ + -DBRIDGE_APP_VERSION=$pkgver \ + -S internal/frontend/bridge-gui/bridge-gui \ + -B build + cmake --build build } -build(){ - export PATH=$PATH:$(go env GOPATH)/bin/ - cd ${srcdir}/proton-bridge/ - make build +package_protonmail-bridge-core() { + pkgdesc="$pkgdesc (core executable and daemon)" + depends=( + glib2 + glibc + libsecret + ) + optdepends=( + 'gnome-keyring: gnome-keyring support' + 'org.freedesktop.secrets: Applications that support Freedesktop secrets api' + 'pass: pass support' + ) + + cd "$_archive" + + install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE + install -Dm644 -t "$pkgdir/usr/share/doc/protonmail/bridge" ./*.md + + install -Dm644 -t "$pkgdir/usr/lib/systemd/user" "$srcdir/protonmail-bridge.service" + + install -Dm755 bridge "$pkgdir/usr/lib/protonmail/bridge/bridge" + + install -dm755 "$pkgdir/usr/bin/" + ln -s /usr/lib/protonmail/bridge/bridge "$pkgdir/usr/bin/protonmail-bridge-core" } -package() { - mkdir -p "${pkgdir}"/opt - mkdir -p "${pkgdir}"/usr/bin - cp -r "${srcdir}"/proton-bridge/cmd/Desktop-Bridge/deploy/linux/ "${pkgdir}"/opt/protonmail-bridge - install -D -m644 "${pkgdir}"/opt/protonmail-bridge/LICENSE -t "${pkgdir}"/usr/share/licenses/"${pkgname}"/ - install -D -m644 "${pkgdir}"/opt/protonmail-bridge/logo.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/"${pkgname}".svg - install -D -m644 "${srcdir}"/protonmail-bridge.desktop -t "${pkgdir}"/usr/share/applications/ - ln -s "/opt/protonmail-bridge/proton-bridge" "$pkgdir/usr/bin/protonmail-bridge" +package_protonmail-bridge() { + pkgdesc="$pkgdesc (Qt desktop application)" + depends=( + protonmail-bridge-core + + abseil-cpp + gcc-libs + glibc + grpc + hicolor-icon-theme + protobuf + qt6-base + qt6-declarative + qt6-svg + sentry-native + ) + optdepends=( + 'qt6-wayland: Wayland support' + ) + + cd "$_archive" + + install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE + install -Dm644 -t "$pkgdir/usr/share/applications" "$srcdir/protonmail-bridge.desktop" + install -Dm644 dist/bridge.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/protonmail-bridge.svg" + + install -Dm755 build/bridge-gui "$pkgdir/usr/lib/protonmail/bridge/bridge-gui" + + install -dm755 "$pkgdir/usr/bin/" + ln -s /usr/lib/protonmail/bridge/bridge-gui "$pkgdir/usr/bin/protonmail-bridge" } diff --git a/protonmail-bridge.desktop b/protonmail-bridge.desktop index de4a6ffc238f..ed77abf6a6cf 100644 --- a/protonmail-bridge.desktop +++ b/protonmail-bridge.desktop @@ -1,12 +1,10 @@ [Desktop Entry] Type=Application -Version=1.1 +Version=1.5 Name=ProtonMail Bridge -GenericName=ProtonMail Bridge for Linux Comment=The Bridge is an application that runs on your computer in the background and seamlessly encrypts and decrypts your mail as it enters and leaves your computer. -Icon=/opt/protonmail-bridge/logo.svg +Icon=/usr/share/icons/hicolor/scalable/apps/protonmail-bridge.svg Exec=/usr/bin/protonmail-bridge Terminal=false -Categories=Office;Email;Network +Categories=Email;Network StartupWMClass=protonmail-bridge - diff --git a/protonmail-bridge.service b/protonmail-bridge.service new file mode 100644 index 000000000000..d728a5e2fa91 --- /dev/null +++ b/protonmail-bridge.service @@ -0,0 +1,26 @@ +[Unit] +Description=ProtonMail Bridge - ProtonMail IMAP and SMTP Bridge +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/protonmail-bridge-core --noninteractive +Restart=always +KillMode=process + +# Hardening +PrivateTmp=true +# ProtectHome=true +ProtectSystem=full +NoNewPrivileges=true +ProtectControlGroups=true +ProtectKernelModules=true +ProtectKernelTunables=true +PrivateDevices=true +# RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 +RestrictNamespaces=true +RestrictRealtime=true +SystemCallArchitectures=native + +[Install] +WantedBy=default.target diff --git a/remove-vcpkg-dependency.patch b/remove-vcpkg-dependency.patch new file mode 100644 index 000000000000..2ba40a79a589 --- /dev/null +++ b/remove-vcpkg-dependency.patch @@ -0,0 +1,28 @@ +diff --unified --recursive --text proton-bridge-3.6.1.orig/internal/frontend/bridge-gui/BridgeSetup.cmake proton-bridge-3.6.1/internal/frontend/bridge-gui/BridgeSetup.cmake +--- proton-bridge-3.6.1.orig/internal/frontend/bridge-gui/BridgeSetup.cmake 2023-11-21 15:03:10.865099608 +0100 ++++ proton-bridge-3.6.1/internal/frontend/bridge-gui/BridgeSetup.cmake 2023-11-21 15:03:34.591823916 +0100 +@@ -51,17 +51,6 @@ + # We rely on vcpkg for to get gRPC / Protobuf + # run build.sh / build.ps1 to get gRPC / Protobuf and dependencies installed. + +-set(VCPKG_ROOT "${BRIDGE_REPO_ROOT}/extern/vcpkg") +-message(STATUS "VCPKG_ROOT is ${VCPKG_ROOT}") +-if (WIN32) +- find_program(VCPKG_EXE "${VCPKG_ROOT}/vcpkg.exe") +-else() +- find_program(VCPKG_EXE "${VCPKG_ROOT}/vcpkg") +-endif() +-if (NOT VCPKG_EXE) +- message(FATAL_ERROR "vcpkg is not installed. Run build.sh (macOS/Linux) or build.ps1 (Windows) first.") +-endif() +- + # For now we support only a single architecture for macOS (ARM64 or x86_64). We need to investigate how to build universal binaries with vcpkg. + if (APPLE) + if (NOT DEFINED CMAKE_OSX_ARCHITECTURES) +@@ -86,5 +75,3 @@ + message(STATUS "Building for Intel x64 Windows computers") + set(VCPKG_TARGET_TRIPLET x64-windows) + endif() +- +-set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "toolchain") +\ No newline at end of file |