FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: libpng for linux devs  (Read 5215 times)

ashen

  • Newbie
  • Posts: 3
  • Mess with the best, die like the rest
    • View Profile
libpng for linux devs
« on: April 12, 2008, 06:02:49 pm »

There seems to be bug in recent versions of libpng disallowing fife to build on unix based system, i'm sending script which download latest libpng version, patch it and modify build scripts, but it needs testing
So this is how you should get rid of libpng build error on some linux systems:
move to fife's trunk directory, fire up your editor, create this files and insert following code into them. Filenames MUST be exactly same:
1st file:
SConscript.new
Code: [Select]
import os
from utils.util_scripts.path import path

Import('env')

curpath = str(path('.'))
installpath = str((path('.') / path('install')).abspath())

os.chdir(str(path('.') / path('guichan-0.7.1')))

os.system('./configure')
os.system('make')
os.system('make install prefix=%s' % installpath)

os.chdir(str(path('..')))

os.chdir(str(path('.') / path('libpng-1.2.26')))

os.system('./configure')
os.system('make all-am')
os.system('make install prefix=%s' % installpath)
os.system('make install-data-hook prefix=%s' % installpath)

os.chdir(curpath)

2nd file:
libpng.patch
Code: [Select]
--- libpng-1.2.26/pngconf.h     2008-04-02 19:27:26.000000000 +0200
+++ libpng-1.2.26-patched/pngconf.h     2008-04-12 23:59:45.000000000 +0200
@@ -323,8 +323,8 @@
      /* If you encounter a compiler error here, see the explanation
       * near the end of INSTALL.
       */
-         __pngconf.h__ already includes setjmp.h;
-         __dont__ include it again.;
+#warning         __pngconf.h__ already includes setjmp.h;
+#warning        __dont__ include it again.;
 #    endif
 #  endif /* __linux__ */
3rd file:
apply.sh
Code: [Select]
#!/bin/sh
CURDIR=$PWD
LIBPNGVER=1.2.26
mv -f SConscript.new ext/SConscript
mv libpng.patch ext
cd ext
patch < SConscript.patch

wget -nc http://prdownloads.sourceforge.net/libpng/libpng-$LIBPNGVER.tar.bz2?download
tar xjf libpng-$LIBPNGVER.tar.bz2
cd libpng-$LIBPNGVER
patch -p1 < ../libpng.patch
cd $CURDIR

Now just give execs and run the script:
Code: [Select]
chmod +x apply.sh
./apply.sh

Please try scons ext=1 && scons then and send me report
« Last Edit: April 13, 2008, 08:55:53 am by ashen »
Logged
“He is able who thinks he is able.”

Shocky

  • Newbie
  • Posts: 2
    • View Profile
Re: libpng for linux devs
« Reply #1 on: April 13, 2008, 05:24:11 pm »

Worked for me.  :)
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: libpng for linux devs
« Reply #2 on: April 15, 2008, 01:47:14 pm »

Could any linux developer who has write access to our SVN please test this and apply the patch to the datasets branch and trunk in case it works?
Logged

dauerflucher

  • Newbie
  • Posts: 3
    • View Profile
Re: libpng for linux devs
« Reply #3 on: April 15, 2008, 05:39:33 pm »

Could somebody please give a more detailed description about the bug in libpng on Linux systems?

I currently just know about an error on Ubuntu 7.10 caused by syntax typos in /usr/include/pngconf.h which can be easily fixed by commenting out line 317-318 in this file.

Logged

ashen

  • Newbie
  • Posts: 3
  • Mess with the best, die like the rest
    • View Profile
Re: libpng for linux devs
« Reply #4 on: April 16, 2008, 09:31:10 am »

Could somebody please give a more detailed description about the bug in libpng on Linux systems?

I currently just know about an error on Ubuntu 7.10 caused by syntax typos in /usr/include/pngconf.h which can be easily fixed by commenting out line 317-318 in this file.


And that's what this patch solves. I don't like the idea of demanding to edit system files so we added libpng into ext, thats why the Scons build scripts are patched too.  Unfortunately i don't have svn write access so i had to make it the hard way;o)
Logged
“He is able who thinks he is able.”

dauerflucher

  • Newbie
  • Posts: 3
    • View Profile
Re: libpng for linux devs
« Reply #5 on: April 16, 2008, 12:23:10 pm »

Ok, i was just wondering if we are talking about the same bug.

It is a good idea to add libpng to FIFE extensions then. I checked the current packages list for Ubuntu 8.04 (will be released in about a week) and it looks like they will use the same version of libpng as used in 7.10. But maybe the list will get updated later... I will keep track of changes and let you know.
Logged

homer

  • Newbie
  • Posts: 1
    • View Profile
Re: libpng for linux devs
« Reply #6 on: April 16, 2008, 03:47:13 pm »

worked for me on ubuntu 8.04
with: gcc-Version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Logged

jwt

  • Developer
  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: libpng for linux devs
« Reply #7 on: April 19, 2008, 09:22:11 am »

Works here!
Logged

dauerflucher

  • Newbie
  • Posts: 3
    • View Profile
Re: libpng for linux devs
« Reply #8 on: April 30, 2008, 09:50:19 am »

Ok, while I already opened a launchpad entry some time ago (https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/218409) spq send me a patch offered by the Gentoo devs (for all the guys who dare fixing a bug within their system - http://mirrors.usc.edu/pub/linux/distributions/gentoo/media-libs/libpng/files/libpng-1.2.24-pngconf-setjmp.patch):

--- libpng/pngconf.h
+++ libpng/pngconf.h
@@ -323,8 +323,8 @@
      /* If you encounter a compiler error here, see the explanation
       * near the end of INSTALL.
       */
-         __pngconf.h__ already includes setjmp.h;
-         __dont__ include it again.;
+#warning  __pngconf.h__ already includes setjmp.h;
+#warning  __dont__ include it again.;
 #    endif
 #  endif /* __linux__ */
Logged