Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ebuild copy file to configure path [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Skinjob2707
n00b
n00b


Joined: 07 Aug 2013
Posts: 57

PostPosted: Wed Jan 16, 2019 5:33 pm    Post subject: Ebuild copy file to configure path [SOLVED] Reply with quote

I'm trying to update the ebuild for forked-daap to upgrade from 23.2-r1 to 26.4. According to the INSTALL file, the configure script must have the following script in its path:
Code:
  #!/bin/sh
  CLASSPATH=...
exec /path/to/java -cp $CLASSPATH org.antlr.Tool "@"


Is there a way to copy a file from the packages files directory into the path of configure before the configure script is run? Does anyone know the right way to handle the CLASSPATH variable? Should it be hard coded into the file? Or is there some way the path should be determined by the ebuild?

Thanks for your help! 8O


Last edited by Skinjob2707 on Thu Jan 17, 2019 8:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21586

PostPosted: Thu Jan 17, 2019 3:43 am    Post subject: Reply with quote

Do you actually need that? According to the INSTALL document, that is a workaround if the build system cannot find the system antlr. The existing ebuild does not use such a wrapper. Do you have output that indicates that the lack of this wrapper in the new version is causing a problem?
Back to top
View user's profile Send private message
Skinjob2707
n00b
n00b


Joined: 07 Aug 2013
Posts: 57

PostPosted: Thu Jan 17, 2019 12:58 pm    Post subject: Reply with quote

Good question! I was relying on the documentation at: https://github.com/jasonmc/forked-daapd/blob/master/INSTALL . The section that starts
"Building from the git tree" includes the following:

Quote:
The configure script will look for a wrapper called antlr3 in the PATH to
invoke ANTLR3. If your installation of ANTLR3 does not come with such a
wrapper, create one as follows:

#!/bin/sh
CLASSPATH=...
exec /path/to/java -cp $CLASSPATH org.antlr.Tool "@"

Adjust the CLASSPATH as needed so that Java will find all the jars needed
by ANTLR3.

The parsers will be generated during the build, no manual intervention is
needed.


If I unpack the source code (forked-daapd-26.4.tar.gz) and run configure, I get the following output:
Quote:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for a sed that does not truncate output... /bin/sed
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/usr/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-linux-gnu/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gperf... /usr/bin/gperf
checking for antlr3... no
configure: error: antlr3 wrapper required, please install it.


Consequently, I don't see any way around it. Perhaps you see an alternative?

I've done a little research. The following line will copy the file into the working directory used by the ebuild:
Quote:
cp ${FILESDIR}/antlr3 ${S}


In that case, the file doesn't get executed because it isn't in the path. If I try and copy it into the path (e.g. /usr/local/bin), I get an error. One choice would be to temporarily change the path. That looks like it should work, but I'm going to have to test it latter today.

I don't like the above solution because it seems hinky. A better solution would be to patch the configure.ac file to allow for the specification of the antlr3 file with the complete path. That way, I could just specify the path to the antlr3 file in the "files" sub directory and avoid any copying. Do you know of any ebuild or autoconf examples with clear code for adding a file path parameter to configure?

Thanks for your assistance!
Back to top
View user's profile Send private message
Skinjob2707
n00b
n00b


Joined: 07 Aug 2013
Posts: 57

PostPosted: Thu Jan 17, 2019 8:13 pm    Post subject: Reply with quote

I've decided life is too short to try and figure out autoconf and used the copying into the working directory method with a path changed to include the current one. I've got forked-daapd version 26.4 using the ebuild and the files available in this bug: https://bugs.gentoo.org/609272 .
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
Page 1 of 1

 
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