Introduce MODCARGO_WANTLIB variable to be used by port using std library from
Rust.
Rust std uses libc and libpthread for standard operations, and uses
libc++abi/libgcc for unwinding.
Unwinding is done differently depending the MACHINE_ARCH:
- sparc64 is using libgcc (static lib)
- others are using c++abi (shared lib)
MODCARGO_WANTLIB takes care of that details.
ok sthen@
several crates needs few changes (patch) to work easily in ports tree, or might
build bundled versions of libraries instead of using ports tree.
but in some cases, it's simpler to let porters manage that themselves.
the diff replaces MODCARGO_CRATES_SQLITE3_BUNDLED (specific knob for
libsqlite3-sys) by MODCARGO_CRATES_KEEP (a list of crates to keep unmodified).
adapt security/vaultwarden and www/nextcloud_notify_push to use
MODCARGO_CRATES_KEEP instead of MODCARGO_CRATES_SQLITE3_BUNDLED.
ok landry@
expat-sys, freetype-sys and servo-fontconfig-sys are embedding C source directories.
remove them to ensure system-libs are used.
found while reviewing alacritty crates.
no changes for alacritty as system-libs were already used.
libsqlite3-sys only provides "old" bindings for sqlite3 library
(better is 3.7.16). when a crate requires a binding for a recent
version of sqlite3, it is required to use the bundled version to have
proper binding.
add an option MODCARGO_CRATES_SQLITE3_BUNDLED to explictly request it
(and not use the ports version of sqlite3 but build the bundled
version).
we are managing installed files with different mecanism.
it is the v2 for tracking crates installation, and we already remove v1 (.crates.toml).
take care of cleaning ports which are already seen it
problem spotted by landry@
ok landry@
the current version of cargo will look at the profile here too (it wasn't the
case when first commited), and it permits to avoid automatic modification of the
source file.
the compilation options used are based on release profile
(https://doc.rust-lang.org/cargo/reference/profiles.html#release) with
only 'opt-level' difference ('2' instead of '3')
devel/cargo modules will take care of some aspects of crate dependencies on
system/ports libraries
adapt some ports depending on devel/cargo to properly link to ports libraries,
and to not patch anymore what it is now done by devel/cargo (openssl-sys crate
for example)
with help and ok @sthem
the syntax is compatible with older edition, and more crates are using the
edition 2018 which require it.
avoid using MODCARGO_INSTALL_ARGS just to pass "--path ."
ok landry@ (some time ago, the diff was sleeping in my tree)
- uses cargo --offline when building to enforce "no network" at build time.
- properly implement MODCARGO_FEATURES by passing it to all stages (build, test, install)
- add MODCARGO_NO_DEFAULT_FEATURES to permit overriding completely cargo features defined in Cargo.toml
ok sthen@
The new syntax to have version with '-' character:
-MODCARGO_CRATES += aho-corasick-0.6.8 # Unlicense/MIT
+MODCARGO_CRATES += aho-corasick 0.6.8 # Unlicense/MIT
update all customers of devel/cargo to use the new syntax
ok landry@
invocation.
While here, correct (a bit) the license detection (bug reported by
kpcyrd <kpcyrd AT rxv.cc> some time ago) and tweak
modcargo-gen-crates-licenses a bit.
Diff from semarie, ok landry.