From a4625ce8c43de20d0fbf5e5dfd65bdf6dc80ce92 Mon Sep 17 00:00:00 2001 From: Cheney-Wang <850426846@qq.com> Date: Tue, 31 Jan 2023 00:57:36 -0800 Subject: [PATCH 1/2] [faad2] Update to 2.10.1 --- ports/faad2/0001-Fix-non-x86-msvc.patch | 13 ---------- ports/faad2/0002-Fix-unary-minus.patch | 24 ------------------- ports/faad2/0003-Initialize-pointers.patch | 28 ---------------------- ports/faad2/CMakeLists.txt | 2 +- ports/faad2/portfile.cmake | 10 +++----- ports/faad2/vcpkg.json | 4 ++-- versions/baseline.json | 4 ++-- versions/f-/faad2.json | 5 ++++ 8 files changed, 13 insertions(+), 77 deletions(-) delete mode 100644 ports/faad2/0001-Fix-non-x86-msvc.patch delete mode 100644 ports/faad2/0002-Fix-unary-minus.patch delete mode 100644 ports/faad2/0003-Initialize-pointers.patch diff --git a/ports/faad2/0001-Fix-non-x86-msvc.patch b/ports/faad2/0001-Fix-non-x86-msvc.patch deleted file mode 100644 index 821dfb09b5e12b..00000000000000 --- a/ports/faad2/0001-Fix-non-x86-msvc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libfaad/common.h b/libfaad/common.h -index 897a0f0..8b78807 100644 ---- a/libfaad/common.h -+++ b/libfaad/common.h -@@ -313,7 +313,7 @@ char *strchr(), *strrchr(); - } - - -- #if defined(_WIN32) && !defined(_WIN64) && !defined(__MINGW32__) -+ #if defined(_WIN32) && defined(_M_IX86) && !defined(__MINGW32__) - #ifndef HAVE_LRINTF - #define HAS_LRINTF - static INLINE int lrintf(float f) diff --git a/ports/faad2/0002-Fix-unary-minus.patch b/ports/faad2/0002-Fix-unary-minus.patch deleted file mode 100644 index 28e11603fa25e4..00000000000000 --- a/ports/faad2/0002-Fix-unary-minus.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/libfaad/decoder.c b/libfaad/decoder.c -index 4f4b011..9bed248 100644 ---- a/libfaad/decoder.c -+++ b/libfaad/decoder.c -@@ -239,7 +239,7 @@ static int latmCheck(latm_header *latm, bitfile *ld) - while (ld->bytes_left) - { - bits = faad_latm_frame(latm, ld); -- if(bits==-1U) -+ if(bits==0xFFFFFFFF) - bad++; - else - { -diff --git a/libfaad/syntax.c b/libfaad/syntax.c -index c992543..be8c541 100644 ---- a/libfaad/syntax.c -+++ b/libfaad/syntax.c -@@ -2644,5 +2644,5 @@ uint32_t faad_latm_frame(latm_header *latm, bitfile *ld) - return (len*8)-(endpos-initpos); - //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ? - } -- return -1U; -+ return 0xFFFFFFFF; - } diff --git a/ports/faad2/0003-Initialize-pointers.patch b/ports/faad2/0003-Initialize-pointers.patch deleted file mode 100644 index 29c572597a70a0..00000000000000 --- a/ports/faad2/0003-Initialize-pointers.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/frontend/main.c b/frontend/main.c -index e1d3c7d..25881c7 100644 ---- a/frontend/main.c -+++ b/frontend/main.c -@@ -462,9 +462,9 @@ static int decodeAACfile(char *aacfile, char *sndfile, char *adts_fn, int to_std - unsigned char channels; - void *sample_buffer; - -- audio_file *aufile; -+ audio_file *aufile = NULL; - -- FILE *adtsFile; -+ FILE *adtsFile = NULL; - unsigned char *adtsData; - int adtsDataSize; - -@@ -796,9 +796,9 @@ static int decodeMP4file(char *mp4file, char *sndfile, char *adts_fn, int to_std - - long sampleId, startSampleId; - -- audio_file *aufile; -+ audio_file *aufile = NULL; - -- FILE *adtsFile; -+ FILE *adtsFile = NULL; - unsigned char *adtsData; - int adtsDataSize; - diff --git a/ports/faad2/CMakeLists.txt b/ports/faad2/CMakeLists.txt index 10305eb005ed9f..b8784a93d0ba7d 100644 --- a/ports/faad2/CMakeLists.txt +++ b/ports/faad2/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.7.2) -project (faad VERSION 2.9.1) +project (faad VERSION 2.10.1) option(FAAD_BUILD_BINARIES "Build faad2 binaries" OFF) diff --git a/ports/faad2/portfile.cmake b/ports/faad2/portfile.cmake index 8596e1a8bae054..cb77a481631e4e 100644 --- a/ports/faad2/portfile.cmake +++ b/ports/faad2/portfile.cmake @@ -1,13 +1,9 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO knik0/faad2 - REF 043d37b60cdded2abed7c4054f954e # 2_9_1 - SHA512 8658256bbcb3ce641eef67c4f5d22d54b348805a06b2954718a44910861a9882371c887feb085060c524f955993ae26c211c6bb4fb8d95f9e9d1d0b5dca0ebe4 + REF "${VERSION}" + SHA512 8df69278350c68dd770c4bc482e42bc95eb04cd784eeea3f3fc58d615833c8b07dc3c72029bb7e5bfed612b7c1b8daefc9cb57be9789befb587120ef115e55b3 HEAD_REF master - PATCHES - 0001-Fix-non-x86-msvc.patch # https://github.com/knik0/faad2/pull/42 - 0002-Fix-unary-minus.patch # https://github.com/knik0/faad2/pull/43 - 0003-Initialize-pointers.patch # https://github.com/knik0/faad2/pull/44 ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") @@ -28,4 +24,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_copy_pdbs() file(INSTALL "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}") -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/faad2/vcpkg.json b/ports/faad2/vcpkg.json index f2d6031f7395e1..dabcffaee195cf 100644 --- a/ports/faad2/vcpkg.json +++ b/ports/faad2/vcpkg.json @@ -1,9 +1,9 @@ { "name": "faad2", - "version": "2.9.1", - "port-version": 5, + "version": "2.10.1", "description": "Freeware Advanced Audio (AAC) Decoder", "homepage": "https://sourceforge.net/projects/faac/", + "license": "GPL-2.0-or-later", "supports": "windows", "dependencies": [ { diff --git a/versions/baseline.json b/versions/baseline.json index 0cc643ba868d56..69d1415c62941a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2257,8 +2257,8 @@ "port-version": 0 }, "faad2": { - "baseline": "2.9.1", - "port-version": 5 + "baseline": "2.10.1", + "port-version": 0 }, "fadbad": { "baseline": "2.1.0", diff --git a/versions/f-/faad2.json b/versions/f-/faad2.json index 40a3d2c83487bc..ea834e9f89846f 100644 --- a/versions/f-/faad2.json +++ b/versions/f-/faad2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "554ceb378aedd7166831ff6fc1e6e22d30a74721", + "version": "2.10.1", + "port-version": 0 + }, { "git-tree": "67b420585d5f99b7dec259912abd2d7edcfb9492", "version": "2.9.1", From 614b124314e20f4a72f4548be8ab4f83f7062a6a Mon Sep 17 00:00:00 2001 From: Cheney-Wang <850426846@qq.com> Date: Tue, 31 Jan 2023 23:20:37 -0800 Subject: [PATCH 2/2] Fix tools uninstalled --- ports/faad2/CMakeLists.txt | 1 + ports/faad2/portfile.cmake | 4 ++++ versions/f-/faad2.json | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/faad2/CMakeLists.txt b/ports/faad2/CMakeLists.txt index b8784a93d0ba7d..23c0b684fd67d2 100644 --- a/ports/faad2/CMakeLists.txt +++ b/ports/faad2/CMakeLists.txt @@ -28,6 +28,7 @@ if (FAAD_BUILD_BINARIES) "${CMAKE_SOURCE_DIR}/frontend/unicode_support.c" ) target_link_libraries(faad_decoder PRIVATE faad shell32) + install(TARGETS faad_decoder DESTINATION "bin") endif () install( diff --git a/ports/faad2/portfile.cmake b/ports/faad2/portfile.cmake index cb77a481631e4e..9ab7aff86452b4 100644 --- a/ports/faad2/portfile.cmake +++ b/ports/faad2/portfile.cmake @@ -23,5 +23,9 @@ vcpkg_cmake_install() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_copy_pdbs() +if("build-decoder" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES faad_decoder AUTO_CLEAN) +endif() + file(INSTALL "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/versions/f-/faad2.json b/versions/f-/faad2.json index ea834e9f89846f..68bd26a2c4f645 100644 --- a/versions/f-/faad2.json +++ b/versions/f-/faad2.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "554ceb378aedd7166831ff6fc1e6e22d30a74721", + "git-tree": "8109afd383b568e26f0d671384d067fa5fa7cc2e", "version": "2.10.1", "port-version": 0 },