diff --git a/doc/manual/meson.build b/doc/manual/meson.build index 3c3e79541..6fd841e80 100644 --- a/doc/manual/meson.build +++ b/doc/manual/meson.build @@ -26,7 +26,6 @@ bash = find_program('bash', native : true) # HTML manual dependencies (conditional) if get_option('html-manual') mdbook = find_program('mdbook', native : true) - rsync = find_program('rsync', required : true, native : true) endif pymod = import('python') @@ -126,7 +125,12 @@ if get_option('html-manual') @0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@ @0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml - @4@ -r -L --exclude='*.drv' --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/ + # Copy source to build directory, excluding the build directory itself + # (which is present when built as an individual component). + # Use tar with --dereference to copy symlink targets (e.g., JSON examples from tests). + (cd @CURRENT_SOURCE_DIR@ && find . -mindepth 1 -maxdepth 1 ! -name build | tar -c --dereference -T - -f -) | (cd @2@ && tar -xf -) + chmod -R u+w @2@ + find @2@ -name '*.drv' -delete (cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3 rm -rf @2@/manual mv @2@/html @2@/manual @@ -138,7 +142,6 @@ if get_option('html-manual') mdbook.full_path(), meson.current_build_dir(), meson.project_version(), - rsync.full_path(), ), ], input : [ diff --git a/doc/manual/package.nix b/doc/manual/package.nix index 3a90a0faf..24b082993 100644 --- a/doc/manual/package.nix +++ b/doc/manual/package.nix @@ -10,7 +10,6 @@ mdbook, jq, python3, - rsync, nix-cli, changelog-d, json-schema-for-humans, @@ -54,6 +53,8 @@ mkMesonDerivation (finalAttrs: { ../../src/libstore-tests/data/nar-info ../../src/libstore-tests/data/build-result ../../src/libstore-tests/data/dummy-store + # For derivation examples referenced by symlinks in doc/manual/source/protocols/json/schema/ + ../../tests/functional/derivation # Too many different types of files to filter for now ../../doc/manual ./. @@ -90,7 +91,6 @@ mkMesonDerivation (finalAttrs: { ] ++ lib.optionals buildHtmlManual [ mdbook - rsync json-schema-for-humans ] ++ lib.optionals (!officialRelease && buildHtmlManual) [