~brettgilio/org-webring

org-webring/etc/guix.scm -rw-r--r-- 2.6 KiB
8a35e97cBrett Gilio Mention EmacsConf in README 4 days ago
                                                                                
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
;;; Commentary:

;; This package is intended for development, and installation
;; from git HEAD. If you are wanting to install `emacs-org-webring'
;; from GNU Guix, please refer to the relevant section in the
;; README.

;; This recipe is reflect of the latest development of `org-webring',
;; and is the template for merging upstream to GNU Guix.

;; Copyright (C) 2020 Brett Gilio
;; Copyright (C) 2020 Alexandru-Sergiu Marton

;;; Instructions:

;; guix build -f guix.scm
;; guix package -f guix.scm

;;; Code:

(use-modules (gnu packages emacs)
	     (gnu packages emacs-xyz)
	     (guix)
	     (guix build utils)
	     (guix build-system emacs)
	     ((guix licenses) #:prefix license:)
	     (guix packages)
	     (ice-9 match)
	     (ice-9 popen)
	     (ice-9 rdelim)
	     (srfi srfi-1)
	     (srfi srfi-26))

(define %source-dir (dirname (dirname (current-filename))))

(define git-file?
  (let* ((pipe (with-directory-excursion
		%source-dir
		(open-pipe* OPEN_READ "git" "ls-files")))
         (files (let loop ((lines '()))
                  (match (read-line pipe)
                    ((? eof-object?)
                     (reverse lines))
                    (line
                     (loop (cons line lines))))))
         (status (close-pipe pipe)))
    (lambda (file stat)
      (match (stat:type stat)
        ('directory #t)
        ((or 'regular 'symlink)
         (any (cut string-suffix? <> file) files))
        (_ #f)))))

(define-public emacs-org-webring
  (package
   (name "emacs-org-webring")
   (version "git")
   (source (local-file %source-dir
		       #:recursive? #t
		       #:select? git-file?))
   (build-system emacs-build-system)
   (arguments
    `(#:phases
      (modify-phases %standard-phases
		     (add-after 'install 'install-assets
				(lambda* (#:key outputs #:allow-other-keys)
				  (let* ((out (assoc-ref outputs "out"))
					 (assets
					  (string-append out "/share/emacs/org-webring-assets")))
				    (mkdir-p assets)
				    (copy-recursively "assets" assets)
				    #t))))))
   (propagated-inputs
    `(("emacs-xmlgen" ,emacs-xmlgen)))
   (home-page "https://sr.ht/~brettgilio/org-webring")
   (synopsis "Static RSS/ATOM webring generator for Org-mode")
   (description "Org-webring is an alternative implementation of a
feed-based webring, taking inspiration from openring by Drew DeVault.
Intended to integrate with Org-based websites and blogs (either
directly, or indirectly, as in ox-hugo), it will fetch a given list of
web feed files and correctly parse and format the elements to be
displayed for sharing.")
   (license license:gpl3+)))

emacs-org-webring

;;; End.