Guest User

Untitled

a guest
Oct 30th, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 5.87 KB | None | 0 0
  1. (use-modules
  2.  ((guix licenses) #:prefix license:)
  3.  (gnu packages base)
  4.  (gnu packages bootstrap)
  5.  (gnu packages commencement)
  6.  (gnu packages elf)
  7.  (gnu packages fontutils)
  8.  (gnu packages freedesktop)
  9.  (gnu packages gcc)
  10.  (gnu packages gl)
  11.  (gnu packages glib)
  12.  (gnu packages gnome)
  13.  (gnu packages gnuzilla)
  14.  (gnu packages gtk)
  15.  (gnu packages image)
  16.  (gnu packages libevent)
  17.  (gnu packages libffi)
  18.  (gnu packages linux)
  19.  (gnu packages nss)
  20.  (gnu packages pulseaudio)
  21.  (gnu packages tls)
  22.  (gnu packages video)
  23.  (gnu packages webkit)
  24.  (gnu packages xorg)
  25.  (guix build utils)
  26.  (guix build-system copy)
  27.  (guix build-system cargo)
  28.  (guix build-system gnu)
  29.  (guix download)
  30.  (guix gexp)
  31.  (guix packages))
  32.  
  33. (define zen-browser-bin
  34.   (package
  35.     (name "zen-browser-bin")
  36.     (version "1.0.1-a.12")
  37.     (source
  38.       (origin
  39.         (method url-fetch)
  40.         (uri (string-append
  41.                 "https://github.com/zen-browser/desktop/releases/download/"
  42.                 version
  43.                 "/zen.linux-generic.tar.bz2"))
  44.         (sha256
  45.           (base32 "0an639lbk45scl0l5q077lyc482a987mcpf9bc109ajpv6bn4yi9"))))
  46.     (build-system copy-build-system)
  47.     (arguments
  48.       (list #:install-plan
  49.             #~'(("." "lib/zen"))
  50.             #:phases
  51.             #~(modify-phases %standard-phases
  52.                 (add-after 'install 'patch-elf
  53.                   (lambda* (#:key inputs #:allow-other-keys)
  54.                     (let ((ld.so (string-append #$(this-package-input "glibc")
  55.                                                 #$(glibc-dynamic-linker)))
  56.                           (rpath (string-join
  57.                                    (cons*
  58.                                      (string-append #$output "/lib/zen")
  59.                                      (string-append #$(this-package-input "gtk+") "/share")
  60.                                      (map
  61.                                        (lambda (input)
  62.                                          (string-append (cdr input) "/lib"))
  63.                                        inputs))
  64.                                    ":")))
  65.                       ;; Got this proc from hako's Rosenthal, thanks
  66.                       (define (patch-elf file)
  67.                         (format #t "Patching ~a ..." file)
  68.                         (unless (string-contains file ".so")
  69.                           (invoke "patchelf" "--set-interpreter" ld.so file))
  70.                         (invoke "patchelf" "--set-rpath" rpath file)
  71.                         (display " done\n"))
  72.                       (for-each
  73.                         (lambda (binary)
  74.                           (patch-elf binary))
  75.                         (append
  76.                           (map
  77.                             (lambda (binary)
  78.                               (string-append #$output "/lib/zen/" binary))
  79.                             '("glxtest" "updater" "vaapitest" "zen" "zen-bin" "pingsender"))
  80.                           (find-files (string-append #$output "/lib/zen") ".*\\.so.*"))))))
  81.                 (add-after 'patch-elf 'install-bin
  82.                   (lambda _
  83.                     (let* ((zen (string-append #$output "/lib/zen/zen"))
  84.                            (bin-zen (string-append #$output "/bin/zen")))
  85.                       (mkdir (string-append #$output "/bin"))
  86.                       (symlink zen bin-zen))))
  87.                 (add-after 'install-bin 'install-desktop
  88.                   (lambda _
  89.                     (let* ((share-applications (string-append #$output "/share/applications"))
  90.                            (desktop (string-append share-applications "/zen.desktop")))
  91.                       (mkdir-p share-applications)
  92.                       (make-desktop-entry-file desktop
  93.                         #:name "Zen Browser"
  94.                         #:icon "zen"
  95.                         #:type "Application"
  96.                         #:comment #$(package-synopsis this-package)
  97.                         #:exec (string-append #$output "/bin/zen %u")
  98.                         #:keywords '("Internet" "WWW" "Browser" "Web" "Explorer")
  99.                         #:categories '("Network" "Browser")
  100.                         ; #:actions '("new-window" "new-private-window" "profilemanager")
  101.                         #:mime-type '("text/html"
  102.                                       "text/xml"
  103.                                       "application/xhtml+xml"
  104.                                       "x-scheme-handler/http"
  105.                                       "x-scheme-handler/https"
  106.                                       "application/x-xpinstall"
  107.                                       "application/pdf"
  108.                                       "application/json")
  109.                         #:startup-w-m-class "zen-alpha")))))))
  110.     (native-inputs (list patchelf))
  111.     (inputs (list alsa-lib
  112.                   at-spi2-core
  113.                   cairo
  114.                   dbus
  115.                   dbus
  116.                   eudev
  117.                   fontconfig
  118.                   freetype
  119.                   gcc-toolchain
  120.                   gdk-pixbuf
  121.                   glib
  122.                   glib
  123.                   glibc
  124.                   gtk+
  125.                   libnotify
  126.                   libva
  127.                   libx11
  128.                   libxcb
  129.                   libxcomposite
  130.                   libxcursor
  131.                   libxdamage
  132.                   libxext
  133.                   libxfixes
  134.                   libxi
  135.                   libxrandr
  136.                   libxrender
  137.                   nspr
  138.                   nss
  139.                   pango
  140.                   pulseaudio))
  141.     (home-page "https://zen-browser.app/")
  142.     (synopsis "Experience tranquillity while browsing the web without people tracking you!")
  143.     (description "Beautifully designed, privacy-focused, and packed with features.
  144. We care about your experience, not your data.")
  145.     (license (list license:mpl2.0))))
  146.  
  147. zen-browser-bin
  148.  
Advertisement
Add Comment
Please, Sign In to add comment