Page MenuHomeFreeBSD

[New Port] graphics/R-cran-Cairo: R Graphics Device using Cairo Graphics Library
AcceptedPublic

Authored by dteske on Dec 4 2019, 6:50 PM.

Details

Reviewers
imp
swills
mat
Summary

R graphics device using cairographics library that can be used to create
high-quality vector (PDF, PostScript and SVG) and bitmap output
(PNG,JPEG,TIFF), and high-quality rendering in displays (X11 and Win32).
Since it uses the same back-end for all output, copying across formats is
WYSIWYG. Files are created without the dependence on X11 or other external
programs. This device supports alpha channel (semi-transparent drawing)
and resulting images can contain transparent and semi-transparent regions.
It is ideal for use in server environments (file output) and as a
replacement for other devices that don't have Cairo's capabilities such as
alpha support or anti-aliasing. Backends are modular such that any subset
of backends is supported.

Test Plan

install, deinstall, pacakge, pkg install, pkg delete

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27967
Build 26133: arc lint + arc unit

Event Timeline

mat requested changes to this revision.Dec 4 2019, 8:05 PM
mat added inline comments.
graphics/R-cran-Cairo/Makefile
5–6

No. Choose only one. And please test before submitting reviews, an error like this does not build.

This revision now requires changes to proceed.Dec 4 2019, 8:05 PM
graphics/R-cran-Cairo/Makefile
5–6

No. Choose only one

I wasn't aware DISTVERSION was even a thing. I was just creating a variable to use in DISTNAME since you cannot use a dash or underscore in PORTVERSION.

please test before submitting reviews

I did.

an error like this does not build

You are incorrect.

You know that field in Phabricator and arc that says "Test Plan"?

I actually did what I put in there. Let's review what I wrote there:

install, deinstall, package, pkg install, pkg delete

I am literally telling you that I ran "make install" to success. Then ran "make deinstall" to success. Then ran "make package" to success. Then ran "pkg install" to success. Then ran "pkg delete" ... to success.

Here's the output of "make install" to prove to you that it works...

dteske@scribe12 R-cran-Cairo $ make install
===>  License GPLv2 accepted by the user
===>   R-cran-Cairo-1.5.10 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by R-cran-Cairo-1.5.10 for building
===>  Extracting for R-cran-Cairo-1.5.10
=> SHA256 Checksum OK for Cairo_1.5-10.tar.gz.
===>  Patching for R-cran-Cairo-1.5.10
===>   R-cran-Cairo-1.5.10 depends on package: cairo>=1.2 - found
===>   R-cran-Cairo-1.5.10 depends on file: /usr/local/bin/R - found
===>   R-cran-Cairo-1.5.10 depends on executable: gfortran9 - found
===>   R-cran-Cairo-1.5.10 depends on file: /usr/local/bin/as - found
===>  Configuring for R-cran-Cairo-1.5.10
===>  Staging for R-cran-Cairo-1.5.10
===>   R-cran-Cairo-1.5.10 depends on package: cairo>=1.2 - found
===>   R-cran-Cairo-1.5.10 depends on file: /usr/local/bin/R - found
===>   R-cran-Cairo-1.5.10 depends on executable: gfortran9 - found
===>   Generating temporary packing list
* installing *source* package 'Cairo' ...
** package 'Cairo' successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cpp
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking whether pkg-config knows about cairo... yes
checking for configurable backends... cairo cairo-ft cairo-pdf cairo-png cairo-ps cairo-xlib cairo-xlib-xrender
configure: CAIRO_CFLAGS=-I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread 
checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-L/usr/local/lib -lfreetype -lpng16 -lz -lcairo -lpthread -lXext -lXrender -lX11 
checking for library containing deflate... none required
checking whether Cairo programs can be compiled... yes
checking whether cairo_image_surface_get_format is declared... no
checking for FreeType support in cairo... yes
checking whether FreeType needs additional flags... no
checking wheter libjpeg works... yes
checking wheter libtiff works... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/cconfig.h
** libs
gmake[1]: Entering directory '/home/dteske/src/freebsd/ports/graphics/R-cran-Cairo/work/Cairo/src'
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c cairobem.c -o cairobem.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c cairogd.c -o cairogd.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c cairotalk.c -o cairotalk.o
cairotalk.c:130:11: warning: expression which evaluates to zero treated as a
      null pointer constant of type 'cairo_font_face_t *' (aka 'struct
      _cairo_font_face *') [-Wnon-literal-null-conversion]
                        return FALSE;
                               ^~~~~
cairotalk.c:270:22: warning: implicit conversion from enumeration type
      'enum _cairo_line_cap' to different enumeration type 'R_GE_lineend'
      [-Wenum-conversion]
        R_GE_lineend lend = CAIRO_LINE_CAP_SQUARE;
                     ~~~~   ^~~~~~~~~~~~~~~~~~~~~
cairotalk.c:271:24: warning: implicit conversion from enumeration type
      'enum _cairo_line_join' to different enumeration type 'R_GE_linejoin'
      [-Wenum-conversion]
        R_GE_linejoin ljoin = CAIRO_LINE_JOIN_ROUND;
                      ~~~~~   ^~~~~~~~~~~~~~~~~~~~~
cairotalk.c:278:29: warning: implicit conversion from enumeration type
      'enum _cairo_line_cap' to different enumeration type 'R_GE_lineend'
      [-Wenum-conversion]
                case GE_ROUND_CAP: lend = CAIRO_LINE_CAP_ROUND; break;
                                        ~ ^~~~~~~~~~~~~~~~~~~~
cairotalk.c:279:28: warning: implicit conversion from enumeration type
      'enum _cairo_line_cap' to different enumeration type 'R_GE_lineend'
      [-Wenum-conversion]
                case GE_BUTT_CAP: lend = CAIRO_LINE_CAP_BUTT; break;
                                       ~ ^~~~~~~~~~~~~~~~~~~
cairotalk.c:280:30: warning: implicit conversion from enumeration type
      'enum _cairo_line_cap' to different enumeration type 'R_GE_lineend'
      [-Wenum-conversion]
                case GE_SQUARE_CAP: lend = CAIRO_LINE_CAP_SQUARE; break;
                                         ~ ^~~~~~~~~~~~~~~~~~~~~
cairotalk.c:282:24: warning: implicit conversion from enumeration type
      'R_GE_lineend' to different enumeration type 'cairo_line_cap_t' (aka
      'enum _cairo_line_cap') [-Wenum-conversion]
        cairo_set_line_cap(cc,lend);
        ~~~~~~~~~~~~~~~~~~    ^~~~
cairotalk.c:286:31: warning: implicit conversion from enumeration type
      'enum _cairo_line_join' to different enumeration type 'R_GE_linejoin'
      [-Wenum-conversion]
                case GE_ROUND_JOIN: ljoin = CAIRO_LINE_JOIN_ROUND; break;
                                          ~ ^~~~~~~~~~~~~~~~~~~~~
cairotalk.c:287:31: warning: implicit conversion from enumeration type
      'enum _cairo_line_join' to different enumeration type 'R_GE_linejoin'
      [-Wenum-conversion]
                case GE_MITRE_JOIN: ljoin = CAIRO_LINE_JOIN_MITER; break;
                                          ~ ^~~~~~~~~~~~~~~~~~~~~
cairotalk.c:288:31: warning: implicit conversion from enumeration type
      'enum _cairo_line_join' to different enumeration type 'R_GE_linejoin'
      [-Wenum-conversion]
                case GE_BEVEL_JOIN: ljoin = CAIRO_LINE_JOIN_BEVEL; break;
                                          ~ ^~~~~~~~~~~~~~~~~~~~~
cairotalk.c:290:25: warning: implicit conversion from enumeration type
      'R_GE_linejoin' to different enumeration type 'cairo_line_join_t' (aka
      'enum _cairo_line_join') [-Wenum-conversion]
        cairo_set_line_join(cc,ljoin);
        ~~~~~~~~~~~~~~~~~~~    ^~~~~
11 warnings generated.
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c img-backend.c -o img-backend.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c img-jpeg.c -o img-jpeg.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c img-tiff.c -o img-tiff.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c pdf-backend.c -o pdf-backend.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c ps-backend.c -o ps-backend.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c svg-backend.c -o svg-backend.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c w32-backend.c -o w32-backend.o
cc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include/cairo -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libdrm -I/usr/local/include/libpng16 -D_THREAD_SAFE -pthread   -I. -Iinclude  -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fpic  -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -c xlib-backend.c -o xlib-backend.o
cc -shared -L/usr/local/lib/R/lib -L/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc9 -L/usr/local/lib/gcc9 -B/usr/local/bin -fstack-protector-strong -o Cairo.so cairobem.o cairogd.o cairotalk.o img-backend.o img-jpeg.o img-tiff.o pdf-backend.o ps-backend.o svg-backend.o w32-backend.o xlib-backend.o -Wl,-rpath=/usr/local/lib/gcc9 -L/usr/local/lib/gcc9 -B/usr/local/bin -fstack-protector-strong -L/usr/local/lib -lfreetype -lpng16 -lz -lcairo -lpthread -lXext -lXrender -lX11 -ljpeg -ltiff -L/usr/local/lib/R/lib -lR
gmake[1]: Leaving directory '/home/dteske/src/freebsd/ports/graphics/R-cran-Cairo/work/Cairo/src'
installing to /home/dteske/src/freebsd/ports/graphics/R-cran-Cairo/work/stage/usr/local/lib/R/library/00LOCK-Cairo/00new/Cairo/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (Cairo)
/usr/bin/find /home/dteske/src/freebsd/ports/graphics/R-cran-Cairo/work/stage/usr/local/lib/R/library/Cairo -name '*.so' -exec /usr/bin/strip {} +
====> Compressing man pages (compress-man)
===>  Installing for R-cran-Cairo-1.5.10
===>  Checking if R-cran-Cairo is already installed
===>  Switching to root credentials for 'install' target
Password:
===>   Registering installation for R-cran-Cairo-1.5.10
Installing R-cran-Cairo-1.5.10...
===>  Returning to user credentials

So maybe before you blast someone with "please test before submitting reviews" maybe *you* should test

This revision now requires review to proceed.Dec 4 2019, 8:22 PM

Erm, there's this bit in bsd.port.Mk:

.if defined(DISTVERSION)
DEV_ERROR+=     "Defining both PORTVERSION and DISTVERSION is wrong, only set one, if necessary, set DISTNAME"
.endif

I suspect DEV_ERROR means it only errors if you have DEVELOPER=yes set in /etc/make.conf as the porter's handbook recommends (see the start of chapter 3 at https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html). I ran into this error the other day myself when I had a bug in one of my ports (was including bsd.port.mk again after bsd.port.pre.mk).

Removing a reviewer and not accepting feedback is unacceptable behavior. You owe mat@ an apology.

mat added inline comments.
graphics/R-cran-Cairo/Makefile
5–6

Well, as one of the people who actually writes the framework, I can tell you that if you set both, it fails. For example, if I edit, say, sysutils/lsof's Makefile and add PORTVERSION set to the same value as DISTVERSION, it will fail with:

$ make
/!\ lsof-4.93.2_5,8: Makefile errors /!\

Defining both PORTVERSION and DISTVERSION is wrong, only set one, if necessary,
set DISTNAME

*** Error code 1

Stop.
make: stopped in /home/mat/work/freebsd/ports/sysutils/lsof

Please read https://www.freebsd.org/doc/en/books/porters-handbook/makefile-naming.html#makefile-versions

You do have DEVELOPER=yes set in your make.conf, right?

mat requested changes to this revision.Dec 4 2019, 8:41 PM
This revision now requires changes to proceed.Dec 4 2019, 8:41 PM
graphics/R-cran-Cairo/Makefile
5–6

I do not have DEVELOPER=yes in make.conf ... when was that introduced?

In D22681#496190, @jhb wrote:

Erm, there's this bit in bsd.port.Mk:

.if defined(DISTVERSION)
DEV_ERROR+=     "Defining both PORTVERSION and DISTVERSION is wrong, only set one, if necessary, set DISTNAME"
.endif

I suspect DEV_ERROR means it only errors if you have DEVELOPER=yes set in /etc/make.conf as the porter's handbook recommends (see the start of chapter 3 at https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html). I ran into this error the other day myself when I had a bug in one of my ports (was including bsd.port.mk again after bsd.port.pre.mk).

I did not have DEVELOPER=yes in /etc/make.conf

My first commit to ports was in 2012, pre-dating that flag.

Removing a reviewer and not accepting feedback is unacceptable behavior. You owe mat@ an apology.

I will apologize when mat apologizes for even suggesting that I would file a review without testing

dteske added inline comments.
graphics/R-cran-Cairo/Makefile
5–6

Appears DEVELOPER=yes was introduced in 2013

My first commit to ports was in 2012, when I was first mentored for ports

This revision is now accepted and ready to land.Dec 6 2019, 5:31 PM

@jhb @mat

I've had time to reflect, and I sincerely apologize for my unreasonable reaction to a reasonable inquiry.