From 15b2522ed9266c3f4cc9be55376b148e44062a2f Mon Sep 17 00:00:00 2001
From: YuSanka <yusanka@gmail.com>
Date: Wed, 14 Mar 2018 15:10:16 +0100
Subject: [PATCH 1/3] Update "fill_density" to initial preset value instead of
 to 40%

---
 xs/src/slic3r/GUI/Tab.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp
index 858eb8bcf..212b451e4 100644
--- a/xs/src/slic3r/GUI/Tab.cpp
+++ b/xs/src/slic3r/GUI/Tab.cpp
@@ -737,7 +737,7 @@ void TabPrint::update()
 					fill_density = 100;
 				}
 				else
-					fill_density = 40;
+					fill_density = m_presets->get_selected_preset().config.option<ConfigOptionPercent>("fill_density")->value;
 				new_conf.set_key_value("fill_density", new ConfigOptionPercent(fill_density));
 				load_config(new_conf);
 				on_value_change("fill_density", fill_density);

From 639f2bc2f3b91ef86c221a7ce1851fe6f5fd1699 Mon Sep 17 00:00:00 2001
From: YuSanka <yusanka@gmail.com>
Date: Wed, 14 Mar 2018 15:38:54 +0100
Subject: [PATCH 2/3] Update m_initial_extruders_count after preset changing

---
 xs/src/slic3r/GUI/Tab.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp
index 212b451e4..09d346ce3 100644
--- a/xs/src/slic3r/GUI/Tab.cpp
+++ b/xs/src/slic3r/GUI/Tab.cpp
@@ -1430,10 +1430,11 @@ void Tab::load_current_preset()
 		update_tab_ui();
 		on_presets_changed();
 
-		if (name() == "print"){
+		if (name() == "print")
 			update_frequently_changed_parameters();
-			update_changed_ui();
-		}
+		if (m_name == "printer")
+			static_cast<TabPrinter*>(this)->m_initial_extruders_count = static_cast<TabPrinter*>(this)->m_extruders_count;
+		update_changed_ui();
 	});
 }
 

From 37f142940073694456d7826d759b19f8d58ea4eb Mon Sep 17 00:00:00 2001
From: Vojtech Kral <vojtech@kral.hk>
Date: Wed, 14 Mar 2018 16:05:51 +0100
Subject: [PATCH 3/3] Yet another fix of the unix static Makefile (#793)

---
 doc/deps-build/unix-static/Makefile | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/doc/deps-build/unix-static/Makefile b/doc/deps-build/unix-static/Makefile
index 71e46320b..21740bc53 100644
--- a/doc/deps-build/unix-static/Makefile
+++ b/doc/deps-build/unix-static/Makefile
@@ -67,13 +67,17 @@ $(TBB).tar.gz:
 	curl -L -o $@ https://github.com/wjakob/tbb/archive/$(TBB_SHA).tar.gz
 
 
+# Note: libcurl build system seems to be a bit wonky about finding openssl (cf. #2378).
+# It seems that currently the only working option is to set a prefix in the openssl build
+# and use the `--with-ssl=...` option in libcurl.
+# Additionally, pkg-config needs to be installed and openssl libs need to NOT be installed on the build system.
 
 libopenssl: $(OPENSSL).tar.gz
 	tar -zxvf $(OPENSSL).tar.gz
-	cd $(OPENSSL) && ./config --openssldir=/etc/ssl shared no-ssl3-method no-dynamic-engine '-Wa,--noexecstack'
-	make -C $(OPENSSL) depend
-	make -C $(OPENSSL) -j$(NPROC)
-	make -C $(OPENSSL) install DESTDIR=$(DESTDIR)
+	cd $(OPENSSL) && ./config --prefix=$(DESTDIR)/usr/local no-shared no-ssl3-method no-dynamic-engine '-Wa,--noexecstack'
+	$(MAKE) -C $(OPENSSL) depend
+	$(MAKE) -C $(OPENSSL) -j$(NPROC)
+	$(MAKE) -C $(OPENSSL) install_sw
 
 $(OPENSSL).tar.gz:
 	curl -L -o $@ 'https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.tar.gz'
@@ -82,10 +86,9 @@ $(OPENSSL).tar.gz:
 
 libcurl: libopenssl $(CURL).tar.gz
 	tar -zxvf $(CURL).tar.gz
-#	Note: It seems setting custom openssl path doesn't work when pkg-config and system openssl devel libs are installed
 	cd $(CURL) && ./configure \
 		--enable-static \
-		--enable-shared \
+		--disable-shared \
 		--with-ssl=$(DESTDIR)/usr/local \
 		--with-pic \
 		--enable-ipv6 \