Hi Guix,
I've been trying to get the ProtonMail Bridge
(https://protonmail.com/bridge/) installed on my GuixSD system for the
past several days, and I'm running into a bit of a wall. I'm hoping that
one of you package wizards can help me figure out what I'm screwing up
here, and help me get my package code working correctly.
So without further ado, here it is (further explanation below):
;;== BEGIN PACKAGE
(define-module (my-packages protonmail-bridge)
#:use-module ((guix packages) #:prefix p:)
#:use-module ((guix licenses) #:prefix l:)
#:use-module ((guix download) #:prefix d:)
#:use-module ((guix build-system trivial) #:prefix build:)
#:use-module ((guix utils)#:prefix utils:)
#:use-module ((gnu packages) #:prefix gp:)
#:use-module ((gnu packages base) #:prefix base:)
#:use-module ((gnu packages compression) #:prefix compression:)
#:use-module ((gnu packages qt) #:prefix qt:)
#:use-module ((gnu packages gnome)#:prefix gnome:)
#:use-module ((gnu packages fonts)#:prefix fonts:))
(define-public qtbase-5.12
(p:package
(inherit qt:qtbase)
(name "qtbase")
(version "5.12.4")
(source (p:origin
(method d:url-fetch)
(uri (string-append "https://download.qt.io/official_releases/qt/";
(utils:version-major+minor version) "/" version
"/submodules/" name "-everywhere-src-"
version ".tar.xz"))
(sha256 (p:base32
"158i0apc3i8bbgrk9j1k34y2b03v0kwwv8m7aaaxpxsglppwgyr0"))
;; Use TZDIR to avoid depending on package "tzdata".
;; (patches (gp:search-patches "qtbase-use-TZDIR.patch"
;; "qtbase-old-kernel.patch"))
(modules '((guix build utils)))
(snippet
;; corelib uses bundled harfbuzz, md4, md5, sha3
'(begin
(with-directory-excursion "src/3rdparty"
(for-each delete-file-recursively
(list "double-conversion" "freetype" "harfbuzz-ng"
"libpng" "libjpeg" "pcre2" "sqlite" "xcb"
"zlib"))
#t)))
;; FIXME: Update propagated-inputs to address these 2 runtime linking errors:
;; - libstdc++.so.6 => not found
;; - libgcc_s.so.1 => not found
(define-public protonmail-bridge
(p:package
(name "protonmail-bridge")
(version "1.1.6-1")
(supported-systems '("x86_64-linux"))
(license l:expat)
(synopsis "Background service that connects your local mail client to
ProtonMail's servers.")
(description "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.")
(home-page "https://www.protonmail.com/bridge";)
(source (p:origin
(method d:url-fetch)
(uri (string-append
"https://protonmail.com/download/beta/protonmail-bridge_"; version "_amd64.deb"))
(sha256 (p:base32
"1x9fl6s15d2061y37hrl1yz6f5l6pqfwa895xcm2fr29s8v8b1z8"
(build-system build:trivial-build-system)
(inputs `(("binutils" ,base:binutils)
("tar" ,base:tar)
("xz" ,compression:xz)))
(propagated-inputs `(("libz" ,compression:zlib)
("qtbase",qtbase-5.12)
("qtmultimedia" ,qt:qtmultimedia)
("qtdeclarative" ,qt:qtdeclarative)
("qtsvg" ,qt:qtsvg)
("libsecret" ,gnome:libsecret)
("font-dejavu" ,fonts:font-dejavu)))
(arguments '(#:builder (let* ((ar (string-append (assoc-ref
%build-inputs "binutils") "/bin/ar"))
(tar(string-append (assoc-ref
%build-inputs "tar") "/bin/tar"))
(xz (string-append (assoc-ref
%build-inputs "xz") "/bin/xz"))
(source (assoc-ref %build-inputs
"source")) ; /gnu/store/...-protonmail-bridge_1.1.6-1_amd64.deb
(out(assoc-ref %outputs "out"))
(unpack-deb (string-append ar " p " source "
data.tar.xz | " xz " --decompress | " tar " x")))
(mkdir out)
(chdir out)
(system unpack-deb)
(rename-file "usr/bin" "bin")
(rename-file "usr/lib" "lib")
(rename-file "usr/share" "share")
(rmdir "usr")
(delete-file "bin/protonmail-bridge")
(symlink (string-append out
"/lib/protonmail/