blob: e3856a5b7aeab005d12806509e73214e2e91c42a (
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
|
(define-module (ryan-packages login)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system zig)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages curl)
#:use-module (gnu packages linux)
#:use-module (gnu packages nss)
#:use-module (gnu packages version-control)
#:use-module (gnu packages zig)
#:use-module (gnu packages zig-xyz)
#:use-module (guix utils))
(define ly-source
(let ((commit "1b9286166e2b49fb11823a0f02baa6c42e66fe61")
(revision "1")
(name "ly")
(version "1.3.2"))
(origin
(method git-fetch)
(uri (git-reference
(url "https://codeberg.org/fairyglade/ly")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "1dwx0ri61p16n1kpcv57g7xf3rgwysnfijw7i76b1l802a4qnk1z")))))
(define ly-zig-cache
(computed-file
"ly-zig-cache"
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
(let ((cert-dir (string-append #$nss-certs "/etc/ssl/certs"))
(certs "/tmp/ca-certificates.crt")
(zig-bin (string-append #$zig-0.15 "/bin"))
(git-bin (string-append #$git-minimal "/bin"))
(curl-bin (string-append #$curl "/bin"))
(proot-bin (string-append #$proot "/bin"))
(coreutils-bin (string-append #$(@ (gnu packages base) coreutils) "/bin")))
(call-with-output-file certs
(lambda (out)
(for-each (lambda (file)
(call-with-input-file file
(lambda (p)
(dump-port p out)
(display "\n" out))))
(find-files cert-dir "\\.pem$"))))
(setenv "HOME" "/tmp")
(setenv "PATH" (string-append zig-bin ":" curl-bin ":" proot-bin ":" git-bin ":" coreutils-bin))
(setenv "ZIG_GLOBAL_CACHE_DIR" "/tmp/zcache")
(setenv "SSL_CERT_FILE" certs)
(setenv "GIT_SSL_CAINFO" certs)
(setenv "CURL_CA_BUNDLE" certs)
(mkdir-p "/tmp/zcache")
(mkdir-p "/tmp/src")
(copy-recursively #$ly-source "/tmp/src")
(chmod "/tmp/src" #o755)
(with-directory-excursion "/tmp/src"
(invoke "proot" "-b" (string-append certs ":/etc/ssl/certs/ca-certificates.crt")
"zig" "build" "--fetch=all"))
(copy-recursively "/tmp/zcache/p" #$output))))
#:options (list
#:hash-algo 'sha256
#:hash (base32 "1qmj0ysynvyfvwc68apy3lxqccrv3rxak5a21ij6y0c2dw3yzl64")
#:recursive? #t)))
(define-public ly
(package
(name "ly")
(version "1.3.2")
(source ly-source)
(build-system zig-build-system)
(arguments
(list
#:zig-release-type "small"
#:zig-build-flags #~(list "-Denable_x11_support=false"
"--search-prefix"
#$(this-package-input "linux-pam"))
#:zig zig-0.15
#:tests? #f
#:phases
#~(modify-phases %standard-phases
(add-before 'configure 'seed-zig-cache
(lambda _
(let ((cache-dir "/tmp/zig-cache"))
(mkdir-p cache-dir)
(symlink #$ly-zig-cache (string-append cache-dir "/p"))
(setenv "ZIG_GLOBAL_CACHE_DIR" cache-dir)))))))
(native-inputs (list
ly-zig-cache))
(inputs (list linux-pam))
(home-page "https://codeberg.org/fairyglade/ly")
(synopsis "TTY-based login manager written in Zig.")
(description "Zig-based login manager that can launch X Server and Wayland based compositors.")
(license license:expat)))
ly
|