-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13176 from lrusak/libinput
[Linux] add libinput backend for non window system platforms
- Loading branch information
Showing
30 changed files
with
1,440 additions
and
1,681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#.rst: | ||
# FindLibinput | ||
# -------- | ||
# Finds the libinput library | ||
# | ||
# This will define the following variables:: | ||
# | ||
# LIBINPUT_FOUND - system has libinput | ||
# LIBINPUT_INCLUDE_DIRS - the libinput include directory | ||
# LIBINPUT_LIBRARIES - the libinput libraries | ||
# LIBINPUT_DEFINITIONS - the libinput compile definitions | ||
# | ||
|
||
if(PKG_CONFIG_FOUND) | ||
pkg_check_modules(PC_LIBINPUT libinput QUIET) | ||
endif() | ||
|
||
find_path(LIBINPUT_INCLUDE_DIR NAMES libinput.h | ||
PATHS ${PC_LIBINPUT_INCLUDEDIR}) | ||
|
||
find_library(LIBINPUT_LIBRARY NAMES input | ||
PATHS ${PC_LIBINPUT_LIBDIR}) | ||
|
||
set(LIBINPUT_VERSION ${PC_LIBINPUT_VERSION}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LibInput | ||
REQUIRED_VARS LIBINPUT_LIBRARY LIBINPUT_INCLUDE_DIR | ||
VERSION_VAR LIBINPUT_VERSION) | ||
|
||
if(LIBINPUT_FOUND) | ||
set(LIBINPUT_INCLUDE_DIRS ${LIBINPUT_INCLUDE_DIR}}) | ||
set(LIBINPUT_LIBRARIES ${LIBINPUT_LIBRARY}) | ||
endif() | ||
|
||
mark_as_advanced(LIBINPUT_INCLUDE_DIR LIBINPUT_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
set(PLATFORM_REQUIRED_DEPS OpenGLES AML EGL) | ||
set(PLATFORM_REQUIRED_DEPS OpenGLES AML EGL LibInput Xkbcommon) | ||
set(APP_RENDER_SYSTEM gles) | ||
list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM) | ||
set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM LibInput Xkbcommon) | ||
set(PLATFORM_OPTIONAL_DEPS VAAPI) | ||
set(APP_RENDER_SYSTEM gles) | ||
list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -DPLATFORM_SETTINGS_FILE=gbm.xml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
set(PLATFORM_REQUIRED_DEPS OpenGLES EGL MMAL) | ||
set(PLATFORM_REQUIRED_DEPS OpenGLES EGL MMAL LibInput Xkbcommon) | ||
set(APP_RENDER_SYSTEM gles) | ||
list(APPEND PLATFORM_DEFINES -D_ARMEL -DTARGET_RASPBERRY_PI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
include ../../Makefile.include | ||
PLATFORM=$(NATIVEPLATFORM) | ||
DEPS=../../Makefile.include Makefile | ||
|
||
# lib name, version | ||
LIBNAME=meson | ||
VERSION=0.45.1 | ||
SOURCE=$(LIBNAME)-$(VERSION) | ||
ARCHIVE=$(SOURCE).tar.gz | ||
|
||
LIBDYLIB=$(PLATFORM)/build | ||
|
||
all: .installed-$(PLATFORM) | ||
|
||
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) | ||
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) | ||
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) | ||
cd $(PLATFORM); $(NATIVEPREFIX)/bin/python3 setup.py config | ||
|
||
$(LIBDYLIB): $(PLATFORM) | ||
cd $(PLATFORM); $(NATIVEPREFIX)/bin/python3 setup.py build | ||
|
||
.installed-$(PLATFORM): $(LIBDYLIB) | ||
cd $(PLATFORM); $(NATIVEPREFIX)/bin/python3 setup.py install --prefix="$(NATIVEPREFIX)" | ||
touch $@ | ||
|
||
clean: | ||
$(MAKE) -C $(PLATFORM) clean | ||
rm -f .installed-$(PLATFORM) | ||
|
||
distclean:: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
include ../../Makefile.include | ||
PLATFORM=$(NATIVEPLATFORM) | ||
DEPS= ../../Makefile.include Makefile | ||
|
||
# lib name, version | ||
LIBNAME=ninja | ||
VERSION=1.8.2 | ||
SOURCE=$(LIBNAME)-$(VERSION) | ||
ARCHIVE=$(SOURCE).tar.gz | ||
|
||
LIBDYLIB=$(PLATFORM)/ninja | ||
|
||
all: .installed-$(PLATFORM) | ||
|
||
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) | ||
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) | ||
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) | ||
|
||
$(LIBDYLIB): $(PLATFORM) | ||
cd $(PLATFORM); CXX="$(CXX_FOR_BUILD)" AR="$(AR_FOR_BUILD)" CFLAGS="$(NATIVE_CFLAGS)" LDFLAGS="$(NATIVE_LDFLAGS)" $(NATIVEPREFIX)/bin/python3 configure.py --bootstrap | ||
|
||
.installed-$(PLATFORM): $(LIBDYLIB) | ||
install $(PLATFORM)/ninja $(NATIVEPREFIX)/bin | ||
touch $@ | ||
|
||
clean: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) | ||
|
||
distclean:: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
include ../../Makefile.include | ||
PLATFORM=$(NATIVEPLATFORM) | ||
DEPS= ../../Makefile.include Makefile | ||
|
||
# lib name, version | ||
LIBNAME=Python | ||
VERSION=3.6.4 | ||
SOURCE=$(LIBNAME)-$(VERSION) | ||
ARCHIVE=$(SOURCE).tar.xz | ||
|
||
CONFIGURE=./configure --prefix=$(NATIVEPREFIX) --disable-shared --disable-framework --without-ensurepip --without-pymalloc | ||
ifeq ($(TARGET_PLATFORM),wayland) | ||
CONFIGURE += --with-system-expat | ||
endif | ||
|
||
LIBDYLIB=$(PLATFORM)/python | ||
ifeq ($(NATIVE_OS), osx) | ||
LIBDYLIB=$(PLATFORM)/python.exe | ||
endif | ||
|
||
all: .installed-$(PLATFORM) | ||
|
||
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) | ||
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) | ||
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) | ||
cd $(PLATFORM); $(CONFIGURE) | ||
|
||
$(LIBDYLIB): $(PLATFORM) | ||
cd $(PLATFORM); $(MAKE) | ||
|
||
.installed-$(PLATFORM): $(LIBDYLIB) | ||
cd $(PLATFORM); $(MAKE) install | ||
touch $(LIBDYLIB) | ||
touch $@ | ||
|
||
clean: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) | ||
|
||
distclean:: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[binaries] | ||
c = '@CC@' | ||
cpp = '@CXX@' | ||
ar = '@AR@' | ||
strip = '@STRIP@' | ||
pkgconfig = '@prefix@/@tool_dir@/bin/pkg-config' | ||
|
||
[properties] | ||
cargs = ['@platform_cflags@', '@platform_includes@', '-isystem @prefix@/@deps_dir@/include'] | ||
c_link_args = ['-L@prefix@/@deps_dir@/lib', '-L@prefix@/@deps_dir@/lib64', '@platform_ldflags@'] | ||
|
||
[host_machine] | ||
system = '' | ||
cpu_family = '' | ||
cpu = '' | ||
endian = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
include ../../Makefile.include | ||
DEPS=../../Makefile.include Makefile | ||
|
||
# lib name, version | ||
LIBNAME=libevdev | ||
VERSION=1.5.8 | ||
SOURCE=$(LIBNAME)-$(VERSION) | ||
ARCHIVE=$(SOURCE).tar.xz | ||
|
||
# configuration settings | ||
CONFIGURE=./configure --prefix=$(PREFIX) --disable-shared --enable-static --disable-tests | ||
|
||
LIBDYLIB=$(PLATFORM)/libevdev/.libs/libevdev.la | ||
|
||
all: .installed-$(PLATFORM) | ||
|
||
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) | ||
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) | ||
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) | ||
cd $(PLATFORM); $(CONFIGURE) | ||
|
||
$(LIBDYLIB): $(PLATFORM) | ||
$(MAKE) -C $(PLATFORM) | ||
|
||
.installed-$(PLATFORM): $(LIBDYLIB) | ||
$(MAKE) -C $(PLATFORM) install | ||
touch $@ | ||
|
||
clean: | ||
$(MAKE) -C $(PLATFORM) clean | ||
rm -f .installed-$(PLATFORM) | ||
|
||
distclean: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
include ../../Makefile.include | ||
DEPS=../../Makefile.include Makefile | ||
|
||
# lib name, version | ||
LIBNAME=libinput | ||
VERSION=1.10.5 | ||
SOURCE=$(LIBNAME)-$(VERSION) | ||
ARCHIVE=$(SOURCE).tar.xz | ||
|
||
# configuration settings | ||
CONFIGURE= $(NATIVEPREFIX)/bin/python3 $(NATIVEPREFIX)/bin/meson \ | ||
--prefix=$(PREFIX) \ | ||
--libdir=lib \ | ||
-Ddebug-gui=false \ | ||
-Ddocumentation=false \ | ||
-Dlibwacom=false \ | ||
-Dtests=false | ||
|
||
ifeq ($(CROSS_COMPILING), yes) | ||
CONFIGURE += --cross-file $(PREFIX)/share/cross-file.meson | ||
export CC=$(CC_FOR_BUILD) | ||
export CXX=$(CXX_FOR_BUILD) | ||
export CFLAGS=$(CFLAGS_FOR_BUILD) | ||
export CXXFLAGS=$(CXXFLAGS_FOR_BUILD) | ||
else | ||
export CC CXX CFLAGS CXXFLAGS | ||
endif | ||
export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig | ||
|
||
LIBDYLIB=$(PLATFORM)/build/libinput.a | ||
|
||
all: .installed-$(PLATFORM) | ||
|
||
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) | ||
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) | ||
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) | ||
cd $(PLATFORM); rm -rf build; mkdir -p build | ||
cd $(PLATFORM); $(CONFIGURE) . build | ||
|
||
$(LIBDYLIB): $(PLATFORM) | ||
cd $(PLATFORM)/build; $(NATIVEPREFIX)/bin/ninja -v | ||
|
||
.installed-$(PLATFORM): $(LIBDYLIB) | ||
cd $(PLATFORM)/build; $(NATIVEPREFIX)/bin/ninja -v install | ||
touch $@ | ||
|
||
clean: | ||
$(MAKE) -C $(PLATFORM) clean | ||
rm -f .installed-$(PLATFORM) | ||
|
||
distclean: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
include ../../Makefile.include | ||
DEPS=../../Makefile.include Makefile | ||
|
||
# lib name, version | ||
LIBNAME=libudev | ||
VERSION=3.2.5 | ||
SOURCE=$(LIBNAME)-$(VERSION) | ||
ARCHIVE=$(SOURCE).tar.gz | ||
|
||
# configuration settings | ||
CONFIGURE=./configure --prefix=$(PREFIX) --disable-shared --enable-static --enable-introspection=no --disable-programs --disable-blkid --disable-selinux --disable-manpages --disable-kmod --disable-mtd_probe | ||
|
||
LIBDYLIB=$(PLATFORM)/src/libudev/.libs/libudev.la | ||
|
||
all: .installed-$(PLATFORM) | ||
|
||
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) | ||
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) | ||
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) | ||
cd $(PLATFORM); $(AUTORECONF) -vif | ||
cd $(PLATFORM); $(CONFIGURE) | ||
|
||
$(LIBDYLIB): $(PLATFORM) | ||
$(MAKE) -C $(PLATFORM) | ||
|
||
.installed-$(PLATFORM): $(LIBDYLIB) | ||
$(MAKE) -C $(PLATFORM) install | ||
touch $@ | ||
|
||
clean: | ||
$(MAKE) -C $(PLATFORM) clean | ||
rm -f .installed-$(PLATFORM) | ||
|
||
distclean: | ||
rm -rf $(PLATFORM) .installed-$(PLATFORM) |
Oops, something went wrong.