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?
- 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?
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 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)
(inputs (list
rust-addr2line-0.25.1
...))
(native-inputs
(list pkg-config))
(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
My latest issue:
$ guix build -f package.scm
...
error: failed to run custom build command for `zstd-sys v2.0.16+zstd.1.5.7`
Caused by:
process didn't exit successfully: `/tmp/guix-build-ant-node-0.14.3.drv-0/ant-node-0.14.3/target/release/build/zstd-sys-9370d6b83cde04de/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=ZSTD_SYS_USE_PKG_CONFIG
cargo:rerun-if-env-changed=LIBZSTD_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
--- stderr
thread 'main' (42547) panicked at /tmp/guix-build-ant-node-0.14.3.drv-0/ant-node-0.14.3/guix-vendor/rust-zstd-sys-2.0.16+zstd.1.5.7.tar.gz/build.rs:60:10:
Can't probe for zstd in pkg-config:
pkg-config exited with status code 1
> PKG_CONFIG_PATH=/gnu/store/qzmgink147fd9nqm669awy9f2x2i9rih-file-5.46/lib/pkgconfig:/gnu/store/gziyc8kh2wd5gq3ah8vjvpr73my4cgam-xz-5.4.5/lib/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --static --libs --cflags libzstd
pkg-config output:
Package libzstd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzstd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzstd' found
The system library `libzstd` required by crate `zstd-sys` was not found.
The file `libzstd.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
PKG_CONFIG_PATH contains the following:
- /gnu/store/qzmgink147fd9nqm669awy9f2x2i9rih-file-5.46/lib/pkgconfig
- /gnu/store/gziyc8kh2wd5gq3ah8vjvpr73my4cgam-xz-5.4.5/lib/pkgconfig
HINT: you may need to install a package such as libzstd, libzstd-dev or libzstd-devel.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "cargo" arguments: ("build" "--offline" "-j" "4" "--release") exit-status: 101 term-signal: #f stop-signal: #f>
phase `build' failed after 337.2 seconds
command "cargo" "build" "--offline" "-j" "4" "--release" failed with status 101
build process 6 exited with status 256
builder for `/gnu/store/vcqmmslc7ixia7vhpf1b7k2hs7fgkkmd-ant-node-0.14.3.drv' failed with exit code 1
build of /gnu/store/aqh86grqs5m9xpp9gzylssr24q3g1p9h-ant-node-0.14.3.drv failed
View build log at '/var/log/guix/drvs/aq/h86grqs5m9xpp9gzylssr24q3g1p9h-ant-node-0.14.3.drv.gz'.
guix build: error: build of `/gnu/store/aqh86grqs5m9xpp9gzylssr24q3g1p9h-ant-node-0.14.3.drv' failed