LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-25-2010, 01:28 PM   #61
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723

<double post>
 
Old 03-25-2010, 03:33 PM   #62
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.
.....

Last edited by knudfl; 03-25-2010 at 03:37 PM.
 
Old 03-25-2010, 03:55 PM   #63
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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...
Attached Files
File Type: txt nucleo-vm-build-notes.txt (400 Bytes, 12 views)
 
Old 03-26-2010, 07:21 AM   #64
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Nearly went off the page!
 
Old 03-26-2010, 07:27 AM   #65
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Well; I'll keep trying to help albeit not being successful.

Try this:-
http://bbs.archlinux.org/viewtopic.php?id=89952
 
1 members found this post helpful.
Old 03-26-2010, 07:44 AM   #66
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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??
 
Old 03-26-2010, 07:53 AM   #67
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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' {} ;
 
Old 03-26-2010, 08:02 AM   #68
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by MTK358 View Post
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!
 
Old 03-26-2010, 08:11 AM   #69
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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?

Last edited by MTK358; 03-26-2010 at 08:16 AM.
 
Old 03-26-2010, 09:22 AM   #70
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by MTK358 View Post
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?
 
1 members found this post helpful.
Old 03-26-2010, 09:29 AM   #71
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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?
 
Old 03-26-2010, 09:32 AM   #72
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by MTK358 View Post
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?)
 
1 members found this post helpful.
Old 03-26-2010, 09:38 AM   #73
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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".

Last edited by MTK358; 03-26-2010 at 09:41 AM.
 
Old 03-26-2010, 09:45 AM   #74
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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?
 
Old 03-26-2010, 10:23 AM   #75
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Compile kernel] How to compile/install the modules ? frenchn00b Linux - General 1 09-06-2009 03:18 PM
CLFS 5.9 - Glibc compile: suffix of object files, cannot compile Noddegamra Linux From Scratch 3 04-27-2009 12:49 AM
How to get a self-compiled Metisse run automatically in runlevel 5? Vitalie Ciubotaru Linux - Desktop 4 05-22-2007 03:49 PM
Metisse compile Da_Panther Linux - Software 3 02-03-2007 01:56 PM
Nucleo not compiling in Ubuntu 6.06 Da_Panther Linux - Software 2 12-27-2006 07:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration