git: b193595a45ea - main - multimedia/vapoursynth: Update to R64

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Thu, 05 Oct 2023 22:06:50 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b193595a45eab85ce37936e2bacd251b33960d78

commit b193595a45eab85ce37936e2bacd251b33960d78
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-10-05 22:00:20 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-10-05 22:00:27 +0000

    multimedia/vapoursynth: Update to R64
    
    Backport upstream commits:
    8c68f4d42349aa3ba87ec3700a12e7fb38867748
    31979d78dbe49c081b7da3ca1f7949433d83ca24
    ad8bee27e37789ab01b82538e26db72d4128208d
    
    Changelog: https://github.com/vapoursynth/vapoursynth/releases/tag/R64
    
    References:
    https://github.com/vapoursynth/vapoursynth/commit/8c68f4d42349aa3ba87ec3700a12e7fb38867748
    https://github.com/vapoursynth/vapoursynth/commit/31979d78dbe49c081b7da3ca1f7949433d83ca24
    https://github.com/vapoursynth/vapoursynth/commit/ad8bee27e37789ab01b82538e26db72d4128208d
---
 multimedia/vapoursynth/Makefile                    |   7 +-
 multimedia/vapoursynth/distinfo                    |  12 +-
 .../vapoursynth/files/patch-src_core_expr_expr.cpp | 122 ---------------------
 3 files changed, 15 insertions(+), 126 deletions(-)

diff --git a/multimedia/vapoursynth/Makefile b/multimedia/vapoursynth/Makefile
index 1487516079e9..9f67ffc7b9e3 100644
--- a/multimedia/vapoursynth/Makefile
+++ b/multimedia/vapoursynth/Makefile
@@ -1,7 +1,12 @@
 PORTNAME=	vapoursynth
-DISTVERSION=	R63
+DISTVERSION=	R64
 CATEGORIES=	multimedia
 
+PATCH_SITES=	https://github.com/${PORTNAME}/${PORTNAME}/commit/
+PATCHFILES=	8c68f4d42349aa3ba87ec3700a12e7fb38867748.patch:-p1 \
+		31979d78dbe49c081b7da3ca1f7949433d83ca24.patch:-p1 \
+		ad8bee27e37789ab01b82538e26db72d4128208d.patch:-p1
+
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Video processing framework with simplicity in mind
 WWW=		https://www.vapoursynth.com/
diff --git a/multimedia/vapoursynth/distinfo b/multimedia/vapoursynth/distinfo
index 4bdd08f95429..0d8b64c52cb0 100644
--- a/multimedia/vapoursynth/distinfo
+++ b/multimedia/vapoursynth/distinfo
@@ -1,3 +1,9 @@
-TIMESTAMP = 1690671648
-SHA256 (vapoursynth-vapoursynth-R63_GH0.tar.gz) = ed909b3c58e79bcbb056d07c5d301222ba8001222b4b40d5c1123be35fea9ae2
-SIZE (vapoursynth-vapoursynth-R63_GH0.tar.gz) = 1869415
+TIMESTAMP = 1696172369
+SHA256 (vapoursynth-vapoursynth-R64_GH0.tar.gz) = 29e7972eace52bb83365cf9a14a5552df444090391f032de23b589ed8ff64213
+SIZE (vapoursynth-vapoursynth-R64_GH0.tar.gz) = 1870065
+SHA256 (8c68f4d42349aa3ba87ec3700a12e7fb38867748.patch) = 8cd28e01cc513a7a9ce00de62db61f757a6dbe3e4e521c58b28ae8f3f1d58ce9
+SIZE (8c68f4d42349aa3ba87ec3700a12e7fb38867748.patch) = 1519
+SHA256 (31979d78dbe49c081b7da3ca1f7949433d83ca24.patch) = 7f04580eb487be443b6b8f03ffe09f267d7ece843fe1b048024b425dadbdd31c
+SIZE (31979d78dbe49c081b7da3ca1f7949433d83ca24.patch) = 1505
+SHA256 (ad8bee27e37789ab01b82538e26db72d4128208d.patch) = 93a2cc53db57f9bd03a536d6c76757ed5a4217f0caafead2bfefca20a654846d
+SIZE (ad8bee27e37789ab01b82538e26db72d4128208d.patch) = 1994
diff --git a/multimedia/vapoursynth/files/patch-src_core_expr_expr.cpp b/multimedia/vapoursynth/files/patch-src_core_expr_expr.cpp
deleted file mode 100644
index d59277f96e8c..000000000000
--- a/multimedia/vapoursynth/files/patch-src_core_expr_expr.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
---- src/core/expr/expr.cpp.orig	2023-06-06 12:15:18 UTC
-+++ src/core/expr/expr.cpp
-@@ -20,15 +20,15 @@
- 
- #include <algorithm>
- #include <cassert>
--#include <charconv>
- #include <cmath>
-+#include <iostream>
-+#include <locale>
- #include <map>
- #include <memory>
- #include <set>
- #include <sstream>
- #include <stdexcept>
- #include <string>
--#include <string_view>
- #include <unordered_map>
- #include <unordered_set>
- #include <vector>
-@@ -136,9 +136,9 @@ bool equalSubTree(const ExpressionTreeNode *lhs, const
-     return true;
- }
- 
--std::vector<std::string_view> tokenize(const std::string &expr)
-+std::vector<std::string> tokenize(const std::string &expr)
- {
--    std::vector<std::string_view> tokens;
-+    std::vector<std::string> tokens;
-     auto it = expr.begin();
-     auto prev = expr.begin();
- 
-@@ -147,20 +147,20 @@ std::vector<std::string_view> tokenize(const std::stri
- 
-         if (std::isspace(c)) {
-             if (it != prev)
--                tokens.push_back({ expr.c_str() + (prev - expr.begin()), static_cast<size_t>(it - prev) });
-+                tokens.push_back(expr.substr(prev - expr.begin(), it - prev));
-             prev = it + 1;
-         }
-         ++it;
-     }
-     if (prev != expr.end())
--        tokens.push_back({ expr.c_str() + (prev - expr.begin()), static_cast<size_t>(expr.end() - prev) });
-+        tokens.push_back(expr.substr(prev - expr.begin(), expr.end() - prev));
- 
-     return tokens;
- }
- 
--ExprOp decodeToken(std::string_view token)
-+ExprOp decodeToken(const std::string &token)
- {
--    static const std::unordered_map<std::string_view, ExprOp> simple{
-+    static const std::unordered_map<std::string, ExprOp> simple{
-         { "+",    { ExprOpType::ADD } },
-         { "-",    { ExprOpType::SUB } },
-         { "*",    { ExprOpType::MUL } },
-@@ -195,26 +195,34 @@ ExprOp decodeToken(std::string_view token)
-         return{ ExprOpType::MEM_LOAD_U8, token[0] >= 'x' ? token[0] - 'x' : token[0] - 'a' + 3 };
-     } else if (token.substr(0, 3) == "dup" || token.substr(0, 4) == "swap") {
-         size_t prefix = token[0] == 'd' ? 3 : 4;
-+        size_t count = 0;
-         int idx = -1;
- 
--        auto result = std::from_chars(token.data() + prefix, token.data() + token.size(), idx);
--        if (idx < 0 || result.ptr != token.data() + token.size())
--            throw std::runtime_error("illegal token: " + std::string{ token });
-+        try {
-+            idx = std::stoi(token.substr(prefix), &count);
-+        } catch (...) {
-+            // ...
-+        }
-+
-+        if (idx < 0 || prefix + count != token.size())
-+            throw std::runtime_error("illegal token: " + token);
-         return{ token[0] == 'd' ? ExprOpType::DUP : ExprOpType::SWAP, idx };
-     } else {
-         float f;
--        auto result = std::from_chars(token.data(), token.data() + token.size(), f);
--        if (result.ec == std::errc::invalid_argument)
--            throw std::runtime_error("failed to convert '" + std::string{ token } + "' to float");
--        if (result.ptr != token.data() + token.size())
--            throw std::runtime_error("failed to convert '" + std::string{ token } + "' to float, not the whole token could be converted");
-+        std::string s;
-+        std::istringstream numStream(token);
-+        numStream.imbue(std::locale::classic());
-+        if (!(numStream >> f))
-+            throw std::runtime_error("failed to convert '" + token + "' to float");
-+        if (numStream >> s)
-+            throw std::runtime_error("failed to convert '" + token + "' to float, not the whole token could be converted");
-         return{ ExprOpType::CONSTANT, f };
-     }
- }
- 
- ExpressionTree parseExpr(const std::string &expr, const VSVideoInfo * const srcFormats[], int numInputs)
- {
--    static constexpr unsigned char numOperands[] = {
-+    constexpr unsigned char numOperands[] = {
-         0, // MEM_LOAD_U8
-         0, // MEM_LOAD_U16
-         0, // MEM_LOAD_F16
-@@ -256,16 +264,16 @@ ExpressionTree parseExpr(const std::string &expr, cons
-     ExpressionTree tree;
-     std::vector<ExpressionTreeNode *> stack;
- 
--    for (std::string_view tok : tokens) {
-+    for (const std::string &tok : tokens) {
-         ExprOp op = decodeToken(tok);
- 
-         // Check validity.
-         if (op.type == ExprOpType::MEM_LOAD_U8 && op.imm.i >= numInputs)
--            throw std::runtime_error("reference to undefined clip: " + std::string{ tok });
-+            throw std::runtime_error("reference to undefined clip: " + tok);
-         if ((op.type == ExprOpType::DUP || op.type == ExprOpType::SWAP) && op.imm.u >= stack.size())
--            throw std::runtime_error("insufficient values on stack: " + std::string{ tok });
-+            throw std::runtime_error("insufficient values on stack: " + tok);
-         if (stack.size() < numOperands[static_cast<size_t>(op.type)])
--            throw std::runtime_error("insufficient values on stack: " + std::string{ tok });
-+            throw std::runtime_error("insufficient values on stack: " + tok);
- 
-         // Rename load operations with the correct data type.
-         if (op.type == ExprOpType::MEM_LOAD_U8) {