From ceb4f5d1667d5e2704a2b0d971384d619615594f Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 03:38:25 +0900 Subject: [PATCH 1/8] [libvmaf] New port --- ports/libvmaf/no-tools.patch | 10 ++++++++++ ports/libvmaf/portfile.cmake | 26 ++++++++++++++++++++++++++ ports/libvmaf/vcpkg.json | 14 ++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 ports/libvmaf/no-tools.patch create mode 100644 ports/libvmaf/portfile.cmake create mode 100644 ports/libvmaf/vcpkg.json diff --git a/ports/libvmaf/no-tools.patch b/ports/libvmaf/no-tools.patch new file mode 100644 index 00000000000000..d93d37cafe3bca --- /dev/null +++ b/ports/libvmaf/no-tools.patch @@ -0,0 +1,10 @@ +Skip tools subdir in libvmaf to build only the library. +--- a/libvmaf/meson.build ++++ b/libvmaf/meson.build +@@ -51,6 +51,5 @@ endif + + subdir('include') + subdir('src') +-subdir('tools') + subdir('doc') + subdir('test') diff --git a/ports/libvmaf/portfile.cmake b/ports/libvmaf/portfile.cmake new file mode 100644 index 00000000000000..7ba7720782c0da --- /dev/null +++ b/ports/libvmaf/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Netflix/vmaf + REF "v${VERSION}" + SHA512 9e356bb274ce7d5d85a64d2a1a122ea9d267809edd83bb6e663fb348a1a46355882eb9044982bf679f03df7f93c6f66c9b0d9a94661979b2c722db30b21c4f32 + HEAD_REF master + PATCHES + no-tools.patch +) + +vcpkg_find_acquire_program(NASM) +get_filename_component(NASM_PATH "${NASM}" DIRECTORY) +vcpkg_add_to_path("${NASM_PATH}") + +vcpkg_configure_meson( + SOURCE_PATH "${SOURCE_PATH}/libvmaf" + OPTIONS + -Denable_tests=false + -Denable_docs=false +) + +vcpkg_install_meson() +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/libvmaf/vcpkg.json b/ports/libvmaf/vcpkg.json new file mode 100644 index 00000000000000..32b70384ae47ad --- /dev/null +++ b/ports/libvmaf/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "libvmaf", + "version": "3.0.0", + "port-version": 1, + "description": "libvmaf is a library developed by Netflix to compute the VMAF (Video Multi-Method Assessment Fusion) metric.", + "homepage": "https://github.com/Netflix/vmaf", + "license": "BSD-2-Clause-Patent", + "dependencies": [ + { + "name": "vcpkg-tool-meson", + "host": true + } + ] +} From 5d6a8bd826d8d7c7ab8457f7b3b14e464d429e71 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 03:42:26 +0900 Subject: [PATCH 2/8] Apply `vcpkg x-add-version --all` --- versions/baseline.json | 4 ++++ versions/l-/libvmaf.json | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 versions/l-/libvmaf.json diff --git a/versions/baseline.json b/versions/baseline.json index 65d0367faab2c0..1e9cc67524ada2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5260,6 +5260,10 @@ "baseline": "20231127", "port-version": 0 }, + "libvmaf": { + "baseline": "3.0.0", + "port-version": 1 + }, "libvmdk": { "baseline": "20221124", "port-version": 1 diff --git a/versions/l-/libvmaf.json b/versions/l-/libvmaf.json new file mode 100644 index 00000000000000..c7afbe0c643570 --- /dev/null +++ b/versions/l-/libvmaf.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "0dd987af51a76e8b775c3e73dbb38f21a4d69b65", + "version": "3.0.0", + "port-version": 1 + } + ] +} From 4d54b287a6fde765093bba9b1a57f537aade16d6 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 05:27:10 +0900 Subject: [PATCH 3/8] Disable libvmaf on Windows --- ports/libvmaf/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/libvmaf/vcpkg.json b/ports/libvmaf/vcpkg.json index 32b70384ae47ad..b496d4eb1f3276 100644 --- a/ports/libvmaf/vcpkg.json +++ b/ports/libvmaf/vcpkg.json @@ -5,6 +5,7 @@ "description": "libvmaf is a library developed by Netflix to compute the VMAF (Video Multi-Method Assessment Fusion) metric.", "homepage": "https://github.com/Netflix/vmaf", "license": "BSD-2-Clause-Patent", + "supports": "!windows", "dependencies": [ { "name": "vcpkg-tool-meson", From 6e5b64842c8af28febfb4c90d2d4b75453ca6aa1 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 12:16:19 +0900 Subject: [PATCH 4/8] Remove port-version --- ports/libvmaf/vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/libvmaf/vcpkg.json b/ports/libvmaf/vcpkg.json index b496d4eb1f3276..6908982de1e9f8 100644 --- a/ports/libvmaf/vcpkg.json +++ b/ports/libvmaf/vcpkg.json @@ -1,7 +1,6 @@ { "name": "libvmaf", "version": "3.0.0", - "port-version": 1, "description": "libvmaf is a library developed by Netflix to compute the VMAF (Video Multi-Method Assessment Fusion) metric.", "homepage": "https://github.com/Netflix/vmaf", "license": "BSD-2-Clause-Patent", From 4ad080f79a8d996b3452101144384e07ade43a87 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 12:16:44 +0900 Subject: [PATCH 5/8] Disable cross-compilation due to failures in arm_neon_android --- ports/libvmaf/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libvmaf/vcpkg.json b/ports/libvmaf/vcpkg.json index 6908982de1e9f8..913994eea4d6e2 100644 --- a/ports/libvmaf/vcpkg.json +++ b/ports/libvmaf/vcpkg.json @@ -4,7 +4,7 @@ "description": "libvmaf is a library developed by Netflix to compute the VMAF (Video Multi-Method Assessment Fusion) metric.", "homepage": "https://github.com/Netflix/vmaf", "license": "BSD-2-Clause-Patent", - "supports": "!windows", + "supports": "!windows & !android & !ios", "dependencies": [ { "name": "vcpkg-tool-meson", From f72232342d3656f67513528bcf4884d8fcdceaa6 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 12:18:32 +0900 Subject: [PATCH 6/8] Update version database --- versions/baseline.json | 2 +- versions/l-/libvmaf.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 1e9cc67524ada2..9002e9f21e3595 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5262,7 +5262,7 @@ }, "libvmaf": { "baseline": "3.0.0", - "port-version": 1 + "port-version": 0 }, "libvmdk": { "baseline": "20221124", diff --git a/versions/l-/libvmaf.json b/versions/l-/libvmaf.json index c7afbe0c643570..d5195d47660d7c 100644 --- a/versions/l-/libvmaf.json +++ b/versions/l-/libvmaf.json @@ -1,9 +1,9 @@ { "versions": [ { - "git-tree": "0dd987af51a76e8b775c3e73dbb38f21a4d69b65", + "git-tree": "180c069c610bb347936a6fe1e3d11374bd6ad8c2", "version": "3.0.0", - "port-version": 1 + "port-version": 0 } ] } From eeebb8b995f811bb4b61a96224e0374cdd65b0db Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 21:10:38 +0900 Subject: [PATCH 7/8] Enable Android and iOS --- ports/libvmaf/android-off_t.patch | 16 ++++++++++++++++ ports/libvmaf/portfile.cmake | 1 + ports/libvmaf/vcpkg.json | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ports/libvmaf/android-off_t.patch diff --git a/ports/libvmaf/android-off_t.patch b/ports/libvmaf/android-off_t.patch new file mode 100644 index 00000000000000..4b70e7714c43bd --- /dev/null +++ b/ports/libvmaf/android-off_t.patch @@ -0,0 +1,16 @@ +--- a/libvmaf/src/meson.build ++++ b/libvmaf/src/meson.build +@@ -13,6 +13,13 @@ if cc.get_id() != 'msvc' + '-pedantic', + '-DOC_NEW_STYLE_INCLUDES', + ] ++ # If the target is Android, define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS unconditionally ++ # to work around the fact that meson always defines _FILE_OFFSET_BITS=64, which ++ # causes issues for API levels below 24 in 32-bit architectures. ++ # See https://github.com/mesonbuild/meson/issues/3049 for more details. ++ if target_machine.system() == 'android' ++ vmaf_cflags_common += '-D_LIBCPP_HAS_NO_OFF_T_FUNCTIONS' ++ endif + else + vmaf_cflags_common = [ + '-wd4028', # parameter different from declaration diff --git a/ports/libvmaf/portfile.cmake b/ports/libvmaf/portfile.cmake index 7ba7720782c0da..1d4df5ef6a9309 100644 --- a/ports/libvmaf/portfile.cmake +++ b/ports/libvmaf/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES no-tools.patch + android-off_t.patch ) vcpkg_find_acquire_program(NASM) diff --git a/ports/libvmaf/vcpkg.json b/ports/libvmaf/vcpkg.json index 913994eea4d6e2..6908982de1e9f8 100644 --- a/ports/libvmaf/vcpkg.json +++ b/ports/libvmaf/vcpkg.json @@ -4,7 +4,7 @@ "description": "libvmaf is a library developed by Netflix to compute the VMAF (Video Multi-Method Assessment Fusion) metric.", "homepage": "https://github.com/Netflix/vmaf", "license": "BSD-2-Clause-Patent", - "supports": "!windows & !android & !ios", + "supports": "!windows", "dependencies": [ { "name": "vcpkg-tool-meson", From 19d367563086d5bf0be172a63ca94061f138bf5a Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Wed, 25 Sep 2024 21:11:04 +0900 Subject: [PATCH 8/8] Update version database --- versions/l-/libvmaf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/libvmaf.json b/versions/l-/libvmaf.json index d5195d47660d7c..92fdcfe39f7572 100644 --- a/versions/l-/libvmaf.json +++ b/versions/l-/libvmaf.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "180c069c610bb347936a6fe1e3d11374bd6ad8c2", + "git-tree": "01baad74661c761572624fd0eed900ee6fc7b2eb", "version": "3.0.0", "port-version": 0 }