From 09f4dfbc4793bf4614cd4a72b46e6c2ae9b7976c Mon Sep 17 00:00:00 2001
From: Karl Nilsson <karl.robert.nilsson@gmail.com>
Date: Fri, 14 Jun 2019 01:51:52 -0400
Subject: [PATCH 1/5] cura-fdm-materials: update to 4.1.0.

---
 srcpkgs/cura-fdm-materials/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cura-fdm-materials/template b/srcpkgs/cura-fdm-materials/template
index 045a684d23a..7f3edb8f59d 100644
--- a/srcpkgs/cura-fdm-materials/template
+++ b/srcpkgs/cura-fdm-materials/template
@@ -1,6 +1,6 @@
 # Template file for 'cura-fdm-materials'
 pkgname=cura-fdm-materials
-version=4.0.0
+version=4.1.0
 revision=1
 archs=noarch
 wrksrc="fdm_materials-${version}"
@@ -10,7 +10,7 @@ maintainer="Karl Nilsson <karl.robert.nilsson@gmail.com>"
 license="CC0-1.0"
 homepage="https://github.com/Ultimaker/fdm_materials"
 distfiles="https://github.com/Ultimaker/fdm_materials/archive/${version}.tar.gz"
-checksum=ab2c6fcbabd699c65380d7746e58d85e8d5d46271b88b13ba325d6b9f1b66f08
+checksum=4a71742d33f004e6c1b63a25b3c296c2c7872a189775b1dcbaeea9853ec59166
 
 post_install() {
 	vlicense LICENSE

From 2cd3bd942b2ba96fc2425e40afd668bf5a779105 Mon Sep 17 00:00:00 2001
From: Karl Nilsson <karl.robert.nilsson@gmail.com>
Date: Fri, 14 Jun 2019 01:52:12 -0400
Subject: [PATCH 2/5] libArcus: update to 4.1.0.

---
 srcpkgs/libArcus/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libArcus/template b/srcpkgs/libArcus/template
index 8bd39d1675c..91f3a26cd15 100644
--- a/srcpkgs/libArcus/template
+++ b/srcpkgs/libArcus/template
@@ -1,6 +1,6 @@
 # Template file for 'libArcus'
 pkgname=libArcus
-version=4.0.0
+version=4.1.0
 revision=1
 build_style=cmake
 configure_args="-DBUILD_EXAMPLES=OFF"
@@ -12,7 +12,7 @@ maintainer="Karl Nilsson <karl.robert.nilsson@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://github.com/Ultimaker/libArcus"
 distfiles="https://github.com/Ultimaker/libArcus/archive/${version}.tar.gz"
-checksum=fc7709fe8e9738d219baa65606a092dc67d5c9fc3002d48f074a7c55db87a8e4
+checksum=6be791cea7e12b7b9e4c6be771aac28d43b8530258dc1480cf8c30bed0c0f550
 
 libArcus-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From f2df46bdcff53cd0dd0c91480bc7585b3c1fe26f Mon Sep 17 00:00:00 2001
From: Karl Nilsson <karl.robert.nilsson@gmail.com>
Date: Fri, 14 Jun 2019 01:53:17 -0400
Subject: [PATCH 3/5] cura-engine: update to 4.1.0.

---
 .../cura-engine/patches/CuraEngine-gcc9.patch | 48 +++++++++++++++++++
 srcpkgs/cura-engine/template                  |  4 +-
 2 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/cura-engine/patches/CuraEngine-gcc9.patch

diff --git a/srcpkgs/cura-engine/patches/CuraEngine-gcc9.patch b/srcpkgs/cura-engine/patches/CuraEngine-gcc9.patch
new file mode 100644
index 00000000000..328cfc2b687
--- /dev/null
+++ b/srcpkgs/cura-engine/patches/CuraEngine-gcc9.patch
@@ -0,0 +1,48 @@
+From 9fd93712220aa2754e077bf89f165c7a9b795abd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= <feron.gabriel@gmail.com>
+Date: Tue, 18 Jun 2019 22:58:47 +0200
+Subject: [PATCH] [PATCH 3/3] GCC 9 patches
+
+---
+ src/layerPart.cpp | 2 +-
+ src/support.cpp   | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git src/layerPart.cpp src/layerPart.cpp
+index ba3e7157..6cf0919a 100644
+--- src/layerPart.cpp
++++ src/layerPart.cpp
+@@ -52,7 +52,7 @@ void createLayerParts(SliceMeshStorage& mesh, Slicer* slicer)
+ {
+     const auto total_layers = slicer->layers.size();
+     assert(mesh.layers.size() == total_layers);
+-#pragma omp parallel for default(none) shared(mesh, slicer) schedule(dynamic)
++#pragma omp parallel for default(none) shared(mesh, slicer, total_layers) schedule(dynamic)
+     // Use a signed type for the loop counter so MSVC compiles (because it uses OpenMP 2.0, an old version).
+     for (int layer_nr = 0; layer_nr < static_cast<int>(total_layers); layer_nr++)
+     {
+diff --git src/support.cpp src/support.cpp
+index 9bd531a6..bb7a741d 100644
+--- src/support.cpp
++++ src/support.cpp
+@@ -875,7 +875,7 @@ void AreaSupport::generateSupportAreasForMesh(SliceDataStorage& storage, const S
+     constexpr bool no_prime_tower = false;
+     xy_disallowed_per_layer[0] = storage.getLayerOutlines(0, no_support, no_prime_tower).offset(xy_distance);
+     // for all other layers (of non support meshes) compute the overhang area and possibly use that when calculating the support disallowed area
+-    #pragma omp parallel for default(none) shared(xy_disallowed_per_layer, storage, mesh) schedule(dynamic)
++    #pragma omp parallel for default(none) shared(xy_disallowed_per_layer, storage, mesh, layer_count, is_support_mesh_place_holder, use_xy_distance_overhang, z_distance_top, tan_angle, xy_distance, xy_distance_overhang) schedule(dynamic)
+     // Use a signed type for the loop counter so MSVC compiles (because it uses OpenMP 2.0, an old version).
+     for (int layer_idx = 1; layer_idx < static_cast<int>(layer_count); layer_idx++)
+     {
+@@ -1070,7 +1070,7 @@ void AreaSupport::generateSupportAreasForMesh(SliceDataStorage& storage, const S
+         const int max_checking_layer_idx = std::max(0,
+                                                     std::min(static_cast<int>(storage.support.supportLayers.size()),
+                                                              static_cast<int>(layer_count - (layer_z_distance_top - 1))));
+-#pragma omp parallel for default(none) shared(support_areas, storage) schedule(dynamic)
++#pragma omp parallel for default(none) shared(support_areas, storage, max_checking_layer_idx, layer_z_distance_top) schedule(dynamic)
+         // Use a signed type for the loop counter so MSVC compiles (because it uses OpenMP 2.0, an old version).
+         for (int layer_idx = 0; layer_idx < max_checking_layer_idx; layer_idx++)
+         {
+-- 
+2.21.0
+
diff --git a/srcpkgs/cura-engine/template b/srcpkgs/cura-engine/template
index a3d26dc9498..b72a8f16e1c 100644
--- a/srcpkgs/cura-engine/template
+++ b/srcpkgs/cura-engine/template
@@ -1,6 +1,6 @@
 # Template file for 'cura-engine'
 pkgname=cura-engine
-version=4.0.0
+version=4.1.0
 revision=1
 wrksrc="CuraEngine-${version}"
 build_style=cmake
@@ -12,7 +12,7 @@ maintainer="Karl Nilsson <karl.robert.nilsson@gmail.com>"
 license="AGPL-3.0-or-later"
 homepage="https://github.com/Ultimaker/CuraEngine"
 distfiles="https://github.com/Ultimaker/CuraEngine/archive/${version}.tar.gz"
-checksum=08c8cc6ca6ba44ce35cf66b06e399408dd5fc809a208afc1892f0f700728326e
+checksum=8599bd123462692600d6ccf3b0baab5d87fe87aebb9736f1398768c7fdf6b340
 
 post_install() {
 	vlicense LICENSE

From 0fb7020be81c3e4d774fd10c3929e04c8951fa95 Mon Sep 17 00:00:00 2001
From: Karl Nilsson <karl.robert.nilsson@gmail.com>
Date: Fri, 14 Jun 2019 01:53:37 -0400
Subject: [PATCH 4/5] Uranium: update to 4.1.0.

---
 .../0002-Fix-install-prefix-symlink.patch     | 30 -------------------
 srcpkgs/Uranium/template                      |  4 +--
 2 files changed, 2 insertions(+), 32 deletions(-)
 delete mode 100644 srcpkgs/Uranium/patches/0002-Fix-install-prefix-symlink.patch

diff --git a/srcpkgs/Uranium/patches/0002-Fix-install-prefix-symlink.patch b/srcpkgs/Uranium/patches/0002-Fix-install-prefix-symlink.patch
deleted file mode 100644
index 101d8ef90be..00000000000
--- a/srcpkgs/Uranium/patches/0002-Fix-install-prefix-symlink.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 237dc959ca536ae4a45d1ba59d4ad6cf86a36946 Mon Sep 17 00:00:00 2001
-From: Ghostkeeper <rubend@tutanota.com>
-Date: Mon, 25 Feb 2019 11:58:02 +0100
-Subject: [PATCH] Fix install prefix when installing in symlinked directory
-
-If /bin is a symlink to /usr/bin and /bin appears before /usr/bin on the user's PATH, it would get sys.argv[0]='/bin/python3'. This then messes up the install location ('/') which consequently messes up the data and config storage directories.
-This solution is provided by CapnKernel and should resolve the symlink so that sys.argv[0]='/usr/bin/python3' again and the storage data and config storage directories become something like /usr/share/... again.
----
- UM/Application.py | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git UM/Application.py UM/Application.py
-index 05adb8f3..f709438a 100644
---- UM/Application.py
-+++ UM/Application.py
-@@ -398,9 +398,10 @@ class Application:
-     @staticmethod
-     def getInstallPrefix() -> str:
-         if "python" in os.path.basename(sys.executable):
--            return os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
-+            executable = sys.argv[0]
-         else:
--            return os.path.abspath(os.path.join(os.path.dirname(sys.executable), ".."))
-+            executable = sys.executable
-+        return os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(executable)), ".."))
- 
-     __instance = None   # type: Application
- 
--- 
-2.21.0
diff --git a/srcpkgs/Uranium/template b/srcpkgs/Uranium/template
index 6f31c47ce79..8412416c0ef 100644
--- a/srcpkgs/Uranium/template
+++ b/srcpkgs/Uranium/template
@@ -1,6 +1,6 @@
 # Template file for 'Uranium'
 pkgname=Uranium
-version=4.0.0
+version=4.1.0
 revision=1
 archs=noarch
 build_style=cmake
@@ -15,4 +15,4 @@ maintainer="Karl Nilsson <karl.robert.nilsson@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://github.com/Ultimaker/Uranium"
 distfiles="https://github.com/Ultimaker/Uranium/archive/${version}.tar.gz"
-checksum=d405183b98b2e8db8c8c11ebe6f8838865cb4ac7f6a55ab0ac654b060edf9dd8
+checksum=72245dba1fb74236144ffbe59497ef495b87bb3bb2b1d7ffcadebe138824eed4

From 78c34ebfe80d200ea6c3d7cdde681b7c95963055 Mon Sep 17 00:00:00 2001
From: Karl Nilsson <karl.robert.nilsson@gmail.com>
Date: Fri, 14 Jun 2019 01:53:41 -0400
Subject: [PATCH 5/5] cura: update to 4.1.0.

---
 srcpkgs/cura/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/cura/template b/srcpkgs/cura/template
index 9575ad0ee8b..52967a5cc3c 100644
--- a/srcpkgs/cura/template
+++ b/srcpkgs/cura/template
@@ -1,14 +1,14 @@
 # Template file for 'cura'
 pkgname=cura
-version=4.0.0
+version=4.1.0
 revision=1
 archs=noarch
 wrksrc="Cura-${version}"
 build_style=cmake
-configure_args="-DCURA_VERSION=${version} -DCURA_SDK_VERSION=6.0.0 -DCURA_CLOUD_API_VERSION=1"
+configure_args="-DCURA_VERSION=${version} -DCURA_SDK_VERSION=6.0.0"
 pycompile_module="cura"
 pycompile_dirs="usr/lib/cura/plugins"
-makedepends="Uranium libArcus-devel"
+makedepends="python3-devel Uranium libArcus-devel"
 depends="Uranium cura-engine cura-fdm-materials python3-pyserial python3-zeroconf
  libSavitar-python3 python3-requests qt5-graphicaleffects"
 short_desc="3D printer / slicing GUI"
@@ -16,4 +16,4 @@ maintainer="Karl Nilsson <karl.robert.nilsson@gmail.com>"
 license="LGPL-3.0-or-later"
 homepage="https://github.com/Ultimaker/Cura"
 distfiles="https://github.com/Ultimaker/Cura/archive/${version}.tar.gz"
-checksum=546742eaade2d097fb7bef2d89189c17d5fb75291715f58d394076c234d6f4d3
+checksum=29bce1086f9e9e2b773c2d43986cfc00dd3b3c70fbfdb5d84bdf1e31da6812fc
