rosenthal: cloudflare-warp-bin: Update to 2026.3.846.0.

* modules/rosenthal/packages/binaries.scm (cloudflare-warp-bin): Update to
2026.3.846.0.
[build-system]: Switch to gnu-build-system.
[arguments] <#:phases>: Rewrite patch-elf phase.
Add a simple check phase.
This commit is contained in:
Hilton Chain 2026-04-13 09:43:38 +08:00
parent 1100a69108
commit 7df271645f
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292

View File

@ -40,7 +40,7 @@
(define-public cloudflare-warp-bin (define-public cloudflare-warp-bin
(package (package
(name "cloudflare-warp-bin") (name "cloudflare-warp-bin")
(version "2026.1.150.0") (version "2026.3.846.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://pkg.cloudflareclient.com" (uri (string-append "https://pkg.cloudflareclient.com"
@ -48,45 +48,64 @@
"cloudflare-warp_" version "_amd64.deb")) "cloudflare-warp_" version "_amd64.deb"))
(sha256 (sha256
(base32 (base32
"11xdsqww4s2ndqgzaz3d0w3r7557pjsdisw0m4lg9h0a2ilxd6h4")))) "0yvdylcw916hz6wy1y9ah5ajkf4i0ndw7ck0ymqxma74z72101qz"))))
(build-system copy-build-system) (build-system gnu-build-system)
(arguments (arguments
(list #:install-plan (list
#~'(("bin" "bin" #:include ("warp-cli" "warp-svc"))) #:tests? (not (%current-target-system))
#:phases #:imported-modules
#~(modify-phases %standard-phases (append %default-gnu-imported-modules
(add-after 'unpack 'unpack-deb %copy-build-system-modules)
(lambda* (#:key source #:allow-other-keys) #:modules
(invoke "ar" "-x" source) '((guix build utils)
(invoke "tar" "-xf" "data.tar.gz"))) (guix build gnu-build-system)
(add-after 'install 'patch-elf ((guix build copy-build-system) #:prefix copy:))
(lambda _ #:phases
(let ((ld.so (string-append #$(this-package-input "glibc") #~(modify-phases %standard-phases
#$(glibc-dynamic-linker))) (delete 'configure)
(rpath (string-join (delete 'build)
(list (delete 'check)
(string-append (add-after 'unpack 'unpack-deb
(ungexp (lambda* (#:key source #:allow-other-keys)
(this-package-input "gcc") "lib") "/lib") (invoke "ar" "-x" source)
(string-append (invoke "tar" "-xf" "data.tar.gz")))
#$(this-package-input "dbus") "/lib") (replace 'install
(string-append (lambda args
#$(this-package-input "glibc") "/lib") (apply (assoc-ref copy:%standard-phases 'install)
(string-append #:install-plan
#$(this-package-input "nspr") "/lib") '(("bin" "bin" #:include ("warp-cli" "warp-svc")))
(string-append args)))
#$(this-package-input "nss") "/lib/nss")) (add-after 'install 'patch-elf
":"))) (lambda* (#:key inputs #:allow-other-keys)
(define (patch-elf file) (let* ((ld.so (search-input-file inputs #$(glibc-dynamic-linker)))
(format #t "Patching ~a ..." file) (rpath
(unless (string-contains file ".so") (string-join
(invoke "patchelf" "--set-interpreter" ld.so file)) (cons* (dirname ld.so)
(invoke "patchelf" "--set-rpath" rpath file) (dirname
(display " done\n")) (search-input-file inputs "lib/nss/libnss3.so"))
(for-each (lambda (file) (map (lambda (lib)
(patch-elf file)) (dirname (search-input-file
(find-files inputs (in-vicinity "lib" lib))))
(string-append #$output "/bin"))))))))) '("libdbus-1.so"
"libgcc_s.so"
"libnspr4.so")))
":")))
(define (patch-elf file)
(format #t "Patching ~a ..." file)
(unless (string-contains file ".so")
(invoke "patchelf" "--set-interpreter" ld.so file))
(invoke "patchelf" "--set-rpath" rpath file)
(display " done\n"))
(for-each (lambda (file)
(patch-elf file))
(find-files
(string-append #$output "/bin"))))))
(add-after 'patch-elf 'check
(lambda* (#:key tests? outputs #:allow-other-keys)
(let ((cmd (search-input-file outputs "bin/warp-cli")))
(when tests?
(invoke cmd "--help")
(invoke cmd "--version"))))))))
(supported-systems '("x86_64-linux")) (supported-systems '("x86_64-linux"))
(native-inputs (list patchelf-0.16)) (native-inputs (list patchelf-0.16))
(inputs (list dbus `(,gcc "lib") glibc nspr nss)) (inputs (list dbus `(,gcc "lib") glibc nspr nss))