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))
(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
...))
(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
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' (42529) 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: Could not run `PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --static --libs --cflags libzstd`
The pkg-config command could not be found.
Most likely, you need to install a pkg-config package for your OS.
Try `apt install pkg-config`, or `yum install pkg-config`, or `brew install pkgconf`
or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution.
If you've already installed it, ensure the pkg-config command is one of the
directories in the PATH environment variable.
If you did not expect this build to link to a pre-installed system library,
then check documentation of the zstd-sys crate for an option to
build the library from source, or disable features or dependencies
that require pkg-config.
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 277.1 seconds
command "cargo" "build" "--offline" "-j" "4" "--release" failed with status 101
build process 6 exited with status 256
builder for `/gnu/store/aqh86grqs5m9xpp9gzylssr24q3g1p9h-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