mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-22 23:17:15 +03:00
Add support for installing dylib
crate types (#340)
--------- Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net> Co-authored-by: Roman Volosatovs <rvolosatovs@riseup.net>
This commit is contained in:
parent
f31931d6f8
commit
057d95721e
@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
* `buildPackage` now supports installing `dylib` targets
|
||||
|
||||
### Changed
|
||||
* **Breaking** (technically): if `buildPackage` is called _without_ setting
|
||||
`cargoArtifacts`, the default `buildDepsOnly` invocation will now stop running
|
||||
any installation hooks
|
||||
|
@ -249,6 +249,7 @@ in
|
||||
liball_types.a
|
||||
liball_types.so
|
||||
libonly_cdylib.so
|
||||
libonly_dylib.so
|
||||
libonly_staticlib.a
|
||||
EOF
|
||||
|
||||
|
7
checks/with-libs/Cargo.lock
generated
7
checks/with-libs/Cargo.lock
generated
@ -16,6 +16,13 @@ dependencies = [
|
||||
"some-dep",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "only-dylib"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"some-dep",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "only-staticlib"
|
||||
version = "0.1.0"
|
||||
|
@ -1,7 +1,8 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"only-cdylib",
|
||||
"only-staticlib",
|
||||
"all-types",
|
||||
"only-cdylib",
|
||||
"only-dylib",
|
||||
"only-staticlib",
|
||||
]
|
||||
exclude = ["some-dep"]
|
||||
|
12
checks/with-libs/only-dylib/Cargo.toml
Normal file
12
checks/with-libs/only-dylib/Cargo.toml
Normal file
@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "only-dylib"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
some-dep = { path = "../some-dep" }
|
||||
|
||||
[lib]
|
||||
crate-type = [
|
||||
"dylib",
|
||||
]
|
4
checks/with-libs/only-dylib/src/lib.rs
Normal file
4
checks/with-libs/only-dylib/src/lib.rs
Normal file
@ -0,0 +1,4 @@
|
||||
#[no_mangle]
|
||||
pub fn bar(a: i32) -> i32 {
|
||||
some_dep::foo(a) * a
|
||||
}
|
@ -157,7 +157,7 @@ understood by `mkCargoDerivation` apply here as well, with the only difference
|
||||
being some additional book keeping necessary to log cargo's results and
|
||||
subsequently install from that log.
|
||||
|
||||
Note that only `bin`, `staticlib`, and `cdylib` targets will be installed by
|
||||
Note that only `bin`, `cdylib`, `dylib`, and `staticlib`, targets will be installed by
|
||||
default (namely `rlib` targets will be ignored), though it is possible to adjust
|
||||
the behavior by changing the `installPhaseCommand` or registering additional
|
||||
install hooks.
|
||||
|
@ -15,7 +15,11 @@ function installFromCargoBuildLog() (
|
||||
local select_non_test='select(.reason == "compiler-artifact" and .profile.test == false)'
|
||||
local select_bins="${select_non_test} | .executable | select(.!= null)"
|
||||
local select_lib_files="${select_non_test}"'
|
||||
| select(.target.kind | contains(["staticlib"]) or contains(["cdylib"]))
|
||||
| select(.target.kind
|
||||
| contains(["cdylib"])
|
||||
or contains(["dylib"])
|
||||
or contains(["staticlib"])
|
||||
)
|
||||
| .filenames[]
|
||||
| select(endswith(".rlib") | not)
|
||||
'
|
||||
|
Loading…
Reference in New Issue
Block a user