POV-Ray : Newsgroups : povray.bugreports : pkgsrc patches for povray-3.6.1 Server Time
28 Apr 2024 23:28:55 EDT (-0400)
  pkgsrc patches for povray-3.6.1 (Message 1 to 5 of 5)  
From: Thomas Klausner
Subject: pkgsrc patches for povray-3.6.1
Date: 19 Jun 2010 18:45:00
Message: <web.4c1d472bf4bffb9ba05a139b0@news.povray.org>
Hi!

pkgsrc contains a number of patches to povray-3.6.1.

First, a fix for compiling against the latest png library (1.4.2), following
http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt:
--- source/png_pov.cpp.orig     2004-08-02 23:11:37.000000000 +0000
+++ source/png_pov.cpp
@@ -107,9 +107,6 @@ extern "C"
        void png_pov_write_data(png_structp, png_bytep, png_size_t);
        void png_pov_flush_data(png_structp);

-       // This is an internal function for libpng
-       void png_write_finish_row(png_structp);
-


/*****************************************************************************
        *
@@ -782,7 +779,6 @@ PNG_Image::~PNG_Image()
       {
          // finished prematurely - trick into thinking done
          png_ptr->num_rows = png_ptr->row_number;
-         png_write_finish_row(png_ptr);
       }

 #ifdef POV_COMMENTS // temporarily skip comment writing code
@@ -1428,7 +1424,7 @@ void Read_Png_Image(IMAGE *Image, char *
                if(r_info_ptr->valid & PNG_INFO_tRNS)
                {
                        for (index = 0; index < r_info_ptr->num_trans; index++)
-                               cmap[index].Transmit = 255 -
r_info_ptr->trans[index];
+                               cmap[index].Transmit = 255 -
r_info_ptr->trans_alpha[index];
                }

                Image->data.map_lines = (unsigned char **)POV_MALLOC(height *
sizeof(unsigned char *), "PNG image");
@@ -1461,7 +1457,7 @@ void Read_Png_Image(IMAGE *Image, char *
                if(r_info_ptr->valid & PNG_INFO_tRNS)
                {
                        for (index = 0; index < r_info_ptr->num_trans; index++)
-                               cmap[index].Transmit = 255 -
r_info_ptr->trans[index];
+                               cmap[index].Transmit = 255 -
r_info_ptr->trans_alpha[index];
                }

                Image->data.map_lines = (unsigned char **)POV_MALLOC(height *
sizeof(unsigned char *), "PNG image");

Second:
SunPro is a little picky about the places in which the "const" qualifier
is significant, so make sure that the function prototypes match their
declarations in the header file.

--- unix/unix.cpp.orig  2006-09-18 00:17:03.513608780 +0200
+++ unix/unix.cpp       2006-09-18 00:20:40.589099772 +0200
@@ -1892,7 +1892,7 @@ static bool unix_subdir (const char *Fil
 *
 ******************************************************************************/

-int UNIX_allow_file_read (const char *Filename, const unsigned int FileType)
+int UNIX_allow_file_read (const char *Filename, unsigned int FileType)
 {
   char       *filename;
   const char *errormsg;
@@ -1966,7 +1966,7 @@ int UNIX_allow_file_read (const char *Fi
 *
 ******************************************************************************/

-int UNIX_allow_file_write (const char *Filename, const unsigned int FileType)
+int UNIX_allow_file_write (const char *Filename, unsigned int FileType)
 {
   char       *filename;
   const char *errormsg;

Third:
A few files contain the unportable bash(1) "==" comparison operator for test(1).
It is not supported by most other shells or even test(1) from GNU
coreutils. Please use "=" instead.
--- scripts/allanim.sh.orig     2004-08-03 01:16:20.000000000 +0200
+++ scripts/allanim.sh  2006-10-20 01:22:43.000000000 +0200
@@ -57,12 +57,12 @@ case "$OPTIONS" in
     ;;
 esac

-test "$1" == "-d" && SCENE_DIR="$2"
-test "$2" == "-d" && SCENE_DIR="$3"
-test "$3" == "-d" && SCENE_DIR="$4"
-test "$4" == "-d" && SCENE_DIR="$5"
-test "$5" == "-d" && SCENE_DIR="$6"
-test "$6" == "-d" && SCENE_DIR="$7"
+test "$1" = "-d" && SCENE_DIR="$2"
+test "$2" = "-d" && SCENE_DIR="$3"
+test "$3" = "-d" && SCENE_DIR="$4"
+test "$4" = "-d" && SCENE_DIR="$5"
+test "$5" = "-d" && SCENE_DIR="$6"
+test "$6" = "-d" && SCENE_DIR="$7"

 if [ -z "$SCENE_DIR" ] ; then
   INSTALL_DIR="`install_dir`"
@@ -93,12 +93,12 @@ if [ ! -d "$SCENE_DIR" ] ; then
   exit
 fi

-test "$1" == "-o" && OUTPUT_DIR="$2"
-test "$2" == "-o" && OUTPUT_DIR="$3"
-test "$3" == "-o" && OUTPUT_DIR="$4"
-test "$4" == "-o" && OUTPUT_DIR="$5"
-test "$5" == "-o" && OUTPUT_DIR="$6"
-test "$6" == "-o" && OUTPUT_DIR="$7"
+test "$1" = "-o" && OUTPUT_DIR="$2"
+test "$2" = "-o" && OUTPUT_DIR="$3"
+test "$3" = "-o" && OUTPUT_DIR="$4"
+test "$4" = "-o" && OUTPUT_DIR="$5"
+test "$5" = "-o" && OUTPUT_DIR="$6"
+test "$6" = "-o" && OUTPUT_DIR="$7"

 if [ -z "$OUTPUT_DIR" ] ; then
   if [ ! -w "$SCENE_DIR" ] ; then
@@ -124,12 +124,12 @@ fi

 HTML_FILE=

-test "$1" == "-h" && HTML_FILE="$2"
-test "$2" == "-h" && HTML_FILE="$3"
-test "$3" == "-h" && HTML_FILE="$4"
-test "$4" == "-h" && HTML_FILE="$5"
-test "$5" == "-h" && HTML_FILE="$6"
-test "$6" == "-h" && HTML_FILE="$7"
+test "$1" = "-h" && HTML_FILE="$2"
+test "$2" = "-h" && HTML_FILE="$3"
+test "$3" = "-h" && HTML_FILE="$4"
+test "$4" = "-h" && HTML_FILE="$5"
+test "$5" = "-h" && HTML_FILE="$6"
+test "$6" = "-h" && HTML_FILE="$7"

 if [ ! -z "$HTML_FILE" ] ; then

--- scripts/allscene.sh.orig    2004-08-03 01:16:20.000000000 +0200
+++ scripts/allscene.sh 2006-10-20 01:23:23.000000000 +0200
@@ -64,11 +64,11 @@ case "$OPTIONS" in
     ;;
 esac

-test "$1" == "-d" && SCENE_DIR="$2"
-test "$2" == "-d" && SCENE_DIR="$3"
-test "$3" == "-d" && SCENE_DIR="$4"
-test "$4" == "-d" && SCENE_DIR="$5"
-test "$5" == "-d" && SCENE_DIR="$6"
+test "$1" = "-d" && SCENE_DIR="$2"
+test "$2" = "-d" && SCENE_DIR="$3"
+test "$3" = "-d" && SCENE_DIR="$4"
+test "$4" = "-d" && SCENE_DIR="$5"
+test "$5" = "-d" && SCENE_DIR="$6"

 if [ -z "$SCENE_DIR" ] ; then
   INSTALL_DIR="`install_dir`"
@@ -99,11 +99,11 @@ if [ ! -d "$SCENE_DIR" ] ; then
   exit
 fi

-test "$1" == "-o" && OUTPUT_DIR="$2"
-test "$2" == "-o" && OUTPUT_DIR="$3"
-test "$3" == "-o" && OUTPUT_DIR="$4"
-test "$4" == "-o" && OUTPUT_DIR="$5"
-test "$5" == "-o" && OUTPUT_DIR="$6"
+test "$1" = "-o" && OUTPUT_DIR="$2"
+test "$2" = "-o" && OUTPUT_DIR="$3"
+test "$3" = "-o" && OUTPUT_DIR="$4"
+test "$4" = "-o" && OUTPUT_DIR="$5"
+test "$5" = "-o" && OUTPUT_DIR="$6"

 if [ -z "$OUTPUT_DIR" ] ; then
   if [ ! -w "$SCENE_DIR" ] ; then
@@ -133,12 +133,12 @@ fi

 HTML_FILE=

-test "$1" == "-h" && HTML_FILE="$2"
-test "$2" == "-h" && HTML_FILE="$3"
-test "$3" == "-h" && HTML_FILE="$4"
-test "$4" == "-h" && HTML_FILE="$5"
-test "$5" == "-h" && HTML_FILE="$6"
-test "$6" == "-h" && HTML_FILE="$7"
+test "$1" = "-h" && HTML_FILE="$2"
+test "$2" = "-h" && HTML_FILE="$3"
+test "$3" = "-h" && HTML_FILE="$4"
+test "$4" = "-h" && HTML_FILE="$5"
+test "$5" = "-h" && HTML_FILE="$6"
+test "$6" = "-h" && HTML_FILE="$7"

 if [ ! -z "$HTML_FILE" ] ; then

--- scripts/portfolio.sh.orig   2004-08-03 01:16:20.000000000 +0200
+++ scripts/portfolio.sh        2006-10-20 01:23:33.000000000 +0200
@@ -56,10 +56,10 @@ case "$OPTIONS" in
     ;;
 esac

-test "$1" == "-d" && SCENE_DIR="$2"
-test "$2" == "-d" && SCENE_DIR="$3"
-test "$3" == "-d" && SCENE_DIR="$4"
-test "$4" == "-d" && SCENE_DIR="$5"
+test "$1" = "-d" && SCENE_DIR="$2"
+test "$2" = "-d" && SCENE_DIR="$3"
+test "$3" = "-d" && SCENE_DIR="$4"
+test "$4" = "-d" && SCENE_DIR="$5"

 if [ -z "$SCENE_DIR" ] ; then
   INSTALL_DIR="`install_dir`"
@@ -94,10 +94,10 @@ if [ -d "$SCENE_DIR/portfolio" ] ; then
   SCENE_DIR="$SCENE_DIR/portfolio"
 fi

-test "$1" == "-o" && OUTPUT_DIR="$2"
-test "$2" == "-o" && OUTPUT_DIR="$3"
-test "$3" == "-o" && OUTPUT_DIR="$4"
-test "$4" == "-o" && OUTPUT_DIR="$5"
+test "$1" = "-o" && OUTPUT_DIR="$2"
+test "$2" = "-o" && OUTPUT_DIR="$3"
+test "$3" = "-o" && OUTPUT_DIR="$4"
+test "$4" = "-o" && OUTPUT_DIR="$5"

 if [ -z "$OUTPUT_DIR" ] ; then
   if [ -w "$SCENE_DIR" ] ; then

Please include the patches in the next release!

Thanks,
 Thomas


Post a reply to this message

From: clipka
Subject: Re: pkgsrc patches for povray-3.6.1
Date: 20 Jun 2010 12:23:47
Message: <4c1e4093@news.povray.org>
Am 20.06.2010 00:40, schrieb Thomas Klausner:
> Hi!
>
> pkgsrc contains a number of patches to povray-3.6.1.

Note that the current versions are povray-3.6.2 and 
povray-3.7.0.beta.37a, and that current development versions may already 
include various other changes.


> First, a fix for compiling against the latest png library (1.4.2), following
> http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt:

Did you verify that this is still backward compatible with earlier 
versions of libpng?


> Second:
> SunPro is a little picky about the places in which the "const" qualifier
> is significant, so make sure that the function prototypes match their
> declarations in the header file.

Such a change has already been implemented in change #4827 for the 
POV-Ray 3.6 branch (unfortunately just a few days late for 3.6.2); in 
the POV-Ray 3.7 branch, there is neither such a file, nor such functions 
as far as I can see.


> Third:
> A few files contain the unportable bash(1) "==" comparison operator for test(1).
> It is not supported by most other shells or even test(1) from GNU
> coreutils. Please use "=" instead.

This has also been fixed in change #4827, and also in 3.7.0.beta.31.


> Please include the patches in the next release!

I guess the developers will not respond too well to such requests, 
especially when accompanied by exclamation marks. For future code 
submissions, you may want to try submitting (A) a detailed problem 
report (preferably on bugs.povray.org), accompanied by (B) a solution 
/proposal/, rather than a demand.


Post a reply to this message

From: Thomas Klausner
Subject: Re: pkgsrc patches for povray-3.6.1
Date: 20 Jun 2010 13:35:00
Message: <web.4c1e512f9ac045b5a05a139b0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 20.06.2010 00:40, schrieb Thomas Klausner:
> > Hi!
> >
> > pkgsrc contains a number of patches to povray-3.6.1.
>
> Note that the current versions are povray-3.6.2 and
> povray-3.7.0.beta.37a, and that current development versions may already
> include various other changes.

povray-3.6.2 is not available as sources for Unix, AFAICT. Am I missing
something?

> Did you verify that this is still backward compatible with earlier
> versions of libpng?

trans_alpha doesn't exist for png<1.4, so if you still want to support earlier
versions, something like
#if PNG_LIBPNG_VER < 10400
#define trans_alpha trans
#endif
is needed.

> Such a change has already been implemented in change #4827 for the
> POV-Ray 3.6 branch (unfortunately just a few days late for 3.6.2); in
> the POV-Ray 3.7 branch, there is neither such a file, nor such functions
> as far as I can see.

Good to hear that.

> This has also been fixed in change #4827, and also in 3.7.0.beta.31.

Very good.

> > Please include the patches in the next release!
>
> I guess the developers will not respond too well to such requests,
> especially when accompanied by exclamation marks. For future code
> submissions, you may want to try submitting (A) a detailed problem
> report (preferably on bugs.povray.org), accompanied by (B) a solution
> /proposal/, rather than a demand.

I'm sorry if the exclamation mark made you think of my request as a demand, it
was not meant in that way.

Thanks for the pointer to bugs.povray.org, I didn't find it when browsing for
where to report bugs. Do you think it would be useful to report the png problem
there (with exclamation marks this time :) )?

Thanks for your help,
 Thomas


Post a reply to this message

From: clipka
Subject: Re: pkgsrc patches for povray-3.6.1
Date: 20 Jun 2010 13:55:48
Message: <4c1e5624$1@news.povray.org>
Am 20.06.2010 19:34, schrieb Thomas Klausner:
>>> pkgsrc contains a number of patches to povray-3.6.1.
>>
>> Note that the current versions are povray-3.6.2 and
>> povray-3.7.0.beta.37a, and that current development versions may already
>> include various other changes.
>
> povray-3.6.2 is not available as sources for Unix, AFAICT. Am I missing
> something?

The point I intended to make was along the lines that diffs against 
3.6.1 sources are rather cumbersome to merge into the newest development 
versions. (Yeah, I know, then why didn't I say so... duh.)


> Thanks for the pointer to bugs.povray.org, I didn't find it when browsing for
> where to report bugs. Do you think it would be useful to report the png problem
> there (with exclamation marks this time :) )?

Yup. Feel free to present your suggested solution, but please also 
mention how to keep it compatible with older libpng.


Post a reply to this message

From: Thomas Klausner
Subject: Re: pkgsrc patches for povray-3.6.1
Date: 20 Jun 2010 15:10:00
Message: <web.4c1e66b29ac045b5a05a139b0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Yup. Feel free to present your suggested solution, but please also
> mention how to keep it compatible with older libpng.

I've opened issue 144 about this.

Thanks again for your help,
 Thomas


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.