Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Some questions about other ebuild i make
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Mon Nov 12, 2018 4:08 pm    Post subject: [Solved] Some questions about other ebuild i make Reply with quote

Hello, i have questions about new ebuild i make. This ebuild archive contain .sh script require other files in this archive. When i make installation process on ebuild file, how i implement that ?

My second question, this ebuild don't have version number, how i name it ? packagename-o.ebuild ?


Last edited by Fulgurance on Fri Nov 16, 2018 1:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hund
Apprentice
Apprentice


Joined: 18 Jul 2016
Posts: 218
Location: Sweden

PostPosted: Mon Nov 12, 2018 4:56 pm    Post subject: Reply with quote

If it's from a git repository then use version number 9999: `packagename-9999.ebuild`.
_________________
Collect memories, not things.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Mon Nov 12, 2018 5:52 pm    Post subject: Re: Some questions about other ebuild i make Reply with quote

Fulgurance wrote:
Hello, i have questions about new ebuild i make. This ebuild archive contain .sh script require other files in this archive. When i make installation process on ebuild file, how i implement that ?

Depend on what the script do. Basically ebuild is a script file you can run a .sh as long as the script commands remains in sandbox.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Mon Nov 12, 2018 11:03 pm    Post subject: Reply with quote

This script check many things and launch game. This game need resources (pictures ...etc). How and where i teel emerge to save this files?

It's not git repository. It's just client release
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Tue Nov 13, 2018 2:13 am    Post subject: Reply with quote

Portage will save distfiles into $DISTDIR. If you mean, how do you control where Portage places the files on the live filesystem when the package is installed, then the answer is that you install them to the corresponding directory hierarchy under the directory named by $D, Portage collects an inventory of those files, then installs them on your behalf.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Tue Nov 13, 2018 5:06 pm    Post subject: Reply with quote

Do you know ebuild example illustre that please ? I don't found ...

The most simple i think is save directory on downloaded archive under somewhere in system and make symlink to /usr/bin
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Tue Nov 13, 2018 5:29 pm    Post subject: Reply with quote

In src_install you can use insinto and doins (there is other do* functions).
Example:
Code:
src_install() {
    insinto /opt/
    doins <some_file_in_working_dir>
 
    dobin <some_file_in_working_dir>
}

insinto /opt/ tell package manager to install in ${D}/opt/ (${D} is added by insinto function) and doins copy the specific file on it.
dobin Install a binary into ${D}/usr/bin, set the file mode to 0755 and set the ownership to superuser or its equivalent on the system or installation at hand.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Tue Nov 13, 2018 5:50 pm    Post subject: Reply with quote

Okay. Just look my ebuild, i have do this:

Code:
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

KAG_PATH="/usr/share/kag"
DESCRIPTION="2D MMORPG about mining resources, building castles and destroying your enemies"
HOMEPAGE="https://www.kag2d.com/en/"
KEYWORDS="~amd64"
LICENSE="EULA"
SLOT="0"
SRC_URI="http://dl.kag2d.com/kag-linux32-client-release.tar.gz -> ${P}.tgz"

src_install()
{
   dodir "/usr/share/kag"
   cp -R "${WORKDIR}/App" ${KAG_PATH}
   cp -R "${WORKDIR}/Base" ${KAG_PATH}
   cp -R "${WORKDIR}/Docs" ${KAG_PATH}
   cp -R "${WORKDIR}/lib" ${KAG_PATH}
   cp -R "${WORKDIR}/Manual" ${KAG_PATH}
   cp -R "${WORKDIR}/Mods" ${KAG_PATH}
   cp -R "${WORKDIR}/Security" ${KAG_PATH}
   cp "${WORKDIR}/autoupdate_ignore_custom.cfg" ${KAG_PATH}
   cp "${WORKDIR}/autoupdate_ignore.cfg" ${KAG_PATH}
   cp "${WORKDIR}/curl-ca-bundle.crt" ${KAG_PATH}
   cp "${WORKDIR}/curl-license.txt" ${KAG_PATH}
   cp "${WORKDIR}/forceupdate.sh" ${KAG_PATH}
   cp "${WORKDIR}/irrlicht.ico" ${KAG_PATH}
   cp "${WORKDIR}/KAG" ${KAG_PATH}
   cp "${WORKDIR}/libJuxta.so" ${KAG_PATH}
   cp "${WORKDIR}/mods.cfg" ${KAG_PATH}
   cp "${WORKDIR}/nolauncher.sh" ${KAG_PATH}
   cp "${WORKDIR}/readme.txt" ${KAG_PATH}
   cp "${WORKDIR}/rungame.sh" ${KAG_PATH}
   cp "${WORKDIR}/runlocalhost.sh" ${KAG_PATH}
   cp "${WORKDIR}/steam_appid.txt" ${KAG_PATH}
   cp "${WORKDIR}/terms.txt" ${KAG_PATH}
   ln -sf "${KAG_PATH}/rungame.sh" "/usr/bin/kag"
   make_desktop_entry("kag","KAG","${KAG_PATH}/KAG.ico","Game","Comment=2D MMORPG about mining resources, building castles and destroying your enemies")
}


Do you think i remove cp and ln command with your examples commands ?

I have problem with make_deskop_entry_command... wrong syntax?

And what i write for my version of ebuild ? kag-0.ebuild ?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Tue Nov 13, 2018 5:57 pm    Post subject: Reply with quote

Fulgurance wrote:
Do you think i remove cp and ln command with your examples commands ?

Yes and also use dosym for symlink instead of ln

Fulgurance wrote:
I have problem with make_deskop_entry_command... wrong syntax?

Code:
make_desktop_entry "<exec_command>" "<title>" "<icon>" "<category separated by ;>"



Fulgurance wrote:
And what i write for my version of ebuild ? kag-0.ebuild ?

Or 9999
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Tue Nov 13, 2018 9:44 pm    Post subject: Reply with quote

I have doing that:

Code:
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="2D MMORPG about mining resources, building castles and destroying your enemies"
HOMEPAGE="https://www.kag2d.com/en/"
KEYWORDS="~amd64"
LICENSE="EULA"
SLOT="0"
SRC_URI="http://dl.kag2d.com/kag-linux32-client-release.tar.gz -> ${P}.tgz"

src_install()
{
        insinto "/usr/share/kag"
        dodir "/usr/share/kag"
        doins -r "App"
        doins -r "Base"
        doins -r "Docs"
        doins -r "lib"
        doins -r "Manual"
        doins -r "Mods"
        doins -r "Security"
        doins "autoupdate_ignore_custom.cfg"
        doins "autoupdate_ignore.cfg"
        doins "curl-ca-bundle.crt"
        doins "curl-license.txt"
        doins "forceupdate.sh"
        doins "irrlicht.ico"
        doins "KAG"
        doins "libJuxta.so"
        doins "mods.cfg"
        doins "nolauncher.sh"
        doins "readme.txt"
        doins "rungame.sh"
        doins "runlocalhost.sh"
        doins "steam_appid.txt"
        doins "terms.txt"
        dosym "/usr/share/kag/rungame.sh" "/usr/bin/kag"
        make_desktop_entry "kag" "KAG" "/usr/share/kag/KAG.ico" "Game" "Comment='2D MMORPG about mining resources, building castles and destroying your enemies'"
}


But i have this problems:

Code:
fulgurance@msi-gs73vr-6rf /usr/local/portage/games-action/kag $ sudo repoman -dx full
!!! Repository 'x-portage' is missing masters attribute in '/usr/local/portage/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility

RepoMan scours the neighborhood...
  LICENSE.invalid [fatal]       1
   games-action/kag/kag-9999.ebuild: EULA
  ebuild.absdosym               1
   games-action/kag/kag-9999.ebuild: dosym '/usr/share/kag/rungame.sh"'... could use relative path on line: 39
Please fix these important QA issues first.
RepoMan sez: "Make your QA payment on time and you'll never see the likes of me."
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Wed Nov 14, 2018 7:19 am    Post subject: Reply with quote

For the dosym
Code:
dosym "${ED%/}/usr/share/kag/rungame.sh" "/usr/bin/kag"

For license you should add a kag license file in your local overlay in licenses directory (/usr/local/portage/licenses) with kag EULA (you can get EULA here), and then
Code:
LICENSE="kag"

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Wed Nov 14, 2018 7:38 am    Post subject: Reply with quote

Another thing, probably the version o ebuild is better to add a date (ex. kag-20181114.ebuild) and not 9999, in this way you can versioning your package and get update from portage
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Wed Nov 14, 2018 3:02 pm    Post subject: Reply with quote

What is ${ED%/} ?

I have this problem when i try to emerge it ... :?

Code:
fulgurance@msi-gs73vr-6rf ~ $ sudo emerge --ask kag

These are the packages that would be merged, in order:

Calculating dependencies                                          ... done!
[ebuild  N     ] games-action/kag-20181114

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) games-action/kag-20181114::fulgurance-overlay
 * kag-20181114.tgz BLAKE2B SHA512 size ;-) ...                                                              [ ok ]
>>> Unpacking source...
>>> Unpacking kag-20181114.tgz to /var/tmp/portage/games-action/kag-20181114/work
>>> Source unpacked in /var/tmp/portage/games-action/kag-20181114/work
 * ERROR: games-action/kag-20181114::fulgurance-overlay failed (prepare phase):
 *   The source directory '/var/tmp/portage/games-action/kag-20181114/work/kag-20181114' doesn't exist
 *
 * Call stack:
 *            ebuild.sh, line  792:  Called __ebuild_main 'prepare'
 *   phase-functions.sh, line 1068:  Called __dyn_prepare
 *   phase-functions.sh, line  384:  Called die
 * The specific snippet of code:
 *              die "The source directory '${S}' doesn't exist"
 *
 * If you need support, post the output of `emerge --info '=games-action/kag-20181114::fulgurance-overlay'`,
 * the complete build log and the output of `emerge -pqv '=games-action/kag-20181114::fulgurance-overlay'`.
 * The complete build log is located at '/var/tmp/portage/games-action/kag-20181114/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/games-action/kag-20181114/temp/environment'.
 * Working directory: '/var/tmp/portage/games-action/kag-20181114/homedir'
 * S: '/var/tmp/portage/games-action/kag-20181114/work/kag-20181114'

>>> Failed to emerge games-action/kag-20181114, Log file:

>>>  '/var/tmp/portage/games-action/kag-20181114/temp/build.log'

 * Messages for package games-action/kag-20181114:

 * ERROR: games-action/kag-20181114::fulgurance-overlay failed (prepare phase):
 *   The source directory '/var/tmp/portage/games-action/kag-20181114/work/kag-20181114' doesn't exist
 *
 * Call stack:
 *            ebuild.sh, line  792:  Called __ebuild_main 'prepare'
 *   phase-functions.sh, line 1068:  Called __dyn_prepare
 *   phase-functions.sh, line  384:  Called die
 * The specific snippet of code:
 *              die "The source directory '${S}' doesn't exist"
 *
 * If you need support, post the output of `emerge --info '=games-action/kag-20181114::fulgurance-overlay'`,
 * the complete build log and the output of `emerge -pqv '=games-action/kag-20181114::fulgurance-overlay'`.
 * The complete build log is located at '/var/tmp/portage/games-action/kag-20181114/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/games-action/kag-20181114/temp/environment'.
 * Working directory: '/var/tmp/portage/games-action/kag-20181114/homedir'
 * S: '/var/tmp/portage/games-action/kag-20181114/work/kag-20181114'
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Wed Nov 14, 2018 4:16 pm    Post subject: Reply with quote

Fulgurance wrote:
What is ${ED%/} ?

ED: Shorthand for ${D%/}${EPREFIX}/.

Fulgurance wrote:
I have this problem when i try to emerge it ... :?

Yes because program is unpacked directly in workdir, the you should overwrite variable S (default is ${WORKDIR}/${P}) with S="${WORKDIR}"

Maybe best place for this game is /opt/kag not /usr/share/kag because is a precompiled software
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Wed Nov 14, 2018 5:19 pm    Post subject: Reply with quote

Okay, good.

Now, it's possible to emerge it, but i have this error:

Code:
fulgurance@msi-gs73vr-6rf ~/Documents/Gentoo/Overlay/games-action/kag $ sudo emerge --ask kag

These are the packages that would be merged, in order:

Calculating dependencies... done!                       
[ebuild  N     ] games-action/kag-20181114

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) games-action/kag-20181114::fulgurance-overlay
 * kag-20181114.tgz BLAKE2B SHA512 size ;-) ...                          [ ok ]
>>> Unpacking source...
>>> Unpacking kag-20181114.tgz to /var/tmp/portage/games-action/kag-20181114/work
>>> Source unpacked in /var/tmp/portage/games-action/kag-20181114/work
>>> Preparing source in /var/tmp/portage/games-action/kag-20181114/work ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/games-action/kag-20181114/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/games-action/kag-20181114/work ...
>>> Source compiled.
>>> Test phase [not enabled]: games-action/kag-20181114

>>> Install kag-20181114 into /var/tmp/portage/games-action/kag-20181114/image category games-action
/var/tmp/portage/games-action/kag-20181114/temp/environment: line 478: make_desktop_entry: command not found
>>> Completed installing kag-20181114 into /var/tmp/portage/games-action/kag-20181114/image

 * Final size of build directory: 66340 KiB (64.7 MiB)
 * Final size of installed tree:  66336 KiB (64.7 MiB)

 * QA Notice: command not found:
 *
 *      /var/tmp/portage/games-action/kag-20181114/temp/environment: line 478: make_desktop_entry: command not found
scanelf: rpath_security_checks(): Maybe? sec problem with DT_RPATH='D_LIBRARY_PATH:lib' in /var/tmp/portage/games-action/kag-20181114/image/opt/kag/libJuxta.so
scanelf: rpath_security_checks(): Maybe? sec problem with DT_RPATH='lib' in /var/tmp/portage/games-action/kag-20181114/image/opt/kag/libJuxta.so

 * QA Notice: The following files contain runtime text relocations
 *  Text relocations force the dynamic linker to perform extra
 *  work at startup, waste system resources, and may pose a security
 *  risk.  On some architectures, the code may not even function
 *  properly, if at all.
 *  For more information, see:
 *
 *    https://wiki.gentoo.org/wiki/Hardened/HOWTO_locate_and_fix_textrels
 *
 *  Please include the following list of files in your report:
 * TEXTREL opt/kag/libJuxta.so
 * TEXTREL opt/kag/lib/libIrrKlang.so

making executable: /opt/kag/lib/libIrrKlang.so
making executable: /opt/kag/lib/libpng15.so
making executable: /opt/kag/lib/libsteam_api.so


 * QA Notice: Pre-stripped files found:
 * /opt/kag/libJuxta.so
 * /opt/kag/KAG
 * /opt/kag/lib/libIrrKlang.so
strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   /opt/kag/lib/libpng15.so
   /opt/kag/lib/libsteam_api.so
scanelf: rpath_security_checks(): Maybe? sec problem with DT_RPATH='D_LIBRARY_PATH:lib' in /var/tmp/portage/games-action/kag-20181114/image/opt/kag/libJuxta.so
scanelf: rpath_security_checks(): Maybe? sec problem with DT_RPATH='lib' in /var/tmp/portage/games-action/kag-20181114/image/opt/kag/libJuxta.so

>>> Installing (1 of 1) games-action/kag-20181114::fulgurance-overlay
>>> Setting SELinux security labels

>>> Recording games-action/kag in "world" favorites file...
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.


My file:
Code:
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="2D MMORPG about mining resources, building castles and destroying your enemies"
HOMEPAGE="https://www.kag2d.com/en/"
KEYWORDS="~amd64"
LICENSE="EULA"
SLOT="0"
SRC_URI="http://dl.kag2d.com/kag-linux32-client-release.tar.gz -> ${P}.tgz"
S="${WORKDIR}"

src_install()
{
        insinto "/opt/kag"
        dodir "/opt/kag"
        doins -r "App"
        doins -r "Base"
        doins -r "Docs"
        doins -r "lib"
        doins -r "Manual"
        doins -r "Mods"
        doins -r "Security"
        doins "autoupdate_ignore_custom.cfg"
        doins "autoupdate_ignore.cfg"
        doins "curl-ca-bundle.crt"
        doins "curl-license.txt"
        doins "forceupdate.sh"
        doins "irrlicht.ico"
        doins "KAG"
        doins "libJuxta.so"
        doins "mods.cfg"
        doins "nolauncher.sh"
        doins "readme.txt"
        doins "rungame.sh"
        doins "runlocalhost.sh"
        doins "steam_appid.txt"
        doins "terms.txt"
        dosym "${ED%/}/opt/kag/rungame.sh" "/usr/bin/kag"
        make_desktop_entry "kag" "KAG" "/opt/kag/KAG.ico" "Game" "Comment='2D MMORPG about mining resources, building castles and destroying your enemies'"
}


And i have problem with permission:
Code:
fulgurance@msi-gs73vr-6rf ~ $ kag
bash: /usr/bin/kag: Permission non accordée


Kag desktop entrie have problem and isn't created
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Wed Nov 14, 2018 7:22 pm    Post subject: Reply with quote

For QA notice you should add a list of prebuilded file
Code:
QA_PREBUILT="
   opt/kag/libJuxta.so
   opt/kag/KAG
   opt/kag/lib/libIrrKlang.so
   opt/kag/lib/libpng15.so
   opt/kag/lib/libsteam_api.so
"


Code:
scanelf: rpath_security_checks(): Maybe? sec problem with DT_RPATH='D_LIBRARY_PATH:lib' in /var/tmp/portage/games-action/kag-20181114/image/opt/kag/libJuxta.so
scanelf: rpath_security_checks(): Maybe? sec problem with DT_RPATH='lib' in /var/tmp/portage/games-action/kag-20181114/image/opt/kag/libJuxta.so

This is a security warning but there's nothing you can do because is a precompiled library

Quote:
And i have problem with permission:
Code:
fulgurance@msi-gs73vr-6rf ~ $ kag
bash: /usr/bin/kag: Permission non accordée

The problem is that you install .sh and KAG executable without execute permission, to made it you should use exeinto and doexe
Code:
exeinto "/opt/kag"
doexe "runlocalhost.sh"
doexe "rungame.sh"
doexe "KAG"


Quote:
Kag desktop entrie have problem and isn't created

Desktop file isn't created because you should inherit desktop.eclass in ebuild and the correct command is make_desktop_entry "kag" "KAG" "/opt/kag/KAG.ico" "Game".
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Wed Nov 14, 2018 11:08 pm    Post subject: Reply with quote

Okay, thanks for your advices. And is it possible to add more option on desktop file ?

I have added this, but the same result, i'm not allowed with normal account to execute kag without sudo...
And desktop entrie isn't created.

Code:
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="2D MMORPG about mining resources, building castles and destroying your enemies"
HOMEPAGE="https://www.kag2d.com/en/"
KEYWORDS="~amd64"
LICENSE="EULA"
SLOT="0"
SRC_URI="http://dl.kag2d.com/kag-linux32-client-release.tar.gz -> ${P}.tgz"
S="${WORKDIR}"
QA_PREBUILT="
   opt/kag/libJuxta.so
   opt/kag/KAG
   opt/kag/lib/libIrrKlang.so
   opt/kag/lib/libpng15.so
   opt/kag/lib/libsteam_api.so
"

src_install()
{
        insinto "/opt/kag"
   exeinto "/opt/kag"
   doexe "runlocalhost.sh"
   doexe "rungame.sh"
   doexe "KAG"
        dodir "/opt/kag"
        doins -r "App"
        doins -r "Base"
        doins -r "Docs"
        doins -r "lib"
        doins -r "Manual"
        doins -r "Mods"
        doins -r "Security"
        doins "autoupdate_ignore_custom.cfg"
        doins "autoupdate_ignore.cfg"
        doins "curl-ca-bundle.crt"
        doins "curl-license.txt"
        doins "forceupdate.sh"
        doins "irrlicht.ico"
        doins "KAG"
        doins "libJuxta.so"
        doins "mods.cfg"
        doins "nolauncher.sh"
        doins "readme.txt"
        doins "rungame.sh"
        doins "runlocalhost.sh"
        doins "steam_appid.txt"
        doins "terms.txt"
        dosym "${ED%/}/opt/kag/rungame.sh" "/usr/bin/kag"
        make_desktop_entry "kag" "KAG" "/opt/kag/KAG.ico" "Game"
}
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Thu Nov 15, 2018 1:17 am    Post subject: Reply with quote

Fulgurance wrote:
I have added this, but the same result, i'm not allowed with normal account to execute kag without sudo...
What user does sudo run this as? I hope you aren't running it as root. What exactly fails when you try to run it as yourself?
Fulgurance wrote:
And desktop entrie isn't created.
This is because make_desktop_entry is not defined, so it does not work. As fedeliallalinea said above, you need to inherit the eclass that provides it before you can use it.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Thu Nov 15, 2018 2:07 am    Post subject: Reply with quote

When i typed 'kag' on my terminal, terminal ask me i'm not allowed to execute this command.

Yes, you ask me inherit the eclass, but i don't understand what is inherit eclass... it's my first ebuilds, i don't know the ebuild vocabulary
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Thu Nov 15, 2018 6:41 am    Post subject: Reply with quote

Fulgurance wrote:
When i typed 'kag' on my terminal, terminal ask me i'm not allowed to execute this command.

Because you add
Code:
   doexe "runlocalhost.sh"
   doexe "rungame.sh"
   doexe "KAG"

but you left also
Code:
        doins "KAG"
        doins "nolauncher.sh"
        doins "rungame.sh"
        doins "runlocalhost.sh"

and these command overwrite doexe, then remove doins for these files

Fulgurance wrote:
Yes, you ask me inherit the eclass, but i don't understand what is inherit eclass... it's my first ebuilds, i don't know the ebuild vocabulary

After EAPI=7 you should add
Code:
inherit desktop

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Thu Nov 15, 2018 11:17 am    Post subject: Reply with quote

Oh okay! I understand.
Now, it's good, desktop entrie was created. But i have again problem with kag execution. I have checked with information, kag is marked executable, but when i launch it, i have this problem:

Code:
fulgurance@msi-gs73vr-6rf /usr/local/portage/games-action/kag $ kag
Running KAG
KAG isn't executable. Fixing...
chmod: impossible d'accéder à 'KAG': Aucun fichier ou dossier de ce type
Shared library libpng.so will be preloaded from the following path:
lib/libpng15.so
/usr/bin/kag: ligne 19: ./KAG: Aucun fichier ou dossier de ce type


Code:
fulgurance@msi-gs73vr-6rf /usr/local/portage/games-action/kag $ ls -l /opt/kag/
total 14924
drwxr-xr-x.  2 root root     4096 15 nov.  12:11 App
-rw-r--r--.  1 root root      372 15 nov.  12:10 autoupdate_ignore.cfg
-rw-r--r--.  1 root root      152 15 nov.  12:10 autoupdate_ignore_custom.cfg
drwxr-xr-x. 11 root root     4096 15 nov.  12:11 Base
-rw-r--r--.  1 root root   215997 15 nov.  12:10 curl-ca-bundle.crt
-rw-r--r--.  1 root root     1268 15 nov.  12:10 curl-license.txt
drwxr-xr-x.  2 root root     4096 15 nov.  12:11 Docs
-rw-r--r--.  1 root root      482 15 nov.  12:10 forceupdate.sh
-rw-r--r--.  1 root root     1150 15 nov.  12:10 irrlicht.ico
-rwxr-xr-x.  1 root root  4001184 15 nov.  12:10 KAG
drwxr-xr-x.  2 root root     4096 15 nov.  12:11 lib
-rw-r--r--.  1 root root 10978776 15 nov.  12:10 libJuxta.so
drwxr-xr-x.  2 root root     4096 15 nov.  12:11 Manual
drwxr-xr-x.  6 root root     4096 15 nov.  12:11 Mods
-rw-r--r--.  1 root root      111 15 nov.  12:10 mods.cfg
-rwxr-xr-x.  1 root root      428 15 nov.  12:10 nolauncher.sh
-rw-r--r--.  1 root root     1294 15 nov.  12:10 readme.txt
-rwxr-xr-x.  1 root root      410 15 nov.  12:10 rungame.sh
-rwxr-xr-x.  1 root root      422 15 nov.  12:10 runlocalhost.sh
drwxr-xr-x.  2 root root     4096 15 nov.  12:11 Security
-rw-r--r--.  1 root root        6 15 nov.  12:10 steam_appid.txt
-rw-r--r--.  1 root root     4586 15 nov.  12:10 terms.txt


Code:
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit desktop
DESCRIPTION="2D MMORPG about mining resources, building castles and destroying your enemies"
HOMEPAGE="https://www.kag2d.com/en/"
KEYWORDS="~amd64"
LICENSE="EULA"
SLOT="0"
SRC_URI="http://dl.kag2d.com/kag-linux32-client-release.tar.gz -> ${P}.tgz"
S="${WORKDIR}"
QA_PREBUILT="
   opt/kag/libJuxta.so
   opt/kag/KAG
   opt/kag/lib/libIrrKlang.so
   opt/kag/lib/libpng15.so
   opt/kag/lib/libsteam_api.so
"

src_install()
{
        insinto "/opt/kag"
   exeinto "/opt/kag"
        dodir "/opt/kag"
        doins -r "App"
        doins -r "Base"
        doins -r "Docs"
        doins -r "lib"
        doins -r "Manual"
        doins -r "Mods"
        doins -r "Security"
        doins "autoupdate_ignore_custom.cfg"
        doins "autoupdate_ignore.cfg"
        doins "curl-ca-bundle.crt"
        doins "curl-license.txt"
        doins "forceupdate.sh"
        doins "irrlicht.ico"
        doexe "KAG"
        doins "libJuxta.so"
        doins "mods.cfg"
        doexe "nolauncher.sh"
        doins "readme.txt"
        doexe "rungame.sh"
        doexe "runlocalhost.sh"
        doins "steam_appid.txt"
        doins "terms.txt"
        dosym "${ED%/}/opt/kag/rungame.sh" "/usr/bin/kag"
        make_desktop_entry "kag" "KAG" "/opt/kag/irrlicht.ico" "Game"
}
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Thu Nov 15, 2018 11:25 am    Post subject: Reply with quote

Fulgurance wrote:
Now, it's good, desktop entrie was created. But i have again problem with kag execution. I have checked with information, kag is marked executable, but when i launch it, i have this problem:

This because the script is intended to be launched directly in the kag directory (see latest line of script with ./KAG)
Code:
#!/bin/bash
echo "Running KAG"
cd "$(dirname $0)"

if [ ! -x KAG ]; then
        echo "KAG isn't executable. Fixing..."
        chmod +x KAG
else
        echo "KAG is already executable. Proceeding..."
fi

# setting libpng path
libdir="lib/libpng15.so"
export LD_PRELOAD="${libdir}"
echo "Shared library libpng.so will be preloaded from the following path:"
echo $LD_PRELOAD

# exec passing all the arguments from script
./KAG "$@"

One possible solution is try to create symlink directly to KAG executable (you can install libpng15 because in gentoo is slotted emerge -1 media-libs/libpng:1.5)
Code:
dosym "${ED%/}/opt/kag/KAG" "/usr/bin/kag"

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Thu Nov 15, 2018 11:53 am    Post subject: Reply with quote

No, i have already tested that, but launcher need to launch rungame.sh before, or update client fail...
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30889
Location: here

PostPosted: Thu Nov 15, 2018 12:52 pm    Post subject: Reply with quote

Fulgurance wrote:
No, i have already tested that, but launcher need to launch rungame.sh before, or update client fail...

In this case you should use sed in src_prepare() for change relative path with absolute path
Code:
src_prepare() {
    default
    local FILE
    for FILE in *.sh; do
        sed -i -e 's/\.\/KAG/\/opt\/kag\/KAG/' \
            -e 's/lib\//\/opt\/kag\/lib/' \
            -e 's/Scripts/\/opt\/Scripts/' "${FILE}"
    done
}

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Fulgurance
Veteran
Veteran


Joined: 15 Feb 2017
Posts: 1199

PostPosted: Thu Nov 15, 2018 2:24 pm    Post subject: Reply with quote

This package is hard ... i'm happy you help me, it's hard for me...

When i run application, window is openned and this window only show black screen, and terminal block with this message:

Code:
fulgurance@msi-gs73vr-6rf /usr/local/portage/games-action/kag $ kag
Running KAG
KAG isn't executable. Fixing...
chmod: impossible d'accéder à 'KAG': Aucun fichier ou dossier de ce type
Shared library libpng.so will be preloaded from the following path:
/opt/kag/liblibpng15.so
ERROR: ld.so: object '/opt/kag/liblibpng15.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
PID: 26055
Starting in directory: /usr/bin/
Engine
File not found startup_config.cfg - creating...

Creating video device...
Irrlicht Engine version 1.8.0-alpha
Linux 4.19.2-gentoo #1 SMP Wed Nov 14 16:13:48 CET 2018 x86_64
Using renderer: OpenGL 3.0
Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2) : Intel Open Source Technology Center
OpenGL driver version is 1.2 or better.
GLSL version: 1.3
Unable to open gui file: Base/GUI/guiStarter.xml
Could not open file of texture: Base/GUI/MenuItems.png
Could not open file of texture: Base/GUI/Starter_Gradient.png
Could not find autoupdate_ignore.cfg

Not using autoupdate_ignore_custom.cfg

Downloading checksums from http://update.kag2d.com/1/linux32-client-release/App/version.txt

CCurl: Failed to create file App/version.txt (err: 2)
Error downloading checksum from http://update.kag2d.com/1/linux32-client-release/App/version.txt (err:1)


Code:
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit desktop
DESCRIPTION="2D MMORPG about mining resources, building castles and destroying your enemies"
HOMEPAGE="https://www.kag2d.com/en/"
KEYWORDS="~amd64"
LICENSE="EULA"
SLOT="0"
SRC_URI="http://dl.kag2d.com/kag-linux32-client-release.tar.gz -> ${P}.tgz"
S="${WORKDIR}"
QA_PREBUILT="
   opt/kag/libJuxta.so
   opt/kag/KAG
   opt/kag/lib/libIrrKlang.so
   opt/kag/lib/libpng15.so
   opt/kag/lib/libsteam_api.so
"
src_prepare() {
    default
    local FILE
    for FILE in *.sh; do
        sed -i -e 's/\.\/KAG/\/opt\/kag\/KAG/' \
            -e 's/lib\//\/opt\/kag\/lib/' \
            -e 's/Scripts/\/opt\/Scripts/' "${FILE}"
    done
}

src_install()
{
        insinto "/opt/kag"
   exeinto "/opt/kag"
        dodir "/opt/kag"
        doins -r "App"
        doins -r "Base"
        doins -r "Docs"
        doins -r "lib"
        doins -r "Manual"
        doins -r "Mods"
        doins -r "Security"
        doins "autoupdate_ignore_custom.cfg"
        doins "autoupdate_ignore.cfg"
        doins "curl-ca-bundle.crt"
        doins "curl-license.txt"
        doins "forceupdate.sh"
        doins "irrlicht.ico"
        doexe "KAG"
        doins "libJuxta.so"
        doins "mods.cfg"
        doexe "nolauncher.sh"
        doins "readme.txt"
        doexe "rungame.sh"
        doexe "runlocalhost.sh"
        doins "steam_appid.txt"
        doins "terms.txt"
        dosym "${ED%/}/opt/kag/rungame.sh" "/usr/bin/kag"
        make_desktop_entry "kag" "KAG" "/opt/kag/irrlicht.ico" "Game"
}
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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