Skip to content

Repetition of open-source project #878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 22, 2020
Merged

Repetition of open-source project #878

merged 10 commits into from
May 22, 2020

Conversation

perfah
Copy link

@perfah perfah commented May 21, 2020

Patching wlroots-sys

Members

  1. Per Fahlander ([email protected])
  2. Gunnar Applelid ([email protected])

Links to what we did

Repository

Reflection & Contribution document

Pull request

Passing build

Proposal

Patch the crate wlroots-sys belonging to the deprecated wlroots-rs (rust bindings for wlroots) library to suit it for use in other projects directly.

A new crate would preferably be published on a separate GitHub repository, although a fork+merge request could also work. The original author would of course be given full credit regardless.

I think a new repo would be better since I only want to keep the wlroots-sys part of the repo.

Some suggestions for tangible changes to the crate:

  • Make sure that the automatic building work in an self-contained manner as much as possible

  • Update the library dependencies to the latest versions

  • Refactor deprecated function calls (such as 'bindgen::builder::whitelisted_type(...)')

  • Remove references to protocols that no longer exists (such as 'wlroots/protocol/screenshooter.xml')

  • Change it so that the building of the crate always is fully self-contained unless explicitly indicated by the user otherwise (maybe)

  • Add compilation messages to communicate what libraries must be installed if some dependency libraries are referenced dynamically

  • Make sure that the library's api is sound (exposing the correct data structures)

  • Add a README / documentation page

Motivation

The project was deprecated due to the author giving up on it. There is however interest in the the project (see stars on GitHub) since the project (including it's subcrates) is a useful resource for developing Wayland-compositors in the Rust-language. Patching wlroots-sys would make it possible to interface with the wl-roots c-library directly without dependencies to deprecated bindings.

Ties to DevOps

The project would involve the following:

  • Configure an automatic building script for the underlying C-library

  • Configuration of the packaging of the library

  • Making it as self-contained as possible (containerization)

Context

  • Rust: a programming language

  • Crate: A packaged library or binary in Rust

  • Wayland-compositor: ~a window manager (usually for Linux)

  • wlroots: A library written in C for developing Wayland-compositors

  • wlroots-rs: A deprecated library with Rust-bindings for Wlroots.

  • wlroots-sys: A deprecated library within wlroots-rs that offers auto-generation of "raw" bindings from C to Rust.

Project: wlroots-sys

A fork intended for standalone use of the wlroots-sys subcrate (that generates "raw" Rust bindings for wlroots via bindgen). This means that the development is contained only within the wlroots-sys directory. Note that this is not an attempt to revive wlroots-rs - hence the largely untouched repository root. The motivation for this fork is the benefit of being able to write Wayland-compositors based on wlroots in Rust without relying on outdated protocols, dependencies etc.... See below if you are interested in writing one yourself.

Changes

The following changes have been merged into master:

  • Exposed (updated to reflect) all wlr/protocols currently available here
  • Exposed (updated to reflect) all wlr/types currently available here
  • Updated all dependencies of wlroots-sys to the current versions (including the library suite “wayland-rs” to >=0.25.*)
  • Fixed a bug where wlroots-sys would not compile. The multi-crate issue is described here.
  • Fixed a bug where the wlroots-sys crate would recompile every time you compile another crate that depends on wlroots-sys
  • Added informative dependency checks as well as more constructive error messages for pkg-config when building default, static and unstable, for a smoother build process.
  • Fixed errors with static build with new version of wlroots.
  • Compatibility changes for wlroots-rs (makes CI pass)

Usage

  1. git clone https://github.com/perfah/wlroots-rs.git

  2. cd wlroots-rs

  3. git submodule update --init

  4. cp ./wlroots-sys <path_to_your_project>/wlroots-sys

  5. Include a crate dependency to your project's cargo.toml-file:

     [dependencies]
     wlroots-sys = { path = "wlroots-sys", features = [...] }
    
  6. Replace "..." with the optional dependencies you would like.

Dependencies

  • Required dependencies:

      meson
      wayland
      wayland-protocols
      EGL
      GLESv2
      libdrm
      GBM
      libinput
      xkbcommon
      udev 
    
  • Optional dependencies (that can be added as features):

    • systemd - support for logind
    • elogind - support for logind without systemd installed
    • libcap - capabilities

@SophieHYe
Copy link

Thanks and merged!

@SophieHYe SophieHYe merged commit d1a55df into KTH:master May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants