diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-02-08 21:14:05 +0000 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-02-15 17:34:12 +0100 |
| commit | 5ab5c418685d073f8d98d6f5a23639e276daf776 (patch) | |
| tree | 426fe804f73420e674195dae8b47bd555d1d25d6 /gnu/packages/rust-sources.scm | |
| parent | 6a386b23c228b1ec3f8c1e95c56a080ac7c7ec1d (diff) | |
gnu: Add rust-codex@0.0.0.785c0c43.
* gnu/packages/patches/rust-codex-0.98.0-core-file-lock.patch: New file.
* gnu/packages/patches/rust-codex-0.98.0-core-remove-self-dep.patch: New file.
* gnu/packages/patches/rust-codex-0.98.0-execpolicy-file-lock.patch: New file.
* gnu/packages/patches/rust-codex-0.98.0-arg0-file-lock.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
* gnu/packages/rust-crates.scm (rust-codex-api-0.0.0.785c0c43,
rust-codex-app-server-protocol-0.0.0.785c0c43,
rust-codex-apply-patch-0.0.0.785c0c43,
rust-codex-arg0-0.0.0.785c0c43,
rust-codex-async-utils-0.0.0.785c0c43,
rust-codex-client-0.0.0.785c0c43,
rust-codex-common-0.0.0.785c0c43,
rust-codex-core-0.0.0.785c0c43,
rust-codex-execpolicy-0.0.0.785c0c43,
rust-codex-experimental-api-macros-0.0.0.785c0c43,
rust-codex-file-search-0.0.0.785c0c43,
rust-codex-git-0.0.0.785c0c43,
rust-codex-keyring-store-0.0.0.785c0c43,
rust-codex-linux-sandbox-0.0.0.785c0c43,
rust-codex-lmstudio-0.0.0.785c0c43,
rust-codex-login-0.0.0.785c0c43,
rust-codex-mcp-server-0.0.0.785c0c43,
rust-codex-ollama-0.0.0.785c0c43,
rust-codex-otel-0.0.0.785c0c43,
rust-codex-protocol-0.0.0.785c0c43,
rust-codex-rmcp-client-0.0.0.785c0c43,
rust-codex-state-0.0.0.785c0c43,
rust-codex-utils-absolute-path-0.0.0.785c0c43,
rust-codex-utils-cache-0.0.0.785c0c43,
rust-codex-utils-home-dir-0.0.0.785c0c43,
rust-codex-utils-image-0.0.0.785c0c43,
rust-codex-utils-json-to-toml-0.0.0.785c0c43,
rust-codex-utils-pty-0.0.0.785c0c43,
rust-codex-utils-readiness-0.0.0.785c0c43,
rust-codex-utils-string-0.0.0.785c0c43,
rust-codex-windows-sandbox-0.0.0.785c0c43): New variables.
* gnu/packages/rust-crates.scm (lookup-cargo-inputs)
[rust-codex-0.0.0.785c0c43, codex-app-server-protocol, codex-common,
codex-core, codex-protocol, codex-utils-absolute-path]: New entries.
* gnu/packages/rust-sources.scm (rust-codex-0.0.0.785c0c43): New variable.
Change-Id: I3e4fceeb6f7821525a19b556fe852db6c707bae4
Diffstat (limited to 'gnu/packages/rust-sources.scm')
| -rw-r--r-- | gnu/packages/rust-sources.scm | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/gnu/packages/rust-sources.scm b/gnu/packages/rust-sources.scm index 3d61b320bae..82bdef53ee2 100644 --- a/gnu/packages/rust-sources.scm +++ b/gnu/packages/rust-sources.scm | |||
| @@ -678,3 +678,108 @@ intelligence.") | |||
| 678 | webview, a tiny cross-platform library to render web-based GUIs as desktop | 678 | webview, a tiny cross-platform library to render web-based GUIs as desktop |
| 679 | applications.") | 679 | applications.") |
| 680 | (license license:expat))))) | 680 | (license license:expat))))) |
| 681 | (define-public rust-codex-0.0.0.785c0c43 | ||
| 682 | (let ((commit "785c0c43df941e6997ff3a9e8a9dd48da2661f20") | ||
| 683 | (revision "0")) | ||
| 684 | (hidden-package | ||
| 685 | (package | ||
| 686 | (name "rust-codex") | ||
| 687 | (version (git-version "0.0.0" revision commit)) | ||
| 688 | (source | ||
| 689 | (origin | ||
| 690 | (method git-fetch) | ||
| 691 | (uri (git-reference | ||
| 692 | (url "https://github.com/zed-industries/codex") | ||
| 693 | (commit commit))) | ||
| 694 | (file-name (git-file-name name version)) | ||
| 695 | (sha256 | ||
| 696 | (base32 "0rwj1ykknng39mhzna3fw3rcl3vngynsjdcj1namgkvw91zd9dl7")) | ||
| 697 | ;; TODO: Remove patches when Rust provides stable file locking API. | ||
| 698 | ;; The file_lock feature is tracked at | ||
| 699 | ;; <https://github.com/rust-lang/rust/issues/130994>. | ||
| 700 | (patches (search-patches "rust-codex-0.98.0-execpolicy-file-lock.patch" | ||
| 701 | "rust-codex-0.98.0-core-file-lock.patch" | ||
| 702 | "rust-codex-0.98.0-arg0-file-lock.patch" | ||
| 703 | "rust-codex-0.98.0-core-remove-self-dep.patch")))) | ||
| 704 | (build-system cargo-build-system) | ||
| 705 | (arguments | ||
| 706 | (list | ||
| 707 | #:skip-build? #t | ||
| 708 | #:cargo-package-crates | ||
| 709 | ;; Order matters: dependencies must come before packages that need them | ||
| 710 | ''("codex-async-utils" ; No internal deps | ||
| 711 | "codex-client" ; No internal deps | ||
| 712 | "codex-execpolicy" ; No internal deps | ||
| 713 | "codex-file-search" ; No internal deps | ||
| 714 | "codex-git" ; No internal deps | ||
| 715 | "codex-keyring-store" ; No internal deps | ||
| 716 | "codex-utils-absolute-path" ; No internal deps | ||
| 717 | "codex-utils-cache" ; No internal deps | ||
| 718 | "codex-utils-cargo-bin" ; No internal deps | ||
| 719 | "codex-utils-home-dir" ; No internal deps | ||
| 720 | "codex-utils-json-to-toml" ; No internal deps | ||
| 721 | "codex-utils-pty" ; No internal deps | ||
| 722 | "codex-utils-readiness" ; No internal deps | ||
| 723 | "codex-utils-string" ; No internal deps | ||
| 724 | "codex-utils-image" ; Depends on codex-utils-cache | ||
| 725 | "codex-apply-patch" ; Depends on codex-utils-cargo-bin | ||
| 726 | "codex-protocol" ; Depends on codex-git, codex-utils-* | ||
| 727 | "codex-windows-sandbox" ; Depends on codex-utils-absolute-path, codex-protocol | ||
| 728 | "codex-api" ; Depends on codex-client, codex-protocol | ||
| 729 | "codex-experimental-api-macros" ; Macro crate (must come before app-server-protocol) | ||
| 730 | "codex-app-server-protocol" ; Depends on codex-protocol, codex-experimental-api-macros | ||
| 731 | "codex-rmcp-client" ; Depends on codex-keyring-store, codex-protocol | ||
| 732 | "codex-otel" ; Depends on codex-app-server-protocol, codex-api | ||
| 733 | "codex-state" ; Depends on codex-protocol, codex-otel | ||
| 734 | "codex-core" ; Depends on many packages above | ||
| 735 | "codex-linux-sandbox" ; Depends on codex-core, codex-utils-absolute-path | ||
| 736 | "codex-arg0" ; Depends on codex-apply-patch, codex-core, codex-linux-sandbox | ||
| 737 | "codex-lmstudio" ; Depends on codex-core | ||
| 738 | "codex-login" ; Depends on codex-core | ||
| 739 | "codex-ollama" ; Depends on codex-core | ||
| 740 | "codex-common" ; Depends on codex-core, codex-lmstudio, codex-ollama | ||
| 741 | "codex-mcp-server") ; Depends on codex-core, codex-common | ||
| 742 | #:phases | ||
| 743 | #~(modify-phases %standard-phases | ||
| 744 | (add-after 'unpack 'chdir-to-workspace | ||
| 745 | (lambda _ | ||
| 746 | (chdir "codex-rs"))) | ||
| 747 | (add-after 'chdir-to-workspace 'patch-git-deps-to-vendor | ||
| 748 | (lambda _ | ||
| 749 | ;; Avoid git fetches in offline builds by pointing patches | ||
| 750 | ;; at the vendored sources provided via cargo-inputs. | ||
| 751 | (substitute* "Cargo.toml" | ||
| 752 | (("crossterm = \\{ git = [^}]+\\}") | ||
| 753 | "crossterm = { version = \"0.28.1\" }") | ||
| 754 | (("ratatui = \\{ git = [^}]+\\}") | ||
| 755 | "ratatui = { version = \"0.29.0\" }") | ||
| 756 | (("tokio-tungstenite = \\{ git = [^}]+\\}") | ||
| 757 | "tokio-tungstenite = { version = \"0.28.0\" }") | ||
| 758 | ;; Point nucleo git dependency to vendored checkout. | ||
| 759 | (("nucleo = \\{ git = [^}]+\\}") | ||
| 760 | "nucleo = { version = \"0.5.0\" }") | ||
| 761 | ;; Point runfiles git dependency to vendored checkout. | ||
| 762 | (("runfiles = \\{ git = [^}]+\\}") | ||
| 763 | "runfiles = { version = \"0.1.0\" }")))) | ||
| 764 | (add-after 'chdir-to-workspace 'add-version-to-workspace-deps | ||
| 765 | (lambda _ | ||
| 766 | ;; cargo package requires all dependencies to have versions. | ||
| 767 | ;; Add version = "0.0.0" to internal path dependencies. | ||
| 768 | (let ((cargo-files (find-files "." "^Cargo\\.toml$"))) | ||
| 769 | (substitute* cargo-files | ||
| 770 | ;; Handle inline deps: name = { path = "..." } | ||
| 771 | (("(codex-[a-z0-9-]+) = \\{ path = " all name) | ||
| 772 | (string-append name " = { version = \"0.0.0\", path = ")) | ||
| 773 | ;; Handle inline deps with package: name = { package = "...", path = "..." } | ||
| 774 | (("(codex-[a-z0-9-]+) = \\{ package = " all name) | ||
| 775 | (string-append name " = { version = \"0.0.0\", package = ")) | ||
| 776 | ;; Handle section deps: [dependencies.X] with path = "..." | ||
| 777 | (("^(path = \"\\.\\./[^\"]*\")" all path-line) | ||
| 778 | (string-append path-line "\nversion = \"0.0.0\""))))))))) | ||
| 779 | (inputs (cargo-inputs 'rust-codex-0.0.0.785c0c43)) | ||
| 780 | (home-page "https://github.com/zed-industries/codex") | ||
| 781 | (synopsis "Zed Codex workspace crates") | ||
| 782 | (description | ||
| 783 | "This package provides the workspace crates for the Zed Codex CLI | ||
| 784 | and runtime for AI-assisted coding.") | ||
| 785 | (license license:asl2.0))))) | ||
