Skip to content

Commit 327a60f

Browse files
Merge pull request #35 from gtk-rs/bilelmoussaoui/migrate
Merge repos
2 parents 5e37ba8 + 9f5302b commit 327a60f

File tree

494 files changed

+45468
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

494 files changed

+45468
-199
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,25 @@ jobs:
2424
with:
2525
toolchain: ${{ matrix.rust }}
2626
override: true
27-
- uses: actions-rs/cargo@v1
28-
name: "Docs"
29-
with:
30-
command: doc
31-
args: --features "dox,embed-lgpl-docs"
32-
- uses: actions-rs/cargo@v1
33-
name: "Test"
34-
with:
35-
command: test
36-
args: --features "embed-lgpl-docs"
37-
- uses: actions-rs/cargo@v1
38-
name: "Build"
39-
with:
40-
command: build
41-
args: --features "purge-lgpl-docs"
42-
- run: git diff -R --exit-code
43-
# - uses: actions/checkout@v2
44-
# with:
45-
# repository: gtk-rs/examples4
46-
# ref: master
47-
# path: examples4
48-
# - name: Examples
49-
# working-directory: examples4
50-
# run: cargo check
27+
- name: install dependencies
28+
run: sudo dnf install -y xorg-x11-server-Xvfb
29+
# gsk4
30+
- name: "gsk4: tests"
31+
run: xvfb-run --auto-servernum cargo test --manifest-path gsk4/Cargo.toml --all-features
32+
- name: "gsk4: build"
33+
run: cargo build --manifest-path gsk4/Cargo.toml --all-features
34+
# gdk4
35+
- name: "gdk4: tests"
36+
run: xvfb-run --auto-servernum cargo test --manifest-path gdk4/Cargo.toml --all-features
37+
- name: "gdk4: build"
38+
run: cargo build --manifest-path gdk4/Cargo.toml --all-features
39+
# gtk4
40+
- name: "gtk4: tests"
41+
run: xvfb-run --auto-servernum cargo test --manifest-path gtk4/Cargo.toml --all-features
42+
- name: "gtk4: build"
43+
run: cargo build --manifest-path gtk4/Cargo.toml --all-features
44+
45+
- uses: bcomnes/cleanup-xvfb@v1
5146

5247
fmt:
5348
name: Rustfmt
@@ -64,13 +59,11 @@ jobs:
6459
with:
6560
command: fmt
6661
args: --all -- --check
67-
- run: make regen_check
6862

6963
checker:
7064
name: gtk-rs checker
7165
runs-on: ubuntu-latest
7266
steps:
73-
- uses: actions/checkout@v2
7467
- uses: actions/checkout@v2
7568
with:
7669
repository: gtk-rs/checker

Cargo.toml

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,11 @@
1-
[package]
2-
documentation = "https://gtk-rs.org/docs/gtk4/"
3-
categories = ["api-bindings", "gui"]
4-
license = "MIT"
5-
description = "Rust bindings for the GTK 4 library"
6-
name = "gtk4"
7-
homepage = "https://gtk-rs.org/"
8-
authors = ["The Gtk-rs Project Developers"]
9-
readme = "README.md"
10-
version = "0.1.0"
11-
keywords = ["gtk", "gtk4", "gtk-rs", "gnome", "GUI"]
12-
repository = "https://github.com/gtk-rs/gtk4"
13-
build = "build.rs"
14-
exclude = [
15-
"gir-files/*",
1+
[workspace]
2+
members = [
3+
"gdk4",
4+
"gdk4/sys",
5+
"gsk4",
6+
"gsk4/sys",
7+
"gtk4",
8+
"gtk4/sys",
169
]
1710

18-
[badges]
19-
appveyor = { repository = "GuillaumeGomez/gtk4", service = "github" }
20-
travis-ci = { repository = "gtk-rs/gtk4" }
21-
22-
[lib]
23-
name = "gtk4"
24-
25-
[features]
26-
purge-lgpl-docs = ["gtk-rs-lgpl-docs", "gdk4/purge-lgpl-docs", "gsk4/purge-lgpl-docs"]
27-
embed-lgpl-docs = ["gtk-rs-lgpl-docs", "gdk4/embed-lgpl-docs", "gsk4/embed-lgpl-docs"]
28-
dox = ["gdk4/dox", "gsk4/dox", "gtk4-sys/dox"]
29-
30-
[package.metadata.docs.rs]
31-
features = ["dox", "embed-lgpl-docs"]
32-
33-
[build-dependencies.gtk-rs-lgpl-docs]
34-
version = "0.1.3"
35-
optional = true
36-
git = "https://github.com/gtk-rs/lgpl-docs"
37-
38-
[dependencies]
39-
libc = "0.2"
40-
bitflags = "1.0"
41-
once_cell = "1.0"
42-
atk = { git = "https://github.com/gtk-rs/atk" }
43-
atk-sys = { git = "https://github.com/gtk-rs/sys" }
44-
cairo-sys-rs = { git = "https://github.com/gtk-rs/cairo" }
45-
gdk-pixbuf-sys = { git = "https://github.com/gtk-rs/sys" }
46-
gdk4-sys = { git = "https://github.com/gtk-rs/sys" }
47-
gio-sys = { git = "https://github.com/gtk-rs/sys" }
48-
glib-sys = { git = "https://github.com/gtk-rs/sys" }
49-
gobject-sys = { git = "https://github.com/gtk-rs/sys" }
50-
graphene-sys = { git = "https://github.com/gtk-rs/graphene" }
51-
gsk4-sys = { git = "https://github.com/gtk-rs/sys" }
52-
gtk4-sys = { git = "https://github.com/gtk-rs/sys" }
53-
pango-sys = { git = "https://github.com/gtk-rs/sys" }
54-
cairo-rs = { git = "https://github.com/gtk-rs/cairo" }
55-
gio = { git = "https://github.com/gtk-rs/gio", features = ["v2_46"] }
56-
glib = { git = "https://github.com/gtk-rs/glib" }
57-
gdk4 = { git = "https://github.com/gtk-rs/gdk4" }
58-
graphene = { package = "graphene-rs", git = "https://github.com/gtk-rs/graphene" }
59-
gsk4 = { git = "https://github.com/gtk-rs/gsk4" }
60-
gdk-pixbuf = { git = "https://github.com/gtk-rs/gdk-pixbuf" }
61-
pango = { git = "https://github.com/gtk-rs/pango", features = ["v1_46"] }
62-
63-
[dev-dependencies]
64-
gir-format-check = "^0.1"
11+
exclude = ["checker", "gir"]

Makefile

Lines changed: 0 additions & 31 deletions
This file was deleted.

README.md

Lines changed: 27 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,41 @@
1-
# gtk4 ![CI](https://github.com/gtk-rs/gtk4/workflows/CI/badge.svg)
1+
# gtk4-rs
22

3-
[Project site](https://gtk-rs.org/) | [Online documentation](https://gtk-rs.org/docs-src/)
3+
The `gtk4-rs` are a group of crates that aims to provide gtk4 bindings.
44

5-
__Rust__ bindings and wrappers for __GTK 4__.
5+
This repository contains all the "core" crates of gtk 4. For more
6+
information about each crate, please refer to their `README.md` file in their directory.
67

7-
## Building
8+
## Regenerating
89

9-
__gtk4__ expects __GTK 4__, __GLib__ and __Cairo__ development files to be installed on your system.
10-
See the [requirements page](https://gtk-rs.org/docs/requirements.html).
10+
To regenerate crates using [gir], please use the `generator.py`
11+
file as follows:
1112

12-
## Using
13-
14-
We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs),
15-
as [demonstrated here](https://gtk-rs.org/#using).
16-
17-
If you want to track the bleeding edge, use the git dependency instead:
18-
19-
```toml
20-
[dependencies]
21-
gtk = { git = "https://github.com/gtk-rs/gtk4.git" }
22-
```
23-
24-
Avoid mixing versioned and git crates like this:
25-
26-
```toml
27-
# This will not compile
28-
[dependencies]
29-
gdk = "0.2"
30-
gtk = { git = "https://github.com/gtk-rs/gtk4.git" }
31-
```
32-
33-
## Documentation
34-
35-
The majority of the documentation is kept [in a separate repo][gtk-md] due to
36-
licensing issues. You can pull it in with cargo:
37-
38-
```shell
39-
> cargo build --features embed-lgpl-docs
13+
```bash
14+
$ python3 generator.py
4015
```
4116

42-
Changes to those doc-comments should be submitted to the `lgpl-docs` repo. Avoid
43-
including those embedded doc-comments in PRs to this repo.
44-
45-
The opposite feature removes all of those docs regardless of edits:
46-
47-
```shell
48-
> cargo build --features purge-lgpl-docs
49-
```
50-
51-
These features **rewrite the crate sources** so it's sufficient to enable them
52-
once. **Omitting them in the following `cargo` invocations will not undo their
53-
effects!**
54-
55-
Generate the docs:
56-
57-
```shell
58-
> cargo doc
59-
```
60-
61-
[gtk-md]: https://github.com/gtk-rs/lgpl-docs/blob/master/README.md
62-
63-
## Contribute
64-
65-
Contributor you're welcome!
17+
## Development
6618

67-
See the general [bindings documentation](https://gtk-rs.org/docs/glib/).
6819

69-
Most of the bindings ([`src/auto`](src/auto)) are generated by [gir](https://github.com/gtk-rs/gir) using [this configuration file](Gir.toml). After editing `Gir.toml` the sources can be regenerated with
20+
This repository is structured as follows:
7021

71-
```shell
72-
> make gir
22+
```text
23+
- crate/
24+
|
25+
|-- README.md
26+
|-- Gir.toml
27+
|-- Cargo.toml
28+
|-- src/
29+
|-- sys/
7330
```
7431

75-
When opening a PR please put the changes to the `src/auto` directory in a separate commit.
32+
The `crate` is a "top" directory (so "gdk4" or "gtk4" in here for example). I listed some
33+
import files, let's quickly explain them:
7634

77-
## License
35+
* `README.md`: Explanations about the crate itself and eventually some details.
36+
* `Gir.toml`: Used by [gir] to generate most of the crates' code.
37+
* `Cargo.toml`: File describing the crate, used by `cargo` and `Rust`.
38+
* `src`: Contains the source code of the crate.
39+
* `sys`: Contains the 1:1 bindings of the C API.
7840

79-
__gtk4__ is available under the MIT License, please refer to it.
41+
[gir]: https://github.com/gtk-rs/gir

gdk4/Cargo.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[package]
2+
name = "gdk4"
3+
license = "MIT"
4+
homepage = "https://gtk-rs.org/"
5+
authors = ["The Gtk-rs Project Developers"]
6+
keywords = ["gdk", "gdk4", "gtk", "gtk-rs", "gnome", "GUI"]
7+
readme = "README.md"
8+
documentation = "https://gtk-rs.org/docs/gdk4/"
9+
version = "0.1.0"
10+
description = "Rust bindings for the GDK 4 library"
11+
repository = "https://github.com/gtk-rs/gdk4"
12+
build = "build.rs"
13+
exclude = [
14+
"gir-files/*",
15+
]
16+
17+
[lib]
18+
name = "gdk4"
19+
20+
[features]
21+
dox = ["gdk4-sys/dox", "glib/dox", "gio/dox", "gdk-pixbuf/dox", "cairo-rs/dox", "pango/dox"]
22+
purge-lgpl-docs = ["gtk-rs-lgpl-docs", "cairo-rs/purge-lgpl-docs", "gdk-pixbuf/purge-lgpl-docs", "gio/purge-lgpl-docs"]
23+
embed-lgpl-docs = ["gtk-rs-lgpl-docs", "cairo-rs/embed-lgpl-docs", "gdk-pixbuf/embed-lgpl-docs", "gio/embed-lgpl-docs"]
24+
25+
[package.metadata.docs.rs]
26+
features = ["dox", "embed-lgpl-docs"]
27+
28+
[build-dependencies.gtk-rs-lgpl-docs]
29+
version = "0.1.3"
30+
optional = true
31+
git = "https://github.com/gtk-rs/lgpl-docs"
32+
33+
[dependencies]
34+
libc = "0.2"
35+
bitflags = "1.0"
36+
glib-sys = { git = "https://github.com/gtk-rs/gtk-rs" }
37+
gdk4-sys = { path = "./sys" }
38+
gio-sys = { git = "https://github.com/gtk-rs/gtk-rs" }
39+
gobject-sys = { git = "https://github.com/gtk-rs/gtk-rs" }
40+
cairo-sys-rs = { git = "https://github.com/gtk-rs/gtk-rs" }
41+
cairo-rs = { git = "https://github.com/gtk-rs/gtk-rs" }
42+
gdk-pixbuf = { git = "https://github.com/gtk-rs/gtk-rs" }
43+
gio = { git = "https://github.com/gtk-rs/gtk-rs" }
44+
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
45+
pango = { git = "https://github.com/gtk-rs/gtk-rs" }
46+
47+
[dev-dependencies]
48+
gir-format-check = "^0.1"

0 commit comments

Comments
 (0)