Hello Arch community
I'm enjoying Arch on my thinkpad t420, but it's about time I properly configured my laptop's power management. I plan to run tlp through systemd, which seems to be going fine. What is not going as planned is my installation of the tpacpi-bat script which makes battery thresholds configurable. I discovered that the project is now hosted on github. So bear with me: i understand that on the AUR, you have to download the .tar.gz, extract it, run makepkg -s, which talks to the PKGBUILD, which you can then pacman -U, but, because i am a noob, i fear i've overlooked a few things. i git cloned the project, so i have it on my machine, but there's no PKGBUILD... only an install script written in perl. "okay, so no big deal..." i ran perl install.pl... and got the following output:
sudo cp tpacpi-bat /usr/local/bin
git reset HEAD --hard
HEAD is now at 342a3d2 Repository cleanup, added several methods and scripts from feedback
git clean -fd
git checkout v1.0.0
HEAD is now at 342a3d2... Repository cleanup, added several methods and scripts from feedback
make -C /lib/modules/3.7.9-1-ARCH/build M=/tmp/acpi_call modules
make: *** /lib/modules/3.7.9-1-ARCH/build: No such file or directory. Stop.
make: *** [default] Error 2
error running 'make'
So, it looks like the script stopped itself when it found that /lib/modules/3.7.9-1-Arch/build does not exist... so the noob question is "why should it exist?"--- what am i doing wrong?
Last edited by garudabear (2013-02-25 06:21:28)
I'm confused - you list the correct steps of installing from the AUR, but then you say you did something completely different. Why?
You should not be manually cloning the git repo. Just download the PKGBUILD from the AUR and use `makepkg -si` which will take care of all that.
After extracting the .tar.gz, a folder with only a PKGBUILD was extracted. and then I got confused... what would I pass as an argument to makepkg? I saw in the comments that the project had moved to git (https://aur.archlinux.org/packages/tpacpi-bat/ ) which is why I cloned the file. After a little while, I thought maybe I forgot to install a dependancy... i discovered that i acpi_call-git is a dependancy, tried to install that, and received a similar "Error 2" Here's the output for that:
makepkg -si acpi_call.install
==> Determining latest git revision...
-> Version found: 20130223
==> Making package: acpi_call-git 20130223-1 (Sat Feb 23 21:22:44 EST 2013)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving Sources...
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Starting build()...
==> WARNING: Please make sure kernel headers are built/installed for the kernel acpi_call will be used with ::
==> WARNING: example #1: 'pacman -S linux-headers'
==> WARNING: example #2: 'pacman -S linux-lts-headers'
==> Git checkout: Updating existing tree
==> Git checkout: Tree has been updated
==> Checkout completed
make -C /usr/lib/modules/3.7.9-1-ARCH/build M=/home/garudabear/Downloads/acpi_call-git/src/acpi_call-build modules
make: *** /usr/lib/modules/3.7.9-1-ARCH/build: No such file or directory. Stop.
make: *** [default] Error 2
==> ERROR: A failure occurred in build().
i discovered this dependancy when i ran makepkg -si in the extracted tpacpi-bat contents from the .tar.gz on the AUR, but seeing that htis acpi-call file has no dependancies, i'm confused.
I feel foolish... so it seems I should have known to install linux-headers? I assumed that would have been installed when updating pacman? After installing linux-headers, the acpi-call-git install went fine. Then I tried to run mkpkg -si on the tpacpi-bat.tar.gz file (from AUR), but I got an error indicating that "one or more of the files did not pass the validity check"... so I perhaps foolishly ignored this risk and ran the perl script again with no further problems... (yet)
You don't need to pass anything as a parameter to makepkg, it checks the current directory for a PKGBUILD. The `-si` flags are useful for installing dependencies and installing the built packaged, but they only streamline the process and are not strictly needed. See the wiki page on makepkg and AUR for more information.
acpi_call-git is required for tpacpi-bat and linux-headers is needed by acpi_call-git, but unfortunately it is listed only as an optdepends. So first install linux-headers (pacman -S linux-headers), then, in the directory with the acpi_call-git PKGBUILD, run `makepkg -i` which will build the new package, and install the new package. Finally, in the directory with the tpacpi-bat PKGBUILD run `makepkg -si` again which will install tp_smapi and any other dependencies, build the new package and install it.
I just built and installed each of these successfully - so the PKGBUILDS do work.
EDIT: it seems this was cross posted with the above. I still don't think you should be manually running any perl install scripts, but if it's working ...
Last edited by Trilby (2013-02-24 02:45:53)
ahh, thanks for the response! it seems i should spend some time looking over the makepkg manpage...so wait, you didn't get an error about a validity check when installing "makepkging" tpacpi-bat?
Nope, no errors or warnings here - except for the linux-headers warning, but once that was installed, both AUR packages worked flawlessly.
I reinstalled arch on my thinkpad, followed your instructions (and was in general more patient and less panicky with the terminal) and everything got set-up flawlessly.... thanks so much for your help
Last edited by garudabear (2013-02-25 05:18:12)
Please edit your first post and edit the title, adding [Solved].
Also, reinstalling might have been a good thing, giving you a better understanding of what is going on. But know that one of the great things about being an Arch user is being immersed in the internals of the OS enough that you can typically fix whatever is borked. I'm not saying that it was the wrong thing to do, but it should be noted that unlike redmond's best, there are other options.
Edited, and I appreciate your advice; had time ( ...and my laptop's battery life) not been such a pressing issue, I would have taken the higher road and tackled the problem myself. I switched to this distro because I wanted to become familiar with its inner workings, so no disagreement there