Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
simple ebuild + patch for "make install failed to install
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
salmander
n00b
n00b


Joined: 19 Oct 2015
Posts: 10

PostPosted: Sun Nov 01, 2020 10:35 pm    Post subject: simple ebuild with 'make install' patch installation denied Reply with quote

hello,

i wrote my first ebuild.

hardened-malloc-9999.ebuild

Code:
EAPI=7

inherit git-r3

DESCRIPTION="hardened-malloc"

HOMEPAGE="https://github.com/GrapheneOS/hardened_malloc"
EGIT_REPO_URI="https://github.com/GrapheneOS/hardened_malloc.git"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

PATCHES=(
   "${FILESDIR}"/0001-Implement-Make-install.patch
)



0001-Implement-Make-install.patch


Code:
From 843e2b4078ede68b30cc079ef2f531f0634f653c Mon Sep 17 00:00:00 2001
From: mileika <localhost@mileika>
Date: Sun, 1 Nov 2020 21:58:15 +0100
Subject: [PATCH] install

---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index 57b32da..45c7e4f 100644
--- a/Makefile
+++ b/Makefile
@@ -139,3 +139,6 @@ test: libhardened_malloc.so
        -python3 -m unittest discover --start-directory test/
 
 .PHONY: check clean tidy test
+
+install:
+       @cp libhardened_malloc.so /usr/lib64
--
2.26.2


Code:
make -j10 DESTDIR=/var/tmp/portage/sys-libs/hardened-malloc-9999/image install
 * ACCESS DENIED:  open_wr:      /usr/lib64
cp: cannot create regular file '/usr/lib64': Permission denied


I'm very happy that sandbox mechanism inside works but my installation is denied.
How can i install this lib with emerge?
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Sun Nov 01, 2020 10:56 pm    Post subject: Reply with quote

In that ebuild with current EAPI and inherits, the default src_install() is (since undefined):
Code:
src_install() {
   if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
      emake DESTDIR="${D}" install
   fi
   einstalldocs
}
However, your makefile ignores DESTDIR and tries to install directly on the live filesystem.

If just a single file then it'd be simpler to just define a src_install yourself so it also use portage provided libdir location, like:
Code:
src_install() {
   dolib.so libhardened_malloc.so
   einstalldocs
}
Otherwise the makefile should be fixed to use DESTDIR, although should preferably still set a src_install() to get the libdir location from $(get_libdir) rather than assume lib64.
Back to top
View user's profile Send private message
salmander
n00b
n00b


Joined: 19 Oct 2015
Posts: 10

PostPosted: Sun Nov 01, 2020 11:12 pm    Post subject: Reply with quote

Ionen wrote:
In that ebuild, the default src_install() is (since undefined):
Code:
src_install() {
   if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
      emake DESTDIR="${D}" install
   fi
   einstalldocs
}
However, your makefile ignores DESTDIR and tries to install directly on the live filesystem.

If just a single file then it'd be simpler to just define a src_install yourself so it also use portage provided libdir location, like:
Code:
src_install() {
   dolib.so libhardened_malloc.so
   einstalldocs
}
Otherwise the makefile should be fixed to use DESTDIR, although should preferably still set a src_install() to get the libdir location from $(get_libdir) rather than assume lib64.


dolib.so looks very promising. now i discover all the other functions ( https://devmanual.gentoo.org/function-reference/install-functions/ )

repoman -dx full complain about "Ebuild contains leading spaces" inside src_install() but its minor fix.

The installation works.
emerge output also
Code:
 * QA Notice: The following shared libraries lack a SONAME
 * /usr/lib64/libhardened_malloc.so
but i guess it isn't an issue of ebuild.

Thank you for the explanation and the hint.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum