;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Fabian Harfert ;;; Copyright © 2016, 2017 Efraim Flashner ;;; Copyright © 2017 Nikita ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2019 Guy Fleury Iteriteka ;;; Copyright © 2020 Jonathan Brielmaier ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2021 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY o
aboutsummaryrefslogtreecommitdiff
blob: 71c028c7887507ff6add02deab74678b9683d04a (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu home services xdg)
  #:use-module (gnu services configuration)
  #:use-module (gnu home services)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu home services utils)
  #:use-module (guix gexp)
  #:use-module (guix records)
  #:use-module (guix i18n)
  #:use-module (guix diagnostics)

  #:use-module (ice-9 match)
  #:use-module (srfi srfi-1)
  #:use-module (rnrs enums)

  #:export (home-xdg-base-directories-service-type
            home-xdg-base-directories-configuration
            home-xdg-base-directories-configuration?

            home-xdg-user-directories-service-type
            home-xdg-user-directories-configuration
            home-xdg-user-directories-configuration?

            xdg-desktop-action
            xdg-desktop-entry
            home-xdg-mime-applications-service-type
            home-xdg-mime-applications-configuration))

;;; Commentary:
;;
;; This module contains services related to XDG directories and
;; applications.
;;
;; - XDG base directories
;; - XDG user directories
;; - XDG MIME applications
;;
;;; Code:


;;;
;;; XDG base directories.
;;;

(define (serialize-path field-name val) "")
(define path? string?)

(define-configuration home-xdg-base-directories-configuration
  (cache-home
   (path "$HOME/.cache")
   "Base directory for programs to store user-specific non-essential
(cached) data.  Files in this directory can be deleted anytime without
loss of important data.")
  (config-home
   (path "$HOME/.config")
   "Base directory for programs to store configuration files.
Some programs store here log or state files, but it's not desired,
this directory should contain static configurations.")
  (data-home
   (path "$HOME/.local/share")
   "Base directory for programs to store architecture independent
read-only shared data, analogus to @file{/usr/share}, but for user.")
  (runtime-dir
   (path "${XDG_RUNTIME_DIR:-/run/user/$UID}")
   "Base directory for programs to store user-specific runtime files,
like sockets.")
  (log-home
   (path "$HOME/.local/var/log")
   "Base directory for programs to store log files, analogus to
@file{/var/log}, but for user.  It is not a part of XDG Base Directory
Specification, but helps to make implementation of home services more
consistent.")
  (state-home
   (path "$HOME/.local/var/lib")
   "Base directory for programs to store state files, like databases,
analogus to @file{/var/lib}, but for user.  It is not a part of XDG
Base Directory Specification, but helps to make implementation of home
services more consistent."))

(define (home-xdg-base-directories-environment-variables-service config)
  (map
   (lambda (field)
     (cons (format
            #f "XDG_~a"
            (object->snake-case-string (configuration-field-name field) 'upper))
           ((configuration-field-getter field) config)))
   home-xdg-base-directories-configuration-fields))

(define (ensure-xdg-base-dirs-on-activation config)
  #~(map (lambda (xdg-base-dir-variable)
           ((@@ (guix build utils) mkdir-p)
            (getenv
             xdg-base-dir-variable)))
         '#$(map (lambda (field)
                   (format
                    #f "XDG_~a"
                    (object->snake-case-string
                     (configuration-field-name field) 'upper)))
                 home-xdg-base-directories-configuration-fields)))

(define (last-extension-or-cfg config extensions)
  "Picks configuration value from last provided extension.  If there
are no extensions use configuration instead."
  (or (and (not (null? extensions)) (last extensions)) config))

(define home-xdg-base-directories-service-type
  (service-type (name 'home-xdg-base-directories)
                (extensions
                 (list (service-extension
                        home-environment-variables-service-type
                        home-xdg-base-directories-environment-variables-service)
                       (service-extension
                        home-activation-service-type
                        ensure-xdg-base-dirs-on-activation)))
                (default-value (home-xdg-base-directories-configuration))
                (compose identity)
                (extend last-extension-or-cfg)
                (description "Configure XDG base directories.  This
service introduces two additional variables @env{XDG_STATE_HOME},
@env{XDG_LOG_HOME}.  They are not a part of XDG specification, at
least yet, but are convenient to have, it improves the consistency
between different home services.  The services of this service-type is
instantiated by default, to provide non-default value, extend the
service-type (using @code{simple-service} for example).")))

(define (generate-home-xdg-base-directories-documentation)
  (generate-documentation
   `((home-xdg-base-directories-configuration
      ,home-xdg-base-directories-configuration-fields))
   'home-xdg-base-directories-configuration))


;;;
;;; XDG user directories.
;;;

(define (serialize-string field-name val)
  ;; The path has to be quoted
  (format #f "XDG_~a_DIR=\"~a\"\n"
          (object->snake-case-string field-name 'upper) val))

(define-configuration home-xdg-user-directories-configuration
  (desktop
   (string "$HOME/Desktop")
   "Default ``desktop'' directory, this is what you see on your
desktop when using a desktop environment,
e.g. GNOME (@pxref{XWindow,,,guix.info}).")
  (documents
   (string "$HOME/Documents")
   "Default directory to put documents like PDFs.")
  (download
   (string "$HOME/Downloads")
   "Default directory downloaded files, this is where your Web-broser
will put downloaded files in.")
  (music
   (string "$HOME/Music")
   "Default directory for audio files.")
  (pictures
   (string "$HOME/Pictures")
   "Default directory for pictures and images.")
  (publicshare
   (string "$HOME/Public")
   "Default directory for shared files, which can be accessed by other
users on local machine or via network.")
  (templates
   (string "$HOME/Templates")
   "Default directory for templates.  They can be used by graphical
file manager or other apps for creating new files with some
pre-populated content.")
  (videos
   (string "$HOME/Videos")
   "Default directory for videos."))

(define (home-xdg-user-directories-files-service config)
  `(("user-dirs.conf"
     ,(mixed-text-file
       "user-dirs.conf"
       "enabled=False\n"))
    ("user-dirs.dirs"
     ,(mixed-text-file
       "user-dirs.dirs"
      (serialize-configuration
       config
       home-xdg-user-directories-configuration-fields)))))

(define (home-xdg-user-directories-activation-service config)
  (let ((dirs (map (lambda (field)
                     ((configuration-field-getter field) config))
                   home-xdg-user-directories-configuration-fields)))
    #~(let ((ensure-dir
             (lambda (path)
               (mkdir-p
                ((@@ (ice-9 string-fun) string-replace-substring)
                 path "$HOME" (getenv "HOME"))))))
        (display "Creating XDG user directories...")
        (map ensure-dir '#$dirs)
        (display " done\n"))))

(define home-xdg-user-directories-service-type
  (service-type (name 'home-xdg-user-directories)
                (extensions
                 (list (service-extension
                        home-xdg-configuration-files-service-type
                        home-xdg-user-directories-files-service)
                       (service-extension
                        home-activation-service-type
                        home-xdg-user-directories-activation-service)))
                (default-value (home-xdg-user-directories-configuration))
                (description "Configure XDG user directories.  To
disable a directory, point it to the $HOME.")))

(define (generate-home-xdg-user-directories-documentation)
  (generate-documentation
   `((home-xdg-user-directories-configuration
     ,home-xdg-user-directories-configuration-fields))
   'home-xdg-user-directories-configuration))


;;;
;;; XDG MIME applications.
;;;

;; Example config
;;
;;  (home-xdg-mime-applications-configuration
;;   (added '((x-scheme-handler/magnet . torrent.desktop)))
;;   (default '((inode/directory . file.desktop)))
;;   (removed '((inode/directory . thunar.desktop)))
;;   (desktop-entries
;;    (list (xdg-desktop-entry
;;           (file "file")
;;           (name "File manager")
;;           (type 'application)
;;           (config
;;            '((exec . "emacsclient -c -a emacs %u"))))
;;          (xdg-desktop-entry
;;           (file "text")
;;           (name "Text editor")
;;           (type 'application)
;;           (config
;;            '((exec . "emacsclient -c -a emacs %u")))
;;           (actions
;;            (list (xdg-desktop-action
;;                   (action 'create)
;;                   (name "Create an action")
;;                   (config
;;                    '((exec . "echo hi"))))))))))

;; See
;; <https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html>
;; <https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html>

(define (serialize-alist field-name val)
  (define (serialize-mimelist-entry key val)
    (let ((val (cond
                ((list? val)
                 (string-join (map maybe-object->string val) ";"))
                ((or (string? val) (symbol? val))
                 val)
                (else (raise (formatted-message
                              (G_ "\
The value of an XDG MIME entry must be a list, string or symbol, was given ~a")
                              val))))))
      (format #f "~a=~a\n" key val)))

  (define (merge-duplicates alist acc)
    "Merge values that have the same key.

@example
(merge-duplicates '((key1 . value1)
                    (key2 . value2)
                    (key1 . value3)
                    (key1 . value4)) '())

@result{} ((key1 . (value4 value3 value1)) (key2 . value2))
@end example"
    (cond
     ((null? alist) acc)
     (else (let* ((head (first alist))
                  (tail (cdr alist))
                  (key (first head))
                  (value (cdr head))
                  (duplicate? (assoc key acc))
                  (ensure-list (lambda (x)
                                 (if (list? x) x (list x)))))
             (if duplicate?
                 ;; XXX: This will change the order of things,
                 ;; though, it shouldn't be a problem for XDG MIME.
                 (merge-duplicates
                  tail
                  (alist-cons key
                              (cons value (ensure-list (cdr duplicate?)))
                              (alist-delete key acc)))
                 (merge-duplicates tail (cons head acc)))))))

  (string-append (if (equal? field-name 'default)
                     "\n[Default Applications]\n"
                     (format #f "\n[~a Associations]\n"
                             (string-capitalize (symbol->string field-name))))
                 (generic-serialize-alist string-append
                                          serialize-mimelist-entry
                                          (merge-duplicates val '()))))

(define xdg-desktop-types (make-enumeration
                           '(application
                             link
                             directory)))

(define (xdg-desktop-type? type)
  (unless (enum-set-member? type xdg-desktop-types)
    (raise (formatted-message
            (G_ "XDG desktop type must be of of ~a, was given: ~a")
            (list->human-readable-list (enum-set->list xdg-desktop-types))
            type))))

;; TODO: Add proper docs for this
;; XXX: 'define-configuration' require that fields have a default
;; value.
(define-record-type* <xdg-desktop-action>
  xdg-desktop-action make-xdg-desktop-action
  xdg-desktop-action?
  (action xdg-desktop-action-action)  ; symbol
  (name   xdg-desktop-action-name)    ; string
  (config xdg-desktop-action-config   ; alist
          (default '())))

(define-record-type* <xdg-desktop-entry>
  xdg-desktop-entry make-xdg-desktop-entry
  xdg-desktop-entry?
  ;; ".desktop" will automatically be added
  (file    xdg-desktop-entry-file)    ; string
  (name    xdg-desktop-entry-name)    ; string
  (type    xdg-desktop-entry-type)    ; xdg-desktop-type
  (config  xdg-desktop-entry-config   ; alist
           (default '()))
  (actions xdg-desktop-entry-actions  ; list of <xdg-desktop-action>
           (default '())))

(define desktop-entries? (list-of xdg-desktop-entry?))
(define (serialize-desktop-entries field-name val) "")

(define (serialize-xdg-desktop-entry entry)
  "Return a tuple of the file name for ENTRY and the serialized
configuration."
  (define (format-config key val)
    (let ((val (cond
                ((list? val)
                 (string-join (map maybe-object->string val) ";"))
                ((boolean? val)
                 (if val "true" "false"))
                (else val)))
          (key (string-capitalize (maybe-object->string key))))
      (list (if (string-suffix? key "?")
                (string-drop-right key (- (string-length key) 1))
                key)
            "=" val "\n")))

  (define (serialize-alist config)
    (generic-serialize-alist append format-config config))

  (define (serialize-xdg-desktop-action action)
    (match action
      (($ <xdg-desktop-action> action name config)
       `(,(format #f "[Desktop Action ~a]\n"
                  (string-capitalize (maybe-object->string action)))
         ,(format #f "Name=~a\n" name)
         ,@(serialize-alist config)))))

  (match entry
    (($ <xdg-desktop-entry> file name type config actions)
     (list (if (string-suffix? file ".desktop")
               file
               (string-append file ".desktop"))
           `("[Desktop Entry]\n"
             ,(format #f "Name=~a\n" name)
             ,(format #f "Type=~a\n"
                      (string-capitalize (symbol->string type)))
             ,@(serialize-alist config)
             ,@(append-map serialize-xdg-desktop-action actions))))))

(define-configuration home-xdg-mime-applications-configuration
  (added
   (alist '())
   "An association list of MIME types and desktop entries which indicate
that the application should used to open the specified MIME type.  The
value has to be string, symbol, or list of strings or symbols, this
applies to the `@code{default}', and `@code{removed}' fields as well.")
  (default
    (alist '())
    "An association list of MIME types and desktop entries which indicate
that the application should be the default for opening the specified
MIME type.")
  (removed
   (alist '())
   "An association list of MIME types and desktop entries which indicate
that the application cannot open the specified MIME type.")
  (desktop-entries
   (desktop-entries '())
   "A list of XDG desktop entries to create.  See
@code{xdg-desktop-entry}."))

(define (home-xdg-mime-applications-files config)
  (define (add-xdg-desktop-entry-file entry)
    (let ((file (first entry))
          (config (second entry)))
      ;; TODO: Use xdg-data-files instead of home-files here
      (list (format #f "applications/~a" file)
          (apply mixed-text-file
                 (format #f "xdg-desktop-~a-entry" file)
                 config))))
  (map (compose add-xdg-desktop-entry-file serialize-xdg-desktop-entry)
       (home-xdg-mime-applications-configuration-desktop-entries config)))

(define (home-xdg-mime-applications-xdg-files config)
  `(("mimeapps.list"
     ,(mixed-text-file
       "xdg-mime-appplications"
       (serialize-configuration
        config
        home-xdg-mime-applications-configuration-fields)))))

(define (home-xdg-mime-applications-extension old-config extension-configs)
  (define (extract-fields config)
    ;; return '(added default removed desktop-entries)
    (list (home-xdg-mime-applications-configuration-added config)
          (home-xdg-mime-applications-configuration-default config)
          (home-xdg-mime-applications-configuration-removed config)
          (home-xdg-mime-applications-configuration-desktop-entries config)))

  (define (append-configs elem acc)
    (list (append (first elem) (first acc))
          (append (second elem) (second acc))
          (append (third elem) (third acc))
          (append (fourth elem) (fourth acc))))

  ;; TODO: Implement procedure to check for duplicates without
  ;; sacrificing performance.
  ;;
  ;; Combine all the alists from 'added', 'default' and 'removed'
  ;; into one big alist.
  (let ((folded-configs (fold append-configs
                              (extract-fields old-config)
                              (map extract-fields extension-configs))))
    (home-xdg-mime-applications-configuration
     (added (first folded-configs))
     (default (second folded-configs))
     (removed (third folded-configs))
     (desktop-entries (fourth folded-configs)))))

(define home-xdg-mime-applications-service-type
  (service-type (name 'home-xdg-mime-applications)
                (extensions
                 (list (service-extension
                        home-xdg-data-files-service-type
                        home-xdg-mime-applications-files)
                       (service-extension
                        home-xdg-configuration-files-service-type
                        home-xdg-mime-applications-xdg-files)))
                (compose identity)
                (extend home-xdg-mime-applications-extension)
                (default-value (home-xdg-mime-applications-configuration))
                (description
                 "Configure XDG MIME applications, and XDG desktop entries.")))
(inputs (list atk glib gtk+ libxml2 libcanberra pango)) (home-page "https://mate-desktop.org/") (synopsis "Calculator for MATE") (description "Mate Calc is the GTK+ calculator application for the MATE Desktop.") (license license:gpl2+))) (define-public mate-backgrounds (package (name "mate-backgrounds") (version "1.24.1") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0b9yx68p9l867bqsl9z2g4wrs8p396ls673jgaliys5snmk8n8dn")))) (build-system glib-or-gtk-build-system) (native-inputs (list intltool)) (home-page "https://mate-desktop.org/") (synopsis "Calculator for MATE") (description "This package contains a collection of graphics files which can be used as backgrounds in the MATE Desktop environment.") (license license:gpl2+))) (define-public mate-netbook (package (name "mate-netbook") (version "1.24.0") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1bmk9gq5gcqkvfppa7i1hqfph8sajc3xs189s4ha97g0ifwd98a8")))) (build-system glib-or-gtk-build-system) (native-inputs (list gettext-minimal intltool pkg-config)) (inputs (list cairo glib gtk+ libfakekey libwnck libxtst libx11 mate-panel xorgproto)) (home-page "https://mate-desktop.org/") (synopsis "Tool for MATE on Netbooks") (description "Mate Netbook is a simple window management tool which: @enumerate @item Allows you to set basic rules for a window type, such as maximise|undecorate @item Allows exceptions to the rules, based on string matching for window name and window class. @item Allows @code{reversing} of rules when the user manually changes something: Re-decorates windows on un-maximise. @end enumerate\n") (license license:gpl3+))) (define-public mate-screensaver (package (name "mate-screensaver") (version "1.24.1") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" "mate-screensaver-" version ".tar.xz")) (sha256 (base32 "0imb1z2yvz1h95dzq396c569kkxys9mb2dyc6qxxxcnc5w02a2dw")))) (build-system glib-or-gtk-build-system) (arguments `(#:configure-flags ;; FIXME: There is a permissions problem with screen locking ;; which effectively locks you out completely. Enable locking ;; once this has been fixed. (list "--enable-locking" "--with-kbd-layout-indicator" "--with-xf86gamma-ext" "--enable-pam" "--disable-schemas-compile" "--without-console-kit") #:phases (modify-phases %standard-phases (add-after 'unpack 'autoconf (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (dbus-dir (string-append out "/share/dbus-1/services"))) (setenv "SHELL" (which "sh")) (setenv "CONFIG_SHELL" (which "sh")) (substitute* "configure" (("dbus-1") "")))))))) (native-inputs `(("automake" ,automake) ("autoconf" ,autoconf) ("gettext" ,gettext-minimal) ("intltool" ,intltool) ("mate-common" ,mate-common) ("pkg-config" ,pkg-config) ("which" ,which) ("xorgproto" ,xorgproto))) (inputs (list cairo dconf dbus dbus-glib glib gtk+ (librsvg-for-system) libcanberra libglade libmatekbd libnotify libx11 libxext libxklavier libxrandr libxrender libxscrnsaver libxxf86vm linux-pam mate-desktop mate-menus pango startup-notification)) (home-page "https://mate-desktop.org/") (synopsis "Screensaver for MATE") (description "MATE backgrounds package contains a collection of graphics files which can be used as backgrounds in the MATE Desktop environment.") (license license:gpl2+))) (define-public mate-utils (package (name "mate-utils") (version "1.24.0") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1b16n1628gcsym5mph6lr9x5xm4rgkxsa8xwr2wlx8g2gw2775i1")))) (build-system glib-or-gtk-build-system) (native-inputs (list gettext-minimal gtk-doc intltool libice libsm pkg-config scrollkeeper xorgproto yelp-tools)) (inputs (list atk cairo glib gtk+ (librsvg-for-system) libcanberra libgtop libx11 libxext mate-panel pango udisks zlib)) (home-page "https://mate-desktop.org/") (synopsis "Utilities for the MATE Desktop") (description "Mate Utilities for the MATE Desktop containing: @enumerate @item mate-system-log @item mate-search-tool @item mate-dictionary @item mate-screenshot @item mate-disk-usage-analyzer @end enumerate\n") (license (list license:gpl2 license:fdl1.1+ license:lgpl2.1)))) (define-public eom (package (name "eom") (version "1.24.1") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" "eom-" version ".tar.xz")) (sha256 (base32 "0dralsc0dvs0l38cysdhx6kiaiqlb8qi6g9xz2cm6mjqyq3d3f9f")))) (build-system glib-or-gtk-build-system) (native-inputs (list gettext-minimal gtk-doc gobject-introspection intltool pkg-config yelp-tools)) (inputs (list atk cairo dconf dbus dbus-glib exempi glib gtk+ libcanberra libx11 libxext libpeas libxml2 libexif libjpeg-turbo (librsvg-for-system) lcms mate-desktop pango shared-mime-info startup-notification zlib)) (home-page "https://mate-desktop.org/") (synopsis "Eye of MATE") (description "Eye of MATE is the Image viewer for the MATE Desktop.") (license license:gpl2))) (define-public engrampa (package (name "engrampa") (version "1.24.1") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" "engrampa-" version ".tar.xz")) (sha256 (base32 "0akjnz85qkpiqgj1ccn41rzbfid4l3r3nsm4s9s779ilzd7f097y")))) (build-system glib-or-gtk-build-system) (arguments `(#:configure-flags (list "--disable-schemas-compile" "--disable-run-in-place" "--enable-magic" "--enable-packagekit" (string-append "--with-cajadir=" (assoc-ref %outputs "out") "/lib/caja/extensions-2.0/")) #:phases (modify-phases %standard-phases (add-before 'install 'skip-gtk-update-icon-cache ;; Don't create 'icon-theme.cache'. (lambda _ (substitute* "data/Makefile" (("gtk-update-icon-cache") "true")) #t))))) (native-inputs `(("gettext" ,gettext-minimal) ("gtk-doc" ,gtk-doc) ("intltool" ,intltool) ("pkg-config" ,pkg-config) ("yelp-tools" ,yelp-tools))) (inputs (list caja file glib gtk+ (librsvg-for-system) json-glib libcanberra libx11 libsm packagekit pango)) (home-page "https://mate-desktop.org/") (synopsis "Archive Manager for MATE") (description "Engrampa is the archive manager for the MATE Desktop.") (license license:gpl2))) (define-public pluma (package (name "pluma") (version "1.24.1") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1sgc5f480icr2ans6gd3akvcax58mr4jp3zjk3xn7bx1mw9i299f")))) (build-system glib-or-gtk-build-system) (arguments `(; Tests can not succeed. ;; https://github.com/mate-desktop/mate-text-editor/issues/33 #:tests? #f)) (native-inputs `(("gettext" ,gettext-minimal) ("gtk-doc" ,gtk-doc) ("gobject-introspection" ,gobject-introspection) ("intltool" ,intltool) ("libtool" ,libtool) ("pkg-config" ,pkg-config) ("yelp-tools" ,yelp-tools))) (inputs (list atk cairo enchant-1.6 glib gtk+ gtksourceview-3 gdk-pixbuf iso-codes libcanberra libx11 libsm libpeas libxml2 libice packagekit pango python scrollkeeper)) (home-page "https://mate-desktop.org/") (synopsis "Text Editor for MATE") (description "Pluma is the text editor for the MATE Desktop.") (license license:gpl2))) (define-public mate-system-monitor (package (name "mate-system-monitor") (version "1.24.1") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" "mate-system-monitor-" version ".tar.xz")) (sha256 (base32 "1i2r4lw6xsk972yp15g5hm8p8xx9pp6jmcvvzbdq80xyx3x898qz")))) (build-system glib-or-gtk-build-system) (native-inputs (list autoconf gettext-minimal intltool pkg-config yelp-tools)) (inputs (list cairo glib glibmm gtkmm-3 gtk+ gdk-pixbuf libsigc++ libcanberra libxml2 libwnck libgtop (librsvg-for-system) polkit)) (home-page "https://mate-desktop.org/") (synopsis "System Monitor for MATE") (description "Mate System Monitor provides a tool for for the MATE Desktop to monitor your system resources and usage.") (license license:gpl2))) (define-public mate-polkit (package (name "mate-polkit") (version "1.24.0") (source (origin (method url-fetch) (uri (string-append "mirror://mate/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1450bqzlnvwy3xa98lj102j2cf7piqbxcd1cy2zp41rdl8ri3gvn")))) (build-system glib-or-gtk-build-system) (native-inputs (list gettext-minimal gtk-doc intltool libtool pkg-config)) (inputs (list accountsservice glib gobject-introspection gtk+ gdk-pixbuf polkit)) (home-page "https://mate-desktop.org/") (synopsis "Polkit authentication agent for MATE") (description "MATE Polkit is a MATE specific D-Bus service that is used to bring up authentication dialogs.") (license license:lgpl2.1))) (define-public mate (package (name "mate") (version (package-version mate-desktop)) (source #f) (build-system trivial-build-system) (arguments `(#:modules ((guix build union)) #:builder (begin (use-modules (ice-9 match) (guix build union)) (match %build-inputs (((names . directories) ...) (union-build (assoc-ref %outputs "out") directories) #t))))) (native-inputs (list desktop-file-utils)) (inputs ;; TODO: Add more packages `(("at-spi2-core" ,at-spi2-core) ("atril" ,atril) ("caja" ,caja) ("dbus" ,dbus) ("dconf" ,dconf) ("engrampa" ,engrampa) ("eom" ,eom) ("font-abattis-cantarell" ,font-abattis-cantarell) ("glib-networking" ,glib-networking) ("gnome-keyring" ,gnome-keyring) ("gvfs" ,gvfs) ("hicolor-icon-theme" ,hicolor-icon-theme) ("libmatekbd" ,libmatekbd) ("libmateweather" ,libmateweather) ("libmatemixer" ,libmatemixer) ("marco" ,marco) ("mate-session-manager" ,mate-session-manager) ("mate-settings-daemon" ,mate-settings-daemon) ("mate-desktop" ,mate-desktop) ("mate-terminal" ,mate-terminal) ("mate-themes" ,mate-themes) ("mate-icon-theme" ,mate-icon-theme) ("mate-power-manager" ,mate-power-manager) ("mate-menu" ,mate-menus) ("mate-panel" ,mate-panel) ("mate-control-center" ,mate-control-center) ("mate-media" ,mate-media) ("mate-applets" ,mate-applets) ("mate-user-guide" ,mate-user-guide) ("mate-calc" ,mate-calc) ("mate-backgrounds" ,mate-backgrounds) ("mate-netbook" ,mate-netbook) ("mate-utils" ,mate-utils) ("mate-polkit" ,mate-polkit) ("mate-system-monitor" ,mate-system-monitor) ("mate-utils" ,mate-utils) ("pluma" ,pluma) ("pinentry-gnome3" ,pinentry-gnome3) ("pulseaudio" ,pulseaudio) ("shared-mime-info" ,shared-mime-info) ("yelp" ,yelp) ("zenity" ,zenity))) (propagated-inputs ;; Default font that applications such as IceCat require. (list font-dejavu)) (synopsis "The MATE desktop environment") (home-page "https://mate-desktop.org/") (description "The MATE Desktop Environment is the continuation of GNOME 2. It provides an intuitive and attractive desktop environment using traditional metaphors for GNU/Linux systems. MATE is under active development to add support for new technologies while preserving a traditional desktop experience.") (license license:gpl2+)))