From 5f3249e50ef94ad8b281053fd71453b58b7f4c3b Mon Sep 17 00:00:00 2001 From: General Jack O'Neill <68293825+StarGate-One@users.noreply.github.com> Date: Mon, 15 Mar 2021 18:21:09 -0400 Subject: [PATCH] [openjpeg] 16645 Fix compile w/features jp3d,jpip,jpwl,mj2 triplet x64-windows VS 2019 ver 16.9.1 (#16661) * Fix for openjpeg issue 16645 compile with VS2019 16.9.1 - Modified portfile.cmake to apply patch fix-lrintf-to-opj_lrintf.patch - Added patch to change /src/lib/openmj2/opj_includes.h From: static INLINE long lrintf(float f) To: static INLINE long opj_lrintf(float f) - Converted CONTROL file to vcpkg.json file - Fix was tested locally on triplet x64-windows with Microsoft Windows x64 Professional 20H2 [Version 10.0.19042.867] Windows Feature Experience Pack 120.2212.551.0 Windows SDK [Version 10.0.19041.0] VS 2017: Visual Studio 2017 Community Edition [Version 15.9.34] Visual Studio Toolset [Version 14.16.27023] Microsoft (R) C/C++ Optimizing Compiler [Version 19.16.27045 for x64] VS 2019: Visual Studio 2019 Community Edition [Version 16.9.1] Visual Studio Toolset [Version 14.28.29910] Microsoft (R) C/C++ Optimizing Compiler [Version 19.28.29912 for x64] * Update json file * Reformat vcpkg.json file * Update port version * Update json file * Update ports/openjpeg/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/openjpeg/vcpkg.json Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update versions/baseline.json Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update versions/o-/openjpeg.json Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update json file Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/openjpeg/CONTROL | 17 --------------- ports/openjpeg/fix-lrintf-to-opj_lrintf.patch | 13 ++++++++++++ ports/openjpeg/portfile.cmake | 4 +++- ports/openjpeg/vcpkg.json | 21 +++++++++++++++++++ versions/baseline.json | 2 +- versions/o-/openjpeg.json | 5 +++++ 6 files changed, 43 insertions(+), 19 deletions(-) delete mode 100644 ports/openjpeg/CONTROL create mode 100644 ports/openjpeg/fix-lrintf-to-opj_lrintf.patch create mode 100644 ports/openjpeg/vcpkg.json diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL deleted file mode 100644 index 07afd75f16..0000000000 --- a/ports/openjpeg/CONTROL +++ /dev/null @@ -1,17 +0,0 @@ -Source: openjpeg -Version: 2.3.1 -Port-Version: 2 -Homepage: https://github.com/uclouvain/openjpeg -Description: JPEG 2000 image library - -Feature: jpwl -Description: Build optional component jpwl - -Feature: mj2 -Description: Build optional component mj2 - -Feature: jpip -Description: Build optional component jpip - -Feature: jp3d -Description: Build optional component jp3d diff --git a/ports/openjpeg/fix-lrintf-to-opj_lrintf.patch b/ports/openjpeg/fix-lrintf-to-opj_lrintf.patch new file mode 100644 index 0000000000..1d79d6332e --- /dev/null +++ b/ports/openjpeg/fix-lrintf-to-opj_lrintf.patch @@ -0,0 +1,13 @@ +diff --git a/src/lib/openmj2/opj_includes.h b/src/lib/openmj2/opj_includes.h +index 340e8a9..11bb0e4 100644 +--- a/src/lib/openmj2/opj_includes.h ++++ b/src/lib/openmj2/opj_includes.h +@@ -93,7 +93,7 @@ Most compilers implement their own version of this keyword ... + + /* MSVC and Borland C do not have lrintf */ + #if defined(_MSC_VER) || defined(__BORLANDC__) +-static INLINE long lrintf(float f) ++static INLINE long opj_lrintf(float f) + { + #ifdef _M_X64 + return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f)); diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index c6d854490f..6885513baf 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -4,7 +4,9 @@ vcpkg_from_github( REF v2.3.1 SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03 HEAD_REF master - PATCHES dll.location.patch + PATCHES + dll.location.patch + fix-lrintf-to-opj_lrintf.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") diff --git a/ports/openjpeg/vcpkg.json b/ports/openjpeg/vcpkg.json new file mode 100644 index 0000000000..d54e271dc2 --- /dev/null +++ b/ports/openjpeg/vcpkg.json @@ -0,0 +1,21 @@ +{ + "name": "openjpeg", + "version-semver": "2.3.1", + "port-version": 3, + "description": "OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of JPEG 2000, a still-image compression standard from the Joint Photographic Experts Group (JPEG). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a JPEG 2000 Reference Software.", + "homepage": "https://github.com/uclouvain/openjpeg", + "features": { + "jp3d": { + "description": "Build optional component jp3d" + }, + "jpip": { + "description": "Build optional component jpip" + }, + "jpwl": { + "description": "Build optional component jpwl" + }, + "mj2": { + "description": "Build optional component mj2" + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 77d4dda6c4..974ad9f064 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4358,7 +4358,7 @@ }, "openjpeg": { "baseline": "2.3.1", - "port-version": 2 + "port-version": 3 }, "openmama": { "baseline": "6.3.1", diff --git a/versions/o-/openjpeg.json b/versions/o-/openjpeg.json index 85dc246987..a556f81fca 100644 --- a/versions/o-/openjpeg.json +++ b/versions/o-/openjpeg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "55220d839365c2134574acc4e9b43b8adc2e20ab", + "version-semver": "2.3.1", + "port-version": 3 + }, { "git-tree": "06e54db04d7adacfd612bbaf233f6f790599b9c1", "version-string": "2.3.1",