git: 0454a541d706 - main - cad/librepcb: Unbreak on 15

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 31 Oct 2024 19:35:20 UTC
The branch main has been updated by yuri:

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

commit 0454a541d7069ff76124a3a8ed6440830d24f985
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-10-31 19:34:54 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-10-31 19:35:18 +0000

    cad/librepcb: Unbreak on 15
---
 cad/librepcb/Makefile                              |  2 --
 .../files/patch-libs_optional_tl_optional.hpp      | 22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/cad/librepcb/Makefile b/cad/librepcb/Makefile
index 61848df352d4..59d3cb64c5c2 100644
--- a/cad/librepcb/Makefile
+++ b/cad/librepcb/Makefile
@@ -13,8 +13,6 @@ WWW=		https://librepcb.org/ \
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-BROKEN_FreeBSD_15=	compilation error: no member named 'construct' in 'optional<type-parameter-0-0 &>', see https://github.com/LibrePCB/LibrePCB/issues/1454
-
 LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg4 \
 		libfontconfig.so:x11-fonts/fontconfig \
 		libfreeimage.so:graphics/freeimage \
diff --git a/cad/librepcb/files/patch-libs_optional_tl_optional.hpp b/cad/librepcb/files/patch-libs_optional_tl_optional.hpp
new file mode 100644
index 000000000000..96d0ce2baa5b
--- /dev/null
+++ b/cad/librepcb/files/patch-libs_optional_tl_optional.hpp
@@ -0,0 +1,22 @@
+- workaround for https://github.com/LibrePCB/LibrePCB/issues/1454
+
+--- libs/optional/tl/optional.hpp.orig	2024-10-31 19:31:32 UTC
++++ libs/optional/tl/optional.hpp
+@@ -1979,17 +1979,6 @@ template <class T> class optional<T &> { (public)
+     return *this;
+   }
+ 
+-  /// Constructs the value in-place, destroying the current one if there is
+-  /// one.
+-  template <class... Args> T &emplace(Args &&... args) noexcept {
+-    static_assert(std::is_constructible<T, Args &&...>::value,
+-                  "T must be constructible with Args");
+-
+-    *this = nullopt;
+-    this->construct(std::forward<Args>(args)...);
+-    return value();
+-  }
+-
+   void swap(optional &rhs) noexcept { std::swap(m_value, rhs.m_value); }
+ 
+   /// Returns a pointer to the stored value