From eb9139b34ee8e0c5ac9f94f93078165c6e5edd56 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 12 Mar 2013 01:13:59 -0400 Subject: sync diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 9e2da81..308bbe9 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -20,6 +20,7 @@ o Changed multmatrix floating-point output to improve dumptest portability o Regression test auto-starts & stops Xvfb / Xvnc if on headless unix machine o CGAL triangulation more lenient- enables partial rendering of 'bad' DXF data o Fixes problem where local changes are overwritten on automatic reload when included files has changed. +o Non-ascii filenames are now allowed OpenSCAD 2013.01 ================ -- cgit v0.10.1 From 5edc8c57da6eb8bfb7725ac51c4b87edd950e847 Mon Sep 17 00:00:00 2001 From: don bright Date: Sat, 16 Mar 2013 21:55:38 +0100 Subject: update cmakelist for building tests in same dir as gui binary diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5eecaae..6178c3a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -604,6 +604,10 @@ else() set(GUI_BINPATH "${CMAKE_CURRENT_SOURCE_DIR}/../openscad") endif() +if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/openscad") + set(GUI_BINPATH "${CMAKE_CURRENT_BINARY_DIR}/openscad") +endif() + if(EXISTS "${GUI_BINPATH}") message(STATUS "Found OpenSCAD GUI binary: ${GUI_BINPATH}") else() -- cgit v0.10.1 From 100b1733df981aa542675d2dad198a259a61ccd2 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 17 Mar 2013 18:34:47 +0100 Subject: backport boost functions to pre-1.48 diff --git a/scripts/uni-build-dependencies.sh b/scripts/uni-build-dependencies.sh index dc61f74..784a191 100755 --- a/scripts/uni-build-dependencies.sh +++ b/scripts/uni-build-dependencies.sh @@ -513,7 +513,7 @@ if [ $1 ]; then exit $? fi if [ $1 = "cgal" ]; then - build_cgal 4.0.2 use-sys-libs + build_cgal 4.1 use-sys-libs exit $? fi if [ $1 = "opencsg" ]; then diff --git a/src/boost-utils.cc b/src/boost-utils.cc index 5127047..534cbaa 100644 --- a/src/boost-utils.cc +++ b/src/boost-utils.cc @@ -1,3 +1,4 @@ +#include "boosty.h" #include "boost-utils.h" #include #include @@ -7,8 +8,8 @@ fs::path boostfs_relative_path(const fs::path &path, const fs::path &relative_to) { // create absolute paths - fs::path p = fs::absolute(boostfs_normalize(path)); - fs::path r = fs::absolute(relative_to); + fs::path p = boosty::absolute(boostfs_normalize(path)); + fs::path r = boosty::absolute(relative_to); // if root paths are different, return absolute path if (p.root_path() != r.root_path()) @@ -46,16 +47,17 @@ fs::path boostfs_relative_path(const fs::path &path, const fs::path &relative_to // Will normalize the given path, i.e. remove any redundant ".." path elements. fs::path boostfs_normalize(const fs::path &path) { - fs::path absPath = absolute(path); + fs::path absPath = boosty::absolute(path); fs::path::iterator it = absPath.begin(); - fs::path result = *it++; + fs::path result = *it; + if (it!=absPath.end()) it++; // Get canonical version of the existing part for(;exists(result) && it != absPath.end(); ++it) { result /= *it; } - result = canonical(result.parent_path()); - --it; + result = boosty::canonical(result.parent_path()); + if (it!=absPath.begin()) it--; // For the rest remove ".." and "." in a path with no symlinks for (; it != absPath.end(); ++it) { @@ -98,8 +100,8 @@ boostfs_uncomplete(fs::path const p, fs::path const base) which it most likely is... but then base shouldn't be a filename so... */ // create absolute paths - fs::path abs_p = fs::absolute(boostfs_normalize(p)); - fs::path abs_base = fs::absolute(base); + fs::path abs_p = boosty::absolute(boostfs_normalize(p)); + fs::path abs_base = boosty::absolute(base); fs::path from_path, from_base, output; diff --git a/src/boosty.h b/src/boosty.h index 6ec417a..5c82002 100644 --- a/src/boosty.h +++ b/src/boosty.h @@ -10,9 +10,8 @@ versions of boost found on popular versions of linux, circa early 2012. design - hope that the user is compiling with boost>1.46 + filesystem v3 - if not, fall back to older deprecated functions, and rely on - testing to find bugs. implement the minimum needed by OpenSCAD and no more. + the boost filsystem changed around 1.46-1.48. we do a large #ifdef + based on boost version that wraps various functions appropriately. in a few years, this file should be deleted as unnecessary. see also @@ -28,6 +27,7 @@ #include #include namespace fs = boost::filesystem; +#include "printutils.h" namespace boosty { @@ -77,6 +77,62 @@ inline std::string extension_str( fs::path p) #endif + + + + +#if BOOST_VERSION >= 104800 + +inline fs::path canonical( fs::path p, fs::path p2 ) +{ + return fs::canonical( p, p2, NULL ); +} + +inline fs::path canonical( fs::path p ) +{ + return fs::canonical( p, fs::current_path(), NULL ); +} + +#else + +inline fs::path canonical( fs::path p, fs::path p2 ) +{ + // dotpath: win32/mac builds will be using newer versions of boost + // so we can treat this as though it is unix only + const fs::path dot_path("."); + const fs::path dot_dot_path(".."); + fs::path result; + if (p=="") + { + p=p2; + } + for (fs::path::iterator itr = p.begin(); itr != p.end(); itr++) + { + if (*itr == dot_path) continue; + if (*itr == dot_dot_path) + { + result.remove_filename(); + continue; + } + result /= *itr; + if (fs::is_symlink(result)) + { + PRINT("WARNING: canonical() wrapper can't do symlinks. upgrade boost to >1.48"); + } + } + return result; +} + +inline fs::path canonical( fs::path p ) +{ + return canonical( p, fs::current_path() ); +} + +#endif + + + + } // namespace #endif diff --git a/src/value.cc b/src/value.cc index ae810a2..ebb825d 100644 --- a/src/value.cc +++ b/src/value.cc @@ -39,7 +39,9 @@ std::ostream &operator<<(std::ostream &stream, const Filename &filename) { - stream << QuotedString(boosty::stringy(boostfs_uncomplete(filename, fs::current_path()))); + fs::path fnpath = fs::path( (std::string)filename ); + fs::path fpath = boostfs_uncomplete(fnpath, fs::current_path()); + stream << QuotedString(boosty::stringy( fpath )); return stream; } -- cgit v0.10.1 From c8c749de1893d76966d924e22276b3d7d58f3b58 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 17 Mar 2013 11:21:15 -0700 Subject: fix some bugs in wrapper of canonical() diff --git a/src/boosty.h b/src/boosty.h index 5c82002..6dc9858 100644 --- a/src/boosty.h +++ b/src/boosty.h @@ -85,12 +85,12 @@ inline std::string extension_str( fs::path p) inline fs::path canonical( fs::path p, fs::path p2 ) { - return fs::canonical( p, p2, NULL ); + return fs::canonical( p, p2 ); } inline fs::path canonical( fs::path p ) { - return fs::canonical( p, fs::current_path(), NULL ); + return fs::canonical( p ); } #else -- cgit v0.10.1 From f40942441882823f9b432c57eead64a89507e577 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 17 Mar 2013 11:57:29 -0700 Subject: update to match Marius' version diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 308bbe9..9e2da81 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -20,7 +20,6 @@ o Changed multmatrix floating-point output to improve dumptest portability o Regression test auto-starts & stops Xvfb / Xvnc if on headless unix machine o CGAL triangulation more lenient- enables partial rendering of 'bad' DXF data o Fixes problem where local changes are overwritten on automatic reload when included files has changed. -o Non-ascii filenames are now allowed OpenSCAD 2013.01 ================ -- cgit v0.10.1 From 1949403689f9cc6f5c5b59e27176518fac4426b9 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 17 Mar 2013 11:58:53 -0700 Subject: boost s/b >=1.48 not >1.48 diff --git a/src/boosty.h b/src/boosty.h index 6dc9858..2b5ab38 100644 --- a/src/boosty.h +++ b/src/boosty.h @@ -117,7 +117,7 @@ inline fs::path canonical( fs::path p, fs::path p2 ) result /= *itr; if (fs::is_symlink(result)) { - PRINT("WARNING: canonical() wrapper can't do symlinks. upgrade boost to >1.48"); + PRINT("WARNING: canonical() wrapper can't do symlinks. upgrade boost to >=1.48"); } } return result; -- cgit v0.10.1 From 8e32cef0a8c52742bf12cafd2aa9dafd1efe764e Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 17 Mar 2013 12:29:02 -0700 Subject: more accurate help message diff --git a/src/boosty.h b/src/boosty.h index 2b5ab38..8b0c93e 100644 --- a/src/boosty.h +++ b/src/boosty.h @@ -117,7 +117,8 @@ inline fs::path canonical( fs::path p, fs::path p2 ) result /= *itr; if (fs::is_symlink(result)) { - PRINT("WARNING: canonical() wrapper can't do symlinks. upgrade boost to >=1.48"); + PRINT("WARNING: canonical() wrapper can't do symlinks. rebuild openscad with boost >=1.48"); + PRINT("WARNING: or don't use symbolic links"); } } return result; -- cgit v0.10.1