summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Wong <gtw@gnu.org>2022-09-28 14:50:44 -0600
committerGary Wong <gtw@gnu.org>2022-09-29 08:51:27 -0600
commit5d47f03b8b03bf9f3208955978dfae868ac49a99 (patch)
treea1a6753fbb0d77b378816387d1c4e16f9cebd271
parent171b2f3c2c4706c6922b7552c4eb3307a0e673ae (diff)
Update media-gfx/openscad to 2021.01-r4.
-rw-r--r--media-gfx/openscad/Manifest7
-rw-r--r--media-gfx/openscad/files/openscad-2021.01-CGAL-build-fix-v5.4-renames-projection-traits-header.patch36
-rw-r--r--media-gfx/openscad/files/openscad-2021.01-CVE-2022-0496-Out-of-bounds-memory-access-in-DXF-loa.patch74
-rw-r--r--media-gfx/openscad/files/openscad-2021.01-CVE-2022-0497-Out-of-bounds-memory-access-in-comment.patch25
-rw-r--r--media-gfx/openscad/files/openscad-2021.01-Fix-build-failure-with-generic_print_polyhedron-on-C.patch42
-rw-r--r--media-gfx/openscad/files/openscad-2021.01-Fix-build-issue-with-overloaded-join.patch60
-rw-r--r--media-gfx/openscad/files/openscad-2021.01-Remove-double-quoting-of-the-output-file-parameter-f.patch20
-rw-r--r--media-gfx/openscad/openscad-2021.01-r4.ebuild114
8 files changed, 378 insertions, 0 deletions
diff --git a/media-gfx/openscad/Manifest b/media-gfx/openscad/Manifest
index 7a5dc65..de24bb0 100644
--- a/media-gfx/openscad/Manifest
+++ b/media-gfx/openscad/Manifest
@@ -5,11 +5,18 @@ AUX openscad-2019.05-optional-dbus.patch 375 BLAKE2B f11d44df4575556a78d06d6adb6
AUX openscad-2019.05_fix-boost-1.72.0-build.patch 689 BLAKE2B b8aea0ab3793b3f3202f7d4154c1aaca235de2450321958819531dd9dd70c1e375c28c9004a9fb348d5116815e99e4190efd2443057991b2e97873c80f52cc80 SHA512 20bc2baf50f23e6b5ccce0d8c22eb3a5004198a0c97c8c955b15a681a64102537be35a12a37692418159de6664a36689a4c3b65b3a520d51ab086aa091a1e48c
AUX openscad-2021.01-0001-Gentoo-specific-Disable-ccache-building.patch 790 BLAKE2B b08a024f81a29d7fb4e0860977b814d2ec6ce6dcbf8ab87655f5d36f51ea3bbce6559369363c33ca7593cbc3284de920f71be3c38e3ab7b5efa83d3466132b79 SHA512 2af887d7b085c49203e72ad41cb5c0e32b772a8abd35843485434cb11b263ba8a727a0ebc34c7138bff1e6852245f2bdaf7d91711184a5f16ed22603578a0892
AUX openscad-2021.01-0002-fix-to-find-lib3mf-2.patch 1396 BLAKE2B a43872dd83427f28a48528fbac534924796db769bd0213ba1b6fca41a65c766aa3355aa9ee3f7d68dcbbf3d578cee984f2ad61f599fdf9551ef55724f460f4db SHA512 ffbf402976054c1e7294a0d661e0648bdb359cf57e676d818cf1140644b7a0d0943f5adf1d2f511ad17ca45a35e31785aae584dc7607f13bfc9d94795fc3812b
+AUX openscad-2021.01-CGAL-build-fix-v5.4-renames-projection-traits-header.patch 1380 BLAKE2B b359211ef34bd0e1306f37fcf84f65fc8b3a03036608abb36ece8e134bee419646754fedb52134947f1a3943c02fc07d778127f544d873346d62e5cd36c3ce9a SHA512 4c0dea73a578db8e6ff499a4fc9b337292d66dc1d652559d73616e85ee57d4a5c06d93e96a4e543a9b7087d3f4939e98bd7e22f9a9305c612a487527454e4d38
+AUX openscad-2021.01-CVE-2022-0496-Out-of-bounds-memory-access-in-DXF-loa.patch 3690 BLAKE2B c320ddd5077e8f4c92f21e9ea18e741b6844f409d1be1ca90fcf8ed8fe0b394694d2a4198b068858b92d8b004e603070bd51a0de1ccafdd3afc1925377f00082 SHA512 1a08d7207a6c98493022a6019d44db468ad8b1b0a7623296302895ffcda789fd9ad90f3d361026b6309fbbd23051a5f686e1a21c01bd90a668dd5ce08fd6ba9f
+AUX openscad-2021.01-CVE-2022-0497-Out-of-bounds-memory-access-in-comment.patch 752 BLAKE2B a54676bdf69a78cbc0ff1d11676de4b5913030093f06a2029bb44bb301dee681a7a971f3cd31b033061f5f4e03ac243c83b51d21576b0bbe21cdc8457632d885 SHA512 49f43408021397d8ca8a628de102dde9f55ccc4fa219f84f7a0e08db6b63232d5d31562814669728273379db521e98d819fe939521ba7a346232a05aa9dcdc89
+AUX openscad-2021.01-Fix-build-failure-with-generic_print_polyhedron-on-C.patch 1390 BLAKE2B 2c5e96675b15f9dc7020f21d5d2b5a9f7edcde154533dcda14762aef5cbe8bec78ac0fb9cc8b0426817027543313a6862c07dd5d17eb46fa101633ed55ed75d6 SHA512 58cfa61093edb3e18022b73cca93d4741ba2fddd259c37864d604ee66bc8f9f1f170677f2151b539ebdf70e3043c6d1650fa7578037c70c277d3eec4ca030a4e
+AUX openscad-2021.01-Fix-build-issue-with-overloaded-join.patch 3336 BLAKE2B c92caab0f33551ee7e66c6527dfa61d5ae70c3820d51188b6b4fc042a66cd58d207d4dbcdc87641b79733784d1c088af34a85078899fa4468522b4653fed7ab7 SHA512 f8860ec827efcdf1e0037c22ec0c1f8364b5f9554d264d2bac5be57c1b86e79f6ab284b65f1763c1548e8e3479c0ca510954937907f18f0db745826338a4f2f8
+AUX openscad-2021.01-Remove-double-quoting-of-the-output-file-parameter-f.patch 775 BLAKE2B eed37277c3e7ea84635c0b8cd02cc4ffde7abea78400ee39e67bcc782800197c57dae07a82084df47705951ced8968be78243a1d0e14a551783b8adcb669d43f SHA512 94306e68e53b01e799a5feb6f16a8f44c965a4b653b60227833013712f23648d20ac8272a7bfe38bde201af42946f91fe17231f120adfbe5b16e42b07d9f8d10
AUX openscad-9999-0002-Gentoo-specific-Disable-ccache-building.patch 822 BLAKE2B ae4c7dc441e5a7391ecd2e704c644877fa7d73f8900fbe6082e070a3d9ecce74f368ead39be3f0321fb47095becf60057fafdee2a5e961106402dffff73687be SHA512 7bae2af4c627cc2f465e75890284bcca8e738dcbe5accf0511fcca2ee845ce9ef5602b752d61ecab7afd92f3a45975287db4e42379ede7875123a8c0a721f2c3
DIST openscad-2019.05.tar.gz 14604881 BLAKE2B ed7d6088606fab44284363da73643e556f07c0f0a7a223bdf718dcc36a82158bf23e315724ea520d63a3f1331207df0ea7b0ade817f01dd39b67ca6f36529d56 SHA512 073053f625ffa4fea6ed836396b7ff4b87b26cf7500b06c804983afc0f1dfd3d78bfb81b3fd217c3939b0ec915d85b0c7990773eaf968512a150deaa0399df13
DIST openscad-2021.01.tar.gz 15817555 BLAKE2B 417857d704fa3c14312641ebda983eb85a1e3bc0d517a235fa3bd2523fce6f93c1ea526c330179bc35f03e6c73d3cd7c4c57cd71480088c21bfc99bb020ab7cd SHA512 8deaa26bf4c295c12da38f323d2b2e6f827851337f5bc1cc9c79afc083c9f913c19a263086e6e853bf2c8434c1ccc705ea22ddb02dc99d39bb1e5e03fc58d128
EBUILD openscad-2019.05-r2.ebuild 1683 BLAKE2B c301142b828cb4999fd4b095c14333477a5b86f17a7889845f2acc779941412dc39d7c32b850d8c358fd92aca734312b0942409da3fcebd2f24ab06b700315b1 SHA512 32ca3512105ceb3bd66ab13bb0c4808ca875c30f85b2cce338cb5a79fe0ad296f152af9588b60a48871f4193eb1cf62ec62572ab52a0a1862839fbe083835b58
EBUILD openscad-2021.01-r2.ebuild 2444 BLAKE2B 76a5ea60123c98ff5e76373fb92c88aa6e91ac2c2228cfa7d3441d8be018c1c737243b4efb0471f731965d74c696ec91568e4f30106c5760806f9eddc749c53d SHA512 4b6619694f54a3df03b09599831512bc1bd5cf15bc99bc154ac50b83b306ea5e1827332ff9ae26e18e5aa72a693b812a16ac718797b55ceb6b3f2ccf6940f68c
+EBUILD openscad-2021.01-r4.ebuild 2872 BLAKE2B 94c727ca324d523d82c93411af00b840c4fdddf22dedd021f72cf924e2f566d38e6ddf055441f1e8e0eb172f4b48134bfefb052879185aed45050bbf912268df SHA512 a411a72912c216bfc8c40198aa3d87b5559aa19ccd241ca045c26b5dba81b167bf955883489aa9d8e9c9d607b9f76943f3f9c3b74c0a3c4db86036bcf13cd981
EBUILD openscad-2021.01.ebuild 2442 BLAKE2B 8daf329e5238455ec24e564c878b52d94597a2c47d7ef06d81e144f4561955611457cb204cafb1769829274436dee7ab33176f94c3d801136c400837726db9c5 SHA512 c78cf23b6c57314cac9d8f16ae62e0f84a91522151c04e57b0eb8201bb18cd03211a51feb0e0613c7408e0291434677aedd3aa15a3bb5ff54e0e0f1d0eaa9227
EBUILD openscad-9999.ebuild 1900 BLAKE2B b7da0c8a17bcc88faa4c9367b4a664a8f58aafe8177d984001fd23ab0ea39f00f40349963691d4aa667d994761c7f60ee7bf0104c023ab43d85e51bde4349b4d SHA512 6378969e22ca27c2ef80928559b2f122e4b86df35a3858ae70537782b1f9209951fa34c55bd791f10cc23a9f0572a6305ba854f3270e4ea11eb045058e9c5b77
MISC metadata.xml 1123 BLAKE2B d182b2b81115ec212b553802174d5305dd37af439aaafb25dd05368b1431b960cb4e35e65bec0519438e9c1ed767124fc686e293d07e5d44807bbf4ca8d74ea2 SHA512 10fda921c2d18d8e3a12d986cd2de9eebf47d9d2f843381b4ea2874d2483a42b84c6aa6c216ceb4c1ecf4183bbc8d43d7202bafbfcddc15de1bcd6b0f297f29c
diff --git a/media-gfx/openscad/files/openscad-2021.01-CGAL-build-fix-v5.4-renames-projection-traits-header.patch b/media-gfx/openscad/files/openscad-2021.01-CGAL-build-fix-v5.4-renames-projection-traits-header.patch
new file mode 100644
index 0000000..5fea499
--- /dev/null
+++ b/media-gfx/openscad/files/openscad-2021.01-CGAL-build-fix-v5.4-renames-projection-traits-header.patch
@@ -0,0 +1,36 @@
+https://bugs.gentoo.org/851189
+From https://github.com/openscad/openscad/commit/abfebc651343909b534ef337aacc7604c99cf0ea Mon Sep 17 00:00:00 2001
+From: Torsten Paul <Torsten.Paul@gmx.de>
+Date: Wed, 2 Feb 2022 02:30:59 +0100
+Subject: [PATCH 09/11] CGAL build fix, v5.4 renames projection traits header
+ files and classes.
+
+--- a/src/cgalutils-tess.cc
++++ b/src/cgalutils-tess.cc
+@@ -6,10 +6,12 @@
+ #pragma push_macro("NDEBUG")
+ #undef NDEBUG
+ #include <CGAL/Constrained_Delaunay_triangulation_2.h>
+-#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,11,0)
+- #include <CGAL/Triangulation_2_projection_traits_3.h>
++#if CGAL_VERSION_NR < 1050401000
++#include <CGAL/Triangulation_2_projection_traits_3.h>
++typedef CGAL::Triangulation_2_filtered_projection_traits_3<K> Projection;
+ #else
+- #include <CGAL/Triangulation_2_filtered_projection_traits_3.h>
++#include <CGAL/Projection_traits_3.h>
++typedef CGAL::Filtered_projection_traits_3<K> Projection;
+ #endif
+ #include <CGAL/Triangulation_face_base_with_info_2.h>
+ #pragma pop_macro("NDEBUG")
+@@ -19,7 +21,6 @@ struct FaceInfo {
+ bool in_domain() { return nesting_level%2 == 1; }
+ };
+
+-typedef CGAL::Triangulation_2_filtered_projection_traits_3<K> Projection;
+ typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo, K> Fbb;
+ typedef CGAL::Triangulation_data_structure_2<
+ CGAL::Triangulation_vertex_base_2<Projection>,
+--
+2.35.1
+
diff --git a/media-gfx/openscad/files/openscad-2021.01-CVE-2022-0496-Out-of-bounds-memory-access-in-DXF-loa.patch b/media-gfx/openscad/files/openscad-2021.01-CVE-2022-0496-Out-of-bounds-memory-access-in-DXF-loa.patch
new file mode 100644
index 0000000..6c0a955
--- /dev/null
+++ b/media-gfx/openscad/files/openscad-2021.01-CVE-2022-0496-Out-of-bounds-memory-access-in-DXF-loa.patch
@@ -0,0 +1,74 @@
+From https://github.com/openscad/openscad/commit/00a4692989c4e2f191525f73f24ad8727bacdf41 Mon Sep 17 00:00:00 2001
+From: Torsten Paul <Torsten.Paul@gmx.de>
+Date: Sat, 5 Feb 2022 18:38:31 +0100
+Subject: [PATCH 01/11] CVE-2022-0496 Out-of-bounds memory access in DXF
+ loader.
+
+Public issue:
+https://github.com/openscad/openscad/issues/4037
+
+Fix in master branch:
+https://github.com/openscad/openscad/pull/4090
+--- a/src/dxfdata.cc
++++ b/src/dxfdata.cc
+@@ -441,6 +441,11 @@ DxfData::DxfData(double fn, double fs, double fa,
+ auto lv = grid.data(this->points[lines[idx].idx[j]][0], this->points[lines[idx].idx[j]][1]);
+ for (size_t ki = 0; ki < lv.size(); ++ki) {
+ int k = lv.at(ki);
++ if (k < 0 || k >= lines.size()) {
++ LOG(message_group::Warning,Location::NONE,"",
++ "Bad DXF line index in %1$s.",QuotedString(boostfs_uncomplete(filename, fs::current_path()).generic_string()));
++ continue;
++ }
+ if (k == idx || lines[k].disabled) continue;
+ goto next_open_path_j;
+ }
+@@ -466,13 +471,20 @@ DxfData::DxfData(double fn, double fs, double fa,
+ auto lv = grid.data(ref_point[0], ref_point[1]);
+ for (size_t ki = 0; ki < lv.size(); ++ki) {
+ int k = lv.at(ki);
++ if (k < 0 || k >= lines.size()) {
++ LOG(message_group::Warning,Location::NONE,"",
++ "Bad DXF line index in %1$s.",QuotedString(boostfs_uncomplete(filename, fs::current_path()).generic_string()));
++ continue;
++ }
+ if (lines[k].disabled) continue;
+- if (grid.eq(ref_point[0], ref_point[1], this->points[lines[k].idx[0]][0], this->points[lines[k].idx[0]][1])) {
++ auto idk0 = lines[k].idx[0]; // make it easier to read and debug
++ auto idk1 = lines[k].idx[1];
++ if (grid.eq(ref_point[0], ref_point[1], this->points[idk0][0], this->points[idk0][1])) {
+ current_line = k;
+ current_point = 0;
+ goto found_next_line_in_open_path;
+ }
+- if (grid.eq(ref_point[0], ref_point[1], this->points[lines[k].idx[1]][0], this->points[lines[k].idx[1]][1])) {
++ if (grid.eq(ref_point[0], ref_point[1], this->points[idk1][0], this->points[idk1][1])) {
+ current_line = k;
+ current_point = 1;
+ goto found_next_line_in_open_path;
+@@ -501,13 +513,20 @@ DxfData::DxfData(double fn, double fs, double fa,
+ auto lv = grid.data(ref_point[0], ref_point[1]);
+ for (size_t ki = 0; ki < lv.size(); ++ki) {
+ int k = lv.at(ki);
++ if (k < 0 || k >= lines.size()) {
++ LOG(message_group::Warning,Location::NONE,"",
++ "Bad DXF line index in %1$s.",QuotedString(boostfs_uncomplete(filename, fs::current_path()).generic_string()));
++ continue;
++ }
+ if (lines[k].disabled) continue;
+- if (grid.eq(ref_point[0], ref_point[1], this->points[lines[k].idx[0]][0], this->points[lines[k].idx[0]][1])) {
++ auto idk0 = lines[k].idx[0]; // make it easier to read and debug
++ auto idk1 = lines[k].idx[1];
++ if (grid.eq(ref_point[0], ref_point[1], this->points[idk0][0], this->points[idk0][1])) {
+ current_line = k;
+ current_point = 0;
+ goto found_next_line_in_closed_path;
+ }
+- if (grid.eq(ref_point[0], ref_point[1], this->points[lines[k].idx[1]][0], this->points[lines[k].idx[1]][1])) {
++ if (grid.eq(ref_point[0], ref_point[1], this->points[idk1][0], this->points[idk1][1])) {
+ current_line = k;
+ current_point = 1;
+ goto found_next_line_in_closed_path;
+--
+2.35.1
+
diff --git a/media-gfx/openscad/files/openscad-2021.01-CVE-2022-0497-Out-of-bounds-memory-access-in-comment.patch b/media-gfx/openscad/files/openscad-2021.01-CVE-2022-0497-Out-of-bounds-memory-access-in-comment.patch
new file mode 100644
index 0000000..39ef724
--- /dev/null
+++ b/media-gfx/openscad/files/openscad-2021.01-CVE-2022-0497-Out-of-bounds-memory-access-in-comment.patch
@@ -0,0 +1,25 @@
+From https://github.com/openscad/openscad/commit/84addf3c1efbd51d8ff424b7da276400bbfa1a4b Mon Sep 17 00:00:00 2001
+From: Torsten Paul <Torsten.Paul@gmx.de>
+Date: Sat, 5 Feb 2022 18:45:29 +0100
+Subject: [PATCH 02/11] CVE-2022-0497 Out-of-bounds memory access in comment
+ parser.
+
+Public issue:
+https://github.com/openscad/openscad/issues/4043
+
+Fix in master branch:
+https://github.com/openscad/openscad/pull/4044
+--- a/src/comment.cpp
++++ b/src/comment.cpp
+@@ -92,7 +92,7 @@ static std::string getComment(const std::string &fulltext, int line)
+ }
+
+ int end = start + 1;
+- while (fulltext[end] != '\n') end++;
++ while (end < fulltext.size() && fulltext[end] != '\n') end++;
+
+ std::string comment = fulltext.substr(start, end - start);
+
+--
+2.35.1
+
diff --git a/media-gfx/openscad/files/openscad-2021.01-Fix-build-failure-with-generic_print_polyhedron-on-C.patch b/media-gfx/openscad/files/openscad-2021.01-Fix-build-failure-with-generic_print_polyhedron-on-C.patch
new file mode 100644
index 0000000..f09954b
--- /dev/null
+++ b/media-gfx/openscad/files/openscad-2021.01-Fix-build-failure-with-generic_print_polyhedron-on-C.patch
@@ -0,0 +1,42 @@
+https://bugs.gentoo.org/851189
+From https://github.com/openscad/openscad/commit/9aa0d7e9f2914fe5f547bdde69202161d1c6064d Mon Sep 17 00:00:00 2001
+From: Jordan Brown <github@jordan.maileater.net>
+Date: Sun, 18 Jul 2021 21:01:46 -0700
+Subject: [PATCH 05/11] Fix build failure with "generic_print_polyhedron" on
+ CGAL-5.3.
+
+--- a/src/cgalutils-polyhedron.cc
++++ b/src/cgalutils-polyhedron.cc
+@@ -337,19 +337,6 @@ namespace CGALUtils {
+ }
+ };
+
+- template <typename Polyhedron>
+- std::string printPolyhedron(const Polyhedron &p) {
+- std::ostringstream sstream;
+- sstream.precision(20);
+-
+- Polyhedron_writer writer;
+- generic_print_polyhedron(sstream, p, writer);
+-
+- return sstream.str();
+- }
+-
+- template std::string printPolyhedron(const CGAL_Polyhedron &p);
+-
+ }; // namespace CGALUtils
+
+ #endif /* ENABLE_CGAL */
+--- a/src/cgalutils.h
++++ b/src/cgalutils.h
+@@ -45,7 +45,6 @@ namespace CGALUtils {
+ bool is_approximately_convex(const PolySet &ps);
+ Geometry const* applyMinkowski(const Geometry::Geometries &children);
+
+- template <typename Polyhedron> std::string printPolyhedron(const Polyhedron &p);
+ template <typename Polyhedron> bool createPolySetFromPolyhedron(const Polyhedron &p, PolySet &ps);
+ template <typename Polyhedron> bool createPolyhedronFromPolySet(const PolySet &ps, Polyhedron &p);
+ template <class Polyhedron_A, class Polyhedron_B>
+--
+2.35.1
+
diff --git a/media-gfx/openscad/files/openscad-2021.01-Fix-build-issue-with-overloaded-join.patch b/media-gfx/openscad/files/openscad-2021.01-Fix-build-issue-with-overloaded-join.patch
new file mode 100644
index 0000000..7a70b18
--- /dev/null
+++ b/media-gfx/openscad/files/openscad-2021.01-Fix-build-issue-with-overloaded-join.patch
@@ -0,0 +1,60 @@
+https://bugs.gentoo.org/851189
+From https://github.com/openscad/openscad/commit/08bf69b4115c989fc5671254e0d05735d01bcca5 Mon Sep 17 00:00:00 2001
+From: Torsten Paul <Torsten.Paul@gmx.de>
+Date: Wed, 2 Feb 2022 00:50:43 +0100
+Subject: [PATCH 10/11] Fix build issue with overloaded join().
+
+--- a/src/openscad.cc
++++ b/src/openscad.cc
+@@ -65,7 +65,6 @@
+ #include <chrono>
+ #include <boost/algorithm/string.hpp>
+ #include <boost/algorithm/string/split.hpp>
+-#include <boost/algorithm/string/join.hpp>
+ #include <boost/range/adaptor/transformed.hpp>
+ #include <boost/program_options.hpp>
+ #include <boost/filesystem.hpp>
+@@ -307,7 +306,7 @@ void set_render_color_scheme(const std::string color_scheme, const bool exit_if_
+ }
+
+ if (exit_if_not_found) {
+- LOG(message_group::None,Location::NONE,"",(boost::join(ColorMap::inst()->colorSchemeNames(), "\n")));
++ LOG(message_group::None,Location::NONE,"",(boost::algorithm::join(ColorMap::inst()->colorSchemeNames(), "\n")));
+
+ exit(1);
+ } else {
+@@ -885,7 +884,7 @@ struct CommaSeparatedVector
+ };
+
+ template <class Seq, typename ToString>
+-std::string join(const Seq &seq, const std::string &sep, const ToString &toString)
++std::string str_join(const Seq &seq, const std::string &sep, const ToString &toString)
+ {
+ return boost::algorithm::join(boost::adaptors::transform(seq, toString), sep);
+ }
+@@ -947,7 +946,7 @@ int main(int argc, char **argv)
+ ("P,P", po::value<string>(), "customizer parameter set")
+ #ifdef ENABLE_EXPERIMENTAL
+ ("enable", po::value<vector<string>>(), ("enable experimental features: " +
+- join(boost::make_iterator_range(Feature::begin(), Feature::end()), " | ",
++ str_join(boost::make_iterator_range(Feature::begin(), Feature::end()), " | ",
+ [](const Feature *feature) {
+ return feature->get_name();
+ }) +
+@@ -964,11 +963,11 @@ int main(int argc, char **argv)
+ ("render", po::value<string>()->implicit_value(""), "for full geometry evaluation when exporting png")
+ ("preview", po::value<string>()->implicit_value(""), "[=throwntogether] -for ThrownTogether preview png")
+ ("animate", po::value<unsigned>(), "export N animated frames")
+- ("view", po::value<CommaSeparatedVector>(), ("=view options: " + boost::join(viewOptions.names(), " | ")).c_str())
++ ("view", po::value<CommaSeparatedVector>(), ("=view options: " + boost::algorithm::join(viewOptions.names(), " | ")).c_str())
+ ("projection", po::value<string>(), "=(o)rtho or (p)erspective when exporting png")
+ ("csglimit", po::value<unsigned int>(), "=n -stop rendering at n CSG elements when exporting png")
+ ("colorscheme", po::value<string>(), ("=colorscheme: " +
+- join(ColorMap::inst()->colorSchemeNames(), " | ",
++ str_join(ColorMap::inst()->colorSchemeNames(), " | ",
+ [](const std::string& colorScheme) {
+ return (colorScheme == ColorMap::inst()->defaultColorSchemeName() ? "*" : "") + colorScheme;
+ }) +
+--
+2.35.1
+
diff --git a/media-gfx/openscad/files/openscad-2021.01-Remove-double-quoting-of-the-output-file-parameter-f.patch b/media-gfx/openscad/files/openscad-2021.01-Remove-double-quoting-of-the-output-file-parameter-f.patch
new file mode 100644
index 0000000..20167b9
--- /dev/null
+++ b/media-gfx/openscad/files/openscad-2021.01-Remove-double-quoting-of-the-output-file-parameter-f.patch
@@ -0,0 +1,20 @@
+From https://github.com/openscad/openscad/commit/45a5e3bdd6c8071cb50b9c3f2b14a62554aafc4a Mon Sep 17 00:00:00 2001
+From: Torsten Paul <Torsten.Paul@gmx.de>
+Date: Thu, 14 Apr 2022 16:07:04 +0200
+Subject: [PATCH 11/11] Remove double quoting of the output file parameter for
+ ghostscript.
+
+--- a/tests/export_pngtest.py
++++ b/tests/export_pngtest.py
+@@ -82,7 +82,7 @@ result = subprocess.call(export_cmd, env = fontenv)
+ if result != 0:
+ failquit('OpenSCAD failed with return code ' + str(result))
+
+-convert_cmd = gs_cmd + ["-sOutputFile=\"" + pngfile + "\"", exportfile]
++convert_cmd = gs_cmd + ["-sOutputFile=" + pngfile, exportfile]
+ print('Running Converter:', ' '.join(convert_cmd), file=sys.stderr)
+ result = subprocess.call(convert_cmd)
+ if result != 0:
+--
+2.35.1
+
diff --git a/media-gfx/openscad/openscad-2021.01-r4.ebuild b/media-gfx/openscad/openscad-2021.01-r4.ebuild
new file mode 100644
index 0000000..fafee2e
--- /dev/null
+++ b/media-gfx/openscad/openscad-2021.01-r4.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common qmake-utils xdg
+
+SITEFILE="50${PN}-gentoo.el"
+
+DESCRIPTION="The Programmers Solid 3D CAD Modeller"
+HOMEPAGE="https://www.openscad.org/"
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.src.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 x86"
+IUSE="dbus emacs"
+# tests are not fully working and need cmake which isn't yet
+# officially supported.
+RESTRICT="test"
+
+RDEPEND="
+ dev-cpp/eigen:3
+ dev-libs/boost:=
+ dev-libs/double-conversion:=
+ dev-libs/glib:2
+ dev-libs/gmp:0=
+ dev-libs/hidapi
+ dev-libs/libspnav
+ dev-libs/libxml2
+ dev-libs/libzip:=
+ dev-libs/mpfr:0=
+ dev-qt/qtconcurrent:5
+ dev-qt/qtcore:5
+ dbus? ( dev-qt/qtdbus:5 )
+ dev-qt/qtgui:5[-gles2-only]
+ dev-qt/qtmultimedia:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtopengl:5
+ dev-qt/qtwidgets:5
+ media-gfx/opencsg:=
+ media-libs/fontconfig
+ media-libs/freetype
+ >=media-libs/glew-2.0.0:0=
+ media-libs/harfbuzz:=
+ media-libs/lib3mf
+ sci-mathematics/cgal:=
+ x11-libs/cairo
+ >=x11-libs/qscintilla-2.10.3:=
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-util/itstool
+ sys-devel/bison
+ sys-devel/flex
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-0001-Gentoo-specific-Disable-ccache-building.patch
+ "${FILESDIR}"/${P}-0002-fix-to-find-lib3mf-2.patch
+ "${FILESDIR}"/${P}-CVE-2022-0496-Out-of-bounds-memory-access-in-DXF-loa.patch
+ "${FILESDIR}"/${P}-CVE-2022-0497-Out-of-bounds-memory-access-in-comment.patch
+ "${FILESDIR}"/${P}-Fix-build-failure-with-generic_print_polyhedron-on-C.patch
+ "${FILESDIR}"/${P}-CGAL-build-fix-v5.4-renames-projection-traits-header.patch
+ "${FILESDIR}"/${P}-Fix-build-issue-with-overloaded-join.patch
+ "${FILESDIR}"/${P}-Remove-double-quoting-of-the-output-file-parameter-f.patch
+ "${FILESDIR}"/${PN}-2019.05-optional-dbus.patch
+)
+
+src_configure() {
+ if has ccache ${FEATURES}; then
+ eqmake5 "PREFIX = ${ESYSROOT}/usr" "CONFIG += ccache" DISABLE_DBUS=$(usex dbus 0 1) "${PN}.pro"
+ else
+ eqmake5 "PREFIX = ${ESYSROOT}/usr" DISABLE_DBUS=$(usex dbus 0 1) "${PN}.pro"
+ fi
+}
+
+src_compile() {
+ # We have random parallel build issues, bug #856430
+ emake -j1
+
+ if use emacs ; then
+ elisp-compile contrib/*.el
+ fi
+}
+
+src_install() {
+ emake install INSTALL_ROOT="${D}"
+
+ if use emacs; then
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ elisp-install ${PN} contrib/*.el contrib/*.elc
+ fi
+
+ mv -i "${ED}"/usr/share/openscad/locale "${ED}"/usr/share || die "failed to move locales"
+ ln -sf ../locale "${ED}"/usr/share/openscad/locale || die
+
+ einstalldocs
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+ xdg_desktop_database_update
+ xdg_mimeinfo_database_update
+}