From 9105985c7c0c8f24da8150c5c2d5e8d3e044ed9b Mon Sep 17 00:00:00 2001 From: jrmarino Date: Tue, 31 Dec 2024 11:28:48 -0600 Subject: [PATCH] Add offline build notes to INSTALL (#3705) (#3740) Document additional steps that have been successful for NixOS and Ravenports. --- INSTALL | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/INSTALL b/INSTALL index 620fe76f1..3d89be316 100644 --- a/INSTALL +++ b/INSTALL @@ -110,6 +110,43 @@ If Taskwarrior will not build on your system, first take a look at the Operating System notes below. If this doesn't help, then go to the Troubleshooting section, which includes instructions on how to contact us for help. +Offline Build Notes +------------------- + +It is common for packaging systems (e.g. NixOS, FreeBSD Ports Collection, pkgsrc, etc) +to disable networking during builds. This restriction requires all distribution files +to be prepositioned after checksum verification as a prerequisite for the build. The +following steps have been successful in allowing Taskwarrior to be built in this +environment: + +1. Extract all crates in a known location, e.g. ${WRKDIR}/cargo-crates +This includes crates needed for corrosion (search for Cargo.lock files) + +2. Create .cargo-checksum.json for each crate +For example: +printf '{"package":"%s","files":{}}' $(sha256 -q ${DISTDIR}/rayon-core-1.12.1.tar.gz) \ + > ${WRKDIR}/cargo-crates/rayon-core-1.12.1/.cargo-checksum.json + +3. Create a custom config.toml file +For example, ${WRKDIR}/.cargo/config.toml +[source.cargo] +directory = '${WRKDIR}/cargo-crates' +[source.crates-io] +replace-with = 'cargo' + +4. After running cmake, configure cargo +For example: +cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO_ENV} \ + /usr/local/bin/cargo update \ + --manifest-path ${WRKDIR}/.cargo/config.toml \ + --verbose + +5. Set CARGO_HOME in environment +For example +CARGO_HOME=${WRKDIR}/.cargo + +The build and installation steps should be the same as a standard build +at this point. Operating System Notes ----------------------