View previous topic :: View next topic |
Author |
Message |
littletux n00b

Joined: 08 Dec 2003 Posts: 73
|
Posted: Sat Nov 04, 2017 11:11 am Post subject: help with writing an ebuild |
|
|
This is the content of my ebuild
Code: | # Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=6
DESCRIPTION="yapc = Yet Another Pacman Clone"
EGIT_REPO_URI="https://github.com/ebuc99/pacman.git"
inherit git-r3
HOMEPAGE="https://github.com/ebuc99"
SLOT="0"
LICENSE="GPL3"
KEYWORDS="~x86 ~amd64"
DEPEND="media-libs/libsdl2
media-libs/sdl2-image
media-libs/sdl2-mixer
media-libs/sdl2-ttf"
RDEPEND="${DEPEND}"
src_configure() {
CPPFLAGS="-I/usr/include/SDL2" econf
} |
So now if I emerge it, I receive this Message
Code: | * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
* LOG FILE: "/var/log/sandbox/sandbox-15216.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/local/share/applications/.mimeinfo.cache.VR528Y
A: /usr/local/share/applications/.mimeinfo.cache.VR528Y
R: /usr/local/share/applications/.mimeinfo.cache.VR528Y
C: update-desktop-database -q
F: open_wr
S: deny
P: /usr/share/applications/.mimeinfo.cache.LY318Y
A: /usr/share/applications/.mimeinfo.cache.LY318Y
R: /usr/share/applications/.mimeinfo.cache.LY318Y
C: update-desktop-database -q
* -------------------------------------------------------------------------------- |
What I have to change/add to my ebuild so it will work?
[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu] |
|
Back to top |
|
 |
fedeliallalinea Bodhisattva


Joined: 08 Mar 2003 Posts: 22659 Location: here
|
Posted: Sat Nov 04, 2017 12:02 pm Post subject: |
|
|
Add this function in ebuild
Code: | src_prepare() {
default
# Do not run update-desktop-database (sandbox violation)
sed -e '/^UPDATE_DESKTOP/s:=.*:=true:' \
-i Makefile.am Makefile.in || die
} |
For line CPPFLAGS="-I/usr/include/SDL2" econf you can use flag-o-matic eclass with append-cppflags -I/usr/include/SDL2 _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
 |
littletux n00b

Joined: 08 Dec 2003 Posts: 73
|
Posted: Sat Nov 04, 2017 1:29 pm Post subject: |
|
|
Thanks a lot, the new ebuild now looks like that
Code: |
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=6
DESCRIPTION="yapc = Yet Another Pacman Clone"
EGIT_REPO_URI="https://github.com/ebuc99/pacman.git"
inherit flag-o-matic git-r3
HOMEPAGE="https://github.com/ebuc99"
SLOT="0"
LICENSE="GPL3"
KEYWORDS="~x86 ~amd64"
DEPEND="media-libs/libsdl2
media-libs/sdl2-image
media-libs/sdl2-mixer
media-libs/sdl2-ttf"
RDEPEND="${DEPEND}"
src_prepare() {
default
# Do not run update-desktop-database (sandbox violation)
sed -e '/^UPDATE_DESKTOP/s:=.*:=true:' \
-i Makefile.am Makefile.in || die
}
src_configure() {
append-cppflags -I/usr/include/SDL2
econf
}
|
The ebuild now do all that's needed, but, the build process goes wrong. Normaly emerge changes automagic the mostly used path prefix from /usr/local to /usr. It does it also here, but the resulting binary has still /usr/local as the search path, and so if I start the program it says Quote: | Unable to load image: Couldn't open /usr/local/share/pacman/gfx/pacman_desktop.png |
I have played around EPREFIX and ED with emake and emake install but haven't found a solution |
|
Back to top |
|
 |
fedeliallalinea Bodhisattva


Joined: 08 Mar 2003 Posts: 22659 Location: here
|
Posted: Sat Nov 04, 2017 2:11 pm Post subject: |
|
|
littletux wrote: | The ebuild now do all that's needed, but, the build process goes wrong. Normaly emerge changes automagic the mostly used path prefix from /usr/local to /usr. |
Usually yes, but in this case developer load has hard binded images path in code (see src/platform.cpp). You can use sed in src_prepare for patch this problem
Code: | src_prepare() {
default
# Do not run update-desktop-database (sandbox violation)
sed -e '/^UPDATE_DESKTOP/s:=.*:=true:' \
-i Makefile.am Makefile.in || die
# Change path of image
sed -e '/^Icon/s:/local::' -i pacman.desktop || die
sed -e '/strcpy/s:/local::' -i src/platform.cpp || die
} |
_________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
 |
charles17 Advocate

Joined: 02 Mar 2008 Posts: 2799
|
Posted: Sat Nov 04, 2017 3:45 pm Post subject: Re: help with writing an ebuild |
|
|
littletux wrote: | This is the content of my ebuild
Code: | # Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=6
DESCRIPTION="yapc = Yet Another Pacman Clone"
EGIT_REPO_URI="https://github.com/ebuc99/pacman.git"
inherit git-r3 |
|
See https://devmanual.gentoo.org/ebuild-writing/using-eclasses/#the-inherit-function |
|
Back to top |
|
 |
|