NICHOLAS85 / gebaar-libinput

Gebaar, A Super Simple WM Independent Touchpad Gesture Daemon for libinput
GNU General Public License v3.0
7 stars 4 forks source link

Void package fails to build #10

Open asyncial opened 3 years ago

asyncial commented 3 years ago

I am currently creating a package for void linux of this and I can't get the build to go through. I added libinput-devel to the makedepends, but it always fails, like it can't link libinput. The failing output is this:

/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::initialize_context()':
input.cpp:(.text+0x16a): undefined reference to `libinput_udev_create_context'
/usr/bin/ld: input.cpp:(.text+0x17d): undefined reference to `libinput_udev_assign_seat'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::~Input()':
input.cpp:(.text+0x3bc): undefined reference to `libinput_unref'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_touch_event_down(libinput_event_touch*)':
input.cpp:(.text+0x992): undefined reference to `libinput_event_touch_get_time'
/usr/bin/ld: input.cpp:(.text+0x99c): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_touch_event_motion(libinput_event_touch*)':
input.cpp:(.text+0xb45): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xb99): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xbf1): undefined reference to `libinput_event_touch_get_x'
/usr/bin/ld: input.cpp:(.text+0xc03): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xc56): undefined reference to `libinput_event_touch_get_y'
/usr/bin/ld: input.cpp:(.text+0xc69): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xcbe): undefined reference to `libinput_event_touch_get_x'
/usr/bin/ld: input.cpp:(.text+0xccc): undefined reference to `libinput_event_touch_get_y'
/usr/bin/ld: input.cpp:(.text+0xcd9): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xd79): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xdbc): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xe79): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0xea0): undefined reference to `libinput_event_touch_get_x'
/usr/bin/ld: input.cpp:(.text+0xeae): undefined reference to `libinput_event_touch_get_y'
/usr/bin/ld: input.cpp:(.text+0xebb): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::gesture_device_exists()':
input.cpp:(.text+0x1360): undefined reference to `libinput_event_destroy'
/usr/bin/ld: input.cpp:(.text+0x1369): undefined reference to `libinput_dispatch'
/usr/bin/ld: input.cpp:(.text+0x1389): undefined reference to `libinput_get_event'
/usr/bin/ld: input.cpp:(.text+0x139e): undefined reference to `libinput_event_get_device'
/usr/bin/ld: input.cpp:(.text+0x13f4): undefined reference to `libinput_device_get_name'
/usr/bin/ld: input.cpp:(.text+0x14a2): undefined reference to `libinput_device_has_capability'
/usr/bin/ld: input.cpp:(.text+0x14bb): undefined reference to `libinput_device_has_capability'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::initialize()':
input.cpp:(.text+0x17fa): undefined reference to `libinput_udev_create_context'
/usr/bin/ld: input.cpp:(.text+0x180d): undefined reference to `libinput_udev_assign_seat'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::test_above_threshold(unsigned long, double, libinput_device*)':
input.cpp:(.text+0x186f): undefined reference to `libinput_device_get_size'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_touch_event_up(libinput_event_touch*)':
input.cpp:(.text+0x2da4): undefined reference to `libinput_event_touch_get_time'
/usr/bin/ld: input.cpp:(.text+0x2dae): undefined reference to `libinput_event_touch_get_slot'
/usr/bin/ld: input.cpp:(.text+0x3153): undefined reference to `libinput_event_touch_get_base_event'
/usr/bin/ld: input.cpp:(.text+0x315b): undefined reference to `libinput_event_get_device'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_swipe_event_with_coords(libinput_event_gesture*)':
input.cpp:(.text+0x483c): undefined reference to `libinput_event_gesture_get_dx_unaccelerated'
/usr/bin/ld: input.cpp:(.text+0x484e): undefined reference to `libinput_event_gesture_get_dy_unaccelerated'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_swipe_event_without_coords(libinput_event_gesture*, bool)':
input.cpp:(.text+0x4914): undefined reference to `libinput_event_gesture_get_finger_count'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_pinch_event(libinput_event_gesture*, bool)':
input.cpp:(.text+0x6984): undefined reference to `libinput_event_gesture_get_scale'
/usr/bin/ld: input.cpp:(.text+0x6991): undefined reference to `libinput_event_gesture_get_angle_delta'
/usr/bin/ld: input.cpp:(.text+0x6a14): undefined reference to `libinput_event_gesture_get_finger_count'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_switch_event(libinput_event_switch*)':
input.cpp:(.text+0x6ac0): undefined reference to `libinput_event_switch_get_switch_state'
/usr/bin/ld: input.cpp:(.text+0x6acc): undefined reference to `libinput_event_switch_get_switch'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::handle_event()':
input.cpp:(.text+0x758c): undefined reference to `libinput_dispatch'
/usr/bin/ld: input.cpp:(.text+0x7595): undefined reference to `libinput_get_event'
/usr/bin/ld: input.cpp:(.text+0x75aa): undefined reference to `libinput_event_get_type'
/usr/bin/ld: input.cpp:(.text+0x761d): undefined reference to `libinput_event_get_gesture_event'
/usr/bin/ld: input.cpp:(.text+0x76b1): undefined reference to `libinput_event_get_gesture_event'
/usr/bin/ld: input.cpp:(.text+0x76d1): undefined reference to `libinput_event_destroy'
/usr/bin/ld: input.cpp:(.text+0x76da): undefined reference to `libinput_dispatch'
/usr/bin/ld: input.cpp:(.text+0x76e8): undefined reference to `libinput_event_get_gesture_event'
/usr/bin/ld: input.cpp:(.text+0x7753): undefined reference to `libinput_event_get_touch_event'
/usr/bin/ld: input.cpp:(.text+0x77b8): undefined reference to `libinput_event_get_touch_event'
/usr/bin/ld: input.cpp:(.text+0x77dc): undefined reference to `libinput_event_get_switch_event'
/usr/bin/ld: input.cpp:(.text+0x7861): undefined reference to `libinput_event_get_touch_event'
/usr/bin/ld: input.cpp:(.text+0x78ba): undefined reference to `libinput_event_get_gesture_event'
/usr/bin/ld: input.cpp:(.text+0x78c2): undefined reference to `libinput_event_gesture_get_finger_count'
/usr/bin/ld: input.cpp:(.text+0x7903): undefined reference to `libinput_event_get_gesture_event'
/usr/bin/ld: CMakeFiles/gebaard.dir/src/io/input.cpp.o: in function `gebaar::io::Input::start_loop()':
input.cpp:(.text+0x79a9): undefined reference to `libinput_get_fd'

What am I doing wrong? Thanks for any help with this.

NICHOLAS85 commented 3 years ago

Hey, I don't currently have a Void install or vm set up but I did a quick test using a Void stratum on my Bedrock Linux installation and the build proceeded correctly without any modification once I had all the correct dependencies installed. Can you provide more information on your build process? Later today I'll try to write up a quick script to build it on Void and see if you have better luck with that.

asyncial commented 3 years ago

Thanks for the fast answer. First I tried using the cmake-script void provides to build the project. The current version however, which basically executes the steps outline in the README.md, still runs into the same problem.

geebar-libinput/template
---
# Template file for 'gebaar-libinput'
pkgname=gebaar-libinput
version=c25c74b
revision=2
#archs="i686 x86_64"
wrksrc=${pkgname}-master
#create_wrksrc=yes
build_style=cmake
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends="libinput-devel cpptoml-devel cxxopts-devel cxxopts-devel spdlog-devel"
depends="spdlog cpptoml cxxopts"
short_desc="WM Independent Touchpad Gesture Daemon for libinput"
maintainer="asyncial"
license="GPL-3.0-or-later"
homepage="https://github.com/NICHOLAS85/gebaar-libinput"
distfiles="https://github.com/NICHOLAS85/gebaar-libinput/archive/master.zip"
checksum=aa3013cdf825442d16a35ae970d25ccf1231ce41cfd7185f11104dcb5c668c96

do_configure() {
    test ! -d build && mkdir -p build
    cd build
    cmake ..
}

do_build() {
    cd build
    make -j$(nproc)
}

The old version used the default do_configure and do_build functions of the cmake build style. Since void doesn't have packages for cxxopts and cpptoml, I created templates for them as well. I'm not sure, if they are relevant to this problem, so I'm just gonna post them as well.

cxxopts{-devel}/template
---
# Template file for 'cxxopts'
pkgname=cxxopts
version=2.2.1
revision=3
#archs="i686 x86_64"
#wrksrc=
#create_wrksrc=yes
build_style=cmake
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends=""
depends=""
short_desc="A lightweight C++ option parser library, supporting the standard GNU style syntax for options."
maintainer="asyncial"
license="MIT"
homepage="https://github.com/jarro2783/cxxopts"
distfiles="https://github.com/jarro2783/cxxopts/archive/v2.2.1.tar.gz"
checksum=984aa3c8917d649b14d7f6277104ce38dd142ce378a9198ec926f03302399681

post_install() {
    vlicense LICENSE
}

cxxopts-devel_package() {
    depends="$makedepends cxxopts-${version}_${revision}"
    short_desc+=" - development files"
    pkg_install() {
        vmove usr/include
        vmove usr/lib/cmake
    }
}
cpptoml{-devel}/template
---
# Template file for 'cpptoml'
pkgname=cpptoml
version=0.1.1
revision=2
#archs="i686 x86_64"
#wrksrc=
#create_wrksrc=yes
build_style=cmake
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends=""
depends=""
short_desc="A header-only library for parsing TOML configuration files."
maintainer="asyncial"
license="MIT"
homepage="https://github.com/skystrife/cpptoml"
distfiles="https://github.com/skystrife/cpptoml/archive/v0.1.1.tar.gz"
checksum=23af72468cfd4040984d46a0dd2a609538579c78ddc429d6b8fd7a10a6e24403

post_install() {
    vlicense LICENSE
}

cpptoml-devel_package() {
    depends="$makedepends cpptoml-${version}_${revision}"
    short_desc+=" - development files"
    pkg_install() {
        vmove usr/include
        vmove usr/lib/cmake
    }
}

Thanks for your help!

NICHOLAS85 commented 3 years ago

Just an update, I've been trying to replicate the build environment for Void packages in order to attempt to duplicate your issue however I've been running into problems (As I'm not familiar with Void it's likely I'm doing something wrong). For now I am unsure what exactly is causing libinput to fail to link, everything I can see in those templates seem to match the instructions in the README. The only difference I can see is the git submodule update --init command usually run but since you made templates for the used submodules I'm assuming that isn't what is causing this issue. I'll keep trying to diagnose this in the future but for now I don't know what's causing your issue, sorry about that!

asyncial commented 3 years ago

That's unfortunate, but thanks for trying! Do you know on which distribution it works? Maybe it has something to do with the libinput package itself and by analyzing the differences, I could find the error.

NICHOLAS85 commented 3 years ago

The build process should be distro agnostic, afaik. If you were to follow the build instructions manually on Void you should be able to install it yourself, I think theres a quirk with Voids templates causing an issue which we need to figure out. There's an Arch package on the aur for another fork of Gebaar which should work with this fork once adapted to use the correct links: https://aur.archlinux.org/packages/gebaar-libinput-git/. Otherwise I could look into automating the build process and adding releases people can download through github.