View previous topic :: View next topic |
Author |
Message |
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Mon Oct 12, 2015 11:48 pm Post subject: access problem in ebuild [SOLVED] |
|
|
I'm trying to write an ebuild for an open source project that's not in the tree or overlay. This project uses "gradle" not autotools. It builds fine outside of portage and runs too. However the ebuild dies with a permission error in the latest iteration which at least is an improvement over hanging in "doins" Here is the error message: Code: | BUILD SUCCESSFUL
Total time: 1.981 secs
/var/tmp/portage/media-tv/sagetv-9999/work/sagetv/build
>>> Source compiled.
>>> Test phase [not enabled]: media-tv/sagetv-9999
>>> Install sagetv-9999 into /var/tmp/portage/media-tv/sagetv-9999/image/ category media-tv
* Copying installation files into installation directory
* Installing into /opt
cp: cannot stat ‘/var/tmp/portage/media-tv/sagetv-9999/work/sagetv/build/clientrelease/*’: No such file or directory
* ERROR: media-tv/sagetv-9999::local-overlay failed (install phase):
* Install client files failed!
*
* Call stack:
* ebuild.sh, line 93: Called src_install
* environment, line 2262: Called die
* The specific snippet of code:
* cp -R "${S}/sagetv/build/clientrelease/*" "${D}" || die "Install client files failed!";
*
* If you need support, post the output of `emerge --info '=media-tv/sagetv-9999::local-overlay'`,
* the complete build log and the output of `emerge -pqv '=media-tv/sagetv-9999::local-overlay'`.
* The complete build log is located at '/var/tmp/portage/media-tv/sagetv-9999/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/media-tv/sagetv-9999/temp/environment'.
* Working directory: '/var/tmp/portage/media-tv/sagetv-9999/work'
* S: '/var/tmp/portage/media-tv/sagetv-9999/work'
>>> Failed to emerge media-tv/sagetv-9999, Log file:
>>> '/var/tmp/portage/media-tv/sagetv-9999/temp/build.log'
|
Here is the directory that portage says it can't stat: Code: | CASTI sagetv # ls /var/tmp/portage/media-tv/sagetv-9999/work/sagetv/build/clientrelease/
gluegen-rt-2.3.1.jar gluegen-rt-main-2.3.1.jar jogl-all-2.3.1-natives-linux-i586.jar libjtux.so MiniClient.jar
gluegen-rt-2.3.1-natives-linux-amd64.jar jogl-all-2.3.1.jar jogl-all-main-2.3.1.jar libSage.so README
gluegen-rt-2.3.1-natives-linux-i586.jar jogl-all-2.3.1-natives-linux-amd64.jar libImageLoader.so libswscale.so sageclient.sh
|
And the install portion of the ebuild (obviously I've been trying various things): Code: | src_install() {
mkdir ${D}/sagetv
mkdir ${D}/sagetv/client
mkdir ${D}/sagetv/server
einfo "Copying installation files into installation directory"
cp -R ${S}/sagetv/build/clientrelease/* ${D}/sagetv/client
cp -R ${S}/sagetv/build/minirelease/*.jar ${D}/sagetv/client
cp -R ${S}/sagetv/build/serverrelease/* ${D}/sagetv/server
einfo "Installing into /opt"
#insinto /opt
dodir /opt/sagetv/client
cp -R "${S}/sagetv/build/clientrelease/*" "${D}"|| die "Install client files failed!"
cp "${S}/sagetv/build/minirelease/*.jar" "${D}"|| die "Install jar files failed!"
dodir /opt/sagetv/server
cp -R "${S}/sagetv/build/serverrelease/*" "${D}"|| die "Install server files failed!"
# doins -r ${D}
einfo "Installing daemon files"
insinto /etc
doins -r ${S}/sagetv/build/ubuntufiles/server/etc/*
# still need to do desktop pixmaps and share
# doins -r ${S}/sagetv
# doins -r ${WORKDIR}/sagetv/build/clientfiles
# doins -r ${WORKDIR}/sagetv/build/serverfiles
# doins -r ${S}/sagetv/
# cp -R "${WORKDIR}/usr" "${D}" || die "install failed!"
}
|
And the build log https://bpaste.net/show/9fb87a26a3dd
Last edited by Tony0945 on Wed Nov 25, 2015 1:54 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21630
|
Posted: Tue Oct 13, 2015 1:24 am Post subject: |
|
|
The directory you showed has no file named *, so the failure of cp is expected. When you quote a glob, the glob is not expanded. On the assumption that you meant to copy all the files in that directory, rather than a single file with the name of *, then the solution is to place the * outside the quotes, but the variable expansions inside the quotes. |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Sat Jan 14, 2017 9:46 pm Post subject: Re: access problem in ebuild [SOLVED] |
|
|
Tony0945 wrote: | I'm trying to write an ebuild for an open source project that's not in the tree or overlay. This project uses "gradle" not autotools. It builds fine outside of portage and runs too. However the ebuild dies with a permission error in the latest iteration which at least is an improvement over hanging in "doins" Here is the error message:[code]BUILD SUCCESSFUL
|
I know it's been a while since you posted this, but were you successful in creating a sagetv ebuild?
I've gotten a 64-bit v9 sagetv server running running using the binaries I downloaded and some custom openrc init scripts, but I'd rather have a "real" setup based on an ebuild... |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Jan 14, 2017 9:51 pm Post subject: |
|
|
Unfortunately "no" I can build but it doesn't run. See this thread https://forums.sagetv.com/forums/showthread.php?t=63730
If you wish, I can post the ebuild if you want to try and fix it. I know nothing of Java, which definitely doesn't help. |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Sat Jan 14, 2017 10:05 pm Post subject: |
|
|
Quote: | If you wish, I can post the ebuild if you want to try and fix it. I know nothing of Java, which definitely doesn't help. |
Does the ebuild build the sagetv server from sources, or is it doing a binary install from a downloaded .deb or .tar.gz file?
Installing on a 64-bit Gentoo test system from sagetv-server_9.0.12_amd64.tar.gz was pretty trivial: all I did was create an empty directory at /opt/sagetv/server, unpack thar .tar.gz file into that directory, and then start it. I may have just gotten lucky and already had the right prerequisites. I'm currently re-installing Gentoo to convert my "production" server machine from 32 to 64 bits. Once that's done and I have sagetv running again, I would be happy to take a look at the .ebuild to see if I can get it to work. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Jan 14, 2017 10:15 pm Post subject: |
|
|
Here is my latest ebuild http://dpaste.com/2Z4YN40 Maybe you can figure out what's wrong. As you can see from the Sage forum thread, somethings wrong with environment settings and paths. But it does build. |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Sun Jan 22, 2017 2:12 am Post subject: |
|
|
I have some time this weekend to work on a sagetv ebuild, but that link doesn't work. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Jan 22, 2017 4:58 pm Post subject: |
|
|
GrantEdwards wrote: | I have some time this weekend to work on a sagetv ebuild, but that link doesn't work. |
Must have expired. Here is a new one. http://dpaste.com/026AW7Y
EDIT: update version to 536 |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Sun Jan 22, 2017 5:37 pm Post subject: |
|
|
Thanks, got it.
After glancing through it, the first thing I noticed was that it seems
you skipped the build of the stuff in the "thirdparty" directory. I
was particularly interested in how you solved the problems building
mplayer.
By default, the sagetv thirdparty build script will build an old
legacy version of mplayer (which requires ancient png and gif
libraries that aren't available in Gentoo).
Or, it can grab a more recent version of mplayer and ffmpeg sources
from the sagetv git repository and build mplayer with those.
Unfortunately, the git repo seems to be broken at the moment. The
ffmpeg sources it contains are incompatible with the mplayer sources
it contains.
Where are you getting the sagetv mplayer binary from?
AFAIK, you can't use a generic mplayer executable with sagetv. The
sagetv fork of mplayer has some custom video-output modules that are
specific to sagetv. I don't know exactly what sagetv uses mplayer
for. It doesn't seem to be involved in playback of recorded ATSC
programs on HD200 clients. It may be used for playback of other
formats or with other types of clients.
The thirdparty tree also builds an ffmpeg command-line utility. I
don't know if sagetv can use a modern/generic ffmpeg utility or if it
requires it's own custom version like it does with mplayer.
--
Grant |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Sun Jan 22, 2017 7:49 pm Post subject: |
|
|
GrantEdwards wrote: |
After glancing through it, the first thing I noticed was that it seems
you skipped the build of the stuff in the "thirdparty" directory. I
was particularly interested in how you solved the problems building
mplayer.
|
I just realized that if you were doing a server-only install, you
don't need mplayer. What I don't yet know is whether the mplayer
version of ffmpeg is special in any way or if the "generic" Gentoo
ffmpeg will work.
I've never been able to get gradle to build a .jar file, and I don't
know enough about gradle and Java to solve that. So, I'm probably
stuck unless I change the ebuild to download the .jar files.
That might not be a bad option, since I think the .jar files
should be a lot more system-independent than the amd64/x86 binaries.
--
Grant |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Jan 22, 2017 10:12 pm Post subject: |
|
|
I was worried about messing the system mplayer and libraries. I see now that you have shown how to extract from the .deb that everything is installed to /opt/sagetv.
I generated a list of files from the ebuild and from the deb and ran 'meld' on them to see the differences. I made these notes:
Quote: | binary install does not install /opt/sagetv/client files
binary install does not install /opt/sagetv/server/clientfiles files
binary install does not install /opt/sagetv/server/sagetv
source install does not install /opt/sagetv/server/JARs files
source install does not install /opt/sagetv/server/ffmpeg
source install does not install /opt/sagetv/server/irtunerplugins files
source install wrongly installs buildfiles
|
Regarding jar files, I don't think building from source would optimize them anyway.
This ebuild used to build but now fails (I commented out the "die"). When it worked, I was using gcc 4.9, now I'm using 5.4 but I don't think that's the problem. I think it's dependencies. |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Mon Jan 23, 2017 1:47 am Post subject: |
|
|
Tony0945 wrote: | I was worried about messing the system mplayer and
libraries. I see now that you have shown how to extract from the .deb
that everything is installed to /opt/sagetv. |
I didn't use the .deb, I used the generic Linux .tar.gz binary
distribution from https://dl.bintray.com/opensagetv/sagetv/sagetv/. My
install is described at https://forums.sagetv.com/forums/showthread.php?t=63946.
Doing a binary install consists of creating /opt/sagetv/server,
unpacking the tar file into that directory, and then installing
systemd or openrc files to call the start/stop scripts that are in
/opt/sagetv/server. An ebuild to do that would be pretty easy.
Quote: |
I generated a list of files from the ebuild and from the deb and ran
'meld' on them to see the differences. I made these notes:
Quote: | binary install does not install /opt/sagetv/client files
binary install does not install /opt/sagetv/server/clientfiles files
binary install does not install /opt/sagetv/server/sagetv
|
|
Those are all for the Linux "mini-client" (along with the custom
mplayer). The binary distribution of client stuff is seperate from
the server stuff.
Quote: |
Quote: |
source install does not install /opt/sagetv/server/JARs files
source install does not install /opt/sagetv/server/ffmpeg
source install does not install /opt/sagetv/server/irtunerplugins files
source install wrongly installs buildfiles
|
Regarding jar files, I don't think building from source would optimize
them anyway.
|
I think you're right. I wanted to try to do an ebuild to build the
binaries as a way to document/automate the installation of the
required libraries and to avoid compatibility issues. But, I've been
running SageTV binary installs on Gentoo for 8 years and haven't
really had any problems yet.
An ebuild for the binary install would still take care of making sure
the required libraries are installed and deal with the systemd/openrc
stuff, so that might be worth doing even if I give up on building
binaries and .jar files.
Quote: |
This ebuild used to build but now fails (I commented out the
"die"). When it worked, I was using gcc 4.9, now I'm using 5.4 but I
don't think that's the problem. I think it's dependencies.
|
Agreed. I got all the server stuff to build with gcc 4.9.4 except
mplayer.
The "old" mplayer fails fails because my version of libgif is too new.
That should be easy enough to solve, but you don't actually need
mplayer for a server install. Building the old mplayer required
libpng v1.2 include files (which the Gentoo libpng:1.2 package doesn't
install), so I had to download those.
I did have to rework the build3rdpary.sh script so it didn't use the
build hosts ffmpeg library when building codecs for ffmpeg. I suspect
that the native Gentoo ffmpeg would probably work, but I haven't tried
that.
I haven't tried building the client, but I did use a binary install of
the Linux mini-client to do my configuration. Watching recordings
doesn't quite work: there's audio but no video.
The mini-client install is trivial as well: create an empty directory,
unpack the tar file into it. You then start the client by running
"sagetv" script that's in that directory. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Mon Jan 23, 2017 3:40 pm Post subject: |
|
|
I had rather hoped that the Windows client would run under Wine. I'll start on a binary ebuild. As you say, it shouldn't be difficult.
This rather reminds me of Palemoon where the source ebuild took an ungodly amount of time and swap space (12G IIRC) and didn't run any better than the binary. The same was true of Firefox. The big time consumers were human interaction and ethernet traffic. The main attraction of the source ebuild would be moving to another CPU architecture. |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Mon Jan 23, 2017 3:49 pm Post subject: |
|
|
Tony0945 wrote: |
I had rather hoped that the Windows client would run under Wine. I'll start
on a binary ebuild. As you say, it shouldn't be difficult. |
One thing I'm not sure about is how upgrades should work. When upgrading my
binary installs, I usually moved by old installation to a backup directory,
did a clean install, reconfigured the server, then copied the Wiz.bin from
the old install directory to the new install directory.
There's a server installation script for Ubuntu that reportedly handles
upgrades properly (and doesn't require you to configure the server each
time). It might be worth looking at that.
The SageTv server install is very anti-Unix. The program's binary/library
files, user-modified configuration files, and database files, are all in
/opt/sagetv/server. Only the recorded programs are handled properly by being
placed somewhere else. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Mon Jan 23, 2017 6:51 pm Post subject: |
|
|
I doubt think the wiz.bin is part of the installation but rather is created, if needed, by the run-time. Replacing files is done automatically by portage, which is why I like to use local ebuilds for my own projects. |
|
Back to top |
|
|
GrantEdwards n00b
Joined: 14 Jan 2017 Posts: 13
|
Posted: Mon Jan 23, 2017 7:23 pm Post subject: |
|
|
Tony0945 wrote: | I doubt think the wiz.bin is part of the installation but rather is created, if
needed, by the run-time. |
Correct. Wiz.bin is not present in the binary distribution and is created with
default values the first time the server is started.
Quote: | Replacing files is done automatically by portage, which is why I like to use
local ebuilds for my own projects. |
I'm not aware of any files present in the binary distribution that are then
changed during configuration or operation, but I'm not certain there aren't any.
It would probably be a good idea if before replacing a file, portage can make
sure that file hasn't been modified since it was installed. I know it normally
does that for files under /etc.
--
Grant |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Tue Feb 07, 2017 3:25 pm Post subject: |
|
|
Grant, I found your post at the SageTV forums. I'm trying your third party script now. I have patches that fix the build everywhere else. Even without the 3rdparty, the daemon starts and runs. I ran the miniclient and it created a wiz.bin. At some time later it crashed, but this is a big improvement. Will contact further.
EDIT:
It crashed building mplayer but it looks like an easy fix. Code: | Checking for gcc-3.4 version ... not found
Checking for gcc-3.3 version ... not found
Checking for gcc-3.2 version ... not found
Checking for gcc-3.1 version ... not found
Checking for gcc3 version ... not found
Checking for gcc-3.0 version ... not found
Checking for cc version ... 5.4.0, bad
*** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
|
|
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Tue Feb 07, 2017 6:39 pm Post subject: |
|
|
GrantEdwards wrote: | I've never been able to get gradle to build a .jar file, and I don't
know enough about gradle and Java to solve that. So, I'm probably
stuck unless I change the ebuild to download the .jar files. |
Use this patch to fix that Code: | --- build.gradle.old 2017-02-06 12:02:08.030775885 -0600
+++ build.gradle 2017-02-06 12:50:35.100747753 -0600
@@ -303,13 +303,13 @@
if (OperatingSystem.current().isLinux()) {
// use git to find the build version
- ant.exec(
- command: 'git rev-list HEAD --count',
- os: 'Linux',
- failonerror: true,
- outputproperty: 'sagebuildnum')
+// ant.exec(
+// command: 'git rev-list HEAD --count',
+// os: 'Linux',
+// failonerror: true,
+// outputproperty: 'sagebuildnum')
- buildVer = ant.sagebuildnum
+ buildVer = 536;
}
if (buildVer == null) buildVer=0;
| It may be possible to use versionator and a shell variable to extract the build version automatically, but this works and is easy to update by hand.
BTW, I've got everything going except ffmpeg. I'm waiting until it all works to publish. |
|
Back to top |
|
|
|