LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Núcleo doesn't compile (Núcleo now compiled, but Metisse doesn't compile) (https://www.linuxquestions.org/questions/linux-software-2/n%FAcleo-doesnt-compile-n%FAcleo-now-compiled-but-metisse-doesnt-compile-796595/)

MTK358 03-25-2010 01:28 PM

<double post>

knudfl 03-25-2010 03:33 PM

Quote:

..what should I do so that Núcleo is being compiled with libpng12..
Install libpng12. Both can be present at the same time.
See the info about the files, Slackware 13 current, post # 30, etc.

And read this thread again.
.....

MTK358 03-25-2010 03:55 PM

1 Attachment(s)
I read over the thread while working in the VM and taking notes so you can follow what I did (attached).

Needles to say, it failed:

Code:


...

-MF .deps/JPEG.Tpo -c -o JPEG.lo JPEG.cxx
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../nucleo -I../../.. -I../../.. -I/usr/include/libpng12 -I/usr/include/freetype2 -march=x86-64 -mtune=generic -O2 -pipe -MT JPEG.lo -MD -MP -MF .deps/JPEG.Tpo -c JPEG.cxx  -fPIC -DPIC -o .libs/JPEG.o
mv -f .deps/JPEG.Tpo .deps/JPEG.Plo
/bin/sh ../../../libtool --tag=CXX  --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../nucleo  -I../../.. -I../../.. -I/usr/include/libpng12    -I/usr/include/freetype2      -march=x86-64 -mtune=generic -O2 -pipe -MT PNGenc.lo -MD -MP -MF .deps/PNGenc.Tpo -c -o PNGenc.lo PNGenc.cxx
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../nucleo -I../../.. -I../../.. -I/usr/include/libpng12 -I/usr/include/freetype2 -march=x86-64 -mtune=generic -O2 -pipe -MT PNGenc.lo -MD -MP -MF .deps/PNGenc.Tpo -c PNGenc.cxx  -fPIC -DPIC -o .libs/PNGenc.o
PNGenc.cxx: In function ‘void nucleo::png_memory_write_data(png_struct*, png_byte*, png_size_t)’:
PNGenc.cxx:38: warning: ‘png_struct_def::io_ptr’ is deprecated (declared at /usr/include/png.h:1125)
PNGenc.cxx:38: warning: ‘png_struct_def::io_ptr’ is deprecated (declared at /usr/include/png.h:1125)
PNGenc.cxx: In function ‘void nucleo::png_memory_read_data(png_struct*, png_byte*, png_size_t)’:
PNGenc.cxx:133: warning: ‘png_struct_def::io_ptr’ is deprecated (declared at /usr/include/png.h:1125)
PNGenc.cxx:133: warning: ‘png_struct_def::io_ptr’ is deprecated (declared at /usr/include/png.h:1125)
PNGenc.cxx: In function ‘bool nucleo::png_decode(nucleo::Image*, nucleo::Image*, nucleo::Image::Encoding, unsigned int)’:
PNGenc.cxx:173: error: ‘png_set_gray_1_2_4_to_8’ was not declared in this scope
make[4]: *** [PNGenc.lo] Error 1
make[4]: Leaving directory `/home/michael/nucleo/src/nucleo-0.7.6/nucleo/image/encoding'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/michael/nucleo/src/nucleo-0.7.6/nucleo/image'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/michael/nucleo/src/nucleo-0.7.6/nucleo'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/michael/nucleo/src/nucleo-0.7.6/nucleo'
make: *** [all-recursive] Error 1
==> ERROR: Build Failed.
    Aborting...


MTK358 03-26-2010 07:21 AM

Nearly went off the page!

lupusarcanus 03-26-2010 07:27 AM

Well; I'll keep trying to help albeit not being successful.

Try this:-
http://bbs.archlinux.org/viewtopic.php?id=89952

MTK358 03-26-2010 07:44 AM

Hmmm, that sounds like it might be the problem.

Do you think running a search-and-replace that changes "png_set_gray_1_2_4_to_8" to "png_set_expand_gray_1_2_4_to_8" over the Núcleo source would fix it, or at least fix part of it??

MTK358 03-26-2010 07:53 AM

How about this:

Code:

find . -type f -exec sed --in-place 's:png_set_gray_1_2_4_to_8:png_set_expand_gray_1_2_4_to_8:g' {} ;

lupusarcanus 03-26-2010 08:02 AM

Quote:

Originally Posted by MTK358 (Post 3913208)
How about this:

Code:

find . -type f -exec sed --in-place 's:png_set_gray_1_2_4_to_8:png_set_expand_gray_1_2_4_to_8:g' {} ;

I'm not all too good with sed so...
It looks like it might work.
I don't think you can harm your system at all like that.
At worst you'd have to reinstall stuff pertaining to libpng so I think you're okay. Thing is that looks like it's supposed to work in the current directory so it wouldn't be possible to harm your system like that.

Hopefully it works!!!
Good luck!
;) :)

MTK358 03-26-2010 08:11 AM

This is using libpng14, no system files modified:

I tried running it on the Núcleo source and it just messed it up, didn't even compile a little bit.

I will try something else, though: prepend '#define png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8\n' to every .c, .h, .cc, .cpp, and .cxx file.

I know that you can append to a file using ">>", but how do you prepend to one?

lupusarcanus 03-26-2010 09:22 AM

Quote:

Originally Posted by MTK358 (Post 3913230)
This is using libpng14, no system files modified:

I tried running it on the Núcleo source and it just messed it up, didn't even compile a little bit.

I will try something else, though: prepend '#define png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8\n' to every .c, .h, .cc, .cpp, and .cxx file.

I know that you can append to a file using ">>", but how do you prepend to one?

http://www.cyberciti.biz/faq/bash-pr...lines-to-file/
Is that what you are looking for?

MTK358 03-26-2010 09:29 AM

I created this pipeline, it should append echo's output to $file:

Code:

echo '#define png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8' | cat - "$file" > "$file".temp && mv "$file".temp "$file"
Now how to run it every time find finds a file?

lupusarcanus 03-26-2010 09:32 AM

Quote:

Originally Posted by MTK358 (Post 3913308)
I created this pipeline, it should append echo's output to $file:

Code:

echo '#define png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8' | cat - "$file" > "$file".temp && mv "$file".temp "$file"
Now how to run it every time find finds a file?

http://stackoverflow.com/questions/5...h-osx-terminal
(Is that it?)

MTK358 03-26-2010 09:38 AM

Code:

find -name '*.cxx' -exec sed --in-place '1 s:^.*$:#define png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8\n&:' '{}' ';'
I looked through Núcleo's source and found that C++ files are ".cxx" and header files are ".H".

MTK358 03-26-2010 09:45 AM

SUCCESS!!! make finished with a 0 exit code!

(Note that this is using libpng14!)

Anyway, I would like to use the AUR package instead of make install. Is there a way to have makepkg run my pipeline on the source code before compiling?

MTK358 03-26-2010 10:23 AM

I added my two commands to the build function in the PKGBUILD and it worked!

Code:

build() {
  cd "$srcdir"/$pkgname-$pkgver

  find -name '*.cxx' -exec sed --in-place '1 s:^.*$:#define png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8\n&:' '{}' ';'
  find -name '*.H' -exec sed --in-place '1 s:^.*$:#define png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8\n&:' '{}' ';'

 
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --with-x

  make || return 1
  make DESTDIR="$pkgdir" install
}

This is the result:

Code:

$ pacman -Qs nucleo
local/nucleo 0.7.6-1
    Toolkit for exploring new uses of video and new human-computer interaction
    techniques

I tried installing Metisse, and it complains about the same thing, so I will try modifying its PKGBUILD the same way.


All times are GMT -5. The time now is 03:15 AM.