summaryrefslogtreecommitdiff
path: root/vkraus/packages/blog.scm
blob: 0435225f5999b3d979565447a88d461aac7a73f3 (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
(define-module (vkraus packages blog)
  #:use-module (vkraus config blog-release)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages ruby)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages ruby)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages python)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages lisp)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages guile-xyz)
  #:use-module (guix gexp)
  #:use-module (guix git)
  #:use-module (guix modules)
  #:use-module (guix records)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system ruby)
  #:use-module (guix utils)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (ice-9 match)
  #:use-module (ice-9 optargs))

(define ruby-minima
  (package
    (name "ruby-minima")
    (version "2.5.1")
    (source
     (origin
       (method url-fetch)
       (uri (rubygems-uri "minima" version))
       (sha256
        (base32 "1gk7jmriiswda1ykjzpsw9cpiya4m9n0yrh0h6xnrc8zcfy543jj"))))
    (build-system ruby-build-system)
    (arguments
     ;; No rakefile
     `(#:tests? #f))
    (propagated-inputs (list jekyll ruby-jekyll-feed ruby-jekyll-seo-tag))
    (synopsis "A beautiful, minimal theme for Jekyll.")
    (description "This package provides a beautiful, minimal theme for Jekyll.")
    (home-page "https://github.com/jekyll/minima")
    (license license:expat)))

(define gnulib-latest
  (package
    (name "gnulib-latest")
    (version "latest")
    (source
     (git-checkout
      (url "https://git.savannah.gnu.org/git/gnulib.git")))
    (build-system gnu-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (delete 'configure)
          (replace 'install
            (lambda _
              (install-file "gnulib-tool"
                            (string-append #$output "/bin"))
              (copy-recursively "."
                                (string-append #$output "/share/gnulib-srcdir")))))
      #:tests? #f)) ;; Tests are syntax and indentation checks for the
                    ;; maintainer.
    (inputs ;; Shebangs for some auxiliary build files.
     (list python perl clisp))
    (home-page "https://www.gnu.org/software/gnulib/")
    (synopsis "GNU portability library")
    (description
     "Gnulib is a library that provides common functions from the glibc to your
programs, in order to enhance portability across operating systems. It also
provides common maintainer tools for gnu packages. This package always tracks
the latest commit in gnulib. @strong{For packages dependencies, please use the
@code{gnulib} package instead.} The latter provides a recent enough snapshot.")
    (native-search-paths
     (list
      (search-path-specification
       (variable "GNULIB_SRCDIR")
       (files (list "share/gnulib-srcdir")))))
    (license
     (list license:lgpl2.0+ license:gpl3+))))

(define gnulib
  (package
    (inherit gnulib-latest)
    (name "gnulib")
    (version "2022-12-27")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://git.savannah.gnu.org/git/gnulib.git")
             (commit "fde75446490e18d2539817ca418ab8adf73b02d3")))
       (sha256
        (base32
         "0fjbdhwi9025wyq39rwc2j6aazfmagx056kkbvxx6bs97i80dcim"))))
    (synopsis "GNU portability library")
    (description
     "Gnulib is a library that provides common functions from the glibc to your
programs, in order to enhance portability across operating systems. It also
provides common maintainer tools for gnu packages. This package provides a
recent snapshot of gnulib.")))

(define-public blog
  (package
   (name "blog")
   (version blog-version)
   (source
    (origin
     (method git-fetch)
     (uri (git-reference
           (url blog-source-url)
           (commit blog-source-commit)))
     (sha256 (base32 blog-source-hash))))
   (build-system gnu-build-system)
   (arguments
    (list
     #:modules '((guix build utils)
                 (guix build gnu-build-system))
     #:phases
     #~(modify-phases %standard-phases
         (delete 'configure)
         (delete 'build)
         (delete 'check)
         (replace 'install
           (lambda* (#:key outputs inputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (bash-in (search-input-file inputs "/bin/bash"))
                   (emacs-in (search-input-file inputs "/bin/emacs"))
                   (gem-path
                    (search-path-as-list '("/lib/ruby/vendor_ruby")
                                         (map cdr inputs))))
               (mkdir out)
               (setenv "GEM_PATH" (string-join gem-path ":"))
               (setenv "PREFIX" out)
               (setenv "HOME" ".home")
               (mkdir ".build")
               (with-directory-excursion
                   ".build"
                 (invoke emacs-in "--batch"
                         "--file" "../init.org"
                         "--eval" "(require 'org)"
                         "-l" (search-input-file
                               inputs
                               #$(format #f "/share/emacs/site-lisp/htmlize-~a/htmlize.el"
                                         (package-version emacs-htmlize)))
                         "-L" (search-input-directory
                               inputs
                               #$(format #f "/share/emacs/site-lisp/geiser-~a"
                                         (package-version emacs-geiser)))
                         "-L" (search-input-directory
                               inputs
                               #$(format #f "/share/emacs/site-lisp/geiser-guile-~a"
                                         (package-version emacs-geiser-guile)))
                         "--eval" "(setq org-confirm-babel-evaluate nil)"
                         "--eval" "(setq org-html-htmlize-output-type 'css)"
                         "-f" "org-babel-tangle")
                 (invoke bash-in "../build"))))))))
   (native-inputs
    (list emacs bash jekyll emacs-org emacs-htmlize ruby-minima
          guile-3.0 emacs-geiser emacs-geiser-guile guile-gnutls))
   (synopsis "La vie trépidante d’un chat au foyer — blog personnel")
   (description "Ceci est mon blog personnel.")
   (home-page "https://vivien.planete-kraus.eu")
   (license #f)))