Uses chromium-binary-build-system
This commit is contained in:
parent
2b0d85ad29
commit
e1d4956a8b
|
@ -8,17 +8,14 @@
|
||||||
(define-module (nongnu packages messaging)
|
(define-module (nongnu packages messaging)
|
||||||
#:use-module (gnu packages base)
|
#:use-module (gnu packages base)
|
||||||
#:use-module (gnu packages bash)
|
#:use-module (gnu packages bash)
|
||||||
#:use-module (gnu packages bootstrap)
|
|
||||||
#:use-module (gnu packages compression)
|
#:use-module (gnu packages compression)
|
||||||
#:use-module (gnu packages cups)
|
#:use-module (gnu packages cups)
|
||||||
#:use-module (gnu packages elf)
|
|
||||||
#:use-module (gnu packages fontutils)
|
#:use-module (gnu packages fontutils)
|
||||||
#:use-module (gnu packages freedesktop)
|
#:use-module (gnu packages freedesktop)
|
||||||
#:use-module (gnu packages gcc)
|
#:use-module (gnu packages gcc)
|
||||||
#:use-module (gnu packages gl)
|
#:use-module (gnu packages gl)
|
||||||
#:use-module (gnu packages glib)
|
#:use-module (gnu packages glib)
|
||||||
#:use-module (gnu packages gnome)
|
#:use-module (gnu packages gnome)
|
||||||
#:use-module (gnu packages gnuzilla)
|
|
||||||
#:use-module (gnu packages gtk)
|
#:use-module (gnu packages gtk)
|
||||||
#:use-module (gnu packages kerberos)
|
#:use-module (gnu packages kerberos)
|
||||||
#:use-module (gnu packages linux)
|
#:use-module (gnu packages linux)
|
||||||
|
@ -35,7 +32,6 @@
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix utils)
|
#:use-module (guix utils)
|
||||||
#:use-module (guix build-system glib-or-gtk)
|
|
||||||
#:use-module ((guix licenses) :prefix license:)
|
#:use-module ((guix licenses) :prefix license:)
|
||||||
#:use-module (nonguix build-system binary)
|
#:use-module (nonguix build-system binary)
|
||||||
#:use-module (nonguix build-system chromium-binary)
|
#:use-module (nonguix build-system chromium-binary)
|
||||||
|
@ -78,65 +74,6 @@
|
||||||
(display "Disabled updates")
|
(display "Disabled updates")
|
||||||
(newline))))))))
|
(newline))))))))
|
||||||
|
|
||||||
(define discord-install
|
|
||||||
(with-imported-modules
|
|
||||||
'((guix build utils))
|
|
||||||
#~(lambda* (#:key outputs inputs #:allow-other-keys)
|
|
||||||
(use-modules (guix build utils)
|
|
||||||
(srfi srfi-26)
|
|
||||||
(sxml simple))
|
|
||||||
(let* ((line (lambda args
|
|
||||||
(display (apply string-append args)) (newline)))
|
|
||||||
(output (assoc-ref outputs "out"))
|
|
||||||
(libs (cons (string-append (assoc-ref inputs "nss") "/lib/nss")
|
|
||||||
(map (lambda (i) (string-append (cdr i) "/lib"))
|
|
||||||
inputs)))
|
|
||||||
(bins (map (lambda (i) (string-append (cdr i) "/bin"))
|
|
||||||
inputs))
|
|
||||||
(libs (filter file-exists? libs))
|
|
||||||
(bins (filter file-exists? bins)))
|
|
||||||
(mkdir-p (string-append output "/opt/discord"))
|
|
||||||
(copy-recursively "." (string-append output "/opt/discord"))
|
|
||||||
(mkdir-p (string-append output "/bin"))
|
|
||||||
(mkdir-p (string-append output "/share/pixmaps"))
|
|
||||||
(mkdir-p (string-append output "/share/applications"))
|
|
||||||
(mkdir-p (string-append output "/share/icons/hicolor/256x256/apps"))
|
|
||||||
(mkdir-p (string-append output "/etc"))
|
|
||||||
(with-output-to-file (string-append output "/bin/discord")
|
|
||||||
(lambda _
|
|
||||||
(line "#!/bin/sh")
|
|
||||||
(line #$discord-disable-breaking-updates)
|
|
||||||
(line "cd " output "/opt/discord")
|
|
||||||
(line "./Discord"
|
|
||||||
;; Always use Ozone on Wayland, not sure if this is a good idea.
|
|
||||||
" ${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer}"
|
|
||||||
" \"$@\"")))
|
|
||||||
(chmod (string-append output "/bin/discord") #o755)
|
|
||||||
(wrap-program
|
|
||||||
(string-append output "/bin/discord")
|
|
||||||
`("LD_LIBRARY_PATH" = (,(string-append output "/opt/discord") ,@libs))
|
|
||||||
`("PATH" prefix ,bins))
|
|
||||||
(for-each
|
|
||||||
(lambda (f)
|
|
||||||
(chmod (string-append output "/opt/discord/" f) #o755)
|
|
||||||
(invoke #+(file-append patchelf "/bin/patchelf")
|
|
||||||
"--set-interpreter"
|
|
||||||
(string-append #$glibc "/lib/ld-linux-x86-64.so.2")
|
|
||||||
(string-append output "/opt/discord/" f)))
|
|
||||||
(list "Discord" "chrome_crashpad_handler" "chrome-sandbox"))
|
|
||||||
(chmod (string-append output "/opt/discord/postinst.sh") #o755)
|
|
||||||
(link (string-append output "/opt/discord/discord.png")
|
|
||||||
(string-append output "/share/pixmaps/discord.png"))
|
|
||||||
(link (string-append output "/opt/discord/discord.png")
|
|
||||||
(string-append output "/share/icons/hicolor/256x256/apps/discord.png"))
|
|
||||||
(link (string-append output "/opt/discord/discord.desktop")
|
|
||||||
(string-append output "/share/applications/discord.desktop"))
|
|
||||||
(substitute*
|
|
||||||
(string-append output "/share/applications/discord.desktop")
|
|
||||||
(("Exec=.*$") (string-append "Exec=" output "/bin/discord\n"))
|
|
||||||
(("Path=.*$") (string-append "Path=" output "/opt/discord\n")))
|
|
||||||
#t))))
|
|
||||||
|
|
||||||
(define-public discord
|
(define-public discord
|
||||||
(package
|
(package
|
||||||
(name "discord")
|
(name "discord")
|
||||||
|
@ -149,54 +86,57 @@
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "12d5hghnn6a30szsdbay5rx5j31da8y51zxmxg4dcpc9m9wwpk63"))))
|
(base32 "12d5hghnn6a30szsdbay5rx5j31da8y51zxmxg4dcpc9m9wwpk63"))))
|
||||||
;; Use this build system to set XDG_DATA_DIRS and other variables.
|
;; Use this build system to set XDG_DATA_DIRS and other variables.
|
||||||
(build-system glib-or-gtk-build-system)
|
(build-system chromium-binary-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
|
#:patchelf-plan
|
||||||
|
#~`(("Discord") ("chrome_crashpad_handler") ("chrome-sandbox"))
|
||||||
|
#:install-plan
|
||||||
|
#~`(("." "opt/discord")
|
||||||
|
("discord.desktop" "/share/applications/")
|
||||||
|
("discord.sh" "bin/discord")
|
||||||
|
("discord.png" "share/icons/hicolor/256x256/apps/discord.png")
|
||||||
|
("discord.png" "share/pixmaps/discord.png"))
|
||||||
#:phases
|
#:phases
|
||||||
|
(with-imported-modules '((guix build utils)
|
||||||
|
(guix build glib-or-gtk-build-system))
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(delete 'bootstrap)
|
(add-after 'binary-unpack 'setup-cwd
|
||||||
(delete 'configure)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(delete 'build)
|
(use-modules (guix build utils))
|
||||||
(delete 'check)
|
(define output (assoc-ref outputs "out"))
|
||||||
(replace 'install #$discord-install))))
|
(substitute* "discord.desktop"
|
||||||
(inputs (list alsa-lib
|
(("Exec=.*$")
|
||||||
at-spi2-core
|
(string-append "Exec=" output "/bin/discord\n"))
|
||||||
cairo
|
(("Path=.*$")
|
||||||
cups
|
(string-append "Path=" output "/opt/discord\n")))
|
||||||
dbus
|
(with-output-to-file "discord.sh"
|
||||||
eudev
|
(lambda _
|
||||||
expat
|
(define (line . args)
|
||||||
fontconfig
|
(display (apply string-append args)) (newline))
|
||||||
freetype
|
(line "#!/bin/sh")
|
||||||
ffmpeg
|
(line #$discord-disable-breaking-updates)
|
||||||
(list gcc "lib")
|
(line "cd " output "/opt/discord")
|
||||||
|
(line "./Discord"
|
||||||
|
;; Always use Ozone on Wayland, not sure if this is a good idea.
|
||||||
|
" ${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer}"
|
||||||
|
" \"$@\"")))
|
||||||
|
(for-each
|
||||||
|
(lambda (f) (chmod f #o755))
|
||||||
|
'("Discord" "chrome_crashpad_handler" "chrome-sandbox"
|
||||||
|
"discord.sh" "postinst.sh"))))
|
||||||
|
(add-after 'install 'glib-or-gtk-wrap
|
||||||
|
(assoc-ref (@ (guix build glib-or-gtk-build-system)
|
||||||
|
%standard-phases)
|
||||||
|
'glib-or-gtk-wrap))))))
|
||||||
|
(inputs (list ffmpeg
|
||||||
gdk-pixbuf
|
gdk-pixbuf
|
||||||
glib
|
|
||||||
glibc
|
glibc
|
||||||
gtk+
|
|
||||||
libappindicator
|
libappindicator
|
||||||
libcxx
|
libcxx
|
||||||
libdbusmenu
|
libdbusmenu
|
||||||
libdrm
|
|
||||||
libglvnd
|
libglvnd
|
||||||
libnotify
|
|
||||||
libx11
|
|
||||||
libxcb
|
|
||||||
libxcomposite
|
|
||||||
libxcursor
|
|
||||||
libxdamage
|
|
||||||
libxext
|
|
||||||
libxfixes
|
|
||||||
libxi
|
|
||||||
libxrandr
|
|
||||||
libxrender
|
|
||||||
libxscrnsaver
|
libxscrnsaver
|
||||||
libxshmfence
|
|
||||||
libxtst
|
|
||||||
mesa
|
|
||||||
nspr
|
|
||||||
nss
|
|
||||||
pango
|
|
||||||
util-linux
|
util-linux
|
||||||
wayland
|
wayland
|
||||||
;; Not sure if all of these are needed.
|
;; Not sure if all of these are needed.
|
||||||
|
@ -210,7 +150,7 @@
|
||||||
wget
|
wget
|
||||||
xdg-utils))
|
xdg-utils))
|
||||||
(synopsis "Discord chat client")
|
(synopsis "Discord chat client")
|
||||||
(description "All-in-one cross-platform voice and text chat for gamers")
|
(description "All-in-one cross-platform voice and text chat for gamers.")
|
||||||
(license (license:nonfree "https://discord.com/terms"))
|
(license (license:nonfree "https://discord.com/terms"))
|
||||||
(home-page "https://discordapp.com")))
|
(home-page "https://discordapp.com")))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user