Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into readme
Browse files Browse the repository at this point in the history
  • Loading branch information
raphlinus committed Oct 26, 2022
2 parents 7d7c996 + 357b762 commit 07036b2
Show file tree
Hide file tree
Showing 36 changed files with 771 additions and 2,394 deletions.
222 changes: 111 additions & 111 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-2019, ubuntu-latest]
os: [macOS-latest, windows-2019]
name: cargo clippy+test
steps:
- uses: actions/checkout@v2
Expand All @@ -56,7 +56,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=Cargo.toml --all-targets --features=x11,raw-win-handle --no-default-features -- -D warnings
args: --manifest-path=Cargo.toml --all-targets --features=x11 --no-default-features -- -D warnings

# Test packages in deeper-to-higher dependency order
- name: cargo test glazier
Expand All @@ -65,113 +65,113 @@ jobs:
command: test
args: --manifest-path=Cargo.toml --no-default-features --features=x11

# we test the wayland backend as a separate job
test-stable-wayland:
runs-on: ubuntu-latest
name: cargo clippy+test (wayland)
steps:
- uses: actions/checkout@v2

- name: install wayland
run: |
sudo apt update
sudo apt install libwayland-dev libpango1.0-dev libxkbcommon-dev
- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true

- name: restore cache
uses: Swatinem/rust-cache@v1

- name: cargo clippy glazier
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=Cargo.toml --all-targets --features=wayland,raw-win-handle --no-default-features -- -D warnings

- name: cargo test glazier
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=Cargo.toml --features wayland --no-default-features

# we test the gtk backend as a separate job because gtk install takes
# a long time.
test-stable-gtk:
runs-on: ubuntu-latest
name: cargo clippy+test (gtk)
steps:
- uses: actions/checkout@v2

- name: install libgtk-3-dev
run: |
sudo apt update
sudo apt install libgtk-3-dev
- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true

- name: restore cache
uses: Swatinem/rust-cache@v1

- name: cargo clippy glazier
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=Cargo.toml --all-targets --features=raw-win-handle -- -D warnings

- name: cargo test glazier
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=Cargo.toml

test-stable-wasm:
runs-on: macOS-latest
name: cargo test (wasm32)
steps:
- uses: actions/checkout@v2

- name: install wasm-pack
uses: jetli/[email protected]
with:
version: latest

- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
components: clippy
profile: minimal
override: true

- name: restore cache
uses: Swatinem/rust-cache@v1

- name: cargo clippy glazier (wasm)
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=Cargo.toml --all-targets --target wasm32-unknown-unknown -- -D warnings

# Test wasm32 relevant packages in deeper-to-higher dependency order
# TODO: Find a way to make tests work. Until then the tests are merely compiled.
- name: cargo test compile glazier
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=Cargo.toml --no-run --target wasm32-unknown-unknown
# # we test the wayland backend as a separate job
# test-stable-wayland:
# runs-on: ubuntu-latest
# name: cargo clippy+test (wayland)
# steps:
# - uses: actions/checkout@v2
#
# - name: install wayland
# run: |
# sudo apt update
# sudo apt install libwayland-dev libpango1.0-dev libxkbcommon-dev
#
# - name: install stable toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# components: clippy
# profile: minimal
# override: true
#
# - name: restore cache
# uses: Swatinem/rust-cache@v1
#
# - name: cargo clippy glazier
# uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: --manifest-path=Cargo.toml --all-targets --features=wayland --no-default-features -- -D warnings
#
# - name: cargo test glazier
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --manifest-path=Cargo.toml --features wayland --no-default-features
#
# # we test the gtk backend as a separate job because gtk install takes
# # a long time.
# test-stable-gtk:
# runs-on: ubuntu-latest
# name: cargo clippy+test (gtk)
# steps:
# - uses: actions/checkout@v2
#
# - name: install libgtk-3-dev
# run: |
# sudo apt update
# sudo apt install libgtk-3-dev
#
# - name: install stable toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# components: clippy
# profile: minimal
# override: true
#
# - name: restore cache
# uses: Swatinem/rust-cache@v1
#
# - name: cargo clippy glazier
# uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: --manifest-path=Cargo.toml --all-targets -- -D warnings
#
# - name: cargo test glazier
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --manifest-path=Cargo.toml

# test-stable-wasm:
# runs-on: macOS-latest
# name: cargo test (wasm32)
# steps:
# - uses: actions/checkout@v2
#
# - name: install wasm-pack
# uses: jetli/[email protected]
# with:
# version: latest
#
# - name: install stable toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# target: wasm32-unknown-unknown
# components: clippy
# profile: minimal
# override: true
#
# - name: restore cache
# uses: Swatinem/rust-cache@v1
#
# - name: cargo clippy glazier (wasm)
# uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: --manifest-path=Cargo.toml --all-targets --target wasm32-unknown-unknown -- -D warnings
#
# # Test wasm32 relevant packages in deeper-to-higher dependency order
# # TODO: Find a way to make tests work. Until then the tests are merely compiled.
# - name: cargo test compile glazier
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --manifest-path=Cargo.toml --no-run --target wasm32-unknown-unknown

doctest-stable:
runs-on: macOS-latest
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path=Cargo.toml --all-targets --features=raw-win-handle -- -D warnings
args: --manifest-path=Cargo.toml --all-targets -- -D warnings
continue-on-error: true

# Test packages in deeper-to-higher dependency order
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-2019, ubuntu-latest]
os: [macOS-latest, windows-2019]
steps:
- uses: actions/checkout@v2

Expand Down
47 changes: 22 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ rustdoc-args = ["--cfg", "docsrs"]
default-target = "x86_64-pc-windows-msvc"

[features]
default = ["gtk"]
gtk = ["gdk-sys", "glib-sys", "gtk-sys", "gtk-rs"]
default = ["x11"]
gtk = ["cairo-rs", "gdk-sys", "glib-sys", "gtk-sys", "gtk-rs"]
x11 = [
"ashpd",
"bindgen",
"cairo-sys-rs",
"futures",
"nix",
"pkg-config",
Expand All @@ -39,31 +38,29 @@ wayland = [
"bindgen",
"pkg-config",
]
# Implement HasRawWindowHandle for WindowHandle
raw-win-handle = ["raw-window-handle"]

# passing on all the image features. AVIF is not supported because it does not
# support decoding, and that's all we use `Image` for.
image_png = ["piet-common/image_png"]
jpeg = ["piet-common/jpeg"]
jpeg_rayon = ["piet-common/jpeg_rayon"]
gif = ["piet-common/gif"]
bmp = ["piet-common/bmp"]
ico = ["piet-common/ico"]
tiff = ["piet-common/tiff"]
webp = ["piet-common/webp"]
pnm = ["piet-common/pnm"]
dds = ["piet-common/dds"]
tga = ["piet-common/tga"]
farbfeld = ["piet-common/farbfeld"]
dxt = ["piet-common/dxt"]
hdr = ["piet-common/hdr"]
bmp = []
dds = []
dxt = []
farbfeld = []
gif = []
jpeg = []
png = []
ico = []
tiff = []
webp = []
tga = []
hdr = []
image_png = []
jpeg_rayon = []
pnm = []
serde = ["kurbo/serde"]

[dependencies]
# NOTE: When changing the piet or kurbo versions, ensure that
# the kurbo version included in piet is compatible with the kurbo version specified here.
piet-common = "=0.5.0"
kurbo = "0.8.2"

tracing = "0.1.22"
Expand All @@ -75,8 +72,8 @@ anyhow = "1.0.32"
keyboard-types = { version = "0.6.2", default_features = false }

# Optional dependencies
image = { version = "0.23.12", optional = true, default_features = false }
raw-window-handle = { version = "0.5.0", optional = true, default_features = false }
image = { version = "0.24.4", optional = true, default_features = false }
raw-window-handle = { version = "0.5.0", default_features = false }

[target.'cfg(target_os="windows")'.dependencies]
scopeguard = "1.1.0"
Expand All @@ -100,7 +97,7 @@ bitflags = "1.2.1"
[target.'cfg(any(target_os = "freebsd", target_os="linux", target_os="openbsd"))'.dependencies]
ashpd = { version = "0.3.0", optional = true }
# TODO(x11/dependencies): only use feature "xcb" if using X11
cairo-rs = { version = "0.14.0", default_features = false, features = ["xcb"] }
cairo-rs = { version = "0.14.0", default_features = false, features = ["xcb"], optional = true }
cairo-sys-rs = { version = "0.14.0", default_features = false, optional = true }
futures = { version = "0.3.21", optional = true, features = ["executor"]}
gdk-sys = { version = "0.14.0", optional = true }
Expand All @@ -127,12 +124,12 @@ version = "0.3.44"
features = ["Window", "MouseEvent", "CssStyleDeclaration", "WheelEvent", "KeyEvent", "KeyboardEvent", "Navigator"]

[dev-dependencies]
piet-common = { version = "=0.5.0", features = ["png"] }
static_assertions = "1.1.0"
test-log = { version = "0.2.5", features = ["trace"], default-features = false }
tracing-subscriber = { version = "0.3.2", features = ["env-filter"] }
unicode-segmentation = "1.7.0"
piet-gpu-hal = { git = "https://github.com/linebender/piet-gpu", branch = "dev" }

[build-dependencies]
bindgen = {version = "0.58", optional = true}
bindgen = { version = "0.61", optional = true }
pkg-config = { version = "0.3", optional = true }
Loading

0 comments on commit 07036b2

Please sign in to comment.