From owner-svn-ports-all@freebsd.org Wed Dec 4 15:21:50 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 660041C7569; Wed, 4 Dec 2019 15:21:50 +0000 (UTC) (envelope-from bsam@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47SjHy1ZR8z3xx2; Wed, 4 Dec 2019 15:21:50 +0000 (UTC) (envelope-from bsam@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1946E20F9; Wed, 4 Dec 2019 15:21:50 +0000 (UTC) (envelope-from bsam@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB4FLnZI096092; Wed, 4 Dec 2019 15:21:49 GMT (envelope-from bsam@FreeBSD.org) Received: (from bsam@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB4FLnZc096090; Wed, 4 Dec 2019 15:21:49 GMT (envelope-from bsam@FreeBSD.org) Message-Id: <201912041521.xB4FLnZc096090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bsam set sender to bsam@FreeBSD.org using -f From: Boris Samorodov Date: Wed, 4 Dec 2019 15:21:49 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r519021 - in head/print/photoprint: . files X-SVN-Group: ports-head X-SVN-Commit-Author: bsam X-SVN-Commit-Paths: in head/print/photoprint: . files X-SVN-Commit-Revision: 519021 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Dec 2019 15:21:50 -0000 Author: bsam Date: Wed Dec 4 15:21:49 2019 New Revision: 519021 URL: https://svnweb.freebsd.org/changeset/ports/519021 Log: print/photoprint: Fix build with gitenprint 5.3. Let's try to make photoprint and libgutenprint friends. Bump PORTREVISION. It is not needed by rules, but I'd prefer to. Added: head/print/photoprint/files/ head/print/photoprint/files/patch-gp_cppsupport_gprinter.cpp (contents, props changed) Modified: head/print/photoprint/Makefile Modified: head/print/photoprint/Makefile ============================================================================== --- head/print/photoprint/Makefile Wed Dec 4 15:02:47 2019 (r519020) +++ head/print/photoprint/Makefile Wed Dec 4 15:21:49 2019 (r519021) @@ -2,7 +2,7 @@ PORTNAME= photoprint DISTVERSION= 0.4.2-pre2 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= print graphics MASTER_SITES= http://www.blackfiveimaging.co.uk/photoprint/ @@ -11,8 +11,6 @@ COMMENT= Utility to print multiple images per sheet LICENSE= GPLv2 -BROKEN= fails to build - LIB_DEPENDS= libcups.so:print/cups \ libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ @@ -32,8 +30,6 @@ LIBS+= -lX11 INSTALLS_ICONS= yes post-patch: - @${REINPLACE_CMD} -e 's|glib/gstrfuncs.h|glib.h|g' \ - ${WRKSRC}/gp_cppsupport/gprinter.cpp @${REINPLACE_CMD} -e 's|cups/cups.h|cups/ppd.h|g' \ ${WRKSRC}/stp_support/printerqueues_unix.c Added: head/print/photoprint/files/patch-gp_cppsupport_gprinter.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/print/photoprint/files/patch-gp_cppsupport_gprinter.cpp Wed Dec 4 15:21:49 2019 (r519021) @@ -0,0 +1,129 @@ +--- gp_cppsupport/gprinter.cpp.orig 2010-04-30 03:44:31.000000000 +0400 ++++ gp_cppsupport/gprinter.cpp 2019-12-04 18:01:52.055955000 +0300 +@@ -22,7 +22,6 @@ + #include + + #include +-#include + #include + + #include "../imagesource/imagesource.h" +@@ -418,59 +417,72 @@ void GPrinter::Print(ImageSource *src,int xpos,int ypo + + void GPrinter::GetImageableArea() + { +-// pagewidth=pageheight=0; +-// stp_get_media_size(stpvars, &pagewidth, &pageheight); ++ stp_dimension_t double_pagewidth, double_pageheight; ++ stp_get_media_size(stpvars, &double_pagewidth, &double_pageheight); + +-// Debug[TRACE] << "Media size returned: " << pagewidth << " by " << pageheight << endl; ++ // *** HACK *** ++ // Gutenprint uses doubles... Either rewrite all funclions to use doubles or deal with it just here. + +- const char *papersize=stp_get_string_parameter(stpvars,"PageSize"); +- bool gotpapersize=false; +- if(papersize) +- { +- const stp_papersize_t *paper=stp_get_papersize_by_name(papersize); +- if(paper) ++ pagewidth=(int)double_pagewidth; ++ pageheight=(int)double_pageheight; ++ ++ Debug[TRACE] << "Media size returned: " << pagewidth << " by " << pageheight << endl; ++ ++ // From gutenprint TFM: ++ // If the media size is invalid, width and height will be set to -1. ++ ++ if (pagewidth != -1 && pageheight != -1) { ++ ++ // From gutenprint TFM: ++ // Values of 0 for width or height indicate that the dimension ++ // is variable, so that custom page sizes or roll paper can be used. ++ // In this case, the size limit should be used to determine maximum and ++ // minimum values permitted. ++ ++ if(!pagewidth) + { +- gotpapersize=true; +- if(paper->width) +- { +- pagewidth=minwidth=maxwidth=paper->width; +- stp_set_page_width(stpvars,pagewidth); +- Debug[TRACE] << "Width: " << pagewidth << endl; +- } +- else +- { +- int mw,mh,nw,nh; +- pagewidth=stp_get_page_width(stpvars); +- stp_get_size_limit(stpvars,&mw,&mh,&nw,&nh); +- minwidth=nw; +- maxwidth=mw; +- Debug[TRACE] << "Custom width..." << endl; +- } +- if(paper->height) +- { +- pageheight=minheight=maxheight=paper->height; +- stp_set_page_height(stpvars,pageheight); +- Debug[TRACE] << "Height: " << pageheight << endl; +- } +- else +- { +- int mw,mh,nw,nh; +- pageheight=stp_get_page_height(stpvars); +- stp_get_size_limit(stpvars,&mw,&mh,&nw,&nh); +- minheight=nh; +- maxheight=mh; +- Debug[TRACE] << "Custom height..." << endl; +- } ++ stp_dimension_t dmw,dmh,dnw,dnh; ++ double_pagewidth=stp_get_page_width(stpvars); ++ stp_get_size_limit(stpvars,&dmw,&dmh,&dnw,&dnh); ++ ++ // *** HACK *** ++ // Gutenprint uses doubles... Either rewrite all funclions to use doubles or deal with it just here. ++ ++ minwidth=(int)dnw; ++ maxwidth=(int)dmw; ++ Debug[TRACE] << "Custom width..." << endl; + } ++ ++ if(!pageheight) ++ { ++ stp_dimension_t dmw,dmh,dnw,dnh; ++ double_pageheight=stp_get_page_height(stpvars); ++ stp_get_size_limit(stpvars,&dmw,&dmh,&dnw,&dnh); ++ ++ // *** HACK *** ++ // Gutenprint uses doubles... Either rewrite all funclions to use doubles or deal with it just here. ++ ++ minheight=(int)dnh; ++ maxheight=(int)dmh; ++ Debug[TRACE] << "Custom height..." << endl; ++ } + } +- if(!gotpapersize) +- { +- pagewidth=pageheight=0; +- stp_get_media_size(stpvars, &pagewidth, &pageheight); +- } ++ else { ++ // How should we treat an invalid media size? ++ } + ++ stp_dimension_t double_l,double_r,double_t,double_b; ++ stp_get_imageable_area(stpvars, &double_l, &double_r, &double_b, &double_t); ++ + int l,r,t,b; +- stp_get_imageable_area(stpvars, &l, &r, &b, &t); ++ ++ // *** HACK *** ++ // Gutenprint uses doubles... Either rewrite all funclions to use doubles or deal with it just here. ++ ++ l=(int)double_l; ++ r=(int)double_r; ++ t=(int)double_t; ++ b=(int)double_b; + + Debug[TRACE] << "Imageable area from GP: L: " << l << ", R: " << r << ", T: " << t << ", B: " << b << endl; +