Upgrading graphics/mupdf from 1.13 to 1.14 fails after too much errors: [...] mkdir -p build/release/source/fitz/ ; cc -O2 -pipe -march=nocona -fstack-protector -fno-strict-aliasing -ffunction-sections -fdata-sections -DNDEBUG -fomit-frame-pointer -I/usr/ports/graphics/mupdf/work/mupdf-1.14.0-source/include/mupdf -fPIC -Iinclude -MMD -MP -o build/release/source/fitz/load-png.o -c source/fitz/load-png.c -Wall -Wdeclaration-after-statement -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -DSHARE_JPEG -Ithirdparty/lcms2/include -Ithirdparty/mujs -I/usr/local/include/openjpeg-2.3 source/fitz/load-jpx.c:491:2: error: unknown type name 'OPJ_SIZE_T' OPJ_SIZE_T size; ^ source/fitz/load-jpx.c:492:2: error: unknown type name 'OPJ_SIZE_T' OPJ_SIZE_T pos; ^ source/fitz/load-jpx.c:641:8: error: unknown type name 'OPJ_SIZE_T' static OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_by... ^ source/fitz/load-jpx.c:641:55: error: unknown type name 'OPJ_SIZE_T' static OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_by... ^ source/fitz/load-jpx.c:644:2: error: use of undeclared identifier 'OPJ_SIZE_T' OPJ_SIZE_T len; ^ source/fitz/load-jpx.c:646:2: error: use of undeclared identifier 'len' len = sb->size - sb->pos; ^ source/fitz/load-jpx.c:647:6: error: use of undeclared identifier 'len' if (len == 0) ^ source/fitz/load-jpx.c:648:11: error: use of undeclared identifier 'OPJ_SIZE_T' return (OPJ_SIZE_T)-1; /* End of file! */ ^ source/fitz/load-jpx.c:649:6: error: use of undeclared identifier 'len' if (len > p_nb_bytes) ^ source/fitz/load-jpx.c:650:3: error: use of undeclared identifier 'len' len = p_nb_bytes; ^ source/fitz/load-jpx.c:651:39: error: use of undeclared identifier 'len' memcpy(p_buffer, sb->data + sb->pos, len); ^ source/fitz/load-jpx.c:652:13: error: use of undeclared identifier 'len' sb->pos += len; ^ source/fitz/load-jpx.c:653:9: error: use of undeclared identifier 'len' return len; ^ source/fitz/load-jpx.c:656:8: error: unknown type name 'OPJ_OFF_T' static OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data) ^ source/fitz/load-jpx.c:656:37: error: unknown type name 'OPJ_OFF_T' static OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data) source/fitz/load-jpx.c:660:14: error: use of undeclared identifier 'OPJ_OFF_T' if (skip > (OPJ_OFF_T)(sb->size - sb->pos)) ^ source/fitz/load-jpx.c:661:11: error: use of undeclared identifier 'OPJ_OFF_T' skip = (OPJ_OFF_T)(sb->size - sb->pos); ^ source/fitz/load-jpx.c:666:8: error: unknown type name 'OPJ_BOOL' static OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data) ^ source/fitz/load-jpx.c:666:36: error: unknown type name 'OPJ_OFF_T' static OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data) ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. gmake[2]: *** [Makefile:101: build/release/source/fitz/load-jpx.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... gmake[2]: Leaving directory '/usr/ports/graphics/mupdf/work/mupdf-1.14.0-source' ===> Compilation failed unexpectedly. [...] My uname -a: FreeBSD yokozuna 12.0-STABLE FreeBSD 12.0-STABLE r343805 YOKOZUNA amd64
The same and for me FreeBSD daemon.sanitarium.com.ua 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 #1 r343954M: Sun Feb 10 13:43:21 UTC 2019
I can't reproduce in here: https://termbin.com/5pvk
The error appears if option us JS=on.
I have default options set, so with JS=off.
You're right also happens with default.
Still can reproduce with JS=on: https://termbin.com/5jto Are you using portmaster (or eventually portupgrade)? Try building with "-R" (or -r I don't remember) on portmaster to force rebuild all dependencies.
see here: https://svnweb.freebsd.org/ports/head/graphics/mupdf/Makefile?r1=474665&r2=474664&pathrev=474665 If you pui the lines CFLAGS+= `pkg-config --cflags libopenjp2` -I${WRKSRC}/include/mupdf -fPIC # pkg-config to avoid the conflict with openjpeg15 LIBS+= -L${LOCALBASE}/lib back in the Makefile it builds.
It is only needed to add `pkg-config --cflags libopenjp2` to XCFLAGS.
A commit references this bug: Author: rigoletto Date: Sun Feb 24 17:48:15 UTC 2019 New revision: 493777 URL: https://svnweb.freebsd.org/changeset/ports/493777 Log: graphics/mupdf: fix build when graphics/openjpeg15 is present. PR: 235996 Submitted by: Walter Schwarzenfeld <w.schwarzenfeld@utanet.at> Reported by: Marco Beishuizen <mbeis@xs4all.nl> Approved by: tcberner (mentor) Changes: head/graphics/mupdf/Makefile
Thank you. :-)