summaryrefslogtreecommitdiff
path: root/px/packages/setup.scm
blob: b27165db18748c84e8e19d58d709fe6b3eb64a9e (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
;;; Package Repository for GNU Guix
;;; Copyright © 2021-2025 Franz Geffke <m@f-a.nz>

(define-module (px packages setup)
  #:use-module ((guix licenses)
                #:prefix license:)
  #:use-module (guix download)
  #:use-module (guix packages)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system python)
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages boost)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages kde)
  #:use-module (gnu packages kde-frameworks)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages polkit)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages serialization)
  #:use-module (gnu packages web)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-build)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages time)
  #:use-module (gnu packages xorg)
  #:use-module (px packages common))

(define-public px-setup-assistant
  (package
    (name "px-setup-assistant")
    (version "v0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://source.pantherx.org/px-setup-assistant_"
                           version ".tgz"))
       (sha256
        (base32 "0fkcldxrr6j3ig9b26ar7c11h9xqrrdb9cn0gj9fb63lhdv0zac5"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'set-executable
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let ((out (assoc-ref outputs "out")))
                        (invoke "chmod" "755"
                                (string-append out "/bin/px-setup")) #t))))))
    (inputs `(("qtbase" ,qtbase-5)
              ("qtlinguist" ,qttools-5)
              ("rapidjson" ,rapidjson)
              ("yaml-cpp" ,yaml-cpp)))
    (propagated-inputs `(("tzdata" ,tzdata)))
    (home-page "https://www.pantherx.org/")
    (synopsis "PantherX Setup Assistant")
    (description
     "This package provides cli and gui applications for Setup PantherX Devices")
    (license license:gpl3)))

(define-public px-install
  (package
    (name "px-install")
    (version "0.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://source.pantherx.org/" name "_v" version
                           ".tgz"))
       (sha256
        (base32 "09b6jg6vbvba7rz3gqszqhljlcm62bds3a4gl17wnbfbl6kikvc6"))))
    (build-system python-build-system)
    (arguments
     `(#:tests? #f))
    (inputs `(("python-requests" ,python-requests)
              ("python-tqdm" ,python-tqdm)
              ("python-pytz" ,python-pytz)
              ("python-qrcode" ,python-qrcode)
              ("python-py-cpuinfo" ,python-py-cpuinfo)
              ("python-urllib3" ,python-urllib3)))
    (native-inputs `(("pkg-config" ,pkg-config)))
    (home-page "https://www.pantherx.org/")
    (synopsis "PantherX OS Installer")
    (description "A command line driven installer with sane defaults.")
    (license license:gpl3)))

(define-public calamares
  (package
    (name "calamares")
    (version "3.2.61")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/calamares/"
                           name
                           "/releases/download/v"
                           version
                           "/"
                           name
                           "-"
                           version
                           ".tar.gz"))
       (sha256
        (base32 "1lhxf4rbii8ss86ny03an1nh08dbc9admf72kmxvmg9q0yvbk4bm"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f
       #:configure-flags '("-DINSTALL_CONFIG=ON")
       #:phases (modify-phases %standard-phases
                  (add-after 'unpack 'patch-source
                    (lambda _
                      (let* ((out (assoc-ref %outputs "out"))
                             (zonefile (string-append (assoc-ref %build-inputs
                                                       "tzdata")
                                        "/share/zoneinfo/zone.tab"))
                             (xkb-file (string-append (assoc-ref %build-inputs
                                                       "xkeyboard-config")
                                        "/share/X11/xkb/rules/base.lst")))
                        ;; patch polkit rules path
                        (substitute* "CMakeLists.txt"
                          (("DESTINATION \"\\$\\{POLKITQT-1_POLICY_FILES_INSTALL_DIR\\}")
                           "DESTINATION \"share/polkit-1/actions"))
                        ;; fix zone file path
                        (substitute* "src/libcalamares/locale/TimeZone.cpp"
                          (("/usr/share/zoneinfo/zone.tab")
                           zonefile))
                        ;; fix keyboard layout path
                        (substitute* "src/modules/keyboard/keyboardwidget/keyboardglobal.cpp"
                          (("/usr/share/X11/xkb/rules/base.lst")
                           xkb-file))
                        ;; settings.conf preparations
                        (call-with-output-file "settings.conf"
                          (lambda (port)
                            (format port "---
modules-search: [ local ]
sequence:
- show:
  - welcome
  - locale
  - keyboard
  - summary
- show:
  - finished
branding: default
prompt-install: false
dont-chroot: false
oem-setup: false
disable-cancel: false
disable-cancel-during-exec: false
hide-back-and-next-during-exec: false
quit-at-end: false
")))
                        #t))))))
    (native-inputs (list boost extra-cmake-modules pkg-config))
    (inputs (list kcrash
                  kcoreaddons
                  kdbusaddons
                  kparts
                  kservice
                  kwidgetsaddons
                  polkit-qt
                  python
                  python-jsonschema
                  python-pyyaml
                  qtbase-5
                  qtdeclarative-5
                  qtquickcontrols-5
                  qtquickcontrols2-5
                  qtsvg-5
                  qttools-5
                  tzdata
                  xkeyboard-config
                  yaml-cpp))
    (propagated-inputs (list python))
    (home-page "https://calamares.io")
    (synopsis " Distribution-independent installer framework ")
    (description
     "Calamares is a distribution-independent system installer,
with an advanced partitioning feature for both manual and automated partitioning
operations. Calamares is designed to be customizable by distribution maintainers
without need for cumbersome patching, thanks to third party branding and external
modules support.")
    (license license:gpl3)))

(define-public px-install-gui
  (package
    (inherit calamares)
    (name "px-install-gui")
    (version "3.2.61-b1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://source.pantherx.org/" name "_v" version
                           ".tgz"))
       (sha256
        (base32 "1vdylrdkbvfq03i8rbzkamrjvg497j8zqlqwhvdkywqpazwgp8r9"))))
    (arguments
     (substitute-keyword-arguments (package-arguments calamares)
       ((#:phases phases)
        #~(modify-phases #$phases
            (add-after 'patch-source 'setup-installer
              (lambda _
                (call-with-output-file "settings.conf"
                  (lambda (port)
                    (format port "---
modules-search: [ local ]
sequence:
- show:
  - welcome
  - locale
  - packagechooser
  - users
  - summary
- exec:
  - px-install
- show:
  - finished
branding: default
prompt-install: false
dont-chroot: false
oem-setup: false
disable-cancel: false
disable-cancel-during-exec: false
hide-back-and-next-during-exec: false
quit-at-end: false
")))))))))
    (propagated-inputs (list python
                             python-requests
                             python-tqdm
                             python-pytz
                             python-qrcode
                             python-py-cpuinfo
                             python-urllib3))))