1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// The rpath, re-emitted (MANEDRS_PLAN.md §4.5).
//
// `cargo:rustc-link-search` and `cargo:rustc-link-lib` from maned-sys
// propagate to every dependent's final link. `cargo:rustc-link-arg` does NOT:
// it applies only to the targets of the package whose build script emitted
// it. So maned-sys's rpath covers maned-sys's own test binary and nothing
// else, and this three-line build script is what keeps `maned`'s integration
// tests and examples loadable — libmaned_c's install_name is
// @rpath/libmaned_c.dylib, so without an LC_RPATH they link fine and die at
// startup, which is exactly the failure §4.5 calls out.
//
// The directory comes from `DEP_MANED_C_LIB_DIR`, which cargo sets for direct
// dependents of a `links = "maned_c"` crate — the metadata channel that is the
// whole reason for splitting the -sys crate out.
//
// A downstream binary crate that depends on `maned` does NOT get DEP_* vars
// (they reach direct dependents only) and will need the same two lines of its
// own, or an install into a directory already on the loader's path. The README
// says so.