Add vendor-openssl feature flag (#3510)

This commit is contained in:
Laurenz 2024-02-28 09:04:03 +01:00 committed by GitHub
parent 85305139cd
commit 6dab30238a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 2 deletions

View File

@ -45,7 +45,7 @@ jobs:
if: ${{ matrix.cross}}
run: |
cargo install cross --git https://github.com/cross-rs/cross.git
cross build -p typst-cli --release --target ${{ matrix.target }} --features self-update
cross build -p typst-cli --release --target ${{ matrix.target }} --features self-update vendor-openssl
- name: Run Cargo
if: ${{ !matrix.cross }}

11
Cargo.lock generated
View File

@ -1534,6 +1534,15 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
version = "300.1.6+3.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.99"
@ -1542,6 +1551,7 @@ checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae"
dependencies = [
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]
@ -2634,6 +2644,7 @@ dependencies = [
"notify",
"once_cell",
"open",
"openssl",
"parking_lot",
"pathdiff",
"rayon",

View File

@ -68,6 +68,7 @@ native-tls = "0.2"
notify = "6"
once_cell = "1"
open = "5.0.1"
openssl = "0.10"
oxipng = { version = "9.0", default-features = false, features = ["filetime", "parallel", "zopfli"] }
palette = { version = "0.7.3", default-features = false, features = ["approx", "libm"] }
parking_lot = "0.12.1"

View File

@ -56,6 +56,11 @@ ureq = { workspace = true }
xz2 = { workspace = true, optional = true }
zip = { workspace = true, optional = true }
# Explicitly depend on OpenSSL if applicable, so that we can add the
# `openssl/vendored` feature to it if `vendor-openssl` is enabled.
[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "watchos", target_os = "tvos")))'.dependencies]
openssl = { workspace = true }
[build-dependencies]
clap = { workspace = true, features = ["string"] }
clap_complete = { workspace = true }
@ -71,8 +76,11 @@ default = ["embed-fonts"]
# - For code: Deja Vu Sans Mono
embed-fonts = []
# Permits the CLI to update itself without a package manager
# Permits the CLI to update itself without a package manager.
self-update = ["dep:self-replace", "dep:xz2", "dep:zip", "ureq/json"]
# Whether to vendor OpenSSL. Not applicable to Windows and macOS builds.
vendor-openssl = ["openssl/vendored"]
[lints]
workspace = true