mirror of
				https://codeberg.org/hako/Rosenthal.git
				synced 2025-11-04 11:44:48 +00:00 
			
		
		
		
	rosenthal: Add atuin.
* rosenthal/packages.scm: New file. * rosenthal/packages/patches/atuin-disable-failing-tests.patch: New file. * rosenthal/packages/rust-crates.scm (atuin-cargo-inputs): New variable. * rosenthal/packages/rust-apps.scm (atuin): New variable. * rosenthal/packages/binaries.scm (atuin-bin): Deprecated by atuin. * README.org (Packages): Update. * etc/manifest: Update.
This commit is contained in:
		
							parent
							
								
									8ab2595528
								
							
						
					
					
						commit
						891eb84b38
					
				@ -83,6 +83,7 @@ Rosenthal 頻道定義如下,將其加入 =~/.config/guix/channels.scm= 以由
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
** Content / 內容
 | 
					** Content / 內容
 | 
				
			||||||
*** Packages / 軟件包
 | 
					*** Packages / 軟件包
 | 
				
			||||||
 | 
					+ atuin
 | 
				
			||||||
+ cloudflared
 | 
					+ cloudflared
 | 
				
			||||||
+ dinit
 | 
					+ dinit
 | 
				
			||||||
+ dnsmasq-china-list
 | 
					+ dnsmasq-china-list
 | 
				
			||||||
@ -95,7 +96,6 @@ Rosenthal 頻道定義如下,將其加入 =~/.config/guix/channels.scm= 以由
 | 
				
			|||||||
+ tree-sitter-yaml
 | 
					+ tree-sitter-yaml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Binary Packages / 二進制包:
 | 
					Binary Packages / 二進制包:
 | 
				
			||||||
+ atuin-bin
 | 
					 | 
				
			||||||
+ bitwarden-icecat
 | 
					+ bitwarden-icecat
 | 
				
			||||||
+ clash-bin
 | 
					+ clash-bin
 | 
				
			||||||
+ hugo-bin
 | 
					+ hugo-bin
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(specifications->manifest
 | 
					(specifications->manifest
 | 
				
			||||||
 '(
 | 
					 '(
 | 
				
			||||||
   "atuin-bin"
 | 
					   "atuin"
 | 
				
			||||||
   "cloudflare-warp-bin"
 | 
					   "cloudflare-warp-bin"
 | 
				
			||||||
   "cloudflared"
 | 
					   "cloudflared"
 | 
				
			||||||
   "dinit"
 | 
					   "dinit"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										66
									
								
								rosenthal/packages.scm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								rosenthal/packages.scm
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,66 @@
 | 
				
			|||||||
 | 
					;;; SPDX-License-Identifier: GPL-3.0-or-later
 | 
				
			||||||
 | 
					;;; Copyright © 2015, 2018 Ludovic Courtès <ludo@gnu.org>
 | 
				
			||||||
 | 
					;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define-module (rosenthal packages)
 | 
				
			||||||
 | 
					  #:use-module (gnu packages)
 | 
				
			||||||
 | 
					  #:use-module (guix diagnostics)
 | 
				
			||||||
 | 
					  #:use-module (guix i18n)
 | 
				
			||||||
 | 
					  #:use-module (ice-9 match)
 | 
				
			||||||
 | 
					  #:use-module (srfi srfi-34)
 | 
				
			||||||
 | 
					  #:replace (%patch-path
 | 
				
			||||||
 | 
					             search-patch)
 | 
				
			||||||
 | 
					  #:export (rosenthal-patches))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;;; Commentary:
 | 
				
			||||||
 | 
					;;;
 | 
				
			||||||
 | 
					;;; This module refines the default value of some parameters from (gnu
 | 
				
			||||||
 | 
					;;; packages) and the syntax/procedures using those.  This allows
 | 
				
			||||||
 | 
					;;; 'search-paths' and friends to work without any user intervention.
 | 
				
			||||||
 | 
					;;;
 | 
				
			||||||
 | 
					;;; Code:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define %rosenthal-root-directory
 | 
				
			||||||
 | 
					  ;; This is like %distro-root-directory from (gnu packages), with adjusted
 | 
				
			||||||
 | 
					  ;; paths.
 | 
				
			||||||
 | 
					  (letrec-syntax ((dirname* (syntax-rules ()
 | 
				
			||||||
 | 
					                              ((_ file)
 | 
				
			||||||
 | 
					                               (dirname file))
 | 
				
			||||||
 | 
					                              ((_ file head tail ...)
 | 
				
			||||||
 | 
					                               (dirname (dirname* file tail ...)))))
 | 
				
			||||||
 | 
					                  (try      (syntax-rules ()
 | 
				
			||||||
 | 
					                              ((_ (file things ...) rest ...)
 | 
				
			||||||
 | 
					                               (match (search-path %load-path file)
 | 
				
			||||||
 | 
					                                 (#f
 | 
				
			||||||
 | 
					                                  (try rest ...))
 | 
				
			||||||
 | 
					                                 (absolute
 | 
				
			||||||
 | 
					                                  (dirname* absolute things ...))))
 | 
				
			||||||
 | 
					                              ((_)
 | 
				
			||||||
 | 
					                               #f))))
 | 
				
			||||||
 | 
					    (try ("rosenthal/packages/binaries.scm" rosenthal/ packages/)
 | 
				
			||||||
 | 
					         ("rosenthal/packages.scm" rosenthal/))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define %patch-path
 | 
				
			||||||
 | 
					  ;; Define it after '%package-module-path' so that '%load-path' contains user
 | 
				
			||||||
 | 
					  ;; directories, allowing patches in $GUIX_PACKAGE_PATH to be found.
 | 
				
			||||||
 | 
					  (make-parameter
 | 
				
			||||||
 | 
					   (map (lambda (directory)
 | 
				
			||||||
 | 
					          (if (string=? directory %rosenthal-root-directory)
 | 
				
			||||||
 | 
					              (string-append directory "/rosenthal/packages/patches")
 | 
				
			||||||
 | 
					              directory))
 | 
				
			||||||
 | 
					        %load-path)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;;; XXX: The following must be redefined to make use of the overridden
 | 
				
			||||||
 | 
					;;; %patch-path parameter above.
 | 
				
			||||||
 | 
					(define (search-patch file-name)
 | 
				
			||||||
 | 
					  "Search the patch FILE-NAME.  Raise an error if not found."
 | 
				
			||||||
 | 
					  (or (search-path (%patch-path) file-name)
 | 
				
			||||||
 | 
					      (raise (formatted-message (G_ "~a: patch not found")
 | 
				
			||||||
 | 
					                                file-name))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;;; XXX: `search-patches' being syntax, it can't be overridden by the module
 | 
				
			||||||
 | 
					;;; system, or so it seems, so we simply rename it.
 | 
				
			||||||
 | 
					(define-syntax-rule (rosenthal-patches file-name ...)
 | 
				
			||||||
 | 
					  "Return the list of absolute file names corresponding to each
 | 
				
			||||||
 | 
					FILE-NAME found in %PATCH-PATH."
 | 
				
			||||||
 | 
					  (list (search-patch file-name) ...))
 | 
				
			||||||
@ -5,6 +5,7 @@
 | 
				
			|||||||
(define-module (rosenthal packages binaries)
 | 
					(define-module (rosenthal packages binaries)
 | 
				
			||||||
  #:use-module ((guix licenses) #:prefix license:)
 | 
					  #:use-module ((guix licenses) #:prefix license:)
 | 
				
			||||||
  #:use-module (guix gexp)
 | 
					  #:use-module (guix gexp)
 | 
				
			||||||
 | 
					  #:use-module (guix deprecation)
 | 
				
			||||||
  #:use-module (guix packages)
 | 
					  #:use-module (guix packages)
 | 
				
			||||||
  #:use-module (guix download)
 | 
					  #:use-module (guix download)
 | 
				
			||||||
  #:use-module (guix build-system copy)
 | 
					  #:use-module (guix build-system copy)
 | 
				
			||||||
@ -17,61 +18,14 @@
 | 
				
			|||||||
  #:use-module (gnu packages gcc)
 | 
					  #:use-module (gnu packages gcc)
 | 
				
			||||||
  #:use-module (gnu packages glib)
 | 
					  #:use-module (gnu packages glib)
 | 
				
			||||||
  #:use-module (gnu packages java)
 | 
					  #:use-module (gnu packages java)
 | 
				
			||||||
  #:use-module (gnu packages nss))
 | 
					  #:use-module (gnu packages nss)
 | 
				
			||||||
 | 
					  #:use-module (rosenthal packages rust-apps))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define license
 | 
					(define license
 | 
				
			||||||
  (@@ (guix licenses) license))
 | 
					  (@@ (guix licenses) license))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define-public atuin-bin
 | 
					(define-public atuin-bin
 | 
				
			||||||
  (package
 | 
					  (deprecated-package "atuin-bin" atuin))
 | 
				
			||||||
    (name "atuin-bin")
 | 
					 | 
				
			||||||
    (version "18.4.0")
 | 
					 | 
				
			||||||
    (source (origin
 | 
					 | 
				
			||||||
              (method url-fetch)
 | 
					 | 
				
			||||||
              (uri (string-append
 | 
					 | 
				
			||||||
                    "https://github.com/atuinsh/atuin/releases/download/v"
 | 
					 | 
				
			||||||
                    version "/atuin-x86_64-unknown-linux-gnu.tar.gz"))
 | 
					 | 
				
			||||||
              (sha256
 | 
					 | 
				
			||||||
               (base32
 | 
					 | 
				
			||||||
                "09rbk68mlfvjqzpydq9i83c05vpvn03s2343mswimc5svlclwslh"))))
 | 
					 | 
				
			||||||
    (build-system copy-build-system)
 | 
					 | 
				
			||||||
    (arguments
 | 
					 | 
				
			||||||
     (list #:install-plan #~'(("atuin" "bin/"))
 | 
					 | 
				
			||||||
           #:phases
 | 
					 | 
				
			||||||
           #~(modify-phases %standard-phases
 | 
					 | 
				
			||||||
               (add-after 'install 'patch-elf
 | 
					 | 
				
			||||||
                 (lambda _
 | 
					 | 
				
			||||||
                   (let ((ld.so (string-append #$(this-package-input "glibc")
 | 
					 | 
				
			||||||
                                               #$(glibc-dynamic-linker)))
 | 
					 | 
				
			||||||
                         (runpath (string-join
 | 
					 | 
				
			||||||
                                   (list
 | 
					 | 
				
			||||||
                                    (string-append
 | 
					 | 
				
			||||||
                                     (ungexp
 | 
					 | 
				
			||||||
                                      (this-package-input "gcc") "lib") "/lib")
 | 
					 | 
				
			||||||
                                    (string-append
 | 
					 | 
				
			||||||
                                     #$(this-package-input "glibc") "/lib"))
 | 
					 | 
				
			||||||
                                   ":")))
 | 
					 | 
				
			||||||
                     (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" runpath file)
 | 
					 | 
				
			||||||
                       (display " done\n"))
 | 
					 | 
				
			||||||
                     (for-each (lambda (file)
 | 
					 | 
				
			||||||
                                 (patch-elf file))
 | 
					 | 
				
			||||||
                               (find-files
 | 
					 | 
				
			||||||
                                (string-append #$output "/bin")))))))))
 | 
					 | 
				
			||||||
    (supported-systems '("x86_64-linux"))
 | 
					 | 
				
			||||||
    (native-inputs (list patchelf-0.16))
 | 
					 | 
				
			||||||
    (inputs (list `(,gcc "lib") glibc))
 | 
					 | 
				
			||||||
    (home-page "https://atuin.sh/")
 | 
					 | 
				
			||||||
    (synopsis "Sync, search and backup shell history")
 | 
					 | 
				
			||||||
    (description
 | 
					 | 
				
			||||||
     "Atuin replaces existing shell history with a SQLite database, and records
 | 
					 | 
				
			||||||
additional context for commands.  Additionally, it provides optional and fully
 | 
					 | 
				
			||||||
encrypted synchronisation of history between machines, via an Atuin server.")
 | 
					 | 
				
			||||||
    (license license:gpl3)
 | 
					 | 
				
			||||||
    (properties '((upstream-name . "atuin")))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define bitwarden
 | 
					(define bitwarden
 | 
				
			||||||
  (package
 | 
					  (package
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										64
									
								
								rosenthal/packages/patches/atuin-disable-failing-tests.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								rosenthal/packages/patches/atuin-disable-failing-tests.patch
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
				
			|||||||
 | 
					diff --git a/crates/atuin-dotfiles/src/store.rs b/crates/atuin-dotfiles/src/store.rs
 | 
				
			||||||
 | 
					index b77fa370..0449ad0b 100644
 | 
				
			||||||
 | 
					--- a/crates/atuin-dotfiles/src/store.rs
 | 
				
			||||||
 | 
					+++ b/crates/atuin-dotfiles/src/store.rs
 | 
				
			||||||
 | 
					@@ -335,6 +335,7 @@ mod tests {
 | 
				
			||||||
 | 
					         assert_eq!(decoded, record);
 | 
				
			||||||
 | 
					     }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					+    #[ignore]
 | 
				
			||||||
 | 
					     #[tokio::test]
 | 
				
			||||||
 | 
					     async fn build_aliases() {
 | 
				
			||||||
 | 
					         let store = SqliteStore::new(":memory:", test_local_timeout())
 | 
				
			||||||
 | 
					diff --git a/crates/atuin-dotfiles/src/store/var.rs b/crates/atuin-dotfiles/src/store/var.rs
 | 
				
			||||||
 | 
					index 0873b4d5..b2e68e34 100644
 | 
				
			||||||
 | 
					--- a/crates/atuin-dotfiles/src/store/var.rs
 | 
				
			||||||
 | 
					+++ b/crates/atuin-dotfiles/src/store/var.rs
 | 
				
			||||||
 | 
					@@ -317,6 +317,7 @@ mod tests {
 | 
				
			||||||
 | 
					         assert_eq!(decoded, record);
 | 
				
			||||||
 | 
					     }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					+    #[ignore]
 | 
				
			||||||
 | 
					     #[tokio::test]
 | 
				
			||||||
 | 
					     async fn build_vars() {
 | 
				
			||||||
 | 
					         let store = SqliteStore::new(":memory:", test_local_timeout())
 | 
				
			||||||
 | 
					diff --git a/crates/atuin/tests/sync.rs b/crates/atuin/tests/sync.rs
 | 
				
			||||||
 | 
					index 7e25d1c2..e16d5b96 100644
 | 
				
			||||||
 | 
					--- a/crates/atuin/tests/sync.rs
 | 
				
			||||||
 | 
					+++ b/crates/atuin/tests/sync.rs
 | 
				
			||||||
 | 
					@@ -3,6 +3,7 @@ use time::OffsetDateTime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 mod common;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					+#[ignore]
 | 
				
			||||||
 | 
					 #[tokio::test]
 | 
				
			||||||
 | 
					 async fn sync() {
 | 
				
			||||||
 | 
					     let path = format!("/{}", uuid_v7().as_simple());
 | 
				
			||||||
 | 
					diff --git a/crates/atuin/tests/users.rs b/crates/atuin/tests/users.rs
 | 
				
			||||||
 | 
					index 95fb533b..f4154803 100644
 | 
				
			||||||
 | 
					--- a/crates/atuin/tests/users.rs
 | 
				
			||||||
 | 
					+++ b/crates/atuin/tests/users.rs
 | 
				
			||||||
 | 
					@@ -2,6 +2,7 @@ use atuin_common::utils::uuid_v7;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 mod common;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					+#[ignore]
 | 
				
			||||||
 | 
					 #[tokio::test]
 | 
				
			||||||
 | 
					 async fn registration() {
 | 
				
			||||||
 | 
					     let path = format!("/{}", uuid_v7().as_simple());
 | 
				
			||||||
 | 
					@@ -30,6 +31,7 @@ async fn registration() {
 | 
				
			||||||
 | 
					     server.await.unwrap();
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					+#[ignore]
 | 
				
			||||||
 | 
					 #[tokio::test]
 | 
				
			||||||
 | 
					 async fn change_password() {
 | 
				
			||||||
 | 
					     let path = format!("/{}", uuid_v7().as_simple());
 | 
				
			||||||
 | 
					@@ -68,6 +70,7 @@ async fn change_password() {
 | 
				
			||||||
 | 
					     server.await.unwrap();
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					+#[ignore]
 | 
				
			||||||
 | 
					 #[tokio::test]
 | 
				
			||||||
 | 
					 async fn multi_user_test() {
 | 
				
			||||||
 | 
					     let path = format!("/{}", uuid_v7().as_simple());
 | 
				
			||||||
							
								
								
									
										58
									
								
								rosenthal/packages/rust-apps.scm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								rosenthal/packages/rust-apps.scm
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,58 @@
 | 
				
			|||||||
 | 
					;; SPDX-FileCopyrightText: 2025 Hilton Chain <hako@ultrarare.space>
 | 
				
			||||||
 | 
					;;
 | 
				
			||||||
 | 
					;; SPDX-License-Identifier: GPL-3.0-or-later
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define-module (rosenthal packages rust-apps)
 | 
				
			||||||
 | 
					  #:use-module ((guix licenses) #:prefix license:)
 | 
				
			||||||
 | 
					  #:use-module (guix gexp)
 | 
				
			||||||
 | 
					  #:use-module (guix packages)
 | 
				
			||||||
 | 
					  #:use-module (guix download)
 | 
				
			||||||
 | 
					  #:use-module (guix git-download)
 | 
				
			||||||
 | 
					  #:use-module (guix build-system cargo)
 | 
				
			||||||
 | 
					  #:use-module (rosenthal packages rust-crates))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define-public atuin
 | 
				
			||||||
 | 
					  (package
 | 
				
			||||||
 | 
					    (name "atuin")
 | 
				
			||||||
 | 
					    (version "18.4.0")
 | 
				
			||||||
 | 
					    (source (origin
 | 
				
			||||||
 | 
					              (method git-fetch)
 | 
				
			||||||
 | 
					              (uri (git-reference
 | 
				
			||||||
 | 
					                    (url "https://github.com/atuinsh/atuin")
 | 
				
			||||||
 | 
					                    (commit (string-append "v" version))))
 | 
				
			||||||
 | 
					              (file-name (git-file-name name version))
 | 
				
			||||||
 | 
					              (sha256
 | 
				
			||||||
 | 
					               (base32
 | 
				
			||||||
 | 
					                "1zi7ar999ycvig9c9crylab540xdgr0h6v99q9j8ypk9i1fviyiz"))
 | 
				
			||||||
 | 
					              (patches
 | 
				
			||||||
 | 
					               (rosenthal-patches "atuin-disable-failing-tests.patch"))))
 | 
				
			||||||
 | 
					    (build-system cargo-build-system)
 | 
				
			||||||
 | 
					    (arguments
 | 
				
			||||||
 | 
					     (list
 | 
				
			||||||
 | 
					      #:install-source? #f
 | 
				
			||||||
 | 
					      #:tests? #f                  ;TODO
 | 
				
			||||||
 | 
					      #:features
 | 
				
			||||||
 | 
					      ''("client" "sync" "server" "clipboard" "daemon")
 | 
				
			||||||
 | 
					      #:phases
 | 
				
			||||||
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
 | 
					          (replace 'install
 | 
				
			||||||
 | 
					            (lambda* (#:key outputs features #:allow-other-keys)
 | 
				
			||||||
 | 
					              (let* ((out      (assoc-ref outputs "out"))
 | 
				
			||||||
 | 
					                     (registry (string-append out "/share/cargo/registry"))
 | 
				
			||||||
 | 
					                     (sources  (string-append out "/share/cargo/src")))
 | 
				
			||||||
 | 
					                (mkdir-p out)
 | 
				
			||||||
 | 
					                ;; Make cargo reuse all the artifacts we just built instead
 | 
				
			||||||
 | 
					                ;; of defaulting to making a new temp directory
 | 
				
			||||||
 | 
					                (setenv "CARGO_TARGET_DIR" "./target")
 | 
				
			||||||
 | 
					                ;; Only install crates which include binary targets,
 | 
				
			||||||
 | 
					                ;; otherwise cargo will raise an error.
 | 
				
			||||||
 | 
					                (invoke "cargo" "install" "--no-track" "--path" "crates/atuin"
 | 
				
			||||||
 | 
					                        "--root" out "--features" (string-join features))))))))
 | 
				
			||||||
 | 
					    (inputs (force atuin-cargo-inputs))
 | 
				
			||||||
 | 
					    (home-page "https://atuin.sh/")
 | 
				
			||||||
 | 
					    (synopsis "Sync, search and backup shell history")
 | 
				
			||||||
 | 
					    (description
 | 
				
			||||||
 | 
					     "Atuin replaces existing shell history with a SQLite database, and records
 | 
				
			||||||
 | 
					additional context for commands.  Additionally, it provides optional and fully
 | 
				
			||||||
 | 
					encrypted synchronisation of history between machines, via an Atuin server.")
 | 
				
			||||||
 | 
					    (license license:gpl3)))
 | 
				
			||||||
							
								
								
									
										4930
									
								
								rosenthal/packages/rust-crates.scm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4930
									
								
								rosenthal/packages/rust-crates.scm
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user