;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Andreas Enge ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016,2017 Hartmut Goebel ;;; Copyright © 2016 David Craven ;;; Copyright © 2017 Thomas Danckaert ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; ;;; 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 Publi
aboutsummaryrefslogtreecommitdiff
blob: b679ad9b1e44036a8155717807e773b7a6ceb9cc (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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
;;; guix-command.el --- Popup interface for guix commands  -*- lexical-binding: t -*-

;; Copyright © 2015 Alex Kost <alezost@gmail.com>

;; 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 this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This file provides a magit-like popup interface for running guix
;; commands in Guix REPL.  The entry point is "M-x guix".  When it is
;; called the first time, "guix --help" output is parsed and
;; `guix-COMMAND-action' functions are generated for each available guix
;; COMMAND.  Then a window with these commands is popped up.  When a
;; particular COMMAND is called, "guix COMMAND --help" output is parsed,
;; and a user get a new popup window with available options for this
;; command and so on.

;; To avoid hard-coding all guix options, actions, etc., as much data is
;; taken from "guix ... --help" outputs as possible.  But this data is
;; still incomplete: not all long options have short analogs, also
;; special readers should be used for some options (for example, to
;; complete package names while prompting for a package).  So after
;; parsing --help output, the arguments are "improved".  All arguments
;; (switches, options and actions) are `guix-command-argument'
;; structures.

;; Only "M-x guix" command is available after this file is loaded.  The
;; rest commands/actions/popups are generated on the fly only when they
;; are needed (that's why there is a couple of `eval'-s in this file).

;; COMMANDS argument is used by many functions in this file.  It means a
;; list of guix commands without "guix" itself, e.g.: ("build"),
;; ("import" "gnu").  The empty list stands for the plain "guix" without
;; subcommands.

;; All actions in popup windows are divided into 2 groups:
;;
;; - 'Popup' actions - used to pop up another window.  For example, every
;;   action in the 'guix' or 'guix import' window is a popup action.  They
;;   are defined by `guix-command-define-popup-action' macro.
;;
;; - 'Execute' actions - used to do something with the command line (to
;;   run a command in Guix REPL or to copy it into kill-ring) constructed
;;   with the current popup.  They are defined by
;;   `guix-command-define-execute-action' macro.

;;; Code:

(require 'cl-lib)
(require 'guix-popup)
(require 'guix-utils)
(require 'guix-help-vars)
(require 'guix-read)
(require 'guix-base)
(require 'guix-guile)
(require 'guix-external)

(defgroup guix-commands nil
  "Settings for guix popup windows."
  :group 'guix)

(defvar guix-command-complex-with-shared-arguments
  '("system")
  "List of guix commands which have subcommands with shared options.
I.e., 'guix foo --help' is the same as 'guix foo bar --help'.")

(defun guix-command-action-name (&optional commands &rest name-parts)
  "Return name of action function for guix COMMANDS."
  (guix-command-symbol (append commands name-parts (list "action"))))


;;; Command arguments

(cl-defstruct (guix-command-argument
               (:constructor guix-command-make-argument)
               (:copier      guix-command-copy-argument))
  name char doc fun switch? option? action?)

(cl-defun guix-command-modify-argument
    (argument &key
              (name    nil name-bound?)
              (char    nil char-bound?)
              (doc     nil doc-bound?)
              (fun     nil fun-bound?)
              (switch? nil switch?-bound?)
              (option? nil option?-bound?)
              (action? nil action?-bound?))
  "Return a modified version of ARGUMENT."
  (declare (indent 1))
  (let ((copy (guix-command-copy-argument argument)))
    (and name-bound?    (setf (guix-command-argument-name    copy) name))
    (and char-bound?    (setf (guix-command-argument-char    copy) char))
    (and doc-bound?     (setf (guix-command-argument-doc     copy) doc))
    (and fun-bound?     (setf (guix-command-argument-fun     copy) fun))
    (and switch?-bound? (setf (guix-command-argument-switch? copy) switch?))
    (and option?-bound? (setf (guix-command-argument-option? copy) option?))
    (and action?-bound? (setf (guix-command-argument-action? copy) action?))
    copy))

(defun guix-command-modify-argument-from-alist (argument alist)
  "Return a modified version of ARGUMENT or nil if it wasn't modified.
Each assoc from ALIST have a form (NAME . PLIST).  NAME is an
argument name.  PLIST is a property list of argument parameters
to be modified."
  (let* ((name  (guix-command-argument-name argument))
         (plist (guix-assoc-value alist name)))
    (when plist
      (apply #'guix-command-modify-argument
             argument plist))))

(defmacro guix-command-define-argument-improver (name alist)
  "Define NAME variable and function to modify an argument from ALIST."
  (declare (indent 1))
  `(progn
     (defvar ,name ,alist)
     (defun ,name (argument)
       (guix-command-modify-argument-from-alist argument ,name))))

(guix-command-define-argument-improver
    guix-command-improve-action-argument
  '(("graph"       :char ?G)
    ("environment" :char ?E)
    ("publish"     :char ?u)
    ("pull"        :char ?P)
    ("size"        :char ?z)))

(guix-command-define-argument-improver
    guix-command-improve-common-argument
  '(("--help"    :switch? nil)
    ("--version" :switch? nil)))

(guix-command-define-argument-improver
    guix-command-improve-target-argument
  '(("--target" :char ?T)))

(guix-command-define-argument-improver
    guix-command-improve-system-type-argument
  '(("--system" :fun guix-read-system-type)))

(guix-command-define-argument-improver
    guix-command-improve-load-path-argument
  '(("--load-path" :fun read-directory-name)))

(guix-command-define-argument-improver
    guix-command-improve-search-paths-argument
  '(("--search-paths" :char ?P)))

(guix-command-define-argument-improver
    guix-command-improve-substitute-urls-argument
  '(("--substitute-urls" :char ?U)))

(guix-command-define-argument-improver
    guix-command-improve-hash-argument
  '(("--format" :fun guix-read-hash-format)))

(guix-command-define-argument-improver
    guix-command-improve-key-policy-argument
  '(("--key-download" :fun guix-read-key-policy)))

(defvar guix-command-improve-common-build-argument
  '(("--no-substitutes"  :char ?s)
    ("--no-build-hook"   :char ?h)
    ("--max-silent-time" :char ?x)))

(defun guix-command-improve-common-build-argument (argument)
  (guix-command-modify-argument-from-alist
   argument
   (append guix-command-improve-load-path-argument
           guix-command-improve-substitute-urls-argument
           guix-command-improve-common-build-argument)))

(guix-command-define-argument-improver
    guix-command-improve-archive-argument
  '(("--generate-key" :char ?k)))

(guix-command-define-argument-improver
    guix-command-improve-build-argument
  '(("--no-grafts"   :char ?g)
    ("--root"        :fun guix-read-file-name)
    ("--sources"     :char ?S :fun guix-read-source-type :switch? nil)
    ("--with-source" :fun guix-read-file-name)))

(guix-command-define-argument-improver
    guix-command-improve-environment-argument
  '(("--exec" :fun read-shell-command)
    ("--load" :fun guix-read-file-name)))

(guix-command-define-argument-improver
    guix-command-improve-gc-argument
  '(("--list-dead" :char ?D)
    ("--list-live" :char ?L)
    ("--referrers" :char ?f)
    ("--verify"    :fun guix-read-verify-options-string)))

(guix-command-define-argument-improver
    guix-command-improve-graph-argument
  '(("--type" :fun guix-read-graph-type)))

(guix-command-define-argument-improver
    guix-command-improve-import-argument
  '(("cran" :char ?r)))

(guix-command-define-argument-improver
    guix-command-improve-import-elpa-argument
  '(("--archive" :fun guix-read-elpa-archive)))

(guix-command-define-argument-improver
    guix-command-improve-lint-argument
  '(("--checkers" :fun guix-read-lint-checker-names-string)))

(guix-command-define-argument-improver
    guix-command-improve-package-argument
  ;; Unlike all other options, --install/--remove do not have a form
  ;; '--install=foo,bar' but '--install foo bar' instead, so we need
  ;; some tweaks.
  '(("--install"
     :name "--install " :fun guix-read-package-names-string
     :switch? nil :option? t)
    ("--remove"
     :name "--remove "  :fun guix-read-package-names-string
     :switch? nil :option? t)
    ("--install-from-file" :fun guix-read-file-name)
    ("--manifest"       :fun guix-read-file-name)
    ("--do-not-upgrade" :char ?U)
    ("--roll-back"      :char ?R)
    ("--show"           :char ?w :fun guix-read-package-name)))

(guix-command-define-argument-improver
    guix-command-improve-refresh-argument
  '(("--select"     :fun guix-read-refresh-subset)
    ("--key-server" :char ?S)))

(guix-command-define-argument-improver
    guix-command-improve-size-argument
  '(("--map-file" :fun guix-read-file-name)))

(guix-command-define-argument-improver
    guix-command-improve-system-argument
  '(("vm-image"    :char ?V)
    ("--on-error"  :char ?E)
    ("--no-grub"   :char ?g)
    ("--full-boot" :char ?b)))

(defvar guix-command-argument-improvers
  '((()
     guix-command-improve-action-argument)
    (("archive")
     guix-command-improve-common-build-argument
     guix-command-improve-target-argument
     guix-command-improve-system-type-argument
     guix-command-improve-archive-argument)
    (("build")
     guix-command-improve-common-build-argument
     guix-command-improve-target-argument
     guix-command-improve-system-type-argument
     guix-command-improve-build-argument)
    (("download")
     guix-command-improve-hash-argument)
    (("hash")
     guix-command-improve-hash-argument)
    (("environment")
     guix-command-improve-common-build-argument
     guix-command-improve-search-paths-argument
     guix-command-improve-system-type-argument
     guix-command-improve-environment-argument)
    (("gc")
     guix-command-improve-gc-argument)
    (("graph")
     guix-command-improve-graph-argument)
    (("import")
     guix-command-improve-import-argument)
    (("import" "gnu")
     guix-command-improve-key-policy-argument)
    (("import" "elpa")
     guix-command-improve-import-elpa-argument)
    (("lint")
     guix-command-improve-lint-argument)
    (("package")
     guix-command-improve-common-build-argument
     guix-command-improve-search-paths-argument
     guix-command-improve-package-argument)
    (("refresh")
     guix-command-improve-key-policy-argument
     guix-command-improve-refresh-argument)
    (("size")
     guix-command-improve-system-type-argument
     guix-command-improve-substitute-urls-argument
     guix-command-improve-size-argument)
    (("system")
     guix-command-improve-common-build-argument
     guix-command-improve-system-argument))
  "Alist of guix commands and argument improvers for them.")

(defun guix-command-improve-argument (argument improvers)
  "Return ARGUMENT modified with IMPROVERS."
  (or (cl-some (lambda (improver)
                 (funcall improver argument))
               improvers)
      argument))

(defun guix-command-improve-arguments (arguments commands)
  "Return ARGUMENTS for 'guix COMMANDS ...' modified for popup interface."
  (let ((improvers (cons 'guix-command-improve-common-argument
                         (guix-assoc-value guix-command-argument-improvers
                                           commands))))
    (mapcar (lambda (argument)
              (guix-command-improve-argument argument improvers))
            arguments)))

(defun guix-command-parse-arguments (&optional commands)
  "Return a list of parsed 'guix COMMANDS ...' arguments."
  (with-temp-buffer
    (insert (guix-help-string commands))
    (let (args)
      (guix-while-search guix-help-parse-option-regexp
        (let* ((short (match-string-no-properties 1))
               (name  (match-string-no-properties 2))
               (arg   (match-string-no-properties 3))
               (doc   (match-string-no-properties 4))
               (char  (if short
                          (elt short 1) ; short option letter
                        (elt name 2))) ; first letter of the long option
               ;; If "--foo=bar" or "--foo[=bar]" then it is 'option'.
               (option? (not (string= "" arg)))
               ;; If "--foo" or "--foo[=bar]" then it is 'switch'.
               (switch? (or (string= "" arg)
                            (eq ?\[ (elt arg 0)))))
          (push (guix-command-make-argument
                 :name    name
                 :char    char
                 :doc     doc
                 :switch? switch?
                 :option? option?)
                args)))
      (guix-while-search guix-help-parse-command-regexp
        (let* ((name (match-string-no-properties 1))
               (char (elt name 0)))
          (push (guix-command-make-argument
                 :name    name
                 :char    char
                 :fun     (guix-command-action-name commands name)
                 :action? t)
                args)))
      args)))

(defun guix-command-rest-argument (&optional commands)
  "Return '--' argument for COMMANDS."
  (cl-flet ((argument (&rest args)
              (apply #'guix-command-make-argument
                     :name "-- " :char ?= :option? t args)))
    (let ((command (car commands)))
      (cond
       ((member command '("archive" "build" "graph" "edit"
                          "environment" "lint" "refresh"))
        (argument :doc "Packages" :fun 'guix-read-package-names-string))
       ((string= command "download")
        (argument :doc "URL"))
       ((string= command "gc")
        (argument :doc "Paths" :fun 'guix-read-file-name))
       ((member command '("hash" "system"))
        (argument :doc "File" :fun 'guix-read-file-name))
       ((string= command "size")
        (argument :doc "Package" :fun 'guix-read-package-name))
       ((equal commands '("import" "nix"))
        (argument :doc "Nixpkgs Attribute"))
       ;; Other 'guix import' subcommands, but not 'import' itself.
       ((and (cdr commands)
             (string= command "import"))
        (argument :doc "Package name"))))))

(defun guix-command-additional-arguments (&optional commands)
  "Return additional arguments for COMMANDS."
  (let ((rest-arg (guix-command-rest-argument commands)))
    (and rest-arg (list rest-arg))))

;; Ideally only `guix-command-arguments' function should exist with the
;; contents of `guix-command-all-arguments', but we need to make a
;; special case for `guix-command-complex-with-shared-arguments' commands.

(defun guix-command-all-arguments (&optional commands)
  "Return list of all arguments for 'guix COMMANDS ...'."
  (let ((parsed (guix-command-parse-arguments commands)))
    (append (guix-command-improve-arguments parsed commands)
            (guix-command-additional-arguments commands))))

(guix-memoized-defalias guix-command-all-arguments-memoize
  guix-command-all-arguments)

(defun guix-command-arguments (&optional commands)
  "Return list of arguments for 'guix COMMANDS ...'."
  (let ((command (car commands)))
    (if (member command
                guix-command-complex-with-shared-arguments)
        ;; Take actions only for 'guix system', and switches+options for
        ;; 'guix system foo'.
        (funcall (if (null (cdr commands))
                     #'cl-remove-if-not
                   #'cl-remove-if)
                 #'guix-command-argument-action?
                 (guix-command-all-arguments-memoize (list command)))
      (guix-command-all-arguments commands))))

(defun guix-command-switch->popup-switch (switch)
  "Return popup switch from command SWITCH argument."
  (list (guix-command-argument-char switch)
        (or (guix-command-argument-doc switch)
            "Unknown")
        (guix-command-argument-name switch)))

(defun guix-command-option->popup-option (option)
  "Return popup option from command OPTION argument."
  (list (guix-command-argument-char option)
        (or (guix-command-argument-doc option)
            "Unknown")
        (let ((name (guix-command-argument-name option)))
          (if (string-match-p " \\'" name) ; ends with space
              name
            (concat name "=")))
        (or (guix-command-argument-fun option)
            'read-from-minibuffer)))

(defun guix-command-action->popup-action (action)
  "Return popup action from command ACTION argument."
  (list (guix-command-argument-char action)
        (or (guix-command-argument-doc action)
            (guix-command-argument-name action)
            "Unknown")
        (guix-command-argument-fun action)))

(defun guix-command-sort-arguments (arguments)
  "Sort ARGUMENTS by name in alphabetical order."
  (sort arguments
        (lambda (a1 a2)
          (let ((name1 (guix-command-argument-name a1))
                (name2 (guix-command-argument-name a2)))
            (cond ((null name1) nil)
                  ((null name2) t)
                  (t (string< name1 name2)))))))

(defun guix-command-switches (arguments)
  "Return switches from ARGUMENTS."
  (cl-remove-if-not #'guix-command-argument-switch? arguments))

(defun guix-command-options (arguments)
  "Return options from ARGUMENTS."
  (cl-remove-if-not #'guix-command-argument-option? arguments))

(defun guix-command-actions (arguments)
  "Return actions from ARGUMENTS."
  (cl-remove-if-not #'guix-command-argument-action? arguments))

(defun guix-command-post-process-args (args)
  "Adjust appropriately command line ARGS returned from popup command."
  ;; XXX We need to split "--install foo bar" and similar strings into
  ;; lists of strings.  But some commands (e.g., 'guix hash') accept a
  ;; file name as the 'rest' argument, and as file names may contain
  ;; spaces, splitting by spaces will break such names.  For example, the
  ;; following argument: "-- /tmp/file with spaces" will be transformed
  ;; into the following list: ("--" "/tmp/file" "with" "spaces") instead
  ;; of the wished ("--" "/tmp/file with spaces").
  (let* (rest
         (rx (rx string-start
                 (or "-- " "--install " "--remove ")))
         (args (mapcar (lambda (arg)
                         (if (string-match-p rx arg)
                             (progn (push (split-string arg) rest)
                                    nil)
                           arg))
                       args)))
    (if rest
        (apply #'append (delq nil args) rest)
      args)))


;;; 'Execute' actions

(defvar guix-command-default-execute-arguments
  (list
   (guix-command-make-argument
    :name "repl"  :char ?r :doc "Run in Guix REPL")
   (guix-command-make-argument
    :name "shell" :char ?s :doc "Run in shell")
   (guix-command-make-argument
    :name "copy"  :char ?c :doc "Copy command line"))
  "List of default 'execute' action arguments.")

(defvar guix-command-additional-execute-arguments
  `((("build")
     ,(guix-command-make-argument
       :name "log" :char ?l :doc "View build log"))
    (("graph")
     ,(guix-command-make-argument
       :name "view" :char ?v :doc "View graph"))
    (("size")
     ,(guix-command-make-argument
       :name "view" :char ?v :doc "View map")))
  "Alist of guix commands and additional 'execute' action arguments.")

(defun guix-command-execute-arguments (commands)
  "Return a list of 'execute' action arguments for COMMANDS."
  (mapcar (lambda (arg)
            (guix-command-modify-argument arg
              :action? t
              :fun (guix-command-action-name
                    commands (guix-command-argument-name arg))))
          (append guix-command-default-execute-arguments
                  (guix-assoc-value
                   guix-command-additional-execute-arguments commands))))

(defvar guix-command-special-executors
  '((("environment")
     ("repl" . guix-run-environment-command-in-repl))
    (("pull")
     ("repl" . guix-run-pull-command-in-repl))
    (("build")
     ("log" . guix-run-view-build-log))
    (("graph")
     ("view" . guix-run-view-graph))
    (("size")
     ("view" . guix-run-view-size-map)))
  "Alist of guix commands and alists of special executers for them.
See also `guix-command-default-executors'.")

(defvar guix-command-default-executors
  '(("repl"  . guix-run-command-in-repl)
    ("shell" . guix-run-command-in-shell)
    ("copy"  . guix-copy-command-as-kill))
  "Alist of default executers for action names.")

(defun guix-command-executor (commands name)
  "Return function to run command line arguments for guix COMMANDS."
  (or (guix-assoc-value guix-command-special-executors commands name)
      (guix-assoc-value guix-command-default-executors name)))

(defun guix-run-environment-command-in-repl (args)
  "Run 'guix ARGS ...' environment command in Guix REPL."
  ;; As 'guix environment' usually tries to run another process, it may
  ;; be fun but not wise to run this command in Geiser REPL.
  (when (or (member "--dry-run" args)
            (member "--search-paths" args)
            (when (y-or-n-p
                   (format "'%s' command will spawn an external process.
Do you really want to execute this command in Geiser REPL? "
                           (guix-command-string args)))
              (message "May \"M-x shell-mode\" be with you!")
              t))
    (guix-run-command-in-repl args)))

(defun guix-run-pull-command-in-repl (args)
  "Run 'guix ARGS ...' pull command in Guix REPL.
Perform pull-specific actions after operation, see
`guix-after-pull-hook' and `guix-update-after-pull'."
  (guix-eval-in-repl
   (apply #'guix-make-guile-expression 'guix-command args)
   nil 'pull))

(defun guix-run-view-build-log (args)
  "Add --log-file to ARGS, run 'guix ARGS ...' build command, and
open the log file(s)."
  (let* ((args (if (member "--log-file" args)
                   args
                 (apply #'list (car args) "--log-file" (cdr args))))
         (output (guix-command-output args))
         (files  (split-string output "\n" t)))
    (dolist (file files)
      (guix-find-file-or-url file)
      (guix-build-log-mode))))

(defun guix-run-view-graph (args)
  "Run 'guix ARGS ...' graph command, make the image and open it."
  (let* ((graph-file (guix-dot-file-name))
         (dot-args   (guix-dot-arguments graph-file)))
    (if (guix-eval-read (guix-make-guile-expression
                         'pipe-guix-output args dot-args))
        (guix-find-file graph-file)
      (error "Couldn't create a graph"))))

(defun guix-run-view-size-map (args)
  "Run 'guix ARGS ...' size command, and open the map file."
  (let* ((wished-map-file
          (cl-some (lambda (arg)
                     (and (string-match "--map-file=\\(.+\\)" arg)
                          (match-string 1 arg)))
                   args))
         (map-file (or wished-map-file (guix-png-file-name)))
         (args (if wished-map-file
                   args
                 (apply #'list
                        (car args)
                        (concat "--map-file=" map-file)
                        (cdr args)))))
    (guix-command-output args)
    (guix-find-file map-file)))


;;; Generating popups, actions, etc.

(defmacro guix-command-define-popup-action (name &optional commands)
  "Define NAME function to generate (if needed) and run popup for COMMANDS."
  (declare (indent 1) (debug t))
  (let* ((popup-fun (guix-command-symbol `(,@commands "popup")))
         (doc (format "Call `%s' (generate it if needed)."
                      popup-fun)))
    `(defun ,name (&optional arg)
       ,doc
       (interactive "P")
       (unless (fboundp ',popup-fun)
         (guix-command-generate-popup ',popup-fun ',commands))
       (,popup-fun arg))))

(defmacro guix-command-define-execute-action (name executor
                                                   &optional commands)
  "Define NAME function to execute the current action for guix COMMANDS.
EXECUTOR function is called with the current command line arguments."
  (declare (indent 1) (debug t))
  (let* ((arguments-fun (guix-command-symbol `(,@commands "arguments")))
         (doc (format "Call `%s' with the current popup arguments."
                      executor)))
    `(defun ,name (&rest args)
       ,doc
       (interactive (,arguments-fun))
       (,executor (append ',commands
                          (guix-command-post-process-args args))))))

(defun guix-command-generate-popup-actions (actions &optional commands)
  "Generate 'popup' commands from ACTIONS arguments for guix COMMANDS."
  (dolist (action actions)
    (let ((fun (guix-command-argument-fun action)))
      (unless (fboundp fun)
        (eval `(guix-command-define-popup-action ,fun
                 ,(append commands
                          (list (guix-command-argument-name action)))))))))

(defun guix-command-generate-execute-actions (actions &optional commands)
  "Generate 'execute' commands from ACTIONS arguments for guix COMMANDS."
  (dolist (action actions)
    (let ((fun (guix-command-argument-fun action)))
      (unless (fboundp fun)
        (eval `(guix-command-define-execute-action ,fun
                 ,(guix-command-executor
                   commands (guix-command-argument-name action))
                 ,commands))))))

(defun guix-command-generate-popup (name &optional commands)
  "Define NAME popup with 'guix COMMANDS ...' interface."
  (let* ((command  (car commands))
         (man-page (concat "guix" (and command (concat "-" command))))
         (doc      (format "Popup window for '%s' command."
                           (guix-concat-strings (cons "guix" commands)
                                                " ")))
         (args     (guix-command-arguments commands))
         (switches (guix-command-sort-arguments
                    (guix-command-switches args)))
         (options  (guix-command-sort-arguments
                    (guix-command-options args)))
         (popup-actions (guix-command-sort-arguments
                         (guix-command-actions args)))
         (execute-actions (unless popup-actions
                            (guix-command-execute-arguments commands)))
         (actions (or popup-actions execute-actions)))
    (if popup-actions
        (guix-command-generate-popup-actions popup-actions commands)
      (guix-command-generate-execute-actions execute-actions commands))
    (eval
     `(guix-define-popup ,name
        ,doc
        'guix-commands
        :man-page ,man-page
        :switches ',(mapcar #'guix-command-switch->popup-switch switches)
        :options  ',(mapcar #'guix-command-option->popup-option options)
        :actions  ',(mapcar #'guix-command-action->popup-action actions)
        :max-action-columns 4))))

;;;###autoload (autoload 'guix "guix-command" "Popup window for 'guix'." t)
(guix-command-define-popup-action guix)

(defalias 'guix-edit-action #'guix-edit)


(defvar guix-command-font-lock-keywords
  (eval-when-compile
    `((,(rx "("
            (group "guix-command-define-"
                   (or "popup-action"
                       "execute-action"
                       "argument-improver"))
            symbol-end
            (zero-or-more blank)
            (zero-or-one
             (group (one-or-more (or (syntax word) (syntax symbol))))))
       (1 font-lock-keyword-face)
       (2 font-lock-function-name-face nil t)))))

(font-lock-add-keywords 'emacs-lisp-mode guix-command-font-lock-keywords)

(provide 'guix-command)

;;; guix-command.el ends here
t-based applications. It supports several different plugins, including HSpell, Enchant, ASpell and HUNSPELL.") (license license:lgpl2.1+))) (define-public threadweaver (package (name "threadweaver") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1isqlpnfxzxyz7mdm7yfrafgnx09mcndicdgdw3mi4r4misbrrbn")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("qtbase" ,qtbase))) (home-page "https://community.kde.org/Frameworks") (synopsis "Helper for multithreaded programming") (description "ThreadWeaver is a helper for multithreaded programming. It uses a job-based interface to queue tasks and execute them in an efficient way.") (license license:lgpl2.1+))) ;; Tier 2 ;; ;; Tier 2 frameworks additionally depend on tier 1 frameworks, but still have ;; easily manageable dependencies. (define-public kactivities (package (name "kactivities") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0z0ac426npq99s1b8yzrqkjjjc34nbxlpw8pw388yj7fa41hw21r")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("boost" ,boost) ("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kio" ,kio) ("kitemviews" ,kitemviews) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("kxmlgui" ,kxmlgui) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("solid" ,solid))) (home-page "https://community.kde.org/Frameworks") (synopsis "Core components for the KDE Activity concept") (description "KActivities provides the infrastructure needed to manage a user's activities, allowing them to switch between tasks, and for applications to update their state to match the user's current activity. This includes a daemon, a library for interacting with that daemon, and plugins for integration with other frameworks.") ;; triple licensed (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+)))) (define-public kauth (package (name "kauth") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "04kqb2hhr9lkpkxiaqlnyk0kmk6p89z5fgp5i5g83hsi8maz7swi")))) (build-system cmake-build-system) (native-inputs `(("dbus" ,dbus) ("extra-cmake-modules" ,extra-cmake-modules) ("qttools" ,qttools))) (inputs `(("kcoreaddons" ,kcoreaddons) ("polkit-qt" ,polkit-qt) ("qtbase" ,qtbase))) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'fix-cmake-install-directories (lambda _ ;; Make packages using kauth put their policy files and helpers ;; into their own prefix. (substitute* "KF5AuthConfig.cmake.in" (("@KAUTH_POLICY_FILES_INSTALL_DIR@") "${KDE_INSTALL_DATADIR}/polkit-1/actions") (("@KAUTH_HELPER_INSTALL_DIR@") "${KDE_INSTALL_LIBEXECDIR}") (("@KAUTH_HELPER_INSTALL_ABSOLUTE_DIR@") "${KDE_INSTALL_LIBEXECDIR}")))) (replace 'check (lambda _ (setenv "DBUS_FATAL_WARNINGS" "0") (zero? (system* "dbus-launch" "ctest" "."))))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Execute actions as privileged user") (description "KAuth provides a convenient, system-integrated way to offload actions that need to be performed as a privileged user to small set of helper utilities.") (license license:lgpl2.1+))) (define-public kcompletion (package (name "kcompletion") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0yqci2v0dk5v1mz4n3gca599a7mpihy563zc6sl8hsa30ld8li0f")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("qttools" ,qttools))) (inputs `(("kconfig" ,kconfig) ("kwidgetsaddons" ,kwidgetsaddons) ("qtbase" ,qtbase))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Powerful autocompletion framework and widgets") (description "This framework helps implement autocompletion in Qt-based applications. It provides a set of completion-ready widgets, or can be integrated it into your application's other widgets.") (license license:lgpl2.1+))) (define-public kcrash (package (name "kcrash") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "049y0xdyw37y0qid3d3plj8szfys5gw98j7lhcakiini8mn5cins")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kcoreaddons" ,kcoreaddons) ("kwindowsystem" ,kwindowsystem) ("qtbase" ,qtbase) ("qtx11extras" ,qtx11extras))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Graceful handling of application crashes") (description "KCrash provides support for intercepting and handling application crashes.") (license license:lgpl2.1+))) (define-public kdoctools (package (name "kdoctools") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1bby3avdllch1mji0mxzcix8q5yir5a0i6wpjs5lwckv1glh6kmz")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("docbook-xml" ,docbook-xml) ("docbook-xsl" ,docbook-xsl) ("karchive" ,karchive) ("ki18n" ,ki18n) ("libxml2" ,libxml2) ("libxslt" ,libxslt) ("perl" ,perl) ("perl-uri" ,perl-uri) ("qtbase" ,qtbase))) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'cmake-find-docbook (lambda* (#:key inputs #:allow-other-keys) (substitute* (find-files "cmake" "\\.cmake$") (("CMAKE_SYSTEM_PREFIX_PATH") "CMAKE_PREFIX_PATH")) (substitute* "cmake/FindDocBookXML4.cmake" (("^.*xml/docbook/schema/dtd.*$") "xml/dtd/docbook\n")) (substitute* "cmake/FindDocBookXSL.cmake" (("^.*xml/docbook/stylesheet.*$") (string-append "xml/xsl/docbook-xsl-" ,(package-version docbook-xsl) "\n"))) #t)) (add-after 'install 'add-symlinks ;; Some package(s) (e.g. kdelibs4support) refer to this locale by a ;; different spelling. (lambda* (#:key outputs #:allow-other-keys) (let ((xsl (string-append (assoc-ref outputs "out") "/share/kf5/kdoctools/customization/xsl/"))) (symlink (string-append xsl "pt_br.xml") (string-append xsl "pt-BR.xml"))) #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Create documentation from DocBook") (description "Provides tools to generate documentation in various format from DocBook files.") (license license:lgpl2.1+))) (define-public kfilemetadata (package (name "kfilemetadata") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "03wk38q3sq354ykz9dwbgykn73ldf94ryx6hxvpr66bq3a59jmwz")))) (build-system cmake-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'disable-failing-test (lambda _ ;; Blacklist a failing test-function. FIXME: Make it pass. ;; UserMetaDataWriterTest fails with getxattr("…/writertest.txt") ;; -> EOPNOTSUPP (Operation not supported) (with-output-to-file "autotests/BLACKLIST" (lambda _ (display "[test]\n*\n"))) #t))))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config) ("python-2" ,python-2))) (inputs `(("attr" ,attr) ;; TODO: EPub http://sourceforge.net/projects/ebook-tools ("karchive" ,karchive) ("ki18n" ,ki18n) ("qtmultimedia" ,qtmultimedia) ("qtbase" ,qtbase) ;; Required run-time packages ("catdoc" ,catdoc) ;; Optional run-time packages ("exiv2" ,exiv2) ("ffmpeg" ,ffmpeg) ("poppler-qt5" ,poppler-qt5) ("taglib" ,taglib))) (home-page "https://community.kde.org/Frameworks") (synopsis "Extract metadata from different fileformats") (description "KFileMetaData provides a simple library for extracting the text and metadata from a number of different files. This library is typically used by file indexers to retrieve the metadata. This library can also be used by applications to write metadata.") (license (list license:lgpl2.0 license:lgpl2.1 license:lgpl3)))) (define-public kimageformats (package (name "kimageformats") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1k67yrmszx7azjzrg478rimbz991lghx4d6dmg22p6dknajd78a6")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config))) (inputs `(("karchive" ,karchive) ; for Krita and OpenRaster images ("openexr" ,openexr) ; for OpenEXR high dynamic-range images ("qtbase" ,qtbase))) (arguments `(#:phases (modify-phases %standard-phases ;; This test fails regularly (also at KDE CI, see ;; https://build.kde.org/job/Frameworks%20kimageformats%20kf5-qt5%20XenialQt5.7/6/testReport/) ;; delete offending portion (add-after 'unpack 'neuter-read-xcf-test (lambda _ (delete-file "autotests/read/xcf/simple-rgba-gimp-2.8.10.png") (delete-file "autotests/read/xcf/simple-rgba-gimp-2.8.10.xcf"))) (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") (setenv "QT_PLUGIN_PATH" (string-append (getcwd) "/bin:" (getenv "QT_PLUGIN_PATH"))) #t))) ;; FIXME: The header files of ilmbase (propagated by openexr) are not ;; found when included by the header files of openexr, and an explicit ;; flag needs to be set. #:configure-flags (list (string-append "-DCMAKE_CXX_FLAGS=-I" (assoc-ref %build-inputs "ilmbase") "/include/OpenEXR")))) (home-page "https://community.kde.org/Frameworks") (synopsis "Plugins to allow QImage to support extra file formats") (description "This framework provides additional image format plugins for QtGui. As such it is not required for the compilation of any other software, but may be a runtime requirement for Qt-based software to support certain image formats.") (license license:lgpl2.1+))) (define-public kjobwidgets (package (name "kjobwidgets") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1m3csdl7wh18ywv5p0qpbjpixvflgjcq3yvk3vlvh0sxxlwcz8k4")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("qttools" ,qttools))) (inputs `(("kcoreaddons" ,kcoreaddons) ("kwidgetsaddons" ,kwidgetsaddons) ("qtbase" ,qtbase) ("qtx11extras" ,qtx11extras))) (home-page "https://community.kde.org/Frameworks") (synopsis "Widgets for showing progress of asynchronous jobs") (description "KJobWIdgets provides widgets for showing progress of asynchronous jobs.") (license license:lgpl2.1+))) (define-public knotifications (package (name "knotifications") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0awmwypmd104vhaj2v9k83niflxj26d4mbl6mzfcj75lgka6kffc")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("dbus" ,dbus) ("qttools" ,qttools))) (inputs `(("kcodecs" ,kcodecs) ("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("kwindowsystem" ,kwindowsystem) ("phonon" ,phonon) ("qtbase" ,qtbase) ("qtspeech" ,qtspeech) ;; TODO: Think about adding dbusmenu-qt5 from ;; https://launchpad.net/libdbusmenu-qt ("qtx11extras" ,qtx11extras))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) #t)) (replace 'check (lambda _ (setenv "DBUS_FATAL_WARNINGS" "0") (zero? (system* "dbus-launch" "ctest" "."))))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Desktop notifications") (description "KNotification is used to notify the user of an event. It covers feedback and persistent events.") (license license:lgpl2.1+))) (define-public kpackage (package (name "kpackage") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "10amhh07x8d0jkyylb19cyzjs71k8dq1y8isfahqzb2kd43vijqa")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("karchive" ,karchive) ("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("kdoctools" ,kdoctools) ("ki18n" ,ki18n) ("qtbase" ,qtbase))) (arguments `(#:tests? #f ; FIXME: 3/9 tests fail. #:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Installation and loading of additional content as packages") (description "The Package framework lets the user install and load packages of non binary content such as scripted extensions or graphic assets, as if they were traditional plugins.") (license (list license:gpl2+ license:lgpl2.1+)))) (define-public kpty (package (name "kpty") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "07s16zxs03ixy7yxy9fda83yqhcgqzx42gnvwjwkyc8q05njmma6")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kcoreaddons" ,kcoreaddons) ("ki18n" ,ki18n) ;; TODO: utempter, for managing UTMP entries ("qtbase" ,qtbase))) (arguments `(#:tests? #f ; FIXME: 1/1 tests fail. #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-tests (lambda _ (substitute* "autotests/kptyprocesstest.cpp" (("/bin/bash") (which "bash"))) #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Interfacing with pseudo terminal devices") (description "This library provides primitives to interface with pseudo terminal devices as well as a KProcess derived class for running child processes and communicating with them using a pty.") (license (list license:gpl2+ license:lgpl2.1+)))) (define-public kunitconversion (package (name "kunitconversion") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0219pna4l3vvhyf5acsc87n48jzdnws6kwyhaiy3hy1pzrilv32l")))) (build-system cmake-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'disable-a-failing-test-case (lambda _ ;; FIXME: Re-enable this test-case. It was committed with the ;; message: "tsan says it's clean, apart from issues in Qt ;; (reported upstream)" (substitute* "autotests/convertertest.cpp" (("const int numThreads = 2") "const int numThreads = 0"))))))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("ki18n" ,ki18n) ("qtbase" ,qtbase))) (home-page "https://community.kde.org/Frameworks") (synopsis "Converting physical units") (description "KUnitConversion provides functions to convert values in different physical units. It supports converting different prefixes (e.g. kilo, mega, giga) as well as converting between different unit systems (e.g. liters, gallons).") (license license:lgpl2.1+))) ;; Tier 3 ;; ;; Tier 3 frameworks are generally more powerful, comprehensive packages, and ;; consequently have more complex dependencies. (define-public baloo (package (name "baloo") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "18yknkcls1ypsp8n5l254bhlffiq4as5w1wgcjzhnf49cacys8nl")))) (build-system cmake-build-system) (propagated-inputs `(("kcoreaddons" ,kcoreaddons) ("kfilemetadata" ,kfilemetadata))) (native-inputs `(("dbus" ,dbus) ("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kbookmarks" ,kbookmarks) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kcrash" ,kcrash) ("kdbusaddons" ,kdbusaddons) ("kidletime" ,kidletime) ("kio" ,kio) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("lmdb" ,lmdb) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("solid" ,solid))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t)) (add-after 'unpack 'remove-failing-test ;; This test fails on i686 and aarch64 (lambda _ (substitute* "autotests/unit/file/CMakeLists.txt" (("metadatamovertest") "")) #t)) (replace 'check (lambda _ (setenv "DBUS_FATAL_WARNINGS" "0") (zero? (system* "dbus-launch" "ctest" "."))))))) (home-page "https://community.kde.org/Frameworks") (synopsis "File searching and indexing") (description "Baloo provides file searching and indexing. It does so by maintaining an index of the contents of your files.") ;; dual licensed (license (list license:gpl2+ license:lgpl2.1+)))) (define-public kactivities-stats (package (name "kactivities-stats") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0si70hayf4brr83jzdjdsfvp8nc1sb7vdk0q532liafhf8hw9mq8")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("boost" ,boost) ("kactivities" ,kactivities) ("kconfig" ,kconfig) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (home-page "https://community.kde.org/Frameworks") (synopsis "Access usage statistics collected by the activity manager") (description "The KActivitiesStats library provides a querying mechanism for the data that the activitiy manager collects - which documents have been opened by which applications, and what documents have been linked to which activity.") ;; triple licensed (license (list license:lgpl2.0+ license:lgpl2.1+ license:lgpl3+)))) (define-public kbookmarks (package (name "kbookmarks") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "08q413mr5ib04gwnqznvm9vkkfmnh16rgf6rqdvclnci9w7ml5x2")))) (build-system cmake-build-system) (propagated-inputs `(("kwidgetsaddons" ,kwidgetsaddons))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("qttools" ,qttools))) (inputs `(("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kiconthemes" ,kiconthemes) ("kxmlgui" ,kxmlgui) ("qtbase" ,qtbase))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Bookmarks management library") (description "KBookmarks lets you access and manipulate bookmarks stored using the XBEL format.") (license license:lgpl2.1+))) (define-public kcmutils (package (name "kcmutils") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1q67b0m6w3xvm22kq8b0b0rib1jzf25gf6dz7h286987zfbbs5n7")))) (build-system cmake-build-system) (propagated-inputs `(("kconfigwidgets" ,kconfigwidgets) ("kservice" ,kservice))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("kdeclarative" ,kdeclarative) ("kiconthemes" ,kiconthemes) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kpackage" ,kpackage) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (home-page "https://community.kde.org/Frameworks") (synopsis "Utilities for KDE System Settings modules") (description "KCMUtils provides various classes to work with KCModules. KCModules can be created with the KConfigWidgets framework.") (license license:lgpl2.1+))) (define-public kconfigwidgets (package (name "kconfigwidgets") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "191zm24q2n001b65hcnfh2639k4iqhxwdmgdw29php3n2648xq4z")))) (build-system cmake-build-system) (propagated-inputs `(("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kconfig" ,kconfig) ("kwidgetsaddons" ,kwidgetsaddons))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("kdoctools" ,kdoctools))) (inputs `(("kcoreaddons" ,kcoreaddons) ("kguiaddons" ,kguiaddons) ("ki18n" ,ki18n) ("qtbase" ,qtbase))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Widgets for configuration dialogs") (description "KConfigWidgets provides easy-to-use classes to create configuration dialogs, as well as a set of widgets which uses KConfig to store their settings.") ;; dual licensed (license (list license:gpl2+ license:lgpl2.1+)))) (define-public kdeclarative (package (name "kdeclarative") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1w604jy6vg2247vggz0ivl7wy2h5iapkz2z86mah3aw99f7dqa22")))) (build-system cmake-build-system) (propagated-inputs `(("kconfig" ,kconfig) ("kpackage" ,kpackage))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config) ("xorg-server" ,xorg-server))) (inputs `(("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kglobalaccel" ,kglobalaccel) ("kguiaddons" ,kguiaddons) ("kiconthemes" ,kiconthemes) ("kio" ,kio) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("kxmlgui" ,kxmlgui) ("libepoxy" ,libepoxy) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("solid" ,solid))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'start-xorg-server (lambda* (#:key inputs #:allow-other-keys) ;; The test suite requires a running X server, setting ;; QT_QPA_PLATFORM=offscreen does not suffice. (system (string-append (assoc-ref inputs "xorg-server") "/bin/Xvfb :1 -screen 0 640x480x24 &")) (setenv "DISPLAY" ":1") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Integration of QML and KDE work spaces") (description "KDeclarative provides integration of QML and KDE work spaces. It's comprises two parts: a library used by the C++ part of your application to intergrate QML with KDE Frameworks specific features, and a series of QML imports that offer bindings to some of the Frameworks.") ;; dual licensed (license (list license:gpl2+ license:lgpl2.1+)))) (define-public kded (package (name "kded") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0w25dl4pnvby28gz0yvij32vi9n3p8si4nm4x45j7zsi2cb70j4l")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("kcrash" ,kcrash) ("kdbusaddons" ,kdbusaddons) ("kdoctools" ,kdoctools) ("kinit" ,kinit) ("kservice" ,kservice) ("qtbase" ,qtbase))) (home-page "https://community.kde.org/Frameworks") (synopsis "Central daemon of KDE work spaces") (description "KDED stands for KDE Daemon. KDED runs in the background and performs a number of small tasks. Some of these tasks are built in, others are started on demand.") ;; dual licensed (license (list license:lgpl2.0+ license:lgpl2.1+)))) (define-public kdesignerplugin (package (name "kdesignerplugin") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "004axa1fkj954d65x7l9z8dmw04209hb368rwa4gjzb8naf13ib6")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("qttools" ,qttools))) (inputs `(("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("kdoctools" ,kdoctools) ("qtbase" ,qtbase) ;; optional: ("kcompletion" ,kcompletion) ("kconfigwidgets" ,kconfigwidgets) ("kiconthemes" ,kiconthemes) ("kitemviews" ,kitemviews) ("kio" ,kio) ("kplotting" ,kplotting) ("ktextwidgets" ,ktextwidgets) ("kdewebkit" ,kdewebkit) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("qtwebkit" ,qtwebkit) ("sonnet" ,sonnet))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Integrating KDE frameworks widgets with Qt Designer") (description "This framework provides plugins for Qt Designer that allow it to display the widgets provided by various KDE frameworks, as well as a utility (kgendesignerplugin) that can be used to generate other such plugins from ini-style description files.") (license license:lgpl2.1+))) (define-public kdesu (package (name "kdesu") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0402p1h7wifk6sppg7ca9w0zfjllbhc1j5gsxj7ypq55g94np7hx")))) (build-system cmake-build-system) (propagated-inputs `(("kpty" ,kpty))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("ki18n" ,ki18n) ("kservice" ,kservice) ("qtbase" ,qtbase))) (home-page "https://community.kde.org/Frameworks") (synopsis "User interface for running shell commands with root privileges") (description "KDESU provides functionality for building GUI front ends for (password asking) console mode programs. kdesu and kdessh use it to interface with su and ssh respectively.") (license license:lgpl2.1+))) (define-public kdewebkit (package (name "kdewebkit") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1csd4p996im7ygxc5rfdkzgdpngjgzyqakj12rl9rnfbsd15i8kb")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("kio" ,kio) ("kjobwidgets" ,kjobwidgets) ("kparts" ,kparts) ("kservice" ,kservice) ("kwallet" ,kwallet) ("qtbase" ,qtbase) ("qtwebkit" ,qtwebkit))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Integration for QtWebKit") (description "This library provides KDE integration of the HTML rendering engine WebKit via QtWebKit.") (license license:lgpl2.1+))) (define-public kemoticons (package (name "kemoticons") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0f6an1bwxnga41a2b35b2pdcni4p0hh76k4jvanl3g046v07f2wr")))) (build-system cmake-build-system) (propagated-inputs `(("kservice" ,kservice))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("karchive" ,karchive) ("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("qtbase" ,qtbase))) (arguments `(#:tests? #f ; FIXME: 2/2 tests fail. #:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Convert text emoticons to graphical emoticons") (description "KEmoticons converts emoticons from text to a graphical representation with images in HTML. It supports setting different themes for emoticons coming from different providers.") ;; dual licensed, image files are licensed under cc-by-sa4.0 (license (list license:gpl2+ license:lgpl2.1+ license:cc-by-sa4.0)))) (define-public kglobalaccel (package (name "kglobalaccel") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0nlza73i0qd79yhwhpnvgbh2xa9lvd1n2xg25p3bvfzwidcfdxg6")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config) ("qttools" ,qttools))) (inputs `(("kconfig" ,kconfig) ("kcrash" ,kcrash) ("kcoreaddons" ,kcoreaddons) ("kdbusaddons" ,kdbusaddons) ("kservice" ,kservice) ("kwindowsystem" ,kwindowsystem) ("libxcb" ,libxcb) ("qtbase" ,qtbase) ("qtx11extras" ,qtx11extras) ("xcb-util-keysyms" ,xcb-util-keysyms))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Global desktop keyboard shortcuts") (description "KGlobalAccel allows you to have global accelerators that are independent of the focused window. Unlike regular shortcuts, the application's window does not need focus for them to be activated.") (license license:lgpl2.1+))) (define-public kiconthemes (package (name "kiconthemes") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1nbxxpf8bv835xl35b17rk8s3zs110bh31078kqqh7dhvwzlxic7")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("shared-mime-info" ,shared-mime-info))) (inputs `(("karchive" ,karchive) ("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kcoreaddons" ,kcoreaddons) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("ki18n" ,ki18n) ("kitemviews" ,kitemviews) ("kwidgetsaddons" ,kwidgetsaddons) ("qtbase" ,qtbase) ("qtsvg" ,qtsvg))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda* (#:key inputs #:allow-other-keys) (setenv "XDG_DATA_DIRS" (string-append (assoc-ref inputs "shared-mime-info") "/share")) (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Icon GUI utilities") (description "This library contains classes to improve the handling of icons in applications using the KDE Frameworks.") (license license:lgpl2.1+))) (define-public kinit (package (name "kinit") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "05vpac41pw1n8y58l2z08vyknzv950x8dxxw66dnymm2v31w07ia")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config))) (inputs `(("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kcrash" ,kcrash) ("kdoctools" ,kdoctools) ("kio" ,kio) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("kxmlgui" ,kxmlgui) ("libcap" ,libcap) ; to install start_kdeinit with CAP_SYS_RESOURCE ("qtbase" ,qtbase) ("solid" ,solid))) (home-page "https://community.kde.org/Frameworks") (synopsis "Library to speed up start of applications on KDE workspaces") (description "Kdeinit is a process launcher similar to init used for booting UNIX. It launches processes by forking and then loading a dynamic library which contains a 'kdemain(...)' function. Using kdeinit to launch KDE applications makes starting KDE applications faster and reduces memory consumption.") ;; dual licensed (license (list license:lgpl2.0+ license:lgpl2.1+)))) (define-public kio (package (name "kio") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1526a89x11ank55dp3rfp7xd04w8x7prjg3y6i7n2q9nabwhw7gc")))) (build-system cmake-build-system) (propagated-inputs `(("kbookmarks" ,kbookmarks) ("kconfig" ,kconfig) ("kcompletion" ,kcompletion) ("kcoreaddons" ,kcoreaddons) ("kitemviews" ,kitemviews) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("kxmlgui" ,kxmlgui) ("solid" ,solid))) (native-inputs `(("dbus" ,dbus) ("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(;; TODO: LibACL , ("krb5" ,mit-krb5) ("karchive" ,karchive) ("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kconfigwidgets" ,kconfigwidgets) ("kdbusaddons" ,kdbusaddons) ("kdoctools" ,kdoctools) ("kiconthemes" ,kiconthemes) ("ki18n" ,ki18n) ("knotifications" ,knotifications) ("ktextwidgets" ,ktextwidgets) ("kwallet" ,kwallet) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("libxml2" ,libxml2) ("libxslt" ,libxslt) ("qtbase" ,qtbase) ("qtscript" ,qtscript) ("qtx11extras" ,qtx11extras) ("sonnet" ,sonnet))) (arguments `(#:tests? #f ; FIXME: 41/50 tests fail. #:phases (modify-phases %standard-phases (add-after 'unpack 'patch (lambda _ ;; Better error message (taken from nix) (substitute* "src/kiod/kiod_main.cpp" (("(^\\s*qCWarning(KIOD_CATEGORY) << \"Error loading plugin:\")( << loader.errorString();)" _ a b) (string-append a "<< name" b))) ;; TODO: samba-search-path.patch from nix: search smbd on $PATH #t)) (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) (setenv "XDG_RUNTIME_DIR" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t)) (add-after 'install 'add-symlinks ;; Some package(s) (e.g. bluedevil) refer to these service types by ;; the wrong name. I would prefer to patch those packages, but I ;; cannot find the files! (lambda* (#:key outputs #:allow-other-keys) (let ((kst5 (string-append (assoc-ref outputs "out") "/share/kservicetypes5/"))) (symlink (string-append kst5 "kfileitemactionplugin.desktop") (string-append kst5 "kfileitemaction-plugin.desktop")))))))) ;;(replace 'check ;; (lambda _ ;; (setenv "DBUS_FATAL_WARNINGS" "0") ;; (zero? (system* "dbus-launch" "ctest" "."))))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Network transparent access to files and data") (description "This framework implements a lot of file management functions. It supports accessing files locally as well as via HTTP and FTP out of the box and can be extended by plugins to support other protocols as well. There is a variety of plugins available, e.g. to support access via SSH. The framework can also be used to bridge a native protocol to a file-based interface. This makes the data accessible in all applications using the KDE file dialog or any other KIO enabled infrastructure.") (license license:lgpl2.1+))) (define-public knewstuff (package (name "knewstuff") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0i2gmyp67xzf2m5wnv7v574q3gsp1yxfflv1jgl0wy57vchwn9g6")))) (build-system cmake-build-system) (propagated-inputs `(("attica" ,attica) ("kservice" ,kservice) ("kxmlgui" ,kxmlgui))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("karchive" ,karchive) ("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kio" ,kio) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kiconthemes" ,kiconthemes) ("kjobwidgets" ,kjobwidgets) ("ktextwidgets" ,ktextwidgets) ("kwidgetsaddons" ,kwidgetsaddons) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("solid" ,solid) ("sonnet" ,sonnet))) (arguments `(#:tests? #f ; FIXME: 1/3 tests fail. #:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ; XDG_DATA_DIRS isn't set (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Framework for downloading and sharing additional application data") (description "The KNewStuff library implements collaborative data sharing for applications. It uses libattica to support the Open Collaboration Services specification.") (license license:lgpl2.1+))) (define-public knotifyconfig (package (name "knotifyconfig") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1h07bjj71611v6912m5ajli6qszh9w925zqbk3vih8rn6pd2s3mc")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kio" ,kio) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("knotifications" ,knotifications) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("phonon" ,phonon) ("qtbase" ,qtbase) ("solid" ,solid))) (home-page "https://community.kde.org/Frameworks") (synopsis "Configuration dialog for desktop notifications") (description "KNotifyConfig provides a configuration dialog for desktop notifications which can be embedded in your application.") ;; dual licensed (license (list license:lgpl2.0+ license:lgpl2.1+)))) (define-public kparts (package (name "kparts") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1mb5gp2ckmmrb4ym7cqvyl81wnp7cryk85gmizl7cnn69svlf40h")))) (build-system cmake-build-system) (propagated-inputs `(("kio" ,kio) ("ktextwidgets" ,ktextwidgets) ("kxmlgui" ,kxmlgui))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("shared-mime-info" ,shared-mime-info) )) (inputs `(("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kiconthemes" ,kiconthemes) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("qtbase" ,qtbase) ("solid" ,solid) ("sonnet" ,sonnet))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Plugin framework for user interface components") (description "This library implements the framework for KDE parts, which are widgets with a user-interface defined in terms of actions.") (license license:lgpl2.1+))) (define-public kpeople (package (name "kpeople") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "050km3rpx58acx2341si46lxc2hywa59m8rwd849c2dnsxw3w1hm")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (arguments `(#:tests? #f ; FIXME: 1/3 tests fail. #:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Provides access to all contacts and aggregates them by person") (description "KPeople offers unified access to our contacts from different sources, grouping them by person while still exposing all the data. KPeople also provides facilities to integrate the data provided in user interfaces by providing QML and Qt Widgets components. The sources are plugin-based, allowing to easily extend the contacts collection.") (license license:lgpl2.1+))) (define-public krunner (package (name "krunner") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0xh9kss67l09am1ilsr9zyx1yhlmaq3g9x60hw0sx7h7wrl6zsw6")))) (build-system cmake-build-system) (propagated-inputs `(("plasma-framework" ,plasma-framework))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kio" ,kio) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("kpackage" ,kpackage) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("kxmlgui" ,kxmlgui) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("solid" ,solid) ("threadweaver" ,threadweaver))) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'fix-paths-for-test ;; This test tries to access paths like /home, /usr/bin and /bin/ls ;; which don't exist in the build-container. Change to existing paths. (lambda _ (substitute* "autotests/runnercontexttest.cpp" (("/home\"") "/tmp\"") ;; single path-part (("//usr/bin\"") (string-append (getcwd) "\"")) ;; multiple path-parts (("/bin/ls" path) (string-append (assoc-ref %build-inputs "coreutils") path))))) (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") ;; Blacklist a failing test-function. FIXME: Make it pass. (with-output-to-file "bin/BLACKLIST" (lambda _ (display "[testMatch]\n*\n"))) #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Framework for Plasma runners") (description "The Plasma workspace provides an application called KRunner which, among other things, allows one to type into a text area which causes various actions and information that match the text appear as the text is being typed.") (license license:lgpl2.1+))) (define-public kservice (package (name "kservice") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0z8zfpd00ndvkm1klp8l4mrcksshhyg280zgmg3gffz5rgh3gwri")))) (build-system cmake-build-system) (propagated-inputs `(("kconfig" ,kconfig) ("kcoreaddons" ,kcoreaddons))) (native-inputs `(("bison" ,bison) ("extra-cmake-modules" ,extra-cmake-modules) ("flex" ,flex))) (inputs `(("kcrash" ,kcrash) ("kdbusaddons" ,kdbusaddons) ("kdoctools" ,kdoctools) ("ki18n" ,ki18n) ("qtbase" ,qtbase))) (arguments `(#:tests? #f ; FIXME: 6/10 tests fail. #:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Plugin framework for desktop services") (description "KService provides a plugin framework for handling desktop services. Services can be applications or libraries. They can be bound to MIME types or handled by application specific code.") ;; triple licensed (license (list license:gpl2+ license:gpl3+ license:lgpl2.1+)))) (define-public ktexteditor (package (name "ktexteditor") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "020y3j6vm15sfpiwainr3qsx9i93j15mrvq523wmbmdj1z36yrh2")))) (build-system cmake-build-system) (propagated-inputs `(("kparts" ,kparts))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config))) (inputs `(;; TODO: editor-config ("karchive" ,karchive) ("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kguiaddons" ,kguiaddons) ("kiconthemes" ,kiconthemes) ("kio" ,kio) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("ksyntaxhighlighting" ,ksyntaxhighlighting) ("ktextwidgets" ,ktextwidgets) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("libgit2" ,libgit2) ("perl" ,perl) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("qtscript" ,qtscript) ("qtxmlpatterns" ,qtxmlpatterns) ("solid" ,solid) ("sonnet" ,sonnet))) (arguments `(#:tests? #f ; FIXME: 2/54 tests fail: Cannot find fontdirectory qtbase/lib/font #:phases (modify-phases %standard-phases (add-after 'unpack 'setup (lambda* (#:key inputs #:allow-other-keys) (setenv "XDG_DATA_DIRS" ; FIXME build phase doesn't find parts.desktop (string-append (assoc-ref inputs "kparts") "/share")) #t)) (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t)) (add-after 'install 'add-symlinks ;; Some package(s) (e.g. plasma-sdk) refer to these service types ;; by the wrong name. I would prefer to patch those packages, but ;; I cannot find the files! (lambda* (#:key outputs #:allow-other-keys) (let ((kst5 (string-append (assoc-ref outputs "out") "/share/kservicetypes5/"))) (symlink (string-append kst5 "ktexteditorplugin.desktop") (string-append kst5 "ktexteditor-plugin.desktop")))))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Full text editor component") (description "KTextEditor provides a powerful text editor component that you can embed in your application, either as a KPart or using the KF5::TextEditor library.") ;; triple licensed (license (list license:gpl2+ license:lgpl2.0+ license:lgpl2.1+)))) (define-public ktextwidgets (package (name "ktextwidgets") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "088azbv95ycwxmxxw4l63i2l14fmn8l473pb4djh2mvz1ypfqayk")))) (build-system cmake-build-system) (propagated-inputs `(("ki18n" ,ki18n) ("sonnet" ,sonnet))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kiconthemes" ,kiconthemes) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("qtbase" ,qtbase) ("qtspeech" ,qtspeech))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Text editing widgets") (description "KTextWidgets provides widgets for displaying and editing text. It supports rich text as well as plain text.") ;; dual licensed (license (list license:lgpl2.0+ license:lgpl2.1+)))) (define-public kwallet (package (name "kwallet") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "1kv3v7593srfn0wd7qp4rhvb30rxp7d2qmlwi0n4nc9s6v59pabn")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("gpgme" ,gpgme) ("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kdbusaddons" ,kdbusaddons) ("kdoctools" ,kdoctools) ("kiconthemes" ,kiconthemes) ("ki18n" ,ki18n) ("knotifications" ,knotifications) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("libgcrypt" ,libgcrypt) ("phonon" ,phonon) ("qgpgme" ,qgpgme) ("qtbase" ,qtbase))) (home-page "https://community.kde.org/Frameworks") (synopsis "Safe desktop-wide storage for passwords") (description "This framework contains an interface to KWallet, a safe desktop-wide storage for passwords and the kwalletd daemon used to safely store the passwords on KDE work spaces.") (license license:lgpl2.1+))) (define-public kxmlgui (package (name "kxmlgui") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0kfxjx8wrhkys5bydnv84nqxc2jqvv92zb2l6zpi0km5ggmia5y0")))) (build-system cmake-build-system) (propagated-inputs `(("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("attica" ,attica) ("kauth" ,kauth) ("kcodecs" ,kcodecs) ("kcoreaddons" ,kcoreaddons) ("kglobalaccel" ,kglobalaccel) ("kiconthemes" ,kiconthemes) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("ktextwidgets" ,ktextwidgets) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("qtbase" ,qtbase) ("sonnet" ,sonnet))) (arguments `(#:tests? #f ; FIXME: 1/5 tests fail. #:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Framework for managing menu and toolbar actions") (description "KXMLGUI provides a framework for managing menu and toolbar actions in an abstract way. The actions are configured through a XML description and hooks in the application code. The framework supports merging of multiple descriptions for integrating actions from plugins.") ;; dual licensed (license (list license:gpl2+ license:lgpl2.1+)))) (define-public kxmlrpcclient (package (name "kxmlrpcclient") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "0ciip27ilsfk9s3gslpbi06v8i6ipdbmcig2jf43z3amsxpq0ncn")))) (build-system cmake-build-system) (propagated-inputs `(("kio" ,kio))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules))) (inputs `(("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kitemviews" ,kitemviews) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("qtbase" ,qtbase) ("solid" ,solid))) (home-page "https://community.kde.org/Frameworks") (synopsis "XML-RPC client") (description "This library contains simple XML-RPC Client support. It is a complete client and is easy to use. Only one interface is exposed, kxmlrpcclient/client.h and from that interface, you only need to use 3 methods: setUrl, setUserAgent and call.") ;; dual licensed (license (list license:bsd-2 license:lgpl2.1+)))) (define-public plasma-framework (package (name "plasma-framework") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" name "-" version ".tar.xz")) (sha256 (base32 "079c8h0lmbkfr3srj5m8a40b50kyrxbgmy1n66329l8js9xrvaah")))) (build-system cmake-build-system) (propagated-inputs `(("kpackage" ,kpackage) ("kservice" ,kservice))) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config))) (inputs `(("kactivities" ,kactivities) ("karchive" ,karchive) ("kauth" ,kauth) ("kbookmarks" ,kbookmarks) ("kcodecs" ,kcodecs) ("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kdbusaddons" ,kdbusaddons) ("kdeclarative" ,kdeclarative) ("kdoctools" ,kdoctools) ("kglobalaccel" ,kglobalaccel) ("kguiaddons" ,kguiaddons) ("kiconthemes" ,kiconthemes) ("kirigami" ,kirigami) ("kitemviews" ,kitemviews) ("kio" ,kio) ("ki18n" ,ki18n) ("kjobwidgets" ,kjobwidgets) ("knotificantions" ,knotifications) ("kwayland" ,kwayland) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("kxmlgui" ,kxmlgui) ("phonon" ,phonon) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("qtsvg" ,qtsvg) ("qtx11extras" ,qtx11extras) ("solid" ,solid))) (arguments `(#:tests? #f ; FIXME: 9/15 tests fail. #:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "Libraries, components and tools of Plasma workspaces") (description "The plasma framework provides QML components, libplasma and script engines.") ;; dual licensed (license (list license:gpl2+ license:lgpl2.1+)))) ;; This version of kdbusaddons does not use kinit as an input, and is used to ;; build kinit-bootstrap, as well as bootstrap versions of all kinit ;; dependencies which also rely on kdbusaddons. (define kdbusaddons-bootstrap (package (inherit kdbusaddons) (source (origin (inherit (package-source kdbusaddons)) (patches '()))) (inputs (alist-delete "kinit" (package-inputs kdbusaddons))) (arguments (substitute-keyword-arguments (package-arguments kdbusaddons) ((#:phases phases) `(modify-phases ,phases (delete 'patch-source))))))) (define kinit-bootstrap ((package-input-rewriting `((,kdbusaddons . ,kdbusaddons-bootstrap))) kinit)) ;; Tier 4 ;; ;; Tier 4 frameworks can be mostly ignored by application programmers; this ;; tier consists of plugins acting behind the scenes to provide additional ;; functionality or platform integration to existing frameworks (including ;; Qt). (define-public kde-frameworkintegration (package (name "kde-frameworkintegration") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/" "frameworkintegration-" version ".tar.xz")) (sha256 (base32 "17fyny3c5chv7bipr19ayfjmd1amp2nms4ba5r7mwjp97xkphry7")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("pkg-config" ,pkg-config))) ;; TODO: Optional packages not yet in Guix: packagekitqt5, AppStreamQt (inputs `(("kconfig" ,kconfig) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("ki18n" ,ki18n) ("kiconthemes" ,kiconthemes) ("kitemviews" ,kitemviews) ("knewstuff" ,knewstuff) ("knotificantions" ,knotifications) ("kpackage" ,kpackage) ("kwidgetsaddons" ,kwidgetsaddons) ("qtbase" ,qtbase) ("qtx11extras" ,qtx11extras))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ (setenv "HOME" (getcwd)) ;; Make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Frameworks 5 workspace and cross-framework integration plugins") (description "Framework Integration is a set of plugins responsible for better integration of Qt applications when running on a KDE Plasma workspace.") ;; This package is distributed under either LGPL2 or LGPL3, but some ;; files are explicitly LGPL2+. (license (list license:lgpl2.0 license:lgpl3 license:lgpl2.0+)) (properties `((upstream-name . "frameworkintegration"))))) ;; Porting Aids ;; ;; Porting Aids frameworks provide code and utilities to ease the transition ;; from kdelibs 4 to KDE Frameworks 5. Code should aim to port away from this ;; framework, new projects should avoid using these libraries. (define-public kdelibs4support (package (name "kdelibs4support") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/portingAids/" name "-" version ".tar.xz")) (sha256 (base32 "0aiig8akn6bdxrqdl96xjjy2pxw8hhfrsalbkkzyhh06j794snfb")))) (build-system cmake-build-system) (native-inputs `(("dbus" ,dbus) ("docbook-xml" ,docbook-xml-4.4) ; optional ("extra-cmake-modules" ,extra-cmake-modules) ("perl" ,perl) ("perl-uri" ,perl-uri) ("pkg-config" ,pkg-config) ("shared-mime-info" ,shared-mime-info) ("kjobwidgets" ,kjobwidgets) ;; required for running the tests ("strace" ,strace) ("tzdata" ,tzdata))) (propagated-inputs ;; These are required to be installed along with this package, see ;; lib64/cmake/KF5KDELibs4Support/KF5KDELibs4SupportConfig.cmake `(("karchive" ,karchive) ("kauth" ,kauth) ("kconfigwidgets" ,kconfigwidgets) ("kcoreaddons" ,kcoreaddons) ("kcrash" ,kcrash) ("kdbusaddons" ,kdbusaddons) ("kdesignerplugin" ,kdesignerplugin) ("kdoctools" ,kdoctools) ("kemoticons" ,kemoticons) ("kguiaddons" ,kguiaddons) ("kiconthemes" ,kiconthemes) ("kinit" ,kinit) ("kitemmodels" ,kitemmodels) ("knotifications" ,knotifications) ("kparts" ,kparts) ("ktextwidgets" ,ktextwidgets) ("kunitconversion" ,kunitconversion) ("kwindowsystem" ,kwindowsystem) ("qtbase" ,qtbase))) (inputs `(("kcompletion" ,kcompletion) ("kconfig" ,kconfig) ("kded" ,kded) ("kglobalaccel" ,kglobalaccel) ("ki18n" ,ki18n) ("kio" ,kio) ("kservice" ,kservice) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("libsm" ,libsm) ("networkmanager-qt" ,networkmanager-qt) ("openssl" ,openssl) ("qtsvg" ,qtsvg) ("qttools" ,qttools) ("qtx11extras" ,qtx11extras))) ;; FIXME: Use GuixSD ca-bundle.crt in etc/xdg/ksslcalist and ;; share/kf5/kssl/ca-bundle.crt (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'make-cmake-to-find-docbook (lambda _ (substitute* "cmake/FindDocBookXML4.cmake" (("^.*xml/docbook/schema/dtd.*$") "xml/dtd/docbook\n")) #t)) (delete 'check) (add-after 'install 'check-post-install (lambda* (#:key inputs tests? #:allow-other-keys) (setenv "HOME" (getcwd)) (setenv "TZDIR" ; KDateTimeTestsome needs TZDIR (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")) ;; Make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") ;; enable debug output (setenv "CTEST_OUTPUT_ON_FAILURE" "1") ; enable debug output (setenv "DBUS_FATAL_WARNINGS" "0") ;; Make kstandarddirstest pass (see https://bugs.kde.org/381098) (mkdir-p ".kde-unit-test/xdg/config") (with-output-to-file ".kde-unit-test/xdg/config/foorc" (lambda () #t)) ;; simply touch the file ;; Blacklist a test-function (failing at build.kde.org, too). (with-output-to-file "autotests/BLACKLIST" (lambda _ (display "[testSmb]\n*\n"))) ;; kuniqueapptest hangs. FIXME: Make this test pass. (zero? (system* "dbus-launch" "ctest" "." "-E" "kstandarddirstest|kuniqueapptest"))))))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Frameworks 5 porting aid from KDELibs4") (description "This framework provides code and utilities to ease the transition from kdelibs 4 to KDE Frameworks 5. This includes CMake macros and C++ classes whose functionality has been replaced by code in CMake, Qt and other frameworks. Code should aim to port away from this framework eventually. The API documentation of the classes in this framework and the notes at http://community.kde.org/Frameworks/Porting_Notes should help with this.") ;; Most files are distributed under LGPL2+, but the package includes code ;; under a variety of licenses. (license (list license:lgpl2.1+ license:lgpl2.0 license:lgpl2.0+ license:gpl2 license:gpl2+ license:expat license:bsd-2 license:bsd-3 license:public-domain)))) (define-public khtml (package (name "khtml") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/portingAids/" name "-" version ".tar.xz")) (sha256 (base32 "1bfslndxvad0zgzr22w2mz1xwavix9bh5qrrv8dpshlh043bwr3l")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("perl" ,perl))) (inputs `(("giflib" ,giflib) ("gperf" ,gperf) ("karchive" ,karchive) ("kcodecs" ,kcodecs) ("kglobalaccel" ,kglobalaccel) ("ki18n" ,ki18n) ("kiconthemes" ,kiconthemes) ("kio" ,kio) ("kjs" ,kjs) ("knotifications" ,knotifications) ("kparts" ,kparts) ("ktextwidgets" ,ktextwidgets) ("kwallet" ,kwallet) ("kwidgetsaddons" ,kwidgetsaddons) ("kwindowsystem" ,kwindowsystem) ("kxmlgui" ,kxmlgui) ("libjpeg" ,libjpeg) ("libpng" ,libpng) ("openssl" ,openssl) ("phonon" ,phonon) ("qtbase" ,qtbase) ("qtx11extras" ,qtx11extras) ("sonnet" ,sonnet))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; Make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Frameworks 5 HTML widget and component") (description "KHTML is a web rendering engine, based on the KParts technology and using KJS for JavaScript support.") ;; Most files are distributed under LGPL2+, but the package includes code ;; under a variety of licenses. (license (list license:lgpl2.0+ license:lgpl2.1+ license:gpl2 license:gpl3+ license:expat license:bsd-2 license:bsd-3)))) (define-public kjs (package (name "kjs") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/portingAids/" name "-" version ".tar.xz")) (sha256 (base32 "1m26sb2qyrcgmpkw76k2yv5my2pkhld96vw6aaqm77q90faw734g")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("kdoctools" ,kdoctools) ("perl" ,perl) ("pkg-config" ,pkg-config))) (inputs `(("pcre" ,pcre) ("qtbase" ,qtbase))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Frameworks 5 support for Javascript scripting in Qt applications") (description "Add-on library to Qt which adds JavaScript scripting support.") ;; Most files are distributed under LGPL2+, but the package also includes ;; code under a variety of licenses. (license (list license:lgpl2.1+ license:bsd-2 license:bsd-3 (license:non-copyleft "file://src/kjs/dtoa.cpp"))))) (define-public kjsembed (package (name "kjsembed") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/portingAids/" name "-" version ".tar.xz")) (sha256 (base32 "10w4w4ncwr245bv1ii4sh154w91ghfz0l60k89j50lsydpcqcp3a")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("kdoctools" ,kdoctools) ("qttools" ,qttools))) (inputs `(("ki18n" ,ki18n) ("kjs" ,kjs) ("qtbase" ,qtbase) ("qtsvg" ,qtsvg))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Frameworks 5 embedded Javascript engine for Qt") (description "KJSEmbed provides a method of binding Javascript objects to QObjects, so you can script your applications.") (license license:lgpl2.1+))) (define-public kmediaplayer (package (name "kmediaplayer") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/portingAids/" name "-" version ".tar.xz")) (sha256 (base32 "1k1pjc0cz36gs0pl2pxw8f9f82xkbqyy320nfyhan5waxbl1qd5n")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("kdoctools" ,kdoctools) ("qttools" ,qttools))) (inputs `(("kcompletion" ,kcompletion) ("kcoreaddons" ,kcoreaddons) ("ki18n" ,ki18n) ("kiconthemes" ,kiconthemes) ("kio" ,kio) ("kparts" ,kparts) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("qtbase" ,qtbase))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'check 'check-setup (lambda _ ;; Make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Frameworks 5 plugin interface for media player features") (description "KMediaPlayer builds on the KParts framework to provide a common interface for KParts that can play media files. This framework is a porting aid. It is not recommended for new projects, and existing projects that use it are advised to port away from it, and use plain KParts instead.") (license license:expat))) (define-public kross (package (name "kross") (version "5.42.0") (source (origin (method url-fetch) (uri (string-append "mirror://kde/stable/frameworks/" (version-major+minor version) "/portingAids/" name "-" version ".tar.xz")) (sha256 (base32 "1aqqwby6jslimpvx42d4n6gjsjc8l82gmsq5ajpv9zkkk91dqfqi")))) (build-system cmake-build-system) (native-inputs `(("extra-cmake-modules" ,extra-cmake-modules) ("kdoctools" ,kdoctools) ("qttools" ,qttools))) (inputs `(("kcompletion" ,kcompletion) ("kcoreaddons" ,kcoreaddons) ("ki18n" ,ki18n) ("kiconthemes" ,kiconthemes) ("kparts" ,kparts) ("kwidgetsaddons" ,kwidgetsaddons) ("kxmlgui" ,kxmlgui) ("qtbase" ,qtbase) ("qtscript" ,qtscript))) (home-page "https://community.kde.org/Frameworks") (synopsis "KDE Frameworks 5 solution for application scripting") (description "Kross is a scripting bridge for the KDE Development Platform used to embed scripting functionality into an application. It supports QtScript as a scripting interpreter backend. Kross provides an abstract API to provide scripting functionality in a interpreter-independent way. The application that uses Kross should not need to know anything about the scripting language being used. The core of Kross provides the framework to deal transparently with interpreter-backends and offers abstract functionality to deal with scripts.") ;; Most files are distributed under LGPL2+, but the package includes code ;; under a variety of licenses. (license (list license:lgpl2.0+ license:lgpl2.1+ license:lgpl2.0 license:gpl3+))))