45 Commits

Author SHA1 Message Date
semarie
49325f855b devel/cargo: add MODCARGO_WANTLIB variable
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@
2022-11-01 12:36:38 +00:00
naddy
424a60c42f remove line continuation before empty lines
ok sthen@ ajacoutot@
2022-10-31 23:14:52 +00:00
semarie
dffd163a87 devel/cargo: provide a generic way to override MODCARGO_CRATES changes
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@
2022-09-12 07:40:12 +00:00
ajacoutot
26ff940063 Add `-p' to the mkdir call.
When mixing this module with other build systems, modcargo-crates may be
under a subdirectory.
2022-09-10 08:17:00 +00:00
semarie
959ce6b32e devel/cargo: copte with more binding crates with embedded source 2022-09-03 16:01:56 +00:00
sdk
6b75943278 Drop $OpenBSD$ Tag from go.port.mk and cargo.port.mk
OK semarie@
2022-03-13 13:05:52 +00:00
naddy
85229c97e7 drop RCS Ids 2022-03-11 18:49:30 +00:00
semarie
606169e1d4 devel/cargo: enable RUST_BACKTRACE=full in build and test
ok kn@
2022-02-26 12:53:34 +00:00
semarie
c4fff7fdf2 devel/cargo module: add few more C source removing from crates
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.
2021-11-15 07:44:37 +00:00
semarie
5d1912f0f7 devel/cargo tweaks
add a $OpenBSD$ marker in modcargo-gen-crates-licenses output, and a
reminder to run modcargo-gen-crates-licenses in modcargo-gen-crates
output
2021-09-11 07:13:13 +00:00
semarie
b42ecff889 devel/cargo: enforce offline build in config file (installed via CONFIGURE_STYLE) 2021-09-03 08:27:43 +00:00
semarie
ae12e74584 devel/cargo module: add option for libsqlite3-sys crate
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).
2021-04-27 06:51:10 +00:00
semarie
5099c677f6 devel/cargo module: make modcargo-gen-crates considere only crates.io-index dependencies
tested by paco@ with new port
checked with current devel/cargo ports by me
2021-04-24 13:28:45 +00:00
semarie
071b5be212 devel/cargo: remove .crates2.json file after installing with cargo
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@
2021-02-21 09:19:07 +00:00
semarie
e789b51846 unbreak cargo ports.
I should not do last-minute changes without proper testing.

problem reported by aja@
2020-06-09 12:42:28 +00:00
semarie
93ec8f9587 wrong default value for lto. it should be 'false'. 2020-06-09 06:57:58 +00:00
semarie
50bf2dc9ee moves compilations options setting from Cargo.toml (a file from the port) to .cargo/config file (a generated file)
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')
2020-06-09 06:51:59 +00:00
semarie
fa3599adfe devel/cargo: take care of libsodium-sys crate
- force dynamic linking
- remove embedded tarball
2020-03-16 10:55:36 +00:00
semarie
f64f776a43 add more magic to devel/cargo to help maintainers dealing with rust
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
2020-03-12 10:30:05 +00:00
sthen
29eef6e50b cope with missing detection of licenses in modcargo-gen-crates-licenses;
print a "XXX missing license" comment rather than missing a newline and
appending what should be the next line after the #.

with/ok semarie
2020-02-08 18:56:20 +00:00
semarie
2783d20645 devel/cargo: make modcargo-gen-crates-licenses to use the new format for Cargo.lock 2020-02-08 14:06:49 +00:00
semarie
51dd06c1e7 devel/cargo: use edition 2018 syntax by default for installing using cargo
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)
2020-01-21 05:27:18 +00:00
semarie
4ef340bb9e devel/cargo module
- 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@
2019-12-11 12:35:06 +00:00
sthen
4baf271ebd add a comment hinting at use of CONFIGURE_STYLE=cargo, ok semarie@ 2019-11-26 13:01:06 +00:00
semarie
697babb911 make "modcargo-metadata" target to work with PORTS_PRIVSEP
ok jca@
2019-09-14 17:34:46 +00:00
semarie
b19d4110a9 change MODCARGO_CRATES syntax for devel/cargo module.
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@
2018-12-16 08:50:11 +00:00
kn
2b3bac0a5b Use MODCARGO_RUSTFLAGS as port variable to set RUSTFLAGS in cargo
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.
2018-02-24 18:40:28 +00:00
danj
da08f3aa7a Remove cargo, it will now be built in lang/rust
From semarie (maintainer)
2017-07-31 13:16:08 +00:00
danj
91be484d6f Update to cargo-0.19.0
From semarie (maintainer) and a minor tweak by me
2017-06-17 02:08:10 +00:00
landry
c9964e6c27 Remove the use of gcc4 module, not needed anymore since rust has the
libgcc.a symlink pointing to the basesystem libgcc. From semarie@
2017-05-19 10:10:27 +00:00
landry
a2f8f06035 Update to cargo 0.18.0, from semarie@.
Now distributed upstream along rust, so distfiles/bootstraps were
shuffled a bit.

Tested by/feedback from edd@
2017-05-05 11:42:27 +00:00
landry
bb9afec3aa Update to cargo 0.16.0.
All the hard work by semarie@, thanks!
2017-02-15 12:49:42 +00:00
danj
5e375338de modcargo-crates-1 -> modcargo-gen-crates
modcargo-crates-2 -> modcargo-gen-crates-licenses

discussed with semarie
2017-02-08 17:36:33 +00:00
landry
5f9c5b3ba4 Fix logic in cargo.port.mk: the invocation of cargo when
MODCARGO_CRATES_UPDATE is used should be done only when the variable
isn't empty, and not when defined (as it is always defined).

from semarie@
2017-01-08 08:51:31 +00:00
landry
baea1047f3 Apply the same voodoo that has just been commited to lang/rust.
Shouldn't change anything on supported archs, and fix others for dpb.
2017-01-06 17:35:56 +00:00
landry
211034a321 Update to cargo 0.15.0, from Maintainer semarie@ 2017-01-01 18:49:58 +00:00
landry
adb5c0068c Enable cargo on i386, from MAINTAINER semarie@
- provide a new cargo MODULE for ports based on cargo (documentation pending)
- convert cargo itself to use this module

tested on i386 here.
2016-12-26 13:55:11 +00:00
landry
c93d5e4574 Explicitely mark cargo as ONLY_FOR_ARCHS=amd64, as lang/rust is being
worked on for i386, but cargo will need more work...
2016-11-30 09:01:00 +00:00
danj
8a2f7a40ab Update to cargo-0.14.0 and remove BROKEN marker, upstream reverted
the commit

From semarie who takes maintainership again, ok aja@
2016-11-13 08:59:26 +00:00
landry
2b20b7d3ae Mark temporarly BROKEN, crates.io requires Accept: HTTP header, cf https://github.com/rust-lang/crates.io/issues/466 2016-11-12 08:53:11 +00:00
danj
e881cc95de Update to cargo-0.13.0
From semarie (maintainer), ok ajacoutot@
2016-10-05 16:51:22 +00:00
landry
282d5bbfb9 remove patches that were supposed to be cvs rm'ed. My bad.
reported by naddy@
2016-09-01 17:12:29 +00:00
landry
b0df4ea325 Update to cargo 0.12.0, from semarie@, thanks! 2016-08-31 08:33:37 +00:00
landry
ebcc7c96fe Sebastien drops MAINTAINERship for lack of time... any takers ?
Thanks for your work on it !
2016-08-13 07:40:43 +00:00
semarie
1cf96412d8 devel/cargo 0.10.0
Cargo is a tool that allows Rust projects to declare their various
dependencies, and ensure that you'll always get a repeatable build.

ok sthen@ edd@
2016-05-30 04:30:53 +00:00