mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-10-12 17:51:11 -04:00
media-gfx/slic3r: replace vendored code
Uses the following system libraries: * dev-cpp/exprtk * dev-libs/expat * dev-libs/miniz * media-libs/admesh ::guru Replacing the vendored code in: * xs/src/exprtk * xs/src/expat * xs/src/miniz * xs/src/admesh Signed-off-by: bakedsnake <bakedsnake@vagrantz.xyz>
This commit is contained in:
10 files changed
+457
-157
No files matched your search
@@ -1,42 +0,0 @@
|
|||||||
From ce966c2450183dfc1c6415161463ea8d59dcccd5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: zdroyer <ec2-user@ip-172-31-13-62.us-east-2.compute.internal>
|
|
||||||
Date: Fri, 12 Apr 2019 12:47:34 +0000
|
|
||||||
Subject: [PATCH] Removed unused header wchich generated tons of warnings with
|
|
||||||
boost 1.69
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/src/admesh/stl.h
|
|
||||||
+++ b/src/admesh/stl.h
|
|
||||||
@@ -26,7 +26,6 @@
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
-#include <boost/detail/endian.hpp>
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
|
||||||
#include "windows.h"
|
|
||||||
|
|
||||||
From a0f0616b43f50124164ed274c687cf98f532b3ce Mon Sep 17 00:00:00 2001
|
|
||||||
From: Chow Loong Jin <hyperair@debian.org>
|
|
||||||
Date: Tue, 6 Nov 2018 01:10:33 +0800
|
|
||||||
Subject: [PATCH] Drop #error "admesh works correctly on little endian machines
|
|
||||||
only"
|
|
||||||
|
|
||||||
admesh works fine on little-endian machines as of b9592961. It just doesn't
|
|
||||||
compile because of this pesky #error.
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/src/admesh/stl.h
|
|
||||||
+++ b/src/admesh/stl.h
|
|
||||||
@@ -28,10 +28,6 @@
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <boost/detail/endian.hpp>
|
|
||||||
|
|
||||||
-#ifndef BOOST_LITTLE_ENDIAN
|
|
||||||
-#error "admesh works correctly on little endian machines only!"
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
|
||||||
#include "windows.h"
|
|
||||||
#define ADMESH_CHAR wchar_t
|
|
||||||
|
|
||||||
@@ -81,3 +81,85 @@ Subject: [PATCH] add missing boost noncopyable
|
|||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
From d5084db14e7b4e75bf588fe063a5b9941c1cac31 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
Date: Wed, 3 Jun 2020 01:05:39 +0200
|
||||||
|
Subject: [PATCH 01/15] Make boost::Placeholders::_1 visible
|
||||||
|
|
||||||
|
Fixes https://github.com/slic3r/Slic3r/issues/4967
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/src/libslic3r/GCodeTimeEstimator.cpp
|
||||||
|
+++ b/src/libslic3r/GCodeTimeEstimator.cpp
|
||||||
|
@@ -1,9 +1,12 @@
|
||||||
|
#include "GCodeTimeEstimator.hpp"
|
||||||
|
-#include <boost/bind.hpp>
|
||||||
|
+#include <boost/bind/bind.hpp>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
|
+using boost::placeholders::_1;
|
||||||
|
+using boost::placeholders::_2;
|
||||||
|
+
|
||||||
|
void
|
||||||
|
GCodeTimeEstimator::parse(const std::string &gcode)
|
||||||
|
{
|
||||||
|
|
||||||
|
--- a/src/libslic3r/SLAPrint.cpp
|
||||||
|
+++ b/src/libslic3r/SLAPrint.cpp
|
||||||
|
@@ -7,9 +7,12 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <complex>
|
||||||
|
#include <cstdio>
|
||||||
|
+#include <boost/bind/bind.hpp>
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
|
+using boost::placeholders::_1;
|
||||||
|
+
|
||||||
|
void
|
||||||
|
SLAPrint::slice()
|
||||||
|
{
|
||||||
|
--- a/src/libslic3r/TriangleMesh.cpp
|
||||||
|
+++ b/src/libslic3r/TriangleMesh.cpp
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/nowide/convert.hpp>
|
||||||
|
+#include <boost/bind/bind.hpp>
|
||||||
|
|
||||||
|
#ifdef SLIC3R_DEBUG
|
||||||
|
#include "SVG.hpp"
|
||||||
|
@@ -22,6 +23,8 @@
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
|
+using boost::placeholders::_1;
|
||||||
|
+
|
||||||
|
TriangleMesh::TriangleMesh()
|
||||||
|
: repaired(false)
|
||||||
|
{
|
||||||
|
--- a/src/libslic3r/PrintObject.cpp
|
||||||
|
+++ b/src/libslic3r/PrintObject.cpp
|
||||||
|
@@ -4,6 +4,9 @@
|
||||||
|
#include "Geometry.hpp"
|
||||||
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
+#include <boost/bind/bind.hpp>
|
||||||
|
+
|
||||||
|
+using boost::placeholders::_1;
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
|
--- a/Build.PL
|
||||||
|
+++ b/Build.PL
|
||||||
|
@@ -142,7 +142,7 @@ if (defined $ENV{BOOST_LIBRARYPATH}) {
|
||||||
|
}
|
||||||
|
# In order to generate the -l switches we need to know how Boost libraries are named
|
||||||
|
my $have_boost = 0;
|
||||||
|
-my @boost_libraries = qw(system thread filesystem); # we need these
|
||||||
|
+my @boost_libraries = qw(thread filesystem); # we need these
|
||||||
|
# check without explicit lib path (works on Linux)
|
||||||
|
if (! $mswin) {
|
||||||
|
$have_boost = 1
|
||||||
@@ -68,3 +68,14 @@ able to build. ( latest commit ).
|
|||||||
boost::thread background_thread;
|
boost::thread background_thread;
|
||||||
boost::asio::streambuf read_buffer, write_buffer;
|
boost::asio::streambuf read_buffer, write_buffer;
|
||||||
|
|
||||||
|
--- a/Build.PL
|
||||||
|
+++ b/Build.PL
|
||||||
|
@@ -152,7 +152,7 @@ if (defined $ENV{BOOST_LIBRARYPATH}) {
|
||||||
|
# In order to generate the -l switches we need to know how Boost libraries are named
|
||||||
|
my $have_boost = 0;
|
||||||
|
my $have_boost_optional = 0;
|
||||||
|
-my @boost_libraries = qw(system thread filesystem); # we need these
|
||||||
|
+my @boost_libraries = qw(thread filesystem); # we need these
|
||||||
|
my @boost_optional_libraries = qw(nowide); # we need these, but if they aren't present we can deal
|
||||||
|
# check without explicit lib path (works on Linux)
|
||||||
|
if (! $mswin) {
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
From d5084db14e7b4e75bf588fe063a5b9941c1cac31 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jonathan Wakely <jwakely@redhat.com>
|
|
||||||
Date: Wed, 3 Jun 2020 01:05:39 +0200
|
|
||||||
Subject: [PATCH 01/15] Make boost::Placeholders::_1 visible
|
|
||||||
|
|
||||||
Fixes https://github.com/slic3r/Slic3r/issues/4967
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/src/libslic3r/GCodeTimeEstimator.cpp
|
|
||||||
+++ b/src/libslic3r/GCodeTimeEstimator.cpp
|
|
||||||
@@ -1,9 +1,12 @@
|
|
||||||
#include "GCodeTimeEstimator.hpp"
|
|
||||||
-#include <boost/bind.hpp>
|
|
||||||
+#include <boost/bind/bind.hpp>
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
|
|
||||||
+using boost::placeholders::_1;
|
|
||||||
+using boost::placeholders::_2;
|
|
||||||
+
|
|
||||||
void
|
|
||||||
GCodeTimeEstimator::parse(const std::string &gcode)
|
|
||||||
{
|
|
||||||
|
|
||||||
--- a/src/libslic3r/SLAPrint.cpp
|
|
||||||
+++ b/src/libslic3r/SLAPrint.cpp
|
|
||||||
@@ -7,9 +7,12 @@
|
|
||||||
#include <iostream>
|
|
||||||
#include <complex>
|
|
||||||
#include <cstdio>
|
|
||||||
+#include <boost/bind/bind.hpp>
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
|
|
||||||
+using boost::placeholders::_1;
|
|
||||||
+
|
|
||||||
void
|
|
||||||
SLAPrint::slice()
|
|
||||||
{
|
|
||||||
--- a/src/libslic3r/TriangleMesh.cpp
|
|
||||||
+++ b/src/libslic3r/TriangleMesh.cpp
|
|
||||||
@@ -15,6 +15,7 @@
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <boost/nowide/convert.hpp>
|
|
||||||
+#include <boost/bind/bind.hpp>
|
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG
|
|
||||||
#include "SVG.hpp"
|
|
||||||
@@ -22,6 +23,8 @@
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
|
|
||||||
+using boost::placeholders::_1;
|
|
||||||
+
|
|
||||||
TriangleMesh::TriangleMesh()
|
|
||||||
: repaired(false)
|
|
||||||
{
|
|
||||||
--- a/src/libslic3r/PrintObject.cpp
|
|
||||||
+++ b/src/libslic3r/PrintObject.cpp
|
|
||||||
@@ -4,6 +4,9 @@
|
|
||||||
#include "Geometry.hpp"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <vector>
|
|
||||||
+#include <boost/bind/bind.hpp>
|
|
||||||
+
|
|
||||||
+using boost::placeholders::_1;
|
|
||||||
|
|
||||||
namespace Slic3r {
|
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
From: bakedsnake <bakedsnake@vagrantz.xyz>
|
||||||
|
Date: Thu, 24 Sep 2026 23:59:22 +0200
|
||||||
|
Subject: [PATCH] no strict ansi
|
||||||
|
|
||||||
|
---
|
||||||
|
--- a/Build.PL
|
||||||
|
+++ b/Build.PL
|
||||||
|
@@ -20,13 +20,14 @@ $ENV{LD_RUN_PATH} //= "";
|
||||||
|
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
|
||||||
|
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
|
||||||
|
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE -Dexprtk_disable_rtl_io_file -Dexprtk_disable_return_statement -Dexprtk_disable_rtl_vecops -Dexprtk_disable_string_capabilities -Dexprtk_disable_enhanced_features);
|
||||||
|
+# std=c++11 Enforce usage of C++11 (required now). Minimum compiler supported: gcc 4.9, clang 3.3, MSVC 14.0
|
||||||
|
if ($cpp_guess->is_gcc) {
|
||||||
|
# GCC is pedantic with c++11 std, so undefine strict ansi to get M_PI back
|
||||||
|
- push @cflags, qw(-U__STRICT_ANSI__);
|
||||||
|
+ push @cflags, qw(-std=gnu++11);
|
||||||
|
+} else {
|
||||||
|
+ push @cflags, qw(-std=c++11);
|
||||||
|
}
|
||||||
|
|
||||||
|
-# std=c++11 Enforce usage of C++11 (required now). Minimum compiler supported: gcc 4.9, clang 3.3, MSVC 14.0
|
||||||
|
-push @cflags, qw(-std=c++11);
|
||||||
|
|
||||||
|
my @ldflags = ();
|
||||||
|
|
||||||
|
From: bakedsnake <bakedsnake@vagrantz.xyz>
|
||||||
|
Date: Thu, 24 Sep 2026 11:13:59 +0200
|
||||||
|
Subject: [PATCH] use system's libexpat instead of vendored expat code
|
||||||
|
|
||||||
|
---
|
||||||
|
--- a/Build.PL
|
||||||
|
+++ b/Build.PL
|
||||||
|
@@ -151,6 +151,15 @@ if (! $mswin) {
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
+if (! $mswin) {
|
||||||
|
+ push @LIBS, "-lm -ladmesh";
|
||||||
|
+
|
||||||
|
+ die <<'EOF' unless check_lib(lib => "expat");
|
||||||
|
+Could not find expat. Plase install.
|
||||||
|
+EOF
|
||||||
|
+ push @LIBS, "-lexpat";
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
if (!$ENV{SLIC3R_STATIC} && $have_boost) {
|
||||||
|
# The boost library was detected by check_lib on Linux.
|
||||||
|
push @LIBS, map "-lboost_${_}", @boost_libraries;
|
||||||
|
--- a/MANIFEST
|
||||||
|
+++ b/MANIFEST
|
||||||
|
#@@ -2,13 +2,6 @@ Build.PL
|
||||||
|
# lib/Slic3r/XS.pm
|
||||||
|
# libslic3r.doxygen
|
||||||
|
# MANIFEST This list of files
|
||||||
|
#-src/admesh/connect.c
|
||||||
|
#-src/admesh/normals.c
|
||||||
|
#-src/admesh/shared.c
|
||||||
|
#-src/admesh/stl.h
|
||||||
|
#-src/admesh/stl_io.c
|
||||||
|
#-src/admesh/stlinit.c
|
||||||
|
#-src/admesh/util.c
|
||||||
|
# src/boost/nowide/args.hpp
|
||||||
|
# src/boost/nowide/cenv.hpp
|
||||||
|
# src/boost/nowide/config.hpp
|
||||||
|
@@ -26,26 +19,6 @@ src/boost/nowide/utf8_codecvt.hpp
|
||||||
|
src/boost/nowide/windows.hpp
|
||||||
|
src/clipper.cpp
|
||||||
|
src/clipper.hpp
|
||||||
|
-src/expat/ascii.h
|
||||||
|
-src/expat/asciitab.h
|
||||||
|
-src/expat/COPYING
|
||||||
|
-src/expat/expat.h
|
||||||
|
-src/expat/expat_config.h
|
||||||
|
-src/expat/expat_external.h
|
||||||
|
-src/expat/iasciitab.h
|
||||||
|
-src/expat/internal.h
|
||||||
|
-src/expat/latin1tab.h
|
||||||
|
-src/expat/nametab.h
|
||||||
|
-src/expat/README
|
||||||
|
-src/expat/utf8tab.h
|
||||||
|
-src/expat/xmlparse.c
|
||||||
|
-src/expat/xmlrole.c
|
||||||
|
-src/expat/xmlrole.h
|
||||||
|
-src/expat/xmltok.c
|
||||||
|
-src/expat/xmltok.h
|
||||||
|
-src/expat/xmltok_impl.h
|
||||||
|
-src/expat/xmltok_impl.inc
|
||||||
|
-src/expat/xmltok_ns.inc
|
||||||
|
src/libslic3r/BoundingBox.cpp
|
||||||
|
src/libslic3r/BoundingBox.hpp
|
||||||
|
src/libslic3r/BridgeDetector.cpp
|
||||||
|
@@ -146,7 +119,6 @@ src/libslic3r/TriangleMesh.hpp
|
||||||
|
src/libslic3r/utils.cpp
|
||||||
|
src/libslic3r/Zip/ZipArchive.cpp
|
||||||
|
src/libslic3r/Zip/ZipArchive.hpp
|
||||||
|
-src/miniz/miniz.h
|
||||||
|
src/perlglue.cpp
|
||||||
|
src/poly2tri/common/shapes.cc
|
||||||
|
src/poly2tri/common/shapes.h
|
||||||
|
--- a/src/libslic3r/SlicingAdaptive.hpp
|
||||||
|
+++ b/src/libslic3r/SlicingAdaptive.hpp
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
#ifndef slic3r_SlicingAdaptive_hpp_
|
||||||
|
#define slic3r_SlicingAdaptive_hpp_
|
||||||
|
|
||||||
|
-#include "admesh/stl.h"
|
||||||
|
+#include <admesh/stl.h>
|
||||||
|
|
||||||
|
namespace Slic3r
|
||||||
|
{
|
||||||
|
--- a/src/libslic3r/IO/AMF.cpp
|
||||||
|
+++ b/src/libslic3r/IO/AMF.cpp
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
#include <boost/move/move.hpp>
|
||||||
|
#include <boost/nowide/fstream.hpp>
|
||||||
|
#include <boost/nowide/iostream.hpp>
|
||||||
|
-#include <expat/expat.h>
|
||||||
|
+#include <expat.h>
|
||||||
|
|
||||||
|
namespace Slic3r { namespace IO {
|
||||||
|
|
||||||
|
--- a/src/libslic3r/IO/TMF.hpp
|
||||||
|
+++ b/src/libslic3r/IO/TMF.hpp
|
||||||
|
@@ -14,7 +14,7 @@
|
||||||
|
#include <boost/move/move.hpp>
|
||||||
|
#include <boost/nowide/fstream.hpp>
|
||||||
|
#include <boost/nowide/iostream.hpp>
|
||||||
|
-#include <expat/expat.h>
|
||||||
|
+#include <expat.h>
|
||||||
|
|
||||||
|
#define PI 3.141592653589793238
|
||||||
|
|
||||||
|
--- a/src/libslic3r/ConditionalGCode.cpp
|
||||||
|
+++ b/src/libslic3r/ConditionalGCode.cpp
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
-#include <exprtk/exprtk.hpp>
|
||||||
|
+#include <exprtk.hpp>
|
||||||
|
#include "ConditionalGCode.hpp"
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
From: bakedsnake <bakedsnake@vagrantz.xyz>
|
||||||
|
Date: Thu, 24 Sep 2026 20:40:55 +0200
|
||||||
|
Subject: [PATCH] Use system libs instead of vendored code
|
||||||
|
|
||||||
|
* admesh
|
||||||
|
* expat
|
||||||
|
* exprtk
|
||||||
|
* miniz
|
||||||
|
---
|
||||||
|
--- a/Build.PL
|
||||||
|
+++ b/Build.PL
|
||||||
|
@@ -166,6 +166,23 @@ if (! $mswin) {
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
+if (! $mswin) {
|
||||||
|
+# die <<'EOF' unless check_lib(lib => "admesh");
|
||||||
|
+#Could not find admesh. Plase install.
|
||||||
|
+#EOF
|
||||||
|
+ push @LIBS, "-lm -ladmesh";
|
||||||
|
+
|
||||||
|
+ die <<'EOF' unless check_lib(lib => "expat");
|
||||||
|
+Could not find expat. Plase install.
|
||||||
|
+EOF
|
||||||
|
+ push @LIBS, "-lexpat";
|
||||||
|
+
|
||||||
|
+ die <<'EOF' unless check_lib(lib => "miniz");
|
||||||
|
+Could not find libexpat. Plase install.
|
||||||
|
+EOF
|
||||||
|
+ push @LIBS, "-lminiz";
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
if (!$ENV{SLIC3R_STATIC} && $have_boost) {
|
||||||
|
# The boost library was detected by check_lib on Linux.
|
||||||
|
push @LIBS, map "-lboost_${_}", @boost_libraries;
|
||||||
|
--- a/MANIFEST
|
||||||
|
+++ b/MANIFEST
|
||||||
|
@@ -2,14 +2,6 @@ Build.PL
|
||||||
|
lib/Slic3r/XS.pm
|
||||||
|
libslic3r.doxygen
|
||||||
|
MANIFEST This list of files
|
||||||
|
-src/admesh/connect.c
|
||||||
|
-src/admesh/normals.c
|
||||||
|
-src/admesh/portable_endian.h
|
||||||
|
-src/admesh/shared.c
|
||||||
|
-src/admesh/stl_io.c
|
||||||
|
-src/admesh/stl.h
|
||||||
|
-src/admesh/stlinit.c
|
||||||
|
-src/admesh/util.c
|
||||||
|
src/boost/nowide/args.hpp
|
||||||
|
src/boost/nowide/cenv.hpp
|
||||||
|
src/boost/nowide/config.hpp
|
||||||
|
@@ -31,27 +23,6 @@ src/BSpline/BSpline.h
|
||||||
|
src/BSpline/COPYRIGHT
|
||||||
|
src/clipper.cpp
|
||||||
|
src/clipper.hpp
|
||||||
|
-src/expat/ascii.h
|
||||||
|
-src/expat/asciitab.h
|
||||||
|
-src/expat/COPYING
|
||||||
|
-src/expat/expat_config.h
|
||||||
|
-src/expat/expat_external.h
|
||||||
|
-src/expat/expat.h
|
||||||
|
-src/expat/iasciitab.h
|
||||||
|
-src/expat/internal.h
|
||||||
|
-src/expat/latin1tab.h
|
||||||
|
-src/expat/nametab.h
|
||||||
|
-src/expat/README
|
||||||
|
-src/expat/utf8tab.h
|
||||||
|
-src/expat/xmlparse.c
|
||||||
|
-src/expat/xmlrole.c
|
||||||
|
-src/expat/xmlrole.h
|
||||||
|
-src/expat/xmltok_impl.h
|
||||||
|
-src/expat/xmltok_impl.inc
|
||||||
|
-src/expat/xmltok_ns.inc
|
||||||
|
-src/expat/xmltok.c
|
||||||
|
-src/expat/xmltok.h
|
||||||
|
-src/exprtk/exprtk.hpp
|
||||||
|
src/libslic3r/BoundingBox.cpp
|
||||||
|
src/libslic3r/BoundingBox.hpp
|
||||||
|
src/libslic3r/BridgeDetector.cpp
|
||||||
|
@@ -167,7 +138,6 @@ src/libslic3r/TriangleMesh.cpp
|
||||||
|
src/libslic3r/TriangleMesh.hpp
|
||||||
|
src/libslic3r/utils.cpp
|
||||||
|
src/libslic3r/utils.hpp
|
||||||
|
-src/miniz/miniz.h
|
||||||
|
src/perlglue.cpp
|
||||||
|
src/poly2tri/common/shapes.cc
|
||||||
|
src/poly2tri/common/shapes.h
|
||||||
|
--- a/src/libslic3r/SlicingAdaptive.hpp
|
||||||
|
+++ b/src/libslic3r/SlicingAdaptive.hpp
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
#ifndef slic3r_SlicingAdaptive_hpp_
|
||||||
|
#define slic3r_SlicingAdaptive_hpp_
|
||||||
|
|
||||||
|
-#include "admesh/stl.h"
|
||||||
|
+#include <admesh/stl.h>
|
||||||
|
|
||||||
|
namespace Slic3r
|
||||||
|
{
|
||||||
|
--- a/src/libslic3r/IO/AMF.cpp
|
||||||
|
+++ b/src/libslic3r/IO/AMF.cpp
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
#include <boost/filesystem/operations.hpp>
|
||||||
|
#include <boost/nowide/iostream.hpp>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
-#include <expat/expat.h>
|
||||||
|
+#include <expat.h>
|
||||||
|
#include <miniz/miniz.h>
|
||||||
|
#include "../Exception.hpp"
|
||||||
|
#include "miniz_extension.hpp"
|
||||||
|
--- a/src/libslic3r/IO/TMF.hpp
|
||||||
|
+++ b/src/libslic3r/IO/TMF.hpp
|
||||||
|
@@ -14,7 +14,7 @@
|
||||||
|
#include <boost/move/move.hpp>
|
||||||
|
#include <boost/nowide/fstream.hpp>
|
||||||
|
#include <boost/nowide/iostream.hpp>
|
||||||
|
-#include <expat/expat.h>
|
||||||
|
+#include <expat.h>
|
||||||
|
|
||||||
|
#define PI 3.141592653589793238
|
||||||
|
|
||||||
|
--- a/src/libslic3r/ConditionalGCode.cpp
|
||||||
|
+++ b/src/libslic3r/ConditionalGCode.cpp
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
-#include <exprtk/exprtk.hpp>
|
||||||
|
+#include <exprtk.hpp>
|
||||||
|
#include "ConditionalGCode.hpp"
|
||||||
|
namespace Slic3r {
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
From: bakedsnake <bakedsnake@vagrantz.xyz>
|
||||||
|
Date: Thu, 24 Sep 2026 13:49:56 +0200
|
||||||
|
Subject: [PATCH] Use system's libexpat instead of vendored code
|
||||||
|
|
||||||
|
---
|
||||||
|
--- a/src/CMakeLists.txt
|
||||||
|
+++ b/src/CMakeLists.txt
|
||||||
|
@@ -32,7 +32,6 @@ include_directories(${LIBDIR}/Slic3r/GUI/)
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/standalone/)
|
||||||
|
include_directories(${LIBDIR}/admesh/)
|
||||||
|
include_directories(${LIBDIR}/BSpline/)
|
||||||
|
-include_directories(${LIBDIR}/expat/)
|
||||||
|
include_directories(${LIBDIR}/poly2tri/)
|
||||||
|
include_directories(${LIBDIR}/poly2tri/sweep)
|
||||||
|
include_directories(${LIBDIR}/poly2tri/common)
|
||||||
|
@@ -107,11 +106,6 @@ add_library(admesh STATIC
|
||||||
|
set_property(TARGET admesh PROPERTY C_STANDARD 99)
|
||||||
|
|
||||||
|
add_library(clipper STATIC ${LIBDIR}/clipper.cpp)
|
||||||
|
-add_library(expat STATIC
|
||||||
|
- ${LIBDIR}/expat/xmlparse.c
|
||||||
|
- ${LIBDIR}/expat/xmlrole.c
|
||||||
|
- ${LIBDIR}/expat/xmltok.c
|
||||||
|
-)
|
||||||
|
add_library(polypartition STATIC ${LIBDIR}/polypartition.cpp)
|
||||||
|
add_library(poly2tri STATIC
|
||||||
|
${LIBDIR}/poly2tri/common/shapes.cc
|
||||||
|
@@ -149,7 +143,7 @@ IF(CMAKE_HOST_UNIX)
|
||||||
|
#set(Boost_LIBRARIES bsystem bthread bfilesystem)
|
||||||
|
ENDIF(CMAKE_HOST_UNIX)
|
||||||
|
|
||||||
|
-target_link_libraries (slic3r libslic3r admesh BSpline clipper expat polypartition poly2tri ${Boost_LIBRARIES})
|
||||||
|
+target_link_libraries (slic3r libslic3r admesh BSpline clipper polypartition poly2tri ${Boost_LIBRARIES})
|
||||||
|
|
||||||
|
IF(wxWidgets_FOUND)
|
||||||
|
MESSAGE("wx found!")
|
||||||
|
@@ -173,4 +167,4 @@ IF (WIN32)
|
||||||
|
target_link_libraries(extrude-tin boost-nowide)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
-target_link_libraries (extrude-tin libslic3r admesh BSpline clipper expat polypartition poly2tri ${Boost_LIBRARIES})
|
||||||
|
+target_link_libraries (extrude-tin libslic3r admesh BSpline clipper polypartition poly2tri ${Boost_LIBRARIES})
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
From d5d036e83c3893f38bf531f9340234a94bdd549d Mon Sep 17 00:00:00 2001
|
|
||||||
From: KIMDONGYEON00 <dongyeonkim2000@gmail.com>
|
|
||||||
Date: Tue, 15 Jul 2025 01:48:01 +0900
|
|
||||||
Subject: [PATCH] CVE-2024-45492
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/src/expat/xmlparse.c
|
|
||||||
+++ b/src/expat/xmlparse.c
|
|
||||||
@@ -6333,6 +6333,15 @@ nextScaffoldPart(XML_Parser parser)
|
|
||||||
int next;
|
|
||||||
|
|
||||||
if (!dtd->scaffIndex) {
|
|
||||||
+ /* Detect and prevent integer overflow.
|
|
||||||
+ * The preprocessor guard addresses the "always false" warning
|
|
||||||
+ * from -Wtype-limits on platforms where
|
|
||||||
+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
|
|
||||||
+#if UINT_MAX >= SIZE_MAX
|
|
||||||
+ if (parser->m_groupSize > ((size_t)(-1) / sizeof(int))) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
|
|
||||||
if (!dtd->scaffIndex)
|
|
||||||
return -1;
|
|
||||||
@@ -19,7 +19,7 @@ fi
|
|||||||
LICENSE="AGPL-3"
|
LICENSE="AGPL-3"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
|
|
||||||
IUSE="gui xs test"
|
IUSE="+gui xs test"
|
||||||
|
|
||||||
RESTRICT="!test? ( test )"
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
@@ -36,11 +36,15 @@ BDEPEND="
|
|||||||
|
|
||||||
RDEPEND="
|
RDEPEND="
|
||||||
dev-cpp/tbb
|
dev-cpp/tbb
|
||||||
|
dev-cpp/exprtk
|
||||||
dev-lang/perl:=
|
dev-lang/perl:=
|
||||||
dev-libs/boost:=
|
dev-libs/boost:=
|
||||||
|
dev-libs/expat
|
||||||
|
dev-libs/miniz
|
||||||
dev-perl/Encode-Locale[${PERL_USEDEP}]
|
dev-perl/Encode-Locale[${PERL_USEDEP}]
|
||||||
dev-perl/Moo[${PERL_USEDEP}]
|
dev-perl/Moo[${PERL_USEDEP}]
|
||||||
gui-libs/gtk
|
gui-libs/gtk
|
||||||
|
media-libs/admesh
|
||||||
media-libs/freeglut
|
media-libs/freeglut
|
||||||
net-misc/curl[openssl]
|
net-misc/curl[openssl]
|
||||||
virtual/perl-Encode
|
virtual/perl-Encode
|
||||||
@@ -73,24 +77,30 @@ RDEPEND="
|
|||||||
DEPEND="${RDEPEND}"
|
DEPEND="${RDEPEND}"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}/admesh-vulnerability.patch"
|
|
||||||
"${FILESDIR}/boost-header.patch"
|
|
||||||
"${FILESDIR}/boost-io-context-${PV}.patch"
|
"${FILESDIR}/boost-io-context-${PV}.patch"
|
||||||
"${FILESDIR}/boost-placeholders.patch"
|
"${FILESDIR}/build-with-system-libs-${PV}.patch"
|
||||||
"${FILESDIR}/libexpat-cve-2024-45492.patch"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
# boost_system is now part of boost_thread
|
local vendored=( admesh expat exprtk )
|
||||||
# since Boost 1.69
|
for v in "${vendored[@]}"; do
|
||||||
sed -i 's/my @boost_libraries = qw(system thread filesystem);/my @boost_libraries = qw(thread filesystem);/' \
|
rm -rf src/"${v}" || die "Failed to remove vendored ${v}."
|
||||||
Build.PL || die "Failed to remove `boost_system`"
|
done
|
||||||
|
|
||||||
# No strict ansi
|
if [[ "${PV}" != *9999* ]]; then
|
||||||
# See: https://github.com/slic3r/Slic3r/pull/4974
|
cd .. || die
|
||||||
sed -i "s/push @cflags, qw(-std=c++11);/push @cflags, qw(-std=gnu++11);/" \
|
eapply "${FILESDIR}/cmake-with-system-libs.patch"
|
||||||
Build.PL || die "Failed to set gnu++11"
|
sed -i "/^src\/admesh/d" xs/MANIFEST || die
|
||||||
|
else
|
||||||
|
sed -i "/^set(EXPAT_INCLUDES$/,/^)$/c\find_package(expat REQUIRED)\n" \
|
||||||
|
../src/CMakeLists.txt || die
|
||||||
|
|
||||||
|
rm -rf src/miniz || die "Failed to remove vendored miniz"
|
||||||
|
sed -i "s|\"miniz/miniz.h\"|<miniz/miniz.h>|" src/Zip/ZipArchive.hpp || die
|
||||||
|
sed -i "/^add_library(miniz STATIC$/,/^)$/c\find_package(miniz REQUIRED)\n" \
|
||||||
|
../src/CMakeLists.txt || die
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
@@ -19,7 +19,7 @@ fi
|
|||||||
LICENSE="AGPL-3"
|
LICENSE="AGPL-3"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
|
|
||||||
IUSE="gui xs test"
|
IUSE="+gui xs test"
|
||||||
|
|
||||||
RESTRICT="!test? ( test )"
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
@@ -36,11 +36,15 @@ BDEPEND="
|
|||||||
|
|
||||||
RDEPEND="
|
RDEPEND="
|
||||||
dev-cpp/tbb
|
dev-cpp/tbb
|
||||||
|
dev-cpp/exprtk
|
||||||
dev-lang/perl:=
|
dev-lang/perl:=
|
||||||
dev-libs/boost:=
|
dev-libs/boost:=
|
||||||
|
dev-libs/expat
|
||||||
|
dev-libs/miniz
|
||||||
dev-perl/Encode-Locale[${PERL_USEDEP}]
|
dev-perl/Encode-Locale[${PERL_USEDEP}]
|
||||||
dev-perl/Moo[${PERL_USEDEP}]
|
dev-perl/Moo[${PERL_USEDEP}]
|
||||||
gui-libs/gtk
|
gui-libs/gtk
|
||||||
|
media-libs/admesh
|
||||||
media-libs/freeglut
|
media-libs/freeglut
|
||||||
net-misc/curl[openssl]
|
net-misc/curl[openssl]
|
||||||
virtual/perl-Encode
|
virtual/perl-Encode
|
||||||
@@ -73,17 +77,30 @@ RDEPEND="
|
|||||||
DEPEND="${RDEPEND}"
|
DEPEND="${RDEPEND}"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}/admesh-vulnerability.patch"
|
|
||||||
"${FILESDIR}/boost-io-context-${PV}.patch"
|
"${FILESDIR}/boost-io-context-${PV}.patch"
|
||||||
"${FILESDIR}/libexpat-cve-2024-45492.patch"
|
"${FILESDIR}/build-with-system-libs-${PV}.patch"
|
||||||
)
|
)
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
# boost_system is now part of boost_thread
|
local vendored=( admesh expat exprtk )
|
||||||
# since Boost 1.69
|
for v in "${vendored[@]}"; do
|
||||||
sed -i 's/my @boost_libraries = qw(system thread filesystem);/my @boost_libraries = qw(thread filesystem);/' \
|
rm -rf src/"${v}" || die "Failed to remove vendored ${v}."
|
||||||
Build.PL || die "Failed to remove `boost_system`"
|
done
|
||||||
|
|
||||||
|
if [[ "${PV}" != *9999* ]]; then
|
||||||
|
cd .. || die
|
||||||
|
eapply "${FILESDIR}/cmake-with-system-libs.patch"
|
||||||
|
sed -i "/^src\/admesh/d" xs/MANIFEST || die
|
||||||
|
else
|
||||||
|
sed -i "/^set(EXPAT_INCLUDES$/,/^)$/c\find_package(expat REQUIRED)\n" \
|
||||||
|
../src/CMakeLists.txt || die
|
||||||
|
|
||||||
|
rm -rf src/miniz || die "Failed to remove vendored miniz"
|
||||||
|
sed -i "s|\"miniz/miniz.h\"|<miniz/miniz.h>|" src/Zip/ZipArchive.hpp || die
|
||||||
|
sed -i "/^add_library(miniz STATIC$/,/^)$/c\find_package(miniz REQUIRED)\n" \
|
||||||
|
../src/CMakeLists.txt || die
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
Reference in new issue
Block a user