Note: This is actually my fourth attempt, but since this one is probably easiest, I’ll change it to my first.
Wahey!
I finally found a package that I want to add to the guix system, well, my channel really, because I’m not sure how many hoops I’ve got to cross to get it onto guix, so I’ll be building this for my channel first.
I first successfully build it locally, so I think the next step is to wrap it into a guix package,
which I’ve never done before.
The package is called ant-node, although the actual first package I wanted to package was fetchit, but since it relies on ANT applications, I decided to dig down until found the my current target, ant-protocol. Although this one is already complicated, at least it’s a good starting point.
For my first package I ran into these questions..
How do I turn this package definition into a package downloadable for others..
- Is there some command that builds the package from this package definition?
- Where can I see a list of guix licenses accepted by the guix license module?
- How do I know the sha256 base32 code?
- What is guix gexp?
- How do I tell my cargo-build-system the list of package dependencies?
- How do I put my list of rust-crates into a separate scheme file?
- I’m seeing windows package dependencies during the build, should I get rid of those?
- If so, how?
- My build can’t find pkg-config. How do I get it to recognize it?
- How do I add or avoid ‘testing CA certificates’ for building this package?
- I get the suggestion to symlink
configtoconfig.toml. How do I do that in a package build?
package.scm
;;; 2026 Yrop <folaht@protonmail.com>
(define-module (yrop packages ant node)
#:use-module (guix build-system cargo)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module ((guix licenses)
#:prefix license:)
#:use-module (guix packages)
#:use-module (gnu packages compression)
#:use-module (gnu packages pkg-config))
(define rust-addr2line-0.25.1
(crate-source "addr2line" "0.25.1"
"0jwb96gv17vdr29hbzi0ha5q6jkpgjyn7rjlg5nis65k41rk0p8v"))
...
(define-public ant-node
(package
(name "ant-node")
(version "0.14.3")
(source
(origin
(method url-fetch)
(uri (crate-uri "ant-node" version))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32 "109wvkjlvv1s6kxy8x5jwl78lx7waq9vakn3vdjyhz1sd3lmszrz"))))
(build-system cargo-build-system)
(arguments
(list #:cargo-test-flags
''("--"
"--skip=node::tests::test_build_upgrade_monitor_staged_rollout_disabled"
...)))
(native-inputs (list pkg-config))
(inputs
(cons* mimalloc
`(,zstd "lib")
(list
rust-addr2line-0.25.1
...))
(home-page "https://github.com/WithAutonomi/ant-node")
(synopsis
"Pure quantum-proof network node for the Autonomi decentralized network")
(description
"This package provides Pure quantum-proof network node for the Autonomi decentralized network.")
(license (list license:expat license:asl2.0))))
ant-node
Problem #7
I see this during my build…
$ guix build -r
...
./guix-vendor/rust-windows-x86-64-msvc-0.48.5.tar.gz/lib/windows.0.48.5.lib
error: Possible pre-generated file found: ./guix-vendor/rust-windows-x86-64-msvc-0.48.5.tar.gz/lib/windows.0.48.5.lib
./guix-vendor/rust-windows-x86-64-msvc-0.52.6.tar.gz/lib/windows.0.52.0.lib
error: Possible pre-generated file found: ./guix-vendor/rust-windows-x86-64-msvc-0.52.6.tar.gz/lib/windows.0.52.0.lib
./guix-vendor/rust-wit-bindgen-0.57.1.tar.gz/src/rt/libwit_bindgen_cabi.a
error: Possible pre-generated file found: ./guix-vendor/rust-wit-bindgen-0.57.1.tar.gz/src/rt/libwit_bindgen_cabi.a
...
This app doesn’t need windows support if it’s installed for guix.
Is there way to skip these parts?
Problem #10
This is what I see during the build..
$ guix build -r
...
starting phase `install'
warning: `/tmp/guix-build-ant-node-0.14.3.drv-0/source/.cargo/config` is deprecated in favor of `config.toml`
|
= help: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
...
Is there a way to symlink these files in my package definition?