
Oh darn you're right!lars_the_bear wrote:It seems to me that this program just saves in the current working directory. I don't think it will necessarily save in /var/db/repos... -- perhaps that's just where the program gets launched?

This program, Unciv, writes in the CWD. I checked in the source. I presume that /var/db/repos just happened to be the CWD when testing the .ebuild.logrusx wrote:You're both wrong. /var/db/repos is where the ebuild resides, not where the program is launched from. It must be launched at worst in the current user's home directory.
The ebuild is a bash script which is executed in a special environment. Portage creates that environment. It doesn't run in /var/db/repos. The closest is PORTAGE_TEMPDIR, but then it's portage that runs inside it, not the program. That's just wrong assumption OP made.lars_the_bear wrote:I presume that /var/db/repos just happened to be the CWD when testing the .ebuild.

I wouldn't presume to speak for the OP, but I'm guessing he/she ran 'emerge my_thing' in the same directory as the .ebuild file, and then ran 'java -jar /path/to/my_thing.jar' to test it. Presumably as root (?).logrusx wrote:The ebuild is a bash script which is executed in a special environment. Portage creates that environment. It doesn't run in /var/db/repos. The closest is PORTAGE_TEMPDIR, but then it's portage that runs inside it, not the program. That's just wrong assumption OP made.lars_the_bear wrote:I presume that /var/db/repos just happened to be the CWD when testing the .ebuild.
As I said, ebuilds are run in a special environment, so it doesn't matter from which directory you run emerge.lars_the_bear wrote: I wouldn't presume to speak for the OP, but I'm guessing he/she ran 'emerge my_thing' in the same directory as the .ebuild file
That's not testing the ebuild, that's running the program itself.lars_the_bear wrote:, and then ran 'java -jar /path/to/my_thing.jar' to test it. Presumably as root (?).

I think I got what you meant, I should have misunderstood it in the beginning. OP is probably testing the program while still in /var/db/repos as root, is that what you meant? I was just caught up in portage terminology and stuff.lars_the_bear wrote:It's testing that the ebuild resulted in an installation in which the program can be run. But that's just a matter of semantics, isn't it?logrusx wrote: That's not testing the ebuild, that's running the program itself.
BR, Lars.

That was my guess, yes. But my guesses have been known to be wronglogrusx wrote:OP is probably testing the program while still in /var/db/repos as root, is that what you meant? I was just caught up in portage terminology and stuff.
Code: Select all
#!/bin/sh
set -eu
mkdir -m700 -p ~/.local ~/.local/share ~/.local/share/unciv
cd ~/.local/share/unciv
exec java -jar /path/to/unciv.jarSure, take a look https://bpa.st/W6RQlogrusx wrote: You should not launch the program in the ebuild. Please show us your ebuild, there might be better ways to do what you've done.
Best Regards,
Georgi
Code: Select all
#!/bin/bash
gjl_package=unciv-bin
gjl_jar="unciv-bin.jar"
source /usr/share/java-config-2/launcher/launcher.ba
For a launcher look for java-pkg_dolauncher on https://devmanual.gentoo.org/eclass-ref ... -2.eclass/g047 wrote:Sure, take a look https://bpa.st/W6RQ
But I'm not launching the program from the ebuild itself afaik
For reference, the original unciv launcher in /usr/bin/unciv isCode: Select all
#!/bin/bash gjl_package=unciv-bin gjl_jar="unciv-bin.jar" source /usr/share/java-config-2/launcher/launcher.ba