From 2aa2acfff38de7de825868995e49792ecfc03126 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 Jan 2012 23:15:03 +0000 Subject: Tue Jan 24 23:15:02 UTC 2012 --- community-staging/qpxtool/PKGBUILD | 28 +++++++ community-staging/qpxtool/libpng15.patch | 127 +++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 community-staging/qpxtool/PKGBUILD create mode 100644 community-staging/qpxtool/libpng15.patch (limited to 'community-staging/qpxtool') diff --git a/community-staging/qpxtool/PKGBUILD b/community-staging/qpxtool/PKGBUILD new file mode 100644 index 000000000..47c3e14a3 --- /dev/null +++ b/community-staging/qpxtool/PKGBUILD @@ -0,0 +1,28 @@ +# $Id: PKGBUILD 62654 2012-01-23 09:59:30Z spupykin $ +# Maintainer: Sergej Pupykin +# Contributor: Krzysztof Stasiorowski + +pkgname=qpxtool +pkgver=0.7.1_002 +pkgrel=3 +pkgdesc="Allows better controll over optical drives to include QChecks and optimization settings." +arch=('i686' 'x86_64') +url="http://qpxtool.sourceforge.net/" +license=('GPL') +depends=('qt') +source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2 + libpng15.patch) +md5sums=('755321a0196b16d06857550aac74ff50' + 'ab9af7610277652c77c6d114422b2266') + +build() { + cd $srcdir/$pkgname-$pkgver + # Fix strict aliasing warnings + export CFLAGS="$CFLAGS -fno-strict-aliasing" + sed -i 's|lib64|lib|' configure + patch -p1 <$srcdir/libpng15.patch + ./configure --prefix=/usr + make + mkdir -p $pkgdir/usr/bin + make DESTDIR=$pkgdir install +} diff --git a/community-staging/qpxtool/libpng15.patch b/community-staging/qpxtool/libpng15.patch new file mode 100644 index 000000000..05e6f49d2 --- /dev/null +++ b/community-staging/qpxtool/libpng15.patch @@ -0,0 +1,127 @@ +diff -wbBur qpxtool-0.7.1_002/console/f1tattoo/f1tattoo.cpp qpxtool-0.7.1_002.my/console/f1tattoo/f1tattoo.cpp +--- qpxtool-0.7.1_002/console/f1tattoo/f1tattoo.cpp 2009-11-25 10:55:44.000000000 +0300 ++++ qpxtool-0.7.1_002.my/console/f1tattoo/f1tattoo.cpp 2012-01-23 13:53:37.000000000 +0400 +@@ -129,28 +129,28 @@ + + png_read_info(png_ptr, info_ptr); + +- printf("Image size: %ld x %ld\n", info_ptr->width, info_ptr->height); ++ printf("Image size: %u x %u\n", png_get_image_width(png_ptr, info_ptr), png_get_image_height(png_ptr, info_ptr)); + +- if (info_ptr->width != 3744U || info_ptr->height != rows ) { ++ if (png_get_image_width(png_ptr, info_ptr) != 3744U || png_get_image_height(png_ptr, info_ptr) != rows ) { + printf("Image should be 3744 x %d", rows); + return 1; + } + +-// width = info_ptr->width; +-// height = info_ptr->height; +-// bit_depth = info_ptr->bit_depth; ++// width = png_get_image_width(png_ptr, info_ptr); ++// height = png_get_image_height(png_ptr, info_ptr); ++// bit_depth = png_get_bit_depth(png_ptr, info_ptr); + + number_of_passes = png_set_interlace_handling(png_ptr); + png_read_update_info(png_ptr, info_ptr); + +- printf("Color type: [%d] ", info_ptr->color_type); +- switch (info_ptr->color_type) { ++ printf("Color type: [%d] ", png_get_color_type(png_ptr, info_ptr)); ++ switch (png_get_color_type(png_ptr, info_ptr)) { + case PNG_COLOR_TYPE_GRAY: + printf("PNG_COLOR_TYPE_GRAY\n"); + break; + case PNG_COLOR_TYPE_PALETTE: + printf("PNG_COLOR_TYPE_PALETTE\n"); +- if (!(info_ptr->valid & PNG_INFO_PLTE)) { ++ if (!(png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE))) { + printf("PNG color type is indexed, but no palette found!"); + goto err_read_png; + } +@@ -168,49 +168,53 @@ + printf("unlnown PNG color type!\n"); + goto err_read_png; + } +- printf("Bit depth : %d\n", info_ptr->bit_depth); +- if (info_ptr->bit_depth != 8) { ++ printf("Bit depth : %d\n", png_get_bit_depth(png_ptr, info_ptr)); ++ if (png_get_bit_depth(png_ptr, info_ptr) != 8) { + printf("Unsupported bit depth!\n"); + goto err_read_png; + } +- if (info_ptr->valid & PNG_INFO_PLTE) { +- printf("Palette : %d colors\n", info_ptr->num_palette); ++ ++ int num_palette; ++ png_colorp plte; ++ png_get_PLTE(png_ptr, info_ptr, &plte, &num_palette); ++ ++ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) { ++ printf("Palette : %d colors\n", num_palette); + } else { + printf("Palette : NO\n"); + } +- printf("ROW bytes : %ld\n", info_ptr->rowbytes); +- ++ printf("ROW bytes : %d\n", png_get_rowbytes(png_ptr, info_ptr)); + + raw_row_pointer = buf; +- png_row_pointer = (png_byte*) malloc(info_ptr->rowbytes); ++ png_row_pointer = (png_byte*) malloc(png_get_rowbytes(png_ptr, info_ptr)); + for (row=0; rowwidth < 3744U) ++ if (png_get_image_width(png_ptr, info_ptr) < 3744U) + memset(raw_row_pointer, 0, 3744); + +- switch (info_ptr->color_type) { ++ switch (png_get_color_type(png_ptr, info_ptr)) { + case PNG_COLOR_TYPE_GRAY: +- for (col=0; colwidth; col++) { ++ for (col=0; colwidth; col++) { ++ for (col=0; colpalette[c].red; +- g = info_ptr->palette[c].green; +- b = info_ptr->palette[c].blue; ++ r = plte[c].red; ++ g = plte[c].green; ++ b = plte[c].blue; + c = (r*11 + g*16 + b*5) / 32; + raw_row_pointer[col] = c ^ 0xFF; + } + break; + case PNG_COLOR_TYPE_RGB: +- for (col=0; colwidth; col++) { ++ for (col=0; colwidth; col++) { ++ for (col=0; colwidth; col++) { ++ for (col=0; col