Skip to content
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

libdecor support for manylinux wheels #9

Closed
a-hurst opened this issue Dec 27, 2021 · 2 comments
Closed

libdecor support for manylinux wheels #9

a-hurst opened this issue Dec 27, 2021 · 2 comments

Comments

@a-hurst
Copy link
Owner

a-hurst commented Dec 27, 2021

For Linux, SDL2 recently added support for a library called 'libdecor', which seems to be necessary to create windows with titles and control buttons using Wayland.

Unfortunately Debian 9 (used by the manylinux_2_24 wheels) doesn't offer libdecor through apt-get, meaning the manylinux SDL2 binaries don't get built with libdecor support. Making matters worse, compiling libdecor from source on Debian 9 doesn't seem to work due to a problem with the memfd_create kernel function missing:

+ export LIBDECOR_VERSION=0.1.0
+ LIBDECOR_VERSION=0.1.0
+ export LIBDECOR_URL=https://gitlab.gnome.org/jadahl/libdecor/-/archive
+ LIBDECOR_URL=https://gitlab.gnome.org/jadahl/libdecor/-/archive
+ tar -xz
       Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0+ cd libdecor-0.1.0
+ meson build --buildtype release
The Meson build system
Version: 0.60.3
Source dir: /tmp/cirrus-ci-build/libdecor-0.1.0
Build dir: /tmp/cirrus-ci-build/libdecor-0.1.0/build
Build type: native build
Project name: libdecor
Project version: 0.1.0
C compiler for the host machine: cc (gcc 6.3.0 "cc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516")
C linker for the host machine: cc ld.bfd 2.28
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wno-unused-parameter: YES 
Compiler for C supports arguments -Wno-missing-field-initializers: YES 
Found pkg-config: /usr/bin/pkg-config (0.29)
Run-time dependency wayland-client found: YES 1.20.0
Run-time dependency wayland-protocols found: YES 1.24
Library dl found: YES
Run-time dependency dbus-1 found: YES 1.10.32
Checking for function "memfd_create" : NO 

meson.build:56:4: ERROR: Problem encountered: Required function memfd_create missing

The memfd_create function seems to have been introduced several kernel versions ago, so it's unclear why meson doesn't seem to be finding it for Debian 9.

So far, the available options are:

  1. Update the 'modern' manylinux wheels to Debian 10 (not ideal, would leave out a lot of older setups)
  2. Figure out a workaround for the memfd_create bug\
  3. Trick SDL2 into believing that libdecor is installed so it builds with dynamic support
  4. Refuse to support libdecor for the time being (I honestly have no clue how big a deal libdecor is. Maybe wait for someone to file an issue before spending more time on this?)
@a-hurst
Copy link
Owner Author

a-hurst commented Dec 27, 2021

The added code to build libdecor and its dependencies from source using the manylinux.sh script is:

    # Update Wayland to newer version for libdecor
    apt-get install -y libffi-dev libxml2-dev
    export WAYLAND_VERSION=1.20.0
    export WAYLAND_URL=https://gitlab.freedesktop.org/wayland/wayland/-/archive
    curl $WAYLAND_URL/$WAYLAND_VERSION/wayland-$WAYLAND_VERSION.tar.gz | tar -xz
    cd wayland-$WAYLAND_VERSION
    meson build --buildtype=release -Ddocumentation=false
    ninja -C build/ install
    cd ..

    # Update wayland-protocols to newer version for libdecor
    export PROTOCOLS_VERSION=1.24
    export PROTOCOLS_URL=https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive
    curl $PROTOCOLS_URL/$PROTOCOLS_VERSION/wayland-protocols-$PROTOCOLS_VERSION.tar.gz | tar -xz
    cd wayland-protocols-$PROTOCOLS_VERSION
    meson build --buildtype=release
    ninja -C build/ install
    cd ..

    # Install libdecor once wayland and other depedencies are installed
    apt-get install -y libpango1.0-dev
    export LIBDECOR_VERSION=0.1.0
    export LIBDECOR_URL=https://gitlab.gnome.org/jadahl/libdecor/-/archive
    curl $LIBDECOR_URL/$LIBDECOR_VERSION/libdecor-$LIBDECOR_VERSION.tar.gz | tar -xz
    cd libdecor-$LIBDECOR_VERSION
    meson build --buildtype release
    meson install -C build
    cd ..

... after the rest of the apt-get dependencies have been installed.

@a-hurst
Copy link
Owner Author

a-hurst commented May 1, 2023

Closed by #25.

@a-hurst a-hurst closed this as completed May 1, 2023
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

No branches or pull requests

1 participant