Skip to main content
Topic: PNG Libraries for Development (Read 1676 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

PNG Libraries for Development

https://github.com/google/earthenterprise/wiki/Install-Fusion-or-Earth-Server

I've been trying to install the above free software project, originally created by google, but since abandoned by them.  The github source supported Umbuntu and REL, but I really want to build it on Artix.  I'm running into a problem with its requirement for libpng12.  It is looking for libpng12/png.h :).  pacman has a png12 but only the library files, that is the .so, not the header files.  Any clue how I can proceed?


Ruben

Re: PNG Libraries for Development

Reply #1
Hello, i merged few PKGBUILDs together and created one for libpng12 which include additional files...

save this as "PKDBUILD" and run "makepkg" in the same directory:
Code: [Select]
# $Id$
# Maintainer: Maxime Gauduin <[email protected]>
# Contributor: Arthur Zamarin <[email protected]>
# Contributor: trya <[email protected]>
# Contributor: Jan de Groot <[email protected]>
# Contributor: dorphell <[email protected]>
# Contributor: Travis Willard <[email protected]>
# Contributor: Douglas Soares de Andrade <[email protected]>

pkgname=libpng12
pkgver=1.2.57
pkgrel=1
pkgdesc='A collection of routines used to create PNG format graphics files'
arch=('i686' 'x86_64')
url='http://www.libpng.org/pub/png/libpng.html'
license=('custom')
depends=('glibc' 'zlib')
source=("https://sourceforge.net/projects/libpng/files/libpng-${pkgver}.tar.xz"{,.asc}
        "https://sourceforge.net/projects/apng/files/libpng/libpng12/libpng-${pkgver}-apng.patch.gz")
validpgpkeys=('8048643BA2C840F4F92A195FF54984BFA16C640F') # Glenn Randers-Pehrson
sha256sums=('0f4620e11fa283fedafb474427c8e96bf149511a1804bdc47350963ae5cf54d8'
            'SKIP'
            '7cae56ef3b8101d2106fc9c487c53ac600d8699913422b80e068bb50c41bebb6')

prepare() {
  cd libpng-${pkgver}

  patch -Np0 -i ../libpng-${pkgver}-apng.patch

  libtoolize --force --copy
  aclocal
  autoconf
  automake --add-missing
}

build() {
  cd libpng-${pkgver}

  ./configure \
    --prefix='/usr'
  make
}

package() {
  cd libpng-${pkgver}

  make DESTDIR="${pkgdir}" install

  rm -rf "${pkgdir}/usr/share"
  rm -rf "${pkgdir}/usr/bin/libpng-config"
  rm -rf "${pkgdir}/usr/lib/"{libpng.so,libpng.a}
  rm -fr "${pkgdir}/usr/lib/pkgconfig/libpng.pc"
  rm -rf "${pkgdir}/usr/include/"{pngconf.h,png.h}

  install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/libpng12/
}

# vim: ts=2 sw=2 et:

I also needed to install additional packages
Code: [Select]
pacman -S gtest perl-perl4-corelibs

But in the end there was still some error:
Code: [Select]
kernel/qpngio.cpp: In function 'void qt_zlib_compression_hack()':
kernel/qpngio.cpp:1238:5: error: 'compress' was not declared in this scope
     compress(0,0,0,0);
     ^~~~~~~~
kernel/qpngio.cpp:1238:5: note: suggested alternative: 'qCompress'
     compress(0,0,0,0);
     ^~~~~~~~
     qCompress
kernel/qpngio.cpp:1239:5: error: 'uncompress' was not declared in this scope
     uncompress(0,0,0,0);
     ^~~~~~~~~~
kernel/qpngio.cpp:1239:5: note: suggested alternative: 'qUncompress'
     uncompress(0,0,0,0);
     ^~~~~~~~~~
     qUncompress
make[1]: *** [Makefile:13515: .obj/release-shared-mt/qpngio.o] Error 1
make[1]: Leaving directory '/home/juraj/Projects/earthenterprise/earth_enterprise/src/NATIVE-REL-x86_64/third_party/qt/qt-x11-free-3.3.8b/src'
make: *** [Makefile:40: sub-src] Error 2
scons: *** Error 2
scons: *** [NATIVE-REL-x86_64/third_party/qt/.build] Error 2
scons: building terminated because of errors.
scons: *** [build] Error 2
scons: building terminated because of errors.

I think it needs to be patched or fixed in upstream.

Re: PNG Libraries for Development

Reply #2
Hello, i merged few PKGBUILDs together and created one for libpng12 which include additional files...

save this as "PKDBUILD" and run "makepkg" in the same directory:
Code: [Select]
# $Id$
# Maintainer: Maxime Gauduin <[email protected]>
# Contributor: Arthur Zamarin <[email protected]>
# Contributor: trya <[email protected]>
# Contributor: Jan de Groot <[email protected]>
# Contributor: dorphell <[email protected]>
# Contributor: Travis Willard <[email protected]>
# Contributor: Douglas Soares de Andrade <[email protected]>

pkgname=libpng12
pkgver=1.2.57
pkgrel=1
pkgdesc='A collection of routines used to create PNG format graphics files'
arch=('i686' 'x86_64')
url='http://www.libpng.org/pub/png/libpng.html'
license=('custom')
depends=('glibc' 'zlib')
source=("https://sourceforge.net/projects/libpng/files/libpng-${pkgver}.tar.xz"{,.asc}
        "https://sourceforge.net/projects/apng/files/libpng/libpng12/libpng-${pkgver}-apng.patch.gz")
validpgpkeys=('8048643BA2C840F4F92A195FF54984BFA16C640F') # Glenn Randers-Pehrson
sha256sums=('0f4620e11fa283fedafb474427c8e96bf149511a1804bdc47350963ae5cf54d8'
            'SKIP'
            '7cae56ef3b8101d2106fc9c487c53ac600d8699913422b80e068bb50c41bebb6')

prepare() {
  cd libpng-${pkgver}

  patch -Np0 -i ../libpng-${pkgver}-apng.patch

  libtoolize --force --copy
  aclocal
  autoconf
  automake --add-missing
}

build() {
  cd libpng-${pkgver}

  ./configure \
    --prefix='/usr'
  make
}

package() {
  cd libpng-${pkgver}

  make DESTDIR="${pkgdir}" install

  rm -rf "${pkgdir}/usr/share"
  rm -rf "${pkgdir}/usr/bin/libpng-config"
  rm -rf "${pkgdir}/usr/lib/"{libpng.so,libpng.a}
  rm -fr "${pkgdir}/usr/lib/pkgconfig/libpng.pc"
  rm -rf "${pkgdir}/usr/include/"{pngconf.h,png.h}

  install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/libpng12/
}

# vim: ts=2 sw=2 et:

I also needed to install additional packages
Code: [Select]
pacman -S gtest perl-perl4-corelibs

But in the end there was still some error:
Code: [Select]
kernel/qpngio.cpp: In function 'void qt_zlib_compression_hack()':
kernel/qpngio.cpp:1238:5: error: 'compress' was not declared in this scope
     compress(0,0,0,0);
     ^~~~~~~~
kernel/qpngio.cpp:1238:5: note: suggested alternative: 'qCompress'
     compress(0,0,0,0);
     ^~~~~~~~
     qCompress
kernel/qpngio.cpp:1239:5: error: 'uncompress' was not declared in this scope
     uncompress(0,0,0,0);
     ^~~~~~~~~~
kernel/qpngio.cpp:1239:5: note: suggested alternative: 'qUncompress'
     uncompress(0,0,0,0);
     ^~~~~~~~~~
     qUncompress
make[1]: *** [Makefile:13515: .obj/release-shared-mt/qpngio.o] Error 1
make[1]: Leaving directory '/home/juraj/Projects/earthenterprise/earth_enterprise/src/NATIVE-REL-x86_64/third_party/qt/qt-x11-free-3.3.8b/src'
make: *** [Makefile:40: sub-src] Error 2
scons: *** Error 2
scons: *** [NATIVE-REL-x86_64/third_party/qt/.build] Error 2
scons: building terminated because of errors.
scons: *** [build] Error 2
scons: building terminated because of errors.

I think it needs to be patched or fixed in upstream.


Compress and Uncompress are part of zlib within the PNG format, I believe.

Re: PNG Libraries for Development

Reply #3
Problem was that it was still using system default
Code: [Select]
#include <png.h>
and not the one from "libpng12", after updating includes to
Code: [Select]
#include <libpng12/png.h>
i was able to get past this error

after some time... it failed to link with python3.6 or something
Get past this one, i had to change "-lpython3.6" to "-lpython3.6m" in some files

I also had to install few more packages:
Code: [Select]
pacman -S geos proj

their build system has problem with python. It should use only python 2 but it is done in a way that it is using pyton3 and maybe it is using both... crazy

In the end, i did not managed to compile it yet because it used sometimes python2 and sometimes python3, well config is messed up and hope that the newest version of python present is python2 and is directly using /bin/python ehich is on arch python3 and in this way it broke my build.

Re: PNG Libraries for Development

Reply #4
The PNG development libraries haven't changed that much over the last several years, so I'm not even sure why it needs an older version of PNG.  In fact, there was a bug in the Chunck reading of the early PNG libraries which was corrected about 7 years ago and which wrecked a good deal of my PNG files .  I rewrote a PNG interpreter in C++ using threading about 2 years ago as a school project, which is how I became familiar with it.  I don't know why they didn't develope it to the specification.  As for the python chaos, welcome to the world of google projects.

Re: PNG Libraries for Development

Reply #5
You said it yourself, welcome to google.