From f2352adc40ed41e86da3b8afe9447260a418e2cc Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 02:00:57 -0600 Subject: [PATCH 1/8] [jasper]: Move opengl & freeglut dependencies under default-features in order to enable flexibility to not require any of those when importing jasper package (via default-features=false). --- ports/jasper/portfile.cmake | 6 ++++++ ports/jasper/vcpkg.json | 30 +++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ports/jasper/portfile.cmake b/ports/jasper/portfile.cmake index 7d70c79ba5c96d..69efaaef3c9c86 100644 --- a/ports/jasper/portfile.cmake +++ b/ports/jasper/portfile.cmake @@ -13,11 +13,17 @@ endif() string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" JAS_ENABLE_SHARED) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + opengl JAS_ENABLE_OPENGL +) + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF -DJAS_ENABLE_LIBJPEG=ON + -DJAS_ENABLE_OPENGL=${JAS_ENABLE_OPENGL} -DJAS_ENABLE_DOC=OFF -DJAS_ENABLE_PROGRAMS=OFF -DJAS_ENABLE_SHARED=${JAS_ENABLE_SHARED} diff --git a/ports/jasper/vcpkg.json b/ports/jasper/vcpkg.json index 3af61ab2e032f5..43f23377bafd03 100644 --- a/ports/jasper/vcpkg.json +++ b/ports/jasper/vcpkg.json @@ -1,16 +1,11 @@ { "name": "jasper", "version": "2.0.33", - "port-version": 1, + "port-version": 2, "description": "Open source implementation of the JPEG-2000 Part-1 standard", "homepage": "https://github.com/mdadams/jasper", "dependencies": [ - { - "name": "freeglut", - "platform": "!osx" - }, "libjpeg-turbo", - "opengl", { "name": "vcpkg-cmake", "host": true @@ -19,5 +14,26 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "default-features": [ + "freeglut", + "opengl" + ], + "features": { + "freeglut": { + "description": "Open source implementation of GLUT with source and binary backwards compatibility.", + "dependencies": [ + { + "name": "freeglut", + "platform": "!osx" + } + ] + }, + "opengl": { + "description": "OpenGL (Open Graphics Library) is the computer industry's standard API for defining 2-D and 3-D graphic images.", + "dependencies": [ + "opengl" + ] + } + } } From 17b6ce4e38cf6e99aea83215d0aa73250bc5dfb5 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 02:01:36 -0600 Subject: [PATCH 2/8] [jasper]: Move opengl & freeglut dependencies under default-features in order to enable flexibility to not require any of those when importing jasper package (via default-features=false). --- versions/baseline.json | 2 +- versions/j-/jasper.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 594762a138133b..c45e9e9c4da07f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2958,7 +2958,7 @@ }, "jasper": { "baseline": "2.0.33", - "port-version": 1 + "port-version": 2 }, "jbig2dec": { "baseline": "0.19", diff --git a/versions/j-/jasper.json b/versions/j-/jasper.json index f63ffb8cf635ee..3cd3eacd31986e 100644 --- a/versions/j-/jasper.json +++ b/versions/j-/jasper.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7b5a1bfb043c60591ce47bce87cd9d61d2150d45", + "version": "2.0.33", + "port-version": 2 + }, { "git-tree": "6fc7475e9c22dafb473c98e00136e89c03ad8f5b", "version": "2.0.33", From f828a420ffde5f0b02b455325914f2b9e45eb9b6 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 03:16:32 -0600 Subject: [PATCH 3/8] [x264]: enable cross-compilation for linux arm64 target. --- ports/x264/portfile.cmake | 29 +++++++++++++++++++++++++++++ ports/x264/vcpkg.json | 6 +++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index 33e6979ac0e776..ffae76874beb83 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -32,6 +32,35 @@ if(VCPKG_TARGET_IS_LINUX) list(APPEND OPTIONS --enable-pic) endif() +vcpkg_cmake_get_vars(cmake_vars_file) +include("${cmake_vars_file}") + +if (VCPKG_DETECTED_CMAKE_CROSSCOMPILING STREQUAL "TRUE") + if (VCPKG_TARGET_IS_LINUX) + if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + if (DEFINED ENV{CROSS_PREFIX}) + # allow toolchain to specify the cross-prefix + set(cross_prefix $ENV{CROSS_PREFIX}) + else() + # attempt to determine the cross-prefix from VCPKG_DETECTED_CMAKE_C/CXX_COMPILER using the most likely naming conventions + if (${VCPKG_DETECTED_CMAKE_C_COMPILER} MATCHES ".*-gcc") + string(REGEX REPLACE "gcc$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_C_COMPILER}) + get_filename_component(cross_prefix ${full_cross_prefix} NAME) + elseif (${VCPKG_DETECTED_CMAKE_CXX_COMPILER} MATCHES ".*-g\\+\\+") + string(REGEX REPLACE "g\\+\\+$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_CXX_COMPILER}) + get_filename_component(cross_prefix ${full_cross_prefix} NAME) + else() + message(AUTHOR_WARNING "Could not self-determine cross-prefix. Will attempt to use 'aarch64-linux-gnu-'. You should use ENV{CROSS_PREFIX} in your toolchain to override it.") + set(cross_prefix "aarch64-linux-gnu-") + endif() + endif() + list(APPEND OPTIONS --host=aarch64-linux) + list(APPEND OPTIONS --cross-prefix=${cross_prefix}) + list(APPEND OPTIONS --disable-asm) + endif() + endif() +endif() + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} NO_ADDITIONAL_PATHS diff --git a/ports/x264/vcpkg.json b/ports/x264/vcpkg.json index 436cf0b5efd276..2eb3339bccbdfd 100644 --- a/ports/x264/vcpkg.json +++ b/ports/x264/vcpkg.json @@ -1,7 +1,7 @@ { "name": "x264", "version-string": "164-5db6aa6cab1b146", - "port-version": 4, + "port-version": 5, "description": "x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format", "homepage": "https://github.com/mirror/x264", "supports": "!(arm & windows)", @@ -9,6 +9,10 @@ { "name": "pthread", "platform": "linux & osx" + }, + { + "name": "vcpkg-cmake", + "host": true } ] } From 8d60d79e906bcfb6407785c26d6a160f31029c87 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 03:17:37 -0600 Subject: [PATCH 4/8] [x264]: enable cross-compilation for linux arm64 target. --- versions/baseline.json | 2 +- versions/x-/x264.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index c45e9e9c4da07f..9166b56161fd35 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7366,7 +7366,7 @@ }, "x264": { "baseline": "164-5db6aa6cab1b146", - "port-version": 4 + "port-version": 5 }, "x265": { "baseline": "3.4", diff --git a/versions/x-/x264.json b/versions/x-/x264.json index bd8a969ea8dad4..b8474a9bdd342e 100644 --- a/versions/x-/x264.json +++ b/versions/x-/x264.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "37eed5a53e86373788b31863d16ea5cef2dad50a", + "version-string": "164-5db6aa6cab1b146", + "port-version": 5 + }, { "git-tree": "7eea109502309e62a578bcc69811ad0659e00f9d", "version-string": "164-5db6aa6cab1b146", From bea2e6d981eb58437beb680aaafbf32b488616cd Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 03:24:21 -0600 Subject: [PATCH 5/8] Revert "[x264]: enable cross-compilation for linux arm64 target." This reverts commit 8d60d79e906bcfb6407785c26d6a160f31029c87. Revert "[x264]: enable cross-compilation for linux arm64 target." This reverts commit f828a420ffde5f0b02b455325914f2b9e45eb9b6. --- ports/x264/portfile.cmake | 29 ----------------------------- ports/x264/vcpkg.json | 6 +----- versions/baseline.json | 2 +- versions/x-/x264.json | 5 ----- 4 files changed, 2 insertions(+), 40 deletions(-) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index ffae76874beb83..33e6979ac0e776 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -32,35 +32,6 @@ if(VCPKG_TARGET_IS_LINUX) list(APPEND OPTIONS --enable-pic) endif() -vcpkg_cmake_get_vars(cmake_vars_file) -include("${cmake_vars_file}") - -if (VCPKG_DETECTED_CMAKE_CROSSCOMPILING STREQUAL "TRUE") - if (VCPKG_TARGET_IS_LINUX) - if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - if (DEFINED ENV{CROSS_PREFIX}) - # allow toolchain to specify the cross-prefix - set(cross_prefix $ENV{CROSS_PREFIX}) - else() - # attempt to determine the cross-prefix from VCPKG_DETECTED_CMAKE_C/CXX_COMPILER using the most likely naming conventions - if (${VCPKG_DETECTED_CMAKE_C_COMPILER} MATCHES ".*-gcc") - string(REGEX REPLACE "gcc$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_C_COMPILER}) - get_filename_component(cross_prefix ${full_cross_prefix} NAME) - elseif (${VCPKG_DETECTED_CMAKE_CXX_COMPILER} MATCHES ".*-g\\+\\+") - string(REGEX REPLACE "g\\+\\+$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_CXX_COMPILER}) - get_filename_component(cross_prefix ${full_cross_prefix} NAME) - else() - message(AUTHOR_WARNING "Could not self-determine cross-prefix. Will attempt to use 'aarch64-linux-gnu-'. You should use ENV{CROSS_PREFIX} in your toolchain to override it.") - set(cross_prefix "aarch64-linux-gnu-") - endif() - endif() - list(APPEND OPTIONS --host=aarch64-linux) - list(APPEND OPTIONS --cross-prefix=${cross_prefix}) - list(APPEND OPTIONS --disable-asm) - endif() - endif() -endif() - vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} NO_ADDITIONAL_PATHS diff --git a/ports/x264/vcpkg.json b/ports/x264/vcpkg.json index 2eb3339bccbdfd..436cf0b5efd276 100644 --- a/ports/x264/vcpkg.json +++ b/ports/x264/vcpkg.json @@ -1,7 +1,7 @@ { "name": "x264", "version-string": "164-5db6aa6cab1b146", - "port-version": 5, + "port-version": 4, "description": "x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format", "homepage": "https://github.com/mirror/x264", "supports": "!(arm & windows)", @@ -9,10 +9,6 @@ { "name": "pthread", "platform": "linux & osx" - }, - { - "name": "vcpkg-cmake", - "host": true } ] } diff --git a/versions/baseline.json b/versions/baseline.json index 9166b56161fd35..c45e9e9c4da07f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7366,7 +7366,7 @@ }, "x264": { "baseline": "164-5db6aa6cab1b146", - "port-version": 5 + "port-version": 4 }, "x265": { "baseline": "3.4", diff --git a/versions/x-/x264.json b/versions/x-/x264.json index b8474a9bdd342e..bd8a969ea8dad4 100644 --- a/versions/x-/x264.json +++ b/versions/x-/x264.json @@ -1,10 +1,5 @@ { "versions": [ - { - "git-tree": "37eed5a53e86373788b31863d16ea5cef2dad50a", - "version-string": "164-5db6aa6cab1b146", - "port-version": 5 - }, { "git-tree": "7eea109502309e62a578bcc69811ad0659e00f9d", "version-string": "164-5db6aa6cab1b146", From 414cef9665600f0326716f6136920e7a02f45da8 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Fri, 4 Feb 2022 23:12:25 -0600 Subject: [PATCH 6/8] Update ports/jasper/vcpkg.json Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com> --- ports/jasper/vcpkg.json | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ports/jasper/vcpkg.json b/ports/jasper/vcpkg.json index 43f23377bafd03..024d7b144b6fba 100644 --- a/ports/jasper/vcpkg.json +++ b/ports/jasper/vcpkg.json @@ -16,22 +16,16 @@ } ], "default-features": [ - "freeglut", "opengl" ], "features": { - "freeglut": { - "description": "Open source implementation of GLUT with source and binary backwards compatibility.", + "opengl": { + "description": "Enable the use of the OpenGL/GLUT Library", "dependencies": [ { "name": "freeglut", - "platform": "!osx" - } - ] - }, - "opengl": { - "description": "OpenGL (Open Graphics Library) is the computer industry's standard API for defining 2-D and 3-D graphic images.", - "dependencies": [ + "platform": "osx" + }, "opengl" ] } From 269a09d3f5d2a2a71200c950831a61ab26ac2fd5 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Fri, 4 Feb 2022 23:38:59 -0600 Subject: [PATCH 7/8] Remove moot freeglut platform constraint. --- ports/jasper/vcpkg.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/jasper/vcpkg.json b/ports/jasper/vcpkg.json index 024d7b144b6fba..dd5d014bca9ace 100644 --- a/ports/jasper/vcpkg.json +++ b/ports/jasper/vcpkg.json @@ -22,10 +22,7 @@ "opengl": { "description": "Enable the use of the OpenGL/GLUT Library", "dependencies": [ - { - "name": "freeglut", - "platform": "osx" - }, + "freeglut", "opengl" ] } From 45685e2a21d59d460c8a7635122e36165abb01ff Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Sat, 5 Feb 2022 14:01:54 -0600 Subject: [PATCH 8/8] Update jasper port hash. --- versions/j-/jasper.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/j-/jasper.json b/versions/j-/jasper.json index 3cd3eacd31986e..77fb93867b46d6 100644 --- a/versions/j-/jasper.json +++ b/versions/j-/jasper.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "7b5a1bfb043c60591ce47bce87cd9d61d2150d45", + "git-tree": "59d44227795e2e5e31a0f3e327832e4013b1e255", "version": "2.0.33", "port-version": 2 },