[requires] build = [ "tomcli", "pkgconfig(blosc2)", ] lib = [ "pkgconfig(blosc2)", ] [package] cargo-toml-patch-comments = [ "Make bindgen and pkg-config non-optional", ] [[package.extra-patches]] number = 10 # Export from git with "cd blosc2-sys; git format-patch --relative [...]” file = "blosc2-sys-0.2.6-system-blosc2.patch" comments = [ "Downstream-only: always use the system blosc2 and regenerate bindings", ] [features] hide = [ "static", ] [scripts.prep] pre = [ ''' # Remove the bundled copy of blosc2 and the CMake-generated Makefile for it rm -rv c-blosc2 Makefile # These would only be needed to build the bundled blosc2: tomcli set Cargo.toml del build-dependencies.cmake tomcli set Cargo.toml del build-dependencies.copy_dir # Downstream-only: do not require the blosc2 version to exactly match # upstream’s bundled one. Doing this as a sed-patch keeps us from having to # rebase it every time the bundled version changes. sed -r -i 's@^([[:blank:]]*)(\.exactly_version\()@\1// \2@' build.rs # To be more pedantically correct, replace the hard-coded /usr/include patched # into build.rs with the expansion of %%{_includedir}. sed -r -i 's@/usr/include\b@%{_includedir}@' build.rs ''' ]