Skip to content

Commit cae9ac9

Browse files
authored
Merge pull request #151 from xi-editor/druid-gtk
druid linux/gtk backend (take 3)
2 parents 6ea0380 + a108ff2 commit cae9ac9

21 files changed

+2040
-43
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
os: [macOS-10.14, windows-2019]
12+
os: [macOS-10.14, windows-2019, ubuntu-latest]
1313
name: cargo check stable
1414
steps:
1515
- uses: actions/checkout@v1
1616
- name: install cairo
1717
run: brew install cairo
1818
if: contains(matrix.os, 'mac')
1919

20+
- name: install libgtk-dev
21+
run: |
22+
sudo apt update
23+
sudo apt install libgtk-3-dev
24+
if: contains(matrix.os, 'ubuntu')
25+
2026
- name: install stable toolchain
2127
uses: actions-rs/toolchain@v1
2228
with:
@@ -77,7 +83,7 @@ jobs:
7783
runs-on: ${{ matrix.os }}
7884
strategy:
7985
matrix:
80-
os: [macOS-10.14, windows-2019]
86+
os: [macOS-10.14, windows-2019, ubuntu-latest]
8187
name: cargo test stable
8288
steps:
8389
- uses: actions/checkout@v1
@@ -86,6 +92,12 @@ jobs:
8692
run: brew install cairo
8793
if: contains(matrix.os, 'mac')
8894

95+
- name: install libgtk-dev
96+
run: |
97+
sudo apt update
98+
sudo apt install libgtk-3-dev
99+
if: contains(matrix.os, 'ubuntu')
100+
89101
- name: install stable toolchain
90102
uses: actions-rs/toolchain@v1
91103
with:
@@ -108,7 +120,7 @@ jobs:
108120
runs-on: ${{ matrix.os }}
109121
strategy:
110122
matrix:
111-
os: [macOS-10.14, windows-2019]
123+
os: [macOS-10.14, windows-2019, ubuntu-latest]
112124
name: cargo test nightly
113125
steps:
114126
- uses: actions/checkout@v1
@@ -117,6 +129,12 @@ jobs:
117129
run: brew install cairo
118130
if: contains(matrix.os, 'mac')
119131

132+
- name: install libgtk-dev
133+
run: |
134+
sudo apt update
135+
sudo apt install libgtk-3-dev
136+
if: contains(matrix.os, 'ubuntu')
137+
120138
- name: install nightly toolchain
121139
uses: actions-rs/toolchain@v1
122140
with:
@@ -140,14 +158,20 @@ jobs:
140158
runs-on: ${{ matrix.os }}
141159
strategy:
142160
matrix:
143-
os: [macOS-10.14, windows-2019]
161+
os: [macOS-10.14, windows-2019, ubuntu-latest]
144162
steps:
145163
- uses: actions/checkout@v1
146164

147165
- name: install cairo
148166
run: brew install cairo
149167
if: contains(matrix.os, 'mac')
150168

169+
- name: install libgtk-dev
170+
run: |
171+
sudo apt update
172+
sudo apt install libgtk-3-dev
173+
if: contains(matrix.os, 'ubuntu')
174+
151175
- name: install nightly toolchain
152176
uses: actions-rs/toolchain@v1
153177
with:

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ information on using pull requests.
1212
If your name does not already appear in the [AUTHORS] file, please feel free to
1313
add it as part of your patch.
1414

15-
[gtk-rs dependencies]: http://gtk-rs.org/docs/requirements.html
1615
[GitHub Help]: https://help.github.com/articles/about-pull-requests/
1716
[AUTHORS]: AUTHORS

Cargo.lock

Lines changed: 241 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ edition = "2018"
1212
[package.metadata.docs.rs]
1313
default-target = "x86_64-pc-windows-msvc"
1414

15+
[features]
16+
use_gtk = ["druid-shell/use_gtk"]
17+
1518
[badges]
1619
travis-ci = { repository = "xi-editor/druid" }
1720

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ uses Direct2D (and DirectWrite for text). One way forward is to create a
4242
[2d graphics] abstraction.
4343

4444
## Build
45-
Currently, druid only builds on Windows and macOS.
46-
47-
Other options may work, but not tested.
4845

4946
#### Windows
5047

@@ -59,6 +56,11 @@ You may also need to set your `PKG_CONFIG_PATH`; assuming you have installed `ca
5956
```shell
6057
$> PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" cargo build
6158
```
59+
#### Linux
60+
61+
On Linux, druid requires gtk+3; see[gtk-rs dependencies] for installation instructions.
62+
63+
run `cargo build`
6264

6365
## Alternatives
6466

@@ -89,3 +91,4 @@ The main author is Raph Levien.
8991
[ggez]: https://github.com/ggez/ggez
9092
[CONTRIBUTING.md]: CONTRIBUTING.md
9193
[Zulip chat instance]: https://xi.zulipchat.com
94+
[gtk-rs dependencies]: http://gtk-rs.org/docs/requirements.html

0 commit comments

Comments
 (0)