You are not logged in.
I am trying to publish an application to the AUR. My build file contains `cmake --install` .` in the `package()` step which fails since it does not have the permission to write to /usr/bin. Changing it to `sudo cmake --install .` fails as well, telling me that the user must provide the password, but there is no way to. How am I suppose to handle this properly?
Offline
You're meant to install to the fake root accessed via $pkgdir. See e.g. https://aur.archlinux.org/cgit/aur.git/ … tended#n37
EDIT: not sure how well that example translates to 'cmake --install', not used that invocation before.
EDIT2: to be clear, you should not use sudo or anything like that in the PKGBUILD. Everything should be done by the user invoking makepkg, and anything that should be included in the package should be present in $pkgdir by the end of package().
Last edited by WorMzy (2023-08-23 20:40:32)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Offline
I just found https://wiki.archlinux.org/title/CMake_ … guidelines which clarifies this. I still do not understand the actual internals of this. From what I get PKGBUILD builds the package locally in a folder so that pacman is able to see it. Using the fake root I am installing everything to $pkgdir but how is it then moved to the location I want it to be at (/usr/bin and /usr/lib)?
Offline
Following https://wiki.archlinux.org/title/CMake_ … s#Template /usr/bin and /usr/lib are set via -DCMAKE_INSTALL_PREFIX (you could move it to /opt/foo or /usr/local there, though esp. the latter isn't a good idea at all) and DESTDIR="$pkgdir" makes sure everything goes into the fake root path.
Offline
I am installing everything to $pkgdir but how is it then moved to the location I want it to be at (/usr/bin and /usr/lib)?
It is "moved" when you install the package. Nothing should be placed (directly) in /usr/bin/ when you build the package.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline