You are not logged in.

#1 2023-08-23 19:53:03

DavidLazarescu
Member
Registered: 2023-08-23
Posts: 2

"make install"ing fails after package was successfully built

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

#2 2023-08-23 20:34:38

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 12,165
Website

Re: "make install"ing fails after package was successfully built

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

#3 2023-08-23 20:49:38

seth
Member
Registered: 2012-09-03
Posts: 54,569

Offline

#4 2023-08-23 20:51:14

DavidLazarescu
Member
Registered: 2023-08-23
Posts: 2

Re: "make install"ing fails after package was successfully built

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

#5 2023-08-23 20:54:59

seth
Member
Registered: 2012-09-03
Posts: 54,569

Re: "make install"ing fails after package was successfully built

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

#6 2023-08-23 22:03:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,925
Website

Re: "make install"ing fails after package was successfully built

DavidLazarescu wrote:

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

Board footer

Powered by FluxBB