diff options
| author | John Kehayias <john.kehayias@protonmail.com> | 2022-10-14 14:51:58 -0400 |
|---|---|---|
| committer | John Kehayias <john.kehayias@protonmail.com> | 2022-10-14 14:51:58 -0400 |
| commit | 0e902d14e45b491054272a6bd00cf3e40aaf3cf4 (patch) | |
| tree | b340500aa61ddbffe4db4927cd550dec2b69f55c | |
| parent | 208b549eb92d63f64c618f051b88b96d79b8d15d (diff) | |
nongnu: Add discord.discord
* nongnu/packages/messaging.scm (discord): New variable.
| -rw-r--r-- | nongnu/packages/messaging.scm | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/nongnu/packages/messaging.scm b/nongnu/packages/messaging.scm index 1d833e2..01d5794 100644 --- a/nongnu/packages/messaging.scm +++ b/nongnu/packages/messaging.scm | |||
| @@ -47,6 +47,130 @@ | |||
| 47 | #:use-module ((nonguix licenses) :prefix license:) | 47 | #:use-module ((nonguix licenses) :prefix license:) |
| 48 | #:use-module (ice-9 match)) | 48 | #:use-module (ice-9 match)) |
| 49 | 49 | ||
| 50 | (define-public discord | ||
| 51 | (package | ||
| 52 | (name "discord") | ||
| 53 | (version "0.0.20") | ||
| 54 | (source | ||
| 55 | (origin | ||
| 56 | (method url-fetch) | ||
| 57 | (uri | ||
| 58 | (string-append | ||
| 59 | "https://dl.discordapp.net/apps/linux/" version "/" name "-" version ".deb")) | ||
| 60 | (sha256 | ||
| 61 | (base32 "036pg6xi6jwn7qadfbdq88w55mwyszy83sq4xnfbhm1xw5gmn16n")))) | ||
| 62 | (supported-systems '("x86_64-linux")) | ||
| 63 | (build-system binary-build-system) | ||
| 64 | (arguments | ||
| 65 | (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files | ||
| 66 | #:patchelf-plan | ||
| 67 | #~'(("lib/discord/Discord" | ||
| 68 | ("alsa-lib" "at-spi2-atk" "at-spi2-core" "atk" "cairo" "cups" | ||
| 69 | "dbus" "expat" "fontconfig-minimal" "gcc" "gdk-pixbuf" "glib" | ||
| 70 | "gtk+" "libdrm" "libnotify" "libx11" "libxcb" | ||
| 71 | "libxcomposite" "libxcursor" "libxdamage" "libxext" "libxfixes" | ||
| 72 | "libxi" "libxkbcommon" "libxkbfile" "libxrandr" "libxshmfence" | ||
| 73 | "libxrender" "libxkbcommon" "libxkbfile" "libxrandr" "libxtst" | ||
| 74 | "libxtst" "mesa" "nspr" "pango" "pulseaudio" "zlib"))) | ||
| 75 | #:phases | ||
| 76 | #~(modify-phases %standard-phases | ||
| 77 | (replace 'unpack | ||
| 78 | (lambda _ | ||
| 79 | (invoke "ar" "x" #$source) | ||
| 80 | (invoke "tar" "xvf" "data.tar.gz") | ||
| 81 | (copy-recursively "usr/" ".") | ||
| 82 | ;; Use the more standard lib directory for everything. | ||
| 83 | (mkdir-p "lib") | ||
| 84 | (rename-file "share/discord" "lib/discord") | ||
| 85 | ;; Remove unneeded files. | ||
| 86 | (delete-file-recursively "bin") | ||
| 87 | (delete-file "control.tar.gz") | ||
| 88 | (delete-file "data.tar.gz") | ||
| 89 | (delete-file "debian-binary"))) | ||
| 90 | (add-after 'unpack 'fix-desktop-file | ||
| 91 | (lambda _ | ||
| 92 | ;; Fix the .desktop file binary location. | ||
| 93 | (rename-file "lib/discord/discord.desktop" "share/applications/discord.desktop") | ||
| 94 | (substitute* '("share/applications/discord.desktop") | ||
| 95 | (("/usr/share/") | ||
| 96 | (string-append #$output "/lib/"))) | ||
| 97 | ;; And move the icon, replacing the (broken) symlink. | ||
| 98 | (rename-file "lib/discord/discord.png" "share/pixmaps/discord.png"))) | ||
| 99 | (add-after 'install 'symlink-binary-file-and-cleanup | ||
| 100 | (lambda _ | ||
| 101 | (delete-file (string-append #$output "/environment-variables")) | ||
| 102 | (mkdir-p (string-append #$output "/bin")) | ||
| 103 | (symlink (string-append #$output "/lib/discord/Discord") | ||
| 104 | (string-append #$output "/bin/discord")))) | ||
| 105 | (add-after 'install 'wrap-where-patchelf-does-not-work | ||
| 106 | (lambda _ | ||
| 107 | (wrap-program (string-append #$output "/lib/discord/Discord") | ||
| 108 | `("FONTCONFIG_PATH" ":" prefix | ||
| 109 | (,(string-join | ||
| 110 | (list | ||
| 111 | (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts") | ||
| 112 | #$output) | ||
| 113 | ":"))) | ||
| 114 | `("LD_LIBRARY_PATH" ":" prefix | ||
| 115 | (,(string-join | ||
| 116 | (list | ||
| 117 | (string-append #$(this-package-input "nss") "/lib/nss") | ||
| 118 | (string-append #$(this-package-input "eudev") "/lib") | ||
| 119 | (string-append #$(this-package-input "gcc") "/lib") | ||
| 120 | (string-append #$(this-package-input "libnotify") "/lib") | ||
| 121 | (string-append #$(this-package-input "libxkbfile") "/lib") | ||
| 122 | (string-append #$(this-package-input "mesa") "/lib") | ||
| 123 | (string-append #$(this-package-input "pulseaudio") "/lib") | ||
| 124 | (string-append #$(this-package-input "sqlcipher") "/lib") | ||
| 125 | (string-append #$(this-package-input "zlib") "/lib") | ||
| 126 | (string-append #$output "/lib/discord") | ||
| 127 | #$output) | ||
| 128 | ":"))))))))) | ||
| 129 | (native-inputs (list tar)) | ||
| 130 | (inputs | ||
| 131 | (list alsa-lib | ||
| 132 | at-spi2-atk | ||
| 133 | at-spi2-core | ||
| 134 | atk | ||
| 135 | cairo | ||
| 136 | cups | ||
| 137 | dbus | ||
| 138 | eudev | ||
| 139 | expat | ||
| 140 | fontconfig | ||
| 141 | `(,gcc "lib") | ||
| 142 | glib | ||
| 143 | gtk+ | ||
| 144 | libdrm | ||
| 145 | libnotify | ||
| 146 | librsvg | ||
| 147 | libx11 | ||
| 148 | libxcb | ||
| 149 | libxcomposite | ||
| 150 | libxcursor | ||
| 151 | libxdamage | ||
| 152 | libxext | ||
| 153 | libxfixes | ||
| 154 | libxi | ||
| 155 | libxkbcommon | ||
| 156 | libxkbfile | ||
| 157 | libxrandr | ||
| 158 | libxrender | ||
| 159 | libxshmfence | ||
| 160 | libxtst | ||
| 161 | mesa | ||
| 162 | nspr | ||
| 163 | nss | ||
| 164 | pango | ||
| 165 | pulseaudio | ||
| 166 | sqlcipher | ||
| 167 | zlib)) | ||
| 168 | (home-page "https://discord.com/") | ||
| 169 | (synopsis "All-in-one voice, video, and text chat for gamers") | ||
| 170 | (description "Discord is a cross-platform text, voice, and video chat platform aimed at | ||
| 171 | gamers.") | ||
| 172 | (license (license:nonfree "https://discord.com/terms")))) | ||
| 173 | |||
| 50 | (define-public element-desktop | 174 | (define-public element-desktop |
| 51 | (package | 175 | (package |
| 52 | (name "element-desktop") | 176 | (name "element-desktop") |
