Package Details: libratbag-git 0.11.r7.47cc5fc-1

Git Clone URL: https://aur.archlinux.org/libratbag-git.git (read-only, click to copy)
Package Base: libratbag-git
Description: A DBus daemon to configure gaming mice - git version
Upstream URL: https://github.com/libratbag/libratbag
Licenses: MIT
Conflicts: liblur, libratbag, ratbagd
Provides: liblur, libratbag, ratbagd
Submitter: alucryd
Maintainer: openglfreak
Last Packager: openglfreak
Votes: 10
Popularity: 0.37
First Submitted: 2015-09-16 07:32 (UTC)
Last Updated: 2019-12-06 08:24 (UTC)

Latest Comments

1 2 3 Next › Last »

gremious commented on 2024-07-29 20:03 (UTC)

Build seemingly works, but I had to

pip install PyGObject
pip install evdev

first, to run a few of the python tests.

Should probably be added to a requirments.txt file or something

harre commented on 2024-05-16 22:58 (UTC)

can you unflag as outdated as it works for me after rebuilding python

harre commented on 2024-04-29 00:59 (UTC)

Build is working on my machine, Rebuilt tree as python had some updates

yay -S --rebuildtree libratbag-git

gardotd426 commented on 2023-04-07 21:00 (UTC) (edited on 2023-04-07 21:00 (UTC) by gardotd426)

This PKGBUILD is currently failing at check():

==> Starting check()...
 1/10 test-util                  OK              0.01s
 2/10 test-iconv-helper          OK              0.01s
 3/10 test-device                OK              0.02s
 4/10 duplicate-test             OK              0.04s
 5/10 receiver-id-test           OK              0.04s
 6/10 data-parse-test            OK              0.04s
 7/10 python-ruff-check          OK              0.05s
 8/10 ratbagctl-test             SKIP            0.09s   exit status 77
 9/10 test-context               OK              0.42s
10/10 python-black-check         FAIL            0.83s   exit status 1
>>> MALLOC_PERTURB_=198 MESON_SOURCE_ROOT=/home/matt/tmp/makepkg/libratbag-git/src/libratbag LIBRATBAG_DATA_DIR=/home/matt/tmp/makepkg/libratbag-git/src/libratbag/data/devices /home/matt/tmp/makepkg/libratbag-git/src/libratbag/test/python-black-check.sh


Ok:                 8
Expected Fail:      0
Fail:               1
Unexpected Pass:    0
Skipped:            1
Timeout:            0

Full log written to /home/matt/tmp/makepkg/libratbag-git/src/libratbag/build/meson-logs/testlog.txt
==> ERROR: A failure occurred in check().
    Aborting...

From the log, the problem is that python-black needs to change a file but obviously can't because the shell script being ran that runs black just runs black --check on the relevant files, and --check only tells you if any files would be modified, it doesn't go through with the modifications (it's basically like a dry run).

The log file at the end of the above error message shows:

=================================== 10/10 ====================================
test:         python-black-check
start time:   19:59:32
duration:     0.83s
result:       exit status 1
command:      MALLOC_PERTURB_=198 MESON_SOURCE_ROOT=/home/matt/tmp/makepkg/libratbag-git/src/libratbag LIBR>
----------------------------------- stderr -----------------------------------
would reformat /home/matt/tmp/makepkg/libratbag-git/src/libratbag/tools/ratbagctl.body.py.in
Oh no! 💥 💔 💥
1 file would be reformatted, 11 files would be left unchanged.

This is almost certainly due to an upstream change (I've begun the initial basic steps of bisection but I honestly don't have the time to fully bisect this right now). Changing the source() to pull the latest release (v0.17) instead of the latest main branch code completes without error, but obviously it doesn't even run a python-black check during the check process, because that was added later (v0.17 was launched 5 months ago).

I would suggest either patching test/python-black-check.sh at this line:

black --check $files

Actually pause: after typing the above I went ahead and tested a patch of my own, and it works perfectly. It just changes the problematic line into an if function:

  if black --check $files; then
    echo "success" && exit 0
    else black $files
  fi

This is necessary over just doing my initial test patch which amounted to changing black --check $files to black --check $files; black $files, because there may come times when the current upstream code doesn't require any changes, and therefore running black $files may cause an error. With this if statement, we check for whether black --check $files completes successfully and if it does we exit and the test is passed, but if it completes with files needing modified, it will then modify them and the test is passed.

I've also installed and tested the resulting build of libratbag using my patch, and sure enough it works perfectly (it actually fixes a crash I was experiencing earlier today which is why I was trying to reinstall in the first place).

python-black.patch:

--- a/test/python-black-check.sh        2023-04-07 16:19:11.668552415 -0400
+++ b/test/python-black-check.sh        2023-04-07 16:41:05.394645571 -0400
@@ -17,5 +17,7 @@
        echo >&2 "black is not installed"
        exit 77
 }
-
-black --check $files
+  if black --check $files; then
+    echo "success" && exit 0
+    else black $files
+  fi

I went ahead and made a patch for the PKGBUILD just to save you a few minutes if you wanted to use it:

PKGBUILD.patch:

--- a/PKGBUILD  2023-04-07 16:52:39.322608069 -0400
+++ b/PKGBUILD  2023-04-07 16:57:50.267746092 -0400
@@ -13,8 +13,9 @@
 optdepends=('linux: Linux 5.2 is required for Logitech wireless devices')
 makedepends=('meson' 'swig' 'git' 'python-sphinx' 'python-sphinx_rtd_theme')
 checkdepends=('check' 'valgrind' 'python-gobject' 'python-lxml')
-source=('git+https://github.com/libratbag/libratbag.git')
-sha512sums=('SKIP')
+source=('git+https://github.com/libratbag/libratbag.git'
+   'python-black.patch')
+sha512sums=('SKIP' 'SKIP')
 provides=('libratbag' "libratbag=$pkgver" 'ratbagd' 'liblur')
 conflicts=('libratbag' 'ratbagd' 'liblur')

@@ -28,6 +29,9 @@
   cd "$srcdir/$_pkgname"

   sed -i 's|sphinx-build3|sphinx-build|' doc/meson.build
+
+  patch -Np1 -i $srcdir/python-black.patch $srcdir/$_pkgname/test/python-black-check.sh
+
 }

 build() {

thegeekpirate commented on 2023-03-03 11:49 (UTC)

python-black and python-ruff are now required to build this package.

youduda commented on 2023-01-13 17:09 (UTC)

Building in a clean environment fails due to the missing /usr/lib/pkgconfig/libudev.pc. Therefore, systemd is a required build dependency.

InvisibleRasta commented on 2023-01-04 15:56 (UTC)

jsut compiled this but when opening piper-git i get an error saying: Incompatible ratbagd API version / required: 2, provided:1)

Labo commented on 2020-09-09 23:05 (UTC)

just to say I could compile it on aarch64, you just have to edit the PKGBUILD to add it to arch

singron commented on 2019-07-26 18:56 (UTC)

If you get compilation errors like

cc1: error: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Werror=format-security]

I have an upstream fix: https://github.com/libratbag/libratbag/pull/768

FFY00 commented on 2019-05-28 08:17 (UTC) (edited on 2019-05-28 08:17 (UTC) by FFY00)

Could you please update the PKGBUILD to keep up with the one in [community]? Thanks.