Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (use-modules
- ((guix licenses) #:prefix license:)
- (gnu packages base)
- (gnu packages bootstrap)
- (gnu packages commencement)
- (gnu packages elf)
- (gnu packages fontutils)
- (gnu packages freedesktop)
- (gnu packages gcc)
- (gnu packages gl)
- (gnu packages glib)
- (gnu packages gnome)
- (gnu packages gnuzilla)
- (gnu packages gtk)
- (gnu packages image)
- (gnu packages libevent)
- (gnu packages libffi)
- (gnu packages linux)
- (gnu packages nss)
- (gnu packages pulseaudio)
- (gnu packages tls)
- (gnu packages video)
- (gnu packages webkit)
- (gnu packages xorg)
- (guix build utils)
- (guix build-system copy)
- (guix build-system cargo)
- (guix build-system gnu)
- (guix download)
- (guix gexp)
- (guix packages))
- (define zen-browser-bin
- (package
- (name "zen-browser-bin")
- (version "1.0.1-a.12")
- (source
- (origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/zen-browser/desktop/releases/download/"
- version
- "/zen.linux-generic.tar.bz2"))
- (sha256
- (base32 "0an639lbk45scl0l5q077lyc482a987mcpf9bc109ajpv6bn4yi9"))))
- (build-system copy-build-system)
- (arguments
- (list #:install-plan
- #~'(("." "lib/zen"))
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'install 'patch-elf
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((ld.so (string-append #$(this-package-input "glibc")
- #$(glibc-dynamic-linker)))
- (rpath (string-join
- (cons*
- (string-append #$output "/lib/zen")
- (string-append #$(this-package-input "gtk+") "/share")
- (map
- (lambda (input)
- (string-append (cdr input) "/lib"))
- inputs))
- ":")))
- ;; Got this proc from hako's Rosenthal, thanks
- (define (patch-elf file)
- (format #t "Patching ~a ..." file)
- (unless (string-contains file ".so")
- (invoke "patchelf" "--set-interpreter" ld.so file))
- (invoke "patchelf" "--set-rpath" rpath file)
- (display " done\n"))
- (for-each
- (lambda (binary)
- (patch-elf binary))
- (append
- (map
- (lambda (binary)
- (string-append #$output "/lib/zen/" binary))
- '("glxtest" "updater" "vaapitest" "zen" "zen-bin" "pingsender"))
- (find-files (string-append #$output "/lib/zen") ".*\\.so.*"))))))
- (add-after 'patch-elf 'install-bin
- (lambda _
- (let* ((zen (string-append #$output "/lib/zen/zen"))
- (bin-zen (string-append #$output "/bin/zen")))
- (mkdir (string-append #$output "/bin"))
- (symlink zen bin-zen))))
- (add-after 'install-bin 'install-desktop
- (lambda _
- (let* ((share-applications (string-append #$output "/share/applications"))
- (desktop (string-append share-applications "/zen.desktop")))
- (mkdir-p share-applications)
- (make-desktop-entry-file desktop
- #:name "Zen Browser"
- #:icon "zen"
- #:type "Application"
- #:comment #$(package-synopsis this-package)
- #:exec (string-append #$output "/bin/zen %u")
- #:keywords '("Internet" "WWW" "Browser" "Web" "Explorer")
- #:categories '("Network" "Browser")
- ; #:actions '("new-window" "new-private-window" "profilemanager")
- #:mime-type '("text/html"
- "text/xml"
- "application/xhtml+xml"
- "x-scheme-handler/http"
- "x-scheme-handler/https"
- "application/x-xpinstall"
- "application/pdf"
- "application/json")
- #:startup-w-m-class "zen-alpha")))))))
- (native-inputs (list patchelf))
- (inputs (list alsa-lib
- at-spi2-core
- cairo
- dbus
- dbus
- eudev
- fontconfig
- freetype
- gcc-toolchain
- gdk-pixbuf
- glib
- glib
- glibc
- gtk+
- libnotify
- libva
- libx11
- libxcb
- libxcomposite
- libxcursor
- libxdamage
- libxext
- libxfixes
- libxi
- libxrandr
- libxrender
- nspr
- nss
- pango
- pulseaudio))
- (home-page "https://zen-browser.app/")
- (synopsis "Experience tranquillity while browsing the web without people tracking you!")
- (description "Beautifully designed, privacy-focused, and packed with features.
- We care about your experience, not your data.")
- (license (list license:mpl2.0))))
- zen-browser-bin
Advertisement
Add Comment
Please, Sign In to add comment