From 5f32f7d6818047b89a08f6afd1927d66c9c4bae9 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Thu, 6 May 2021 17:54:49 -0700 Subject: [PATCH 1/4] add avcpp port --- ...-remove-problematic-compound-literal.patch | 25 ++++++++++++++ ports/avcpp/portfile.cmake | 34 +++++++++++++++++++ ports/avcpp/vcpkg.json | 28 +++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 ports/avcpp/0001-remove-problematic-compound-literal.patch create mode 100644 ports/avcpp/portfile.cmake create mode 100644 ports/avcpp/vcpkg.json diff --git a/ports/avcpp/0001-remove-problematic-compound-literal.patch b/ports/avcpp/0001-remove-problematic-compound-literal.patch new file mode 100644 index 00000000000000..d99c2f12fd4234 --- /dev/null +++ b/ports/avcpp/0001-remove-problematic-compound-literal.patch @@ -0,0 +1,25 @@ +From 8790ff3520bf2648ff2b5b436686878ec8d37ff3 Mon Sep 17 00:00:00 2001 +From: Charles Barto +Date: Thu, 6 May 2021 17:47:23 -0700 +Subject: [PATCH] remove problematic compound literal + +--- + src/avutils.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/avutils.h b/src/avutils.h +index 29c4ae0..3bfaf82 100644 +--- a/src/avutils.h ++++ b/src/avutils.h +@@ -42,7 +42,7 @@ namespace av { + // Basic FFmpeg constants + constexpr auto NoPts = static_cast(AV_NOPTS_VALUE); + constexpr auto TimeBase = static_cast(AV_TIME_BASE); +-constexpr auto TimeBaseQ = static_cast(AV_TIME_BASE_Q); ++constexpr auto TimeBaseQ = AVRational{1, AV_TIME_BASE}; + + + template +-- +2.27.0.windows.1 + diff --git a/ports/avcpp/portfile.cmake b/ports/avcpp/portfile.cmake new file mode 100644 index 00000000000000..d6412fce8b13d1 --- /dev/null +++ b/ports/avcpp/portfile.cmake @@ -0,0 +1,34 @@ +# avcpp doesn't export any symbols +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO h4tr3d/avcpp + REF d1a39cf6e1ccfe78ababe5a65d02d57f1e65bea1 + SHA512 48eb3bdd8729c9f61c53b152f0bb7283b40d2c8f043a1d6bb4fb1fadb0ceebf754822eeb7fa85edcacbca267eea0999dd9e78e378b04984db6dc25f9a6fab7d0 + HEAD_REF master + PATCHES + 0001-remove-problematic-compound-literal.patch +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" AVCPP_ENABLE_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" AVCPP_ENABLE_SHARED) + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DAV_ENABLE_STATIC=${AVCPP_ENABLE_STATIC} + -DAV_ENABLE_SHARED=${AVCPP_ENABLE_SHARED} + -DAV_BUILD_EXAMPLES=OFF + -DBUILD_TESTING=OFF +) +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/avcpp/vcpkg.json b/ports/avcpp/vcpkg.json new file mode 100644 index 00000000000000..15ec2257cf38b6 --- /dev/null +++ b/ports/avcpp/vcpkg.json @@ -0,0 +1,28 @@ +{ + "name": "avcpp", + "version-date": "2021-05-06", + "homepage": "https://github.com/h4tr3d/avcpp", + "description": "Wrapper for the FFmpeg that simplify usage it from C++ projects.", + "dependencies": [ + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "avcodec", + "avformat", + "avdevice", + "avfilter", + "swscale", + "swresample" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} \ No newline at end of file From 4e0d94210c426bafd146ada6272848e3f351bf0c Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Thu, 6 May 2021 23:36:43 -0700 Subject: [PATCH 2/4] add avcpp --- versions/a-/avcpp.json | 9 +++++++++ versions/baseline.json | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 versions/a-/avcpp.json diff --git a/versions/a-/avcpp.json b/versions/a-/avcpp.json new file mode 100644 index 00000000000000..afc80e2ab6a483 --- /dev/null +++ b/versions/a-/avcpp.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "604462ff365a246bea4ace02f1c0022c33ee5178", + "version-date": "2021-05-06", + "port-version": 0 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 0b1d076ae986f7..8d58efe01b9b78 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -204,6 +204,10 @@ "baseline": "20.8.1", "port-version": 0 }, + "avcpp": { + "baseline": "2021-05-06", + "port-version": 0 + }, "avisynthplus": { "baseline": "3.7.0", "port-version": 0 From c6e5b7273275928d9f7c0b47b4e9c2c1589c5c0d Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 11 May 2021 15:50:48 -0700 Subject: [PATCH 3/4] apply code review comments --- ...-remove-problematic-compound-literal.patch | 11 ---- ports/avcpp/vcpkg.json | 56 +++++++++---------- 2 files changed, 28 insertions(+), 39 deletions(-) diff --git a/ports/avcpp/0001-remove-problematic-compound-literal.patch b/ports/avcpp/0001-remove-problematic-compound-literal.patch index d99c2f12fd4234..aa6c58cc234617 100644 --- a/ports/avcpp/0001-remove-problematic-compound-literal.patch +++ b/ports/avcpp/0001-remove-problematic-compound-literal.patch @@ -1,12 +1,3 @@ -From 8790ff3520bf2648ff2b5b436686878ec8d37ff3 Mon Sep 17 00:00:00 2001 -From: Charles Barto -Date: Thu, 6 May 2021 17:47:23 -0700 -Subject: [PATCH] remove problematic compound literal - ---- - src/avutils.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/src/avutils.h b/src/avutils.h index 29c4ae0..3bfaf82 100644 --- a/src/avutils.h @@ -20,6 +11,4 @@ index 29c4ae0..3bfaf82 100644 template --- -2.27.0.windows.1 diff --git a/ports/avcpp/vcpkg.json b/ports/avcpp/vcpkg.json index 15ec2257cf38b6..afb9a18a44a490 100644 --- a/ports/avcpp/vcpkg.json +++ b/ports/avcpp/vcpkg.json @@ -1,28 +1,28 @@ -{ - "name": "avcpp", - "version-date": "2021-05-06", - "homepage": "https://github.com/h4tr3d/avcpp", - "description": "Wrapper for the FFmpeg that simplify usage it from C++ projects.", - "dependencies": [ - { - "name": "ffmpeg", - "default-features": false, - "features": [ - "avcodec", - "avformat", - "avdevice", - "avfilter", - "swscale", - "swresample" - ] - }, - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} \ No newline at end of file +{ + "name": "avcpp", + "version-date": "2021-05-06", + "description": "Wrapper for the FFmpeg that simplify usage it from C++ projects.", + "homepage": "https://github.com/h4tr3d/avcpp", + "dependencies": [ + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "avcodec", + "avdevice", + "avfilter", + "avformat", + "swresample", + "swscale" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} From e602e403fc1ae960d3849fb694952d4d9d13cd42 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 11 May 2021 15:51:51 -0700 Subject: [PATCH 4/4] update versions --- versions/a-/avcpp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/a-/avcpp.json b/versions/a-/avcpp.json index afc80e2ab6a483..f90c69a45a8603 100644 --- a/versions/a-/avcpp.json +++ b/versions/a-/avcpp.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "604462ff365a246bea4ace02f1c0022c33ee5178", + "git-tree": "aa82b322b6c59cf758147d78664f3d7ce66a77dc", "version-date": "2021-05-06", "port-version": 0 }