Rediff patches
authorRyan Pavlik <ryan@ryanpavlik.com>
Thu, 12 May 2022 22:05:07 +0000 (17:05 -0500)
committerRyan Pavlik <ryan@ryanpavlik.com>
Fri, 13 May 2022 21:56:49 +0000 (16:56 -0500)
Drop 10_mimalloc_restrict_cpu_yield.patch: applied upstream.
Drop 11_update_js_three_r111.patch: applied upstream.
Drop 12_Remove-march-native-from-mimalloc-build.patch: applied upstream.
Add 05_eigen_dependency_fix.patch: Fix test suite build
Revise 01_RemoveGitHash.patch into 01_hardcode_git_hash.patch: Hash needed
to create commit link now

Gbp-Dch: Full

debian/patches/01_RemoveGitHash.patch [deleted file]
debian/patches/01_hardcode_git_hash.patch [new file with mode: 0644]
debian/patches/02_add_debian_pkg_version.patch
debian/patches/03_use_system_threejs.patch
debian/patches/04_use_system_unifont.patch
debian/patches/05_eigen_dependency_fix.patch [new file with mode: 0644]
debian/patches/10_mimalloc_restrict_cpu_yield.patch [deleted file]
debian/patches/11_update_js_three_r111.patch [deleted file]
debian/patches/12_Remove-march-native-from-mimalloc-build.patch [deleted file]
debian/patches/series

diff --git a/debian/patches/01_RemoveGitHash.patch b/debian/patches/01_RemoveGitHash.patch
deleted file mode 100644 (file)
index 4d46fed..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Remove git hash commit consideration
-Forwarded: not-needed
-Author: Anton Gladky <gladk@debian.org>
-Last-Update: 2016-12-31
-Index: solvespace/CMakeLists.txt
-===================================================================
---- solvespace.orig/CMakeLists.txt
-+++ solvespace/CMakeLists.txt
-@@ -36,7 +36,6 @@ endif()
- # NOTE TO PACKAGERS: The embedded git commit hash is critical for rapid bug triage when the builds
- # can come from a variety of sources. If you are mirroring the sources or otherwise build when
- # the .git directory is not present, please comment the following line:
--include(GetGitCommitHash)
- # and instead uncomment the following, adding the complete git hash of the checkout you are using:
- # set(GIT_COMMIT_HASH 0000000000000000000000000000000000000000)
diff --git a/debian/patches/01_hardcode_git_hash.patch b/debian/patches/01_hardcode_git_hash.patch
new file mode 100644 (file)
index 0000000..6210de3
--- /dev/null
@@ -0,0 +1,29 @@
+From: Anton Gladky <gladk@debian.org>
+Date: Thu, 12 May 2022 16:48:46 -0500
+Subject: Manually specify git commit hash
+
+Revise on every upstream update!
+
+Forwarded: not-needed
+Last-Update: 2022-05-13
+===================================================================
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7f08e95..cfdd52d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -34,9 +34,9 @@ endif()
+ # NOTE TO PACKAGERS: The embedded git commit hash is critical for rapid bug triage when the builds
+ # can come from a variety of sources. If you are mirroring the sources or otherwise build when
+ # the .git directory is not present, please comment the following line:
+-include(GetGitCommitHash)
++# include(GetGitCommitHash)
+ # and instead uncomment the following, adding the complete git hash of the checkout you are using:
+-# set(GIT_COMMIT_HASH 0000000000000000000000000000000000000000)
++set(GIT_COMMIT_HASH a4416a4cae3e56b64108f216b5982df51bdd69f3)
+ string(SUBSTRING "${GIT_COMMIT_HASH}" 0 8 solvespace_GIT_HASH)
+ project(solvespace
index e345437c279c32bee0597cf58e903d95f59b7a15..ec574f6feb3dc49dcc3b6ffd58a07e5d3ac16e5f 100644 (file)
@@ -1,24 +1,22 @@
-Subject: Add debian package version to ver string
-Forwarded: not-needed
 From: Ryan Pavlik <ryan.pavlik@collabora.com>
+Date: Thu, 12 May 2022 16:48:46 -0500
+Subject: Add debian package version to ver string.
 
-Date: Tue, 19 Jan 2021 13:51:09 -0600
-
-
+Forwarded: not-needed
 ---
  src/config.h.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/config.h.in b/src/config.h.in
-index 144c46d..b129808 100644
+index 187b9cb..ab0792c 100644
 --- a/src/config.h.in
 +++ b/src/config.h.in
 @@ -1,7 +1,7 @@
  #ifndef SOLVESPACE_CONFIG_H
  #define SOLVESPACE_CONFIG_H
  
--#define PACKAGE_VERSION "@solvespace_VERSION_MAJOR@.@solvespace_VERSION_MINOR@~@solvespace_GIT_HASH@"
+-#define PACKAGE_VERSION "@PROJECT_VERSION@~@solvespace_GIT_HASH@"
 +#define PACKAGE_VERSION "@solvespace_VERSION_MAJOR@.@solvespace_VERSION_MINOR@ (Debian package version @DEBVERSION@)"
+ #define GIT_HASH_URL "https://github.com/solvespace/solvespace/commit/@solvespace_GIT_HASH@"
  
  /* Non-OS X *nix only */
- #define UNIX_DATADIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATAROOTDIR@/solvespace"
index d4b206ee911a2e8ba289ced6ff77bab84d6fa1b3..7efb308d155f573a6f1905cb3a3abb7a9885607d 100644 (file)
@@ -1,33 +1,44 @@
-Subject: Use threejs from system.
-Forwarded: not-needed
 From: Ryan Pavlik <ryan.pavlik@collabora.com>
+Date: Thu, 12 May 2022 16:48:46 -0500
+Subject: Use threejs from system.
 
-Date: Tue, 19 Jan 2021 15:05:06 -0600
-
-
+Forwarded: not-needed
 ---
  res/CMakeLists.txt | 1 -
- src/export.cpp     | 2 +-
- 2 files changed, 1 insertion(+), 2 deletions(-)
+ src/export.cpp     | 4 ++--
+ 2 files changed, 2 insertions(+), 3 deletions(-)
 
---- solvespace.orig/res/CMakeLists.txt
-+++ solvespace/res/CMakeLists.txt
-@@ -284,7 +284,6 @@
+diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt
+index 7303c6f..78d2bd2 100644
+--- a/res/CMakeLists.txt
++++ b/res/CMakeLists.txt
+@@ -295,7 +295,6 @@ add_resources(
      shaders/edge.frag
      shaders/edge.vert
      shaders/outline.vert
--    threejs/three-r76.js.gz
+-    threejs/three-r111.min.js.gz
      threejs/hammer-2.0.8.js.gz
      threejs/SolveSpaceControls.js)
  
---- solvespace.orig/src/export.cpp
-+++ solvespace/src/export.cpp
-@@ -1014,7 +1014,7 @@
+diff --git a/src/export.cpp b/src/export.cpp
+index f1c331f..d3a47b4 100644
+--- a/src/export.cpp
++++ b/src/export.cpp
+@@ -953,7 +953,7 @@ void SolveSpaceUI::ExportMeshAsThreeJsTo(FILE *f, const Platform::Path &filename
+     STriangle *tr;
+     Vector bndl, bndh;
+-    const std::string THREE_FN("three-r111.min.js");
++    const std::string THREE_FN("three.js");
+     const std::string HAMMER_FN("hammer-2.0.8.js");
+     const std::string CONTROLS_FN("SolveSpaceControls.js");
  
+@@ -1016,7 +1016,7 @@ void SolveSpaceUI::ExportMeshAsThreeJsTo(FILE *f, const Platform::Path &filename
      if(filename.HasExtension("html")) {
          fprintf(f, htmlbegin,
--                LoadStringFromGzip("threejs/three-r76.js.gz").c_str(),
-+                LoadString("threejs/three.js").c_str(),
-                 LoadStringFromGzip("threejs/hammer-2.0.8.js.gz").c_str(),
-                 LoadString("threejs/SolveSpaceControls.js").c_str());
-     }
+                 THREE_FN.c_str(),
+-                LoadStringFromGzip("threejs/" + THREE_FN + ".gz").c_str(),
++                LoadString("threejs/" + THREE_FN).c_str(),
+                 HAMMER_FN.c_str(),
+                 LoadStringFromGzip("threejs/" + HAMMER_FN + ".gz").c_str(),
+                 CONTROLS_FN.c_str(),
index 0dc276d0a29909b522df852233ef8a04e09af80b..d9438651a8561e0ee2f517c60368010dfeaafaf3 100644 (file)
@@ -1,21 +1,19 @@
-Subject: Use Unifont from system
-Forwarded: not-needed
 From: Ryan Pavlik <ryan.pavlik@collabora.com>
+Date: Thu, 12 May 2022 16:48:46 -0500
+Subject: Use Unifont from system
 
-Date: Tue, 19 Jan 2021 15:06:55 -0600
-
-
+Forwarded: not-needed
 ---
  res/CMakeLists.txt | 1 -
  src/resource.cpp   | 2 +-
  2 files changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt
-index d893f93..85b6e49 100644
+index 78d2bd2..64fc439 100644
 --- a/res/CMakeLists.txt
 +++ b/res/CMakeLists.txt
-@@ -259,7 +259,6 @@ add_resources(
-     locales/uk_UA.po
+@@ -270,7 +270,6 @@ add_resources(
+     locales/tr_TR.po
      locales/ru_RU.po
      locales/zh_CN.po
 -    fonts/unifont.hex.gz
@@ -23,10 +21,10 @@ index d893f93..85b6e49 100644
      fonts/private/1-check-true.png
      fonts/private/2-radio-false.png
 diff --git a/src/resource.cpp b/src/resource.cpp
-index 7b19081..e8a51bb 100644
+index d3fa4ca..f687894 100644
 --- a/src/resource.cpp
 +++ b/src/resource.cpp
-@@ -665,7 +665,7 @@ size_t BitmapFont::GetWidth(const std::string &str) {
+@@ -669,7 +669,7 @@ size_t BitmapFont::GetWidth(const std::string &str) {
  }
  
  BitmapFont BitmapFont::Create() {
diff --git a/debian/patches/05_eigen_dependency_fix.patch b/debian/patches/05_eigen_dependency_fix.patch
new file mode 100644 (file)
index 0000000..e9315b5
--- /dev/null
@@ -0,0 +1,84 @@
+Subject: Eigen includes are a public dependency
+Forwarded: https://github.com/solvespace/solvespace/pull/1243
+From: Ryan Pavlik <ryan@ryanpavlik.com>
+
+Date: Fri, 13 May 2022 16:00:59 -0500
+
+
+---
+ CMakeLists.txt      | 8 ++++----
+ src/CMakeLists.txt  | 7 +++++--
+ test/CMakeLists.txt | 3 +++
+ 3 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cfdd52d..0446e1b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -185,9 +185,6 @@ endif()
+ message(STATUS "Using in-tree libdxfrw")
+ add_subdirectory(extlib/libdxfrw)
+-message(STATUS "Using in-tree eigen")
+-include_directories(extlib/eigen)
+-
+ message(STATUS "Using in-tree mimalloc")
+ set(MI_OVERRIDE OFF CACHE BOOL "")
+ set(MI_BUILD_SHARED OFF CACHE BOOL "")
+@@ -199,13 +196,16 @@ set(MIMALLOC_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extlib/mimalloc/include)
+ if(NOT FORCE_VENDORED_Eigen3)
+     find_package(Eigen3 CONFIG)
+ endif()
+-if(FORCE_VENDORED_Eigen3 OR NOT EIGEN3_FOUND)
++if(FORCE_VENDORED_Eigen3 OR NOT EIGEN3_INCLUDE_DIRS)
+     message(STATUS "Using in-tree Eigen")
+     set(EIGEN3_FOUND             YES)
+     set(EIGEN3_INCLUDE_DIRS      ${CMAKE_SOURCE_DIR}/extlib/eigen)
+ else()
+     message(STATUS "Using system Eigen: ${EIGEN3_INCLUDE_DIRS}")
+ endif()
++if(NOT EXISTS "${EIGEN3_INCLUDE_DIRS}")
++    message(FATAL_ERROR "Eigen 3 not found on system or in-tree")
++endif()
+ if(WIN32 OR APPLE)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 0c0277e..41c40d0 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -82,7 +82,9 @@ target_compile_definitions(slvs
+     PRIVATE -DLIBRARY)
+ target_include_directories(slvs
+-    PUBLIC ${CMAKE_SOURCE_DIR}/include)
++    PUBLIC
++        ${CMAKE_SOURCE_DIR}/include
++        ${EIGEN3_INCLUDE_DIRS})
+ target_link_libraries(slvs PRIVATE slvs_deps)
+@@ -336,7 +338,8 @@ target_compile_definitions(solvespace-headless
+     PRIVATE HEADLESS)
+ target_include_directories(solvespace-headless
+-    INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
++    INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
++    PUBLIC ${EIGEN3_INCLUDE_DIRS})
+ target_link_libraries(solvespace-headless
+     PRIVATE
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index db812bf..eb6cf60 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -76,6 +76,9 @@ target_link_libraries(solvespace-testsuite
+     solvespace-headless
+     ${COVERAGE_LIBRARY})
++target_include_directories(solvespace-testsuite
++    PRIVATE
++    ${EIGEN3_INCLUDE_DIRS})
+ add_dependencies(solvespace-testsuite
+     resources)
diff --git a/debian/patches/10_mimalloc_restrict_cpu_yield.patch b/debian/patches/10_mimalloc_restrict_cpu_yield.patch
deleted file mode 100644 (file)
index f05babe..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-Subject: Restricts cpu yield instructions a little.
-Forwarded: https://github.com/microsoft/mimalloc/pull/350
-From: Ryan Pavlik <ryan.pavlik@collabora.com>
-Last-Update: 2021-02-11
-Applied-Upstream: 3.0.0, https://github.com/solvespace/solvespace/commit/cdeb6c90fb753a2b0f6d033affedbcceab046758
-
-
-adding clobber for ARM and preventing older 32 bits chips not supporting this instruction.
-
-Backport of https://github.com/microsoft/mimalloc/commit/33a10b48605f8bb419487a03125815ad6ee00a70
-
-Enhanced via https://github.com/mr-c/misc/wiki/pause-techniques-on-many-architectures
-
----
- extlib/mimalloc/include/mimalloc-atomic.h | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
---- solvespace.orig/extlib/mimalloc/include/mimalloc-atomic.h
-+++ solvespace/extlib/mimalloc/include/mimalloc-atomic.h
-@@ -266,17 +266,37 @@
-   static inline void mi_atomic_yield(void) {
-     std::this_thread::yield();
-   }
--#elif (defined(__GNUC__) || defined(__clang__)) && \
--      (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__))
--#if defined(__x86_64__) || defined(__i386__)
-+#elif defined(__SSE2__)  // AMD and Intel
-+  #include <emmintrin.h>
-+  static inline void mi_atomic_yield(void) {
-+    _mm_pause();
-+  }
-+#elif defined(__x86_64__) || defined(__i386__)
-   static inline void mi_atomic_yield(void) {
-     asm volatile ("pause" ::: "memory");
-   }
--#elif defined(__arm__) || defined(__aarch64__)
-+#elif defined(__aarch64__)
-+  static inline void mi_atomic_yield(void) {
-+    asm volatile("wfe");
-+  }
-+#elif defined(__arm__) && __ARM_ARCH__ >= 7
-+  static inline void mi_atomic_yield(void) {
-+    __asm__ volatile("yield" ::: "memory");
-+  }
-+#elif defined(__armel__) || defined(__ARMEL__)
-+  static inline void mi_atomic_yield(void) {
-+    asm volatile ("nop" ::: "memory");  // default operation - does nothing => Might lead to passive spinning.
-+  }
-+#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) // PowerPC
-+  static inline void mi_atomic_yield(void) {
-+     __asm__ __volatile__ ("or 27,27,27" ::: "memory");
-+  }
-+#elif defined(__sun)
-+  // Fallback for other archs
-+  #include <synch.h>
-   static inline void mi_atomic_yield(void) {
--    asm volatile("yield");
-+    smt_pause();
-   }
--#endif
- #elif defined(__wasi__)
-   #include <sched.h>
-   static inline void mi_atomic_yield(void) {
diff --git a/debian/patches/11_update_js_three_r111.patch b/debian/patches/11_update_js_three_r111.patch
deleted file mode 100644 (file)
index 5115862..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-Subject: Update javascript to be compatible with threejs r111
-Forwarded: https://github.com/solvespace/solvespace/pull/906
-From: Ryan Pavlik <ryan.pavlik@collabora.com>
-Last-Update: 2021-02-11
-Applied-Upstream: 3.0.0, https://github.com/solvespace/solvespace/commit/d16e33ac48cb717f24a06a30e268227c860476d2
-
-Date: Tue, 19 Jan 2021 17:22:35 -0600
-
-
----
- res/threejs/SolveSpaceControls.js | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/res/threejs/SolveSpaceControls.js b/res/threejs/SolveSpaceControls.js
-index e141ace..ca74fd5 100644
---- a/res/threejs/SolveSpaceControls.js
-+++ b/res/threejs/SolveSpaceControls.js
-@@ -470,9 +470,9 @@ solvespace = function(obj, params) {
-         changeBasis.makeBasis(camera.right, camera.up, n);
-         for (var i = 0; i < 2; i++) {
--            var newLightPos = changeBasis.applyToVector3Array(
--                [obj.lights.d[i].direction[0], obj.lights.d[i].direction[1],
--                    obj.lights.d[i].direction[2]]);
-+            var newLightPos = new THREE.Vector3(obj.lights.d[i].direction[0],
-+                obj.lights.d[i].direction[1],
-+                obj.lights.d[i].direction[2]).applyMatrix4(changeBasis);
-             directionalLightArray[i].position.set(newLightPos[0],
-                 newLightPos[1], newLightPos[2]);
-         }
-@@ -515,7 +515,7 @@ solvespace = function(obj, params) {
-         }
-         geometry.computeBoundingSphere();
--        return new THREE.Mesh(geometry, new THREE.MultiMaterial(materialList));
-+        return new THREE.Mesh(geometry, materialList);
-     }
-     function createEdges(meshObj) {
diff --git a/debian/patches/12_Remove-march-native-from-mimalloc-build.patch b/debian/patches/12_Remove-march-native-from-mimalloc-build.patch
deleted file mode 100644 (file)
index 40f0282..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Subject: Remove -march=native from mimalloc build.
-Bug: https://github.com/microsoft/mimalloc/issues/361
-Bug: https://github.com/solvespace/solvespace/issues/934
-From: Ryan Pavlik <ryan.pavlik@collabora.com>
-Last-Update: 2021-02-11
-
-Date: Wed, 10 Feb 2021 16:20:25 -0600
-
-
----
- extlib/mimalloc/CMakeLists.txt | 5 -----
- 1 file changed, 5 deletions(-)
-
-diff --git a/extlib/mimalloc/CMakeLists.txt b/extlib/mimalloc/CMakeLists.txt
-index 37616eb..e8e7f88 100644
---- a/extlib/mimalloc/CMakeLists.txt
-+++ b/extlib/mimalloc/CMakeLists.txt
-@@ -183,11 +183,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM
-   endif()
- endif()
--# Architecture flags
--if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm")
--    list(APPEND mi_cflags -march=native)
--endif()
--
- # extra needed libraries
- if(WIN32)
-   list(APPEND mi_libraries psapi shell32 user32 bcrypt)
index 7cad336f2b53f24263e0553d3a8ea2bf43b96e35..c50dbd2c3c1b785c84c6d51c3dea300d35eb2a69 100644 (file)
@@ -1,7 +1,5 @@
-01_RemoveGitHash.patch
+01_hardcode_git_hash.patch
 02_add_debian_pkg_version.patch
 03_use_system_threejs.patch
 04_use_system_unifont.patch
-10_mimalloc_restrict_cpu_yield.patch
-11_update_js_three_r111.patch
-12_Remove-march-native-from-mimalloc-build.patch
+05_eigen_dependency_fix.patch