You are not logged in.

#1 2021-03-06 17:23:11

heidegger
Member
Registered: 2013-04-24
Posts: 100

[SOLVED] Xarcade2jstick-git from AUR requires root privs for makepkg?

I'm trying to install this package from the AUR to an x86_64 system: https://aur.archlinux.org/packages/xarcade2jstick-git/

I am getting the follow output:

[camus@camus xarcade2jstick-git]$ makepkg
==> Making package: xarcade2jstick-git r70.0cb523c-1 (Sat 06 Mar 2021 08:47:49 AM PST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning Xarcade2Jstick git repo...
Cloning into bare repository '/home/camus/Downloads/xarcade2jstick-git/Xarcade2Jstick'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 400 (delta 10), reused 14 (delta 5), pack-reused 376
Receiving objects: 100% (400/400), 98.86 KiB | 1.18 MiB/s, done.
Resolving deltas: 100% (243/243), done.
==> Validating source files with sha1sums...
    Xarcade2Jstick ... Skipped
==> Extracting sources...
  -> Creating working copy of Xarcade2Jstick git repo...
Cloning into 'Xarcade2Jstick'...
done.
==> Starting pkgver()...
==> Updated version: xarcade2jstick-git r83.d080123-1
==> Starting build()...
cd src && make all
make[1]: Entering directory '/home/camus/Downloads/xarcade2jstick-git/src/Xarcade2Jstick/src'
 CC uinput_kbd.c
uinput_kbd.c: In function ‘uinput_kbd_open’:
uinput_kbd.c:38:2: warning: ‘strncpy’ output truncated before terminating nul copying 23 bytes from a string of the same length [-Wstringop-truncation]
   38 |  strncpy(uinp.name, "SNES-to-Keyboard Device",
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |    strlen("SNES-to-Keyboard Device"));
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 CC uinput_gamepad.c
 CC input_xarcade.c
 CC main.c
 Linking...
make[1]: Leaving directory '/home/camus/Downloads/xarcade2jstick-git/src/Xarcade2Jstick/src'
==> Entering fakeroot environment...
==> Starting package()...
cd src && make install
make[1]: Entering directory '/home/camus/Downloads/xarcade2jstick-git/src/Xarcade2Jstick/src'
 Linking...
install -d /home/camus/Downloads/xarcade2jstick-git/pkg/xarcade2jstick-git/usr/local/bin
install -m 0755 xarcade2jstick /home/camus/Downloads/xarcade2jstick-git/pkg/xarcade2jstick-git/usr/local/bin
make[1]: Leaving directory '/home/camus/Downloads/xarcade2jstick-git/src/Xarcade2Jstick/src'
cd scripts && make installservice
make[1]: Entering directory '/home/camus/Downloads/xarcade2jstick-git/src/Xarcade2Jstick/scripts'
install -d /home/camus/Downloads/xarcade2jstick-git/pkg/xarcade2jstick-git/lib/udev/rules.d/
install -m 0644 80-xarcade.rules /home/camus/Downloads/xarcade2jstick-git/pkg/xarcade2jstick-git/lib/udev/rules.d/
install -d /home/camus/Downloads/xarcade2jstick-git/pkg/xarcade2jstick-git/lib/systemd/system/
install -m 0644 xarcade2jstick.service /home/camus/Downloads/xarcade2jstick-git/pkg/xarcade2jstick-git/lib/systemd/system/
udevadm trigger --action=add --subsystem-match=input
Failed to write 'add' to '/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/uevent': Permission denied
make[1]: *** [Makefile:6: installservice] Error 1
make[1]: Leaving directory '/home/camus/Downloads/xarcade2jstick-git/src/Xarcade2Jstick/scripts'
make: *** [Makefile:19: installservice] Error 2
==> ERROR: A failure occurred in package().
    Aborting...

As you can see I am getting a permission error while simply building the package.
Obviously all files at that location are owned by root, and makepkg must be run as a normal user.
I'm a bit confused as to why there would be any changes to /sys/ during the process of building the package.
Can someone point me in the right direction for a solution?

Last edited by heidegger (2021-03-06 19:11:16)

Offline

#2 2021-03-06 18:24:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,230

Re: [SOLVED] Xarcade2jstick-git from AUR requires root privs for makepkg?

For this particular error adjust the makefile in scripts/Makefile and remove the udevadm trigger invocation from within the makefile. that will be handled on package installation anyway.

Offline

#3 2021-03-06 18:42:59

heidegger
Member
Registered: 2013-04-24
Posts: 100

Re: [SOLVED] Xarcade2jstick-git from AUR requires root privs for makepkg?

I made the change to the makefile within scripts, but upon reissuing the makepkg command the file was re-downloaded and overwrote my change. Must this change be made upstream or can I override this behavior?

Offline

#4 2021-03-06 18:59:31

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,230

Re: [SOLVED] Xarcade2jstick-git from AUR requires root privs for makepkg?

Add

prepare() {
        sed -i '/udevadm/d' "${_pkgname}"/scripts/Makefile
}

to the PKGBUILD

Last edited by V1del (2021-03-06 19:00:04)

Offline

#5 2021-03-06 19:09:33

heidegger
Member
Registered: 2013-04-24
Posts: 100

Re: [SOLVED] Xarcade2jstick-git from AUR requires root privs for makepkg?

Fantastic!
This worked.

Thank you V1del!

Offline

Board footer

Powered by FluxBB