Bug 222429 - www/chromium: fails to build with JPEG_PORT=graphics/jpeg defined
Summary: www/chromium: fails to build with JPEG_PORT=graphics/jpeg defined
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Carlos J. Puga Medina
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-18 18:01 UTC by gja822
Modified: 2018-02-20 22:36 UTC (History)
2 users (show)

See Also:
cpm: maintainer-feedback+
jbeich: maintainer-feedback? (portmgr)


Attachments
change behaviour in case of no system libjpeg-turbo (1.11 KB, text/x-c++src)
2017-09-28 07:40 UTC, gja822
no flags Details
change behaviour in case of no system libjpeg-turbo (1.71 KB, text/x-c++src)
2017-09-28 07:40 UTC, gja822
no flags Details
patch (2.58 KB, patch)
2017-10-15 10:39 UTC, Carlos J. Puga Medina
cpm: maintainer-approval+
Details | Diff
patch-chromium-fix-jcs-extensions (3.38 KB, patch)
2017-12-28 23:23 UTC, Carlos J. Puga Medina
cpm: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gja822 2017-09-18 18:01:06 UTC
I have chromium-59.0.3071.115_2 build from ports (no poudriere used). When I tried  to build newer version 61.* (latest try was with 61.0.3163.79) I get error:

FAILED: obj/skia/skia/SkJpegEncoder.o 
clang++40 -MMD -MF obj/skia/skia/SkJpegEncoder.o.d -DV8_DEPRECATION_WARNINGS -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DDISABLE_NACL -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=\"307486-1\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_SUPPORT_GPU=1 -DSK_FREETYPE_MINIMUM_RUNTIME_VERSION=\(\(\(FREETYPE_MAJOR\)\ \*\ 0x01000000\)\ \|\ \(\(FREETYPE_MINOR\)\ \*\ 0x00010000\)\ \|\ \(\(FREETYPE_PATCH\)\ \*\ 0x00000100\)\) -DSK_GAMMA_EXPONENT=1.2 -DSK_GAMMA_CONTRAST=0.2 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -DUSE_SYSTEM_LIBJPEG -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -I../.. -Igen -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/third_party/vulkan -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/skia/include/private -I../../third_party/skia/include/client/android -I../../third_party/skia/src/codec -I../../third_party/skia/src/core -I../../third_party/skia/src/image -I../../third_party/skia/src/images -I../../third_party/skia/src/opts -I../../third_party/skia/src/pdf -I../../third_party/skia/src/ports -I../../third_party/skia/src/shaders -I../../third_party/skia/src/shaders/gradients -I../../third_party/skia/src/sfnt -I../../third_party/skia/src/utils -I../../third_party/skia/src/lazy -I../../third_party/skia/src/effects/gradients -I../../third_party/libpng -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/libpng16 -I/usr/local/include/libdrm -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Igen/shim_headers/harfbuzz_shim -I../../third_party/freetype/include -I../../third_party/freetype/src/include -I../../third_party/zlib -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/sfntly/src/cpp/src -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -fcolor-diagnostics -m64 -march=x86-64 -fomit-frame-pointer -g0 -fvisibility=hidden -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-user-defined-warnings -D_THREAD_SAFE -O2 -fno-ident -fdata-sections -ffunction-sections -std=c++11 -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 -c ../../third_party/skia/src/images/SkJpegEncoder.cpp -o obj/skia/skia/SkJpegEncoder.o
../../third_party/skia/src/images/SkJpegEncoder.cpp:89:35: error: use of undeclared identifier 'JCS_EXT_RGBA'
    J_COLOR_SPACE jpegColorType = JCS_EXT_RGBA;
                                  ^
../../third_party/skia/src/images/SkJpegEncoder.cpp:94:29: error: use of undeclared identifier 'JCS_EXT_RGBA'
            jpegColorType = JCS_EXT_RGBA;
                            ^
../../third_party/skia/src/images/SkJpegEncoder.cpp:99:29: error: use of undeclared identifier 'JCS_EXT_BGRA'
            jpegColorType = JCS_EXT_BGRA;
                            ^
../../third_party/skia/src/images/SkJpegEncoder.cpp:134:29: error: use of undeclared identifier 'JCS_EXT_RGBA'
            jpegColorType = JCS_EXT_RGBA;
                            ^
4 errors generated.


Options ON are CODECS, GCONF and PULSEAUDIO, everything else is OFF.
Comment 1 gja822 2017-09-18 18:01:47 UTC
uname:
FreeBSD 10.4-BETA3 #0 r323103M
Comment 2 Jan Beich freebsd_committer freebsd_triage 2017-09-18 18:48:56 UTC
JCS_* are libjpeg-turbo extensions. Did you define JPEG_PORT=graphics/jpeg by chance? I don't think anyone tests such a configuration.
Comment 3 gja822 2017-09-19 01:42:57 UTC
(In reply to Jan Beich from comment #2)

Oh… Yes, I do have JPEG_PORT=graphics/jpeg in my make.conf
So, is there any solution in my case?
Comment 4 Jan Beich freebsd_committer freebsd_triage 2017-09-19 02:14:51 UTC
Comment out use_system_libjpeg=true in www/chromium/Makefile or track down the upstream commit causing bustage and wrap it with #ifdef JCS_EXTENSIONS.
Comment 5 gja822 2017-09-19 16:50:43 UTC
(In reply to Jan Beich from comment #4)

Thank you for the reply. Shall try.
Comment 6 gja822 2017-09-20 16:49:56 UTC
(In reply to Jan Beich from comment #4)
Fortunately, there's just a couple of files that use JCS_EXT_* so putting these occurrences into #ifdef JCS_EXTENSIONS #indif helped to successfully build and run.
Comment 7 gja822 2017-09-23 16:59:55 UTC
(In reply to gja822 from comment #6)
More precisely, it needed just a couple of modifications in just two files: SkJpegEncoder.cpp and jpeg_codec.cc
Comment 8 gja822 2017-09-28 07:40:04 UTC
Created attachment 186775 [details]
change behaviour in case of no system libjpeg-turbo
Comment 9 gja822 2017-09-28 07:40:23 UTC
Created attachment 186776 [details]
change behaviour in case of no system libjpeg-turbo
Comment 10 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-09-30 21:19:37 UTC
I'll take care.

Thanks
Comment 11 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-10-15 10:39:06 UTC
Created attachment 187192 [details]
patch

Reworking the patch files.
Comment 12 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-12-28 23:23:44 UTC
Created attachment 189181 [details]
patch-chromium-fix-jcs-extensions

Fix properly patch-third__party_skia_src_images_SkJpegEncoder.cpp

Tested on 10.3a w/o JPEG_PORT=graphics/jpeg
Comment 13 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-02-20 22:36:18 UTC
Fixed by ports r462416