VorpalBlade / keyboard-backlightd

Daemon for automatic timeout of laptop (ThinkPad) keyboard backlight
GNU General Public License v3.0
9 stars 0 forks source link

update the read me file #62

Open Stradios opened 1 day ago

Stradios commented 1 day ago

Resolving libevdev and Build Errors

This error indicates that you're missing some system dependencies required to build and compile the project, especially libraries and tools related to libevdev and the build system (e.g., autoreconf).


1. Install Missing Dependencies

The error mentions libevdev and autoreconf. Install these along with other development tools:

For Ubuntu/Debian:

sudo apt update
sudo apt install libevdev-dev pkg-config autoconf automake libtool build-essential

For Fedora/RHEL-based systems:

sudo dnf install libevdev-devel pkg-config autoconf automake libtool make gcc gcc-c++

For Arch-based systems:

sudo pacman -S libevdev pkgconf autoconf automake libtool base-devel
# NOTE! Not recommended! This will overwrite your config file for this
# program, which sucks if you customised it. Use your package manager
# instead!
make
sudo make install

Then enable and start the systemd service and make sure everything still works:

systemctl enable keyboard-backlightd
systemctl start keyboard-backlightd

2. Set the PKG_CONFIG_PATH Environment Variable

If libevdev is installed but the system can't find its .pc file, ensure PKG_CONFIG_PATH includes its location. Check where libevdev.pc is located:

find /usr/lib /usr/local/lib -name "libevdev.pc"

If it's found, set PKG_CONFIG_PATH:

export PKG_CONFIG_PATH=/path/to/directory/containing/libevdev.pc

Replace /path/to/directory/containing/libevdev.pc with the actual directory.


3. Rebuild the Project

Clean and rebuild the project:

cargo clean
cargo build --release

4. Verify Git Repository

The error also notes a missing Git repository. If the source code was downloaded as a zip/tar file instead of cloned via Git, you might lack the .git folder. Clone the repository instead:

git clone https://github.com/example/keyboard-backlightd.git
cd keyboard-backlightd

Replace the URL with the correct repository link.


5. Additional Debugging

If the issue persists, enable verbose output for Cargo and retry:

RUST_BACKTRACE=1 cargo build --release
VorpalBlade commented 22 hours ago

Hi, it is not clear to me what this is about? Is the text in you wrote supposed to be incorporated into the readme?

I'm guessing you ran into an error due to not having libevdev (or the header files for it) installed? Do you still have the specific error text around?

Stradios commented 15 hours ago

i think this is all i have left form it


pop os 22.04 lenovo t408s Fresh install

Couldn't find libevdev from pkgconfig ( pkg-config exited with status code 1

PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libevdev

The system library libevdev required by crate evdev-sys was not found. The file libevdev.pc needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory. The PKG_CONFIG_PATH environment variable is not set.

HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing libevdev.pc. ), compiling it from source... fatal: not a git repository (or any of the parent directories): .git /home/stradios/Downloads/keyboard-backlightd-main/keyboard-backlightd-main/target/release/build/evdev-sys-8243a7d3f5ce24de/out/libevdev/autogen.sh: 9: autoreconf: not found thread 'main' panicked at /home/stradios/.cargo/registry/src/index.crates.io-6f17d22bba15001f/evdev-sys-0.2.5/build.rs:121:5: assertion failed: cmd.status()?.success() note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... make: *** [Makefile:19: target/release/keyboard-backlightd] Error 101


fix


For Ubuntu/Debian:

sudo apt update
sudo apt install libevdev-dev pkg-config autoconf automake libtool build-essential

make
sudo make install

Then enable and start the systemd service and make sure everything still works:

systemctl enable keyboard-backlightd
systemctl start keyboard-backlightd

all works perfect