# [SOLVED] Violación de acceso al crear un ebuild

## edgar_uriel84

Hola a todos.

Tengo un nuevo problema. Estoy creando un ebuild para Photoflare. Es un programa que he probado en un liveUSB de Ubuntu y está bastante bien para mi. Decidí instalarlo en gentoo pero tengo un problema, les dejo el ebuild:

```
# Copyright 1999-2020 Gentoo Authors

# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="Quick, simple but powerful Cross Platform image editor."

HOMEPAGE="https://photoflare.io"

SRC_URI="https://github.com/PhotoFlare/${PN}/archive/v${PV}.tar.gz"

S="${WORKDIR}/${P}"

LICENSE="GPL-3"

SLOT="0"

KEYWORDS="amd64"

IUSE="+extra"

RDEPEND="virtual/libc

   media-gfx/graphicsmagick

   dev-qt/qtcore:5

   dev-qt/qtgui:5

   dev-qt/qtwidgets:5

   dev-qt/qtprintsupport:5

   >=sys-libs/libomp-9

   extra? ( dev-qt/qtimageformats:5 )

   "

DEPEND="|| ( sys-devel/gcc sys-devel/clang )

   ${RDEPEND}"

src_configure() {

    qmake Photoflare.pro PREFIX=/usr

    

}

src_install() {

   emake DESTDIR="${D}" install

}
```

Como verán no es nada del otro mundo, compila perfecto pero al momento de instalar obtengo lo siguiente:

```
>>> Install media-gfx/photoflare-1.6.4 into /var/tmp/portage/media-gfx/photoflare-1.6.4/image

make -j9 DESTDIR=/var/tmp/portage/media-gfx/photoflare-1.6.4/image install

/usr/lib64/qt5/bin/qmake -install qinstall -exe photoflare /usr/bin/photoflare

/usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor /usr/share/icons/hicolor

/usr/lib64/qt5/bin/qmake -install qinstall -exe /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor/48x48/apps/photoflare.png /usr/share/pixmaps/photoflare.png

/usr/lib64/qt5/bin/qmake -install qinstall -exe /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/applications/photoflare.desktop /usr/share/applications/photoflare.desktop

/usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/photoflare.1 /usr/share/man/man1/photoflare.1

/usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/io.photoflare.photoflare.appdata.xml /usr/share/metainfo/io.photoflare.photoflare.appdata.xml

* ACCESS DENIED:  open_wr:      /usr/bin

* ACCESS DENIED:  open_wr:      /usr/share/pixmaps

* ACCESS DENIED:  linkat:       /usr/share/pixmaps/photoflare.png

Error copying /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor/48x48/apps/photoflare.png to /usr/share/pixmaps/photoflare.png: Cannot create /usr/share/pixmaps/photoflare.png for output

* ACCESS DENIED:  open_wr:      /usr/share/icons/hicolor/64x64/apps

* ACCESS DENIED:  mkdir:        /usr/share/photoflare

make: *** [Makefile:1815: install_pixmaps] Error 3

mkdir: make: *** Waiting for unfinished jobs....

cannot create directory ‘/usr/share/photoflare’: Permission denied

* ACCESS DENIED:  linkat:       /usr/share/icons/hicolor/64x64/apps/photoflare.png

Error copying /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor/64x64/apps/photoflare.png to /usr/share/icons/hicolor/64x64/apps/photoflare.png: Cannot create /usr/share/icons/hicolor/64x64/apps/photoflare.png for output

make: *** [Makefile:1780: install_qmfile] Error 1

* ACCESS DENIED:  linkat:       /usr/bin/photoflare

make: *** [Makefile:1806: install_icon] Error 3

* ACCESS DENIED:  open_wr:      /usr/share/applications

Error copying photoflare to /usr/bin/photoflare: Cannot create /usr/bin/photoflare for output

* ACCESS DENIED:  linkat:       /usr/share/applications/photoflare.desktop

Error copying /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/applications/photoflare.desktop to /usr/share/applications/photoflare.desktop: Cannot create /usr/share/applications/photoflare.desktop for output

make: *** [Makefile:1771: install_target] Error 3

* ACCESS DENIED:  open_wr:      /usr/share/man/man1

make: *** [Makefile:1825: install_desktopentry] Error 3

* ACCESS DENIED:  linkat:       /usr/share/man/man1/photoflare.1

* ACCESS DENIED:  open_wr:      /usr/share/metainfo

Error copying /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/photoflare.1 to /usr/share/man/man1/photoflare.1: Cannot create /usr/share/man/man1/photoflare.1 for output

*make: *** [Makefile:1835: install_manpage] Error 3

ACCESS DENIED:  linkat:       /usr/share/metainfo/io.photoflare.photoflare.appdata.xml

Error copying /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/io.photoflare.photoflare.appdata.xml to /usr/share/metainfo/io.photoflare.photoflare.appdata.xml: Cannot create /usr/share/metainfo/io.photoflare.photoflare.appdata.xml for output

make: *** [Makefile:1844: install_appstream] Error 3

* ERROR: media-gfx/photoflare-1.6.4::genomorro-overlay failed (install phase):

*   emake failed

*

* If you need support, post the output of `emerge --info '=media-gfx/photoflare-1.6.4::genomorro-overlay'`,

* the complete build log and the output of `emerge -pqv '=media-gfx/photoflare-1.6.4::genomorro-overlay'`.

* The complete build log is located at '/var/tmp/portage/media-gfx/photoflare-1.6.4/temp/build.log'.

* The ebuild environment file is located at '/var/tmp/portage/media-gfx/photoflare-1.6.4/temp/environment'.

* Working directory: '/var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4'

* S: '/var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4'

* --------------------------- ACCESS VIOLATION SUMMARY ---------------------------

* LOG FILE: "/var/tmp/portage/media-gfx/photoflare-1.6.4/temp/sandbox.log"

*

VERSION 1.0

FORMAT: F - Function called

FORMAT: S - Access Status

FORMAT: P - Path as passed to function

FORMAT: A - Absolute Path (not canonical)

FORMAT: R - Canonical Path

FORMAT: C - Command Line

F: open_wr

S: deny

P: /usr/bin

A: /usr/bin

R: /usr/bin

C: /usr/lib64/qt5/bin/qmake -install qinstall -exe photoflare /usr/bin/photoflare

F: open_wr

S: deny

P: /usr/share/pixmaps

A: /usr/share/pixmaps

R: /usr/share/pixmaps

C: /usr/lib64/qt5/bin/qmake -install qinstall -exe /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor/48x48/apps/photoflare.png /usr/share/pixmaps/photoflare.png

F: linkat

S: deny

P: /usr/share/pixmaps/photoflare.png

A: /usr/share/pixmaps/photoflare.png

R: /usr/share/pixmaps/photoflare.png

C: /usr/lib64/qt5/bin/qmake -install qinstall -exe /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor/48x48/apps/photoflare.png /usr/share/pixmaps/photoflare.png

F: open_wr

S: deny

P: /usr/share/icons/hicolor/64x64/apps

A: /usr/share/icons/hicolor/64x64/apps

R: /usr/share/icons/hicolor/64x64/apps

C: /usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor /usr/share/icons/hicolor

F: mkdir

S: deny

P: photoflare

A: /usr/share/photoflare

R: /usr/share/photoflare

C: mkdir -p /usr/share/photoflare languages/

F: linkat

S: deny

P: /usr/share/icons/hicolor/64x64/apps/photoflare.png

A: /usr/share/icons/hicolor/64x64/apps/photoflare.png

R: /usr/share/icons/hicolor/64x64/apps/photoflare.png

C: /usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/icons/hicolor /usr/share/icons/hicolor

F: linkat

S: deny

P: /usr/bin/photoflare

A: /usr/bin/photoflare

R: /usr/bin/photoflare

C: /usr/lib64/qt5/bin/qmake -install qinstall -exe photoflare /usr/bin/photoflare

F: open_wr

S: deny

P: /usr/share/applications

A: /usr/share/applications

R: /usr/share/applications

C: /usr/lib64/qt5/bin/qmake -install qinstall -exe /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/applications/photoflare.desktop /usr/share/applications/photoflare.desktop

F: linkat

S: deny

P: /usr/share/applications/photoflare.desktop

A: /usr/share/applications/photoflare.desktop

R: /usr/share/applications/photoflare.desktop

C: /usr/lib64/qt5/bin/qmake -install qinstall -exe /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/installers/deb/DEBIAN/usr/share/applications/photoflare.desktop /usr/share/applications/photoflare.desktop

F: open_wr

S: deny

P: /usr/share/man/man1

A: /usr/share/man/man1

R: /usr/share/man/man1

C: /usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/photoflare.1 /usr/share/man/man1/photoflare.1

F: linkat

S: deny

P: /usr/share/man/man1/photoflare.1

A: /usr/share/man/man1/photoflare.1

R: /usr/share/man/man1/photoflare.1

C: /usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/photoflare.1 /usr/share/man/man1/photoflare.1

F: open_wr

S: deny

P: /usr/share/metainfo

A: /usr/share/metainfo

R: /usr/share/metainfo

C: /usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/io.photoflare.photoflare.appdata.xml /usr/share/metainfo/io.photoflare.photoflare.appdata.xml

F: linkat

S: deny

P: /usr/share/metainfo/io.photoflare.photoflare.appdata.xml

A: /usr/share/metainfo/io.photoflare.photoflare.appdata.xml

R: /usr/share/metainfo/io.photoflare.photoflare.appdata.xml

C: /usr/lib64/qt5/bin/qmake -install qinstall /var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4/io.photoflare.photoflare.appdata.xml /usr/share/metainfo/io.photoflare.photoflare.appdata.xml

* --------------------------------------------------------------------------------

>>> Failed to emerge media-gfx/photoflare-1.6.4

* Messages for package media-gfx/photoflare-1.6.4:

* ERROR: media-gfx/photoflare-1.6.4::genomorro-overlay failed (install phase):

*   emake failed

*

* If you need support, post the output of `emerge --info '=media-gfx/photoflare-1.6.4::genomorro-overlay'`,

* the complete build log and the output of `emerge -pqv '=media-gfx/photoflare-1.6.4::genomorro-overlay'`.

* The complete build log is located at '/var/tmp/portage/media-gfx/photoflare-1.6.4/temp/build.log'.

* The ebuild environment file is located at '/var/tmp/portage/media-gfx/photoflare-1.6.4/temp/environment'.

* Working directory: '/var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4'

* S: '/var/tmp/portage/media-gfx/photoflare-1.6.4/work/photoflare-1.6.4'

```

Nunca me había pasado algo similar con un ebuild, he leído la guía de Gentoo y dice que es una violación de acceso, alge escribe fuera del sandbox, pero... no veo ninguna variable o similar. Ojalá alguien tenga una idea.

Gracias de antemano.

EDITO:

Parece ser que modificar el make.conf permite la instalación:

```
FEATURES="ebuild-locks fail-clean parallel-fetch sandbox userfetch"
```

Lo cambié a:

```
FEATURES="ebuild-locks fail-clean parallel-fetch -sandbox userfetch -usersandbox"
```

Con eso ya puedo instalar el ebuild. Sigo tratando de arreglarlo desde el ebuild, sería ideal no romper el sandbox.

SOLUCIÓN

```
src_install() {

    emake INSTALL_ROOT="${D}" install

}
```

----------

