From 21afc11719f7946ddb1da9fac06de61be6b9448c Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 27 Apr 2015 18:44:16 +1000
Subject: Add resource file for Haiku


diff --git a/haiku/LibreCAD.rdef b/haiku/LibreCAD.rdef
new file mode 100644
index 0000000..fe99be0
--- /dev/null
+++ b/haiku/LibreCAD.rdef
@@ -0,0 +1,63 @@
+resource app_signature "application/x-vnd.LibreCAD";
+resource app_flags B_SINGLE_LAUNCH;
+resource app_version {
+	major  = 2,
+	middle = 0,
+	minor  = 7,
+
+	/* Application "variety" can be set to one of the following:
+	*	B_APPV_DEVELOPMENT,
+	*	B_APPV_ALPHA,
+	*	B_APPV_BETA,
+	*	B_APPV_GAMMA,
+	*	B_APPV_GOLDEN_MASTER,
+	*	B_APPV_FINAL
+	*/
+	variety = B_APPV_DEVELOPMENT,
+	internal = 0,
+
+	short_info = "LibreCAD",
+	long_info = "LibreCAD"
+};
+
+resource file_types message {
+	"types" = "application/x-dxf",
+	"types" = "application/x-dwg"
+};
+
+resource vector_icon array {
+	$"6E63696602038ED900054D070606FD0F20B61720B61720B618B3F2B617B5D6B6"
+	$"17B4E4B618B5EBB615B615B618B600B600B618B5D6B617B5EBB618B4E4B61720"
+	$"B617B3F2B61820B6170606F30FC96220C961B3BFC96220CC79CC79B617CC79B6"
+	$"17CB87B618C9A3B617CA95B617C98EB618C963B615C978B618C95FB5CDC961B5"
+	$"3DC963B585C962B47E0211B9F5B462B892B516BB78B39CBED6B308BD24B326BF"
+	$"38B301BFFCB303BF9AB304C091B302C1B8B328C125B310C33CB363C608B4A9C4"
+	$"B4B3E8C797B58CCA04B837C8F5B6C5CAEBB971CC01BC4DCB99BAD5CC2DBCEDCC"
+	$"61BE36CC50BD90CB59BE35C94BBE36CA52BE36C909BC7EC72AB987C847BADBC5"
+	$"C4B7D9C1A3B63FC3C8B6AAC133B627C050B613C0C1B61DBF73B607BDBBB644BE"
+	$"94B616BBF4B6A3B8FEB8CBBA4AB786B7E2B9DEB68DBCADB708BB35B57EBCAEB3"
+	$"5EBCADB46EBCAEB3DDBAA5B647B733B4E1B8C0B752B60D0212C94BC143C911C2"
+	$"BECA52C143CC61C143CB59C143CC26C349CA40C6EBCB67C53EC8B9C929C3E3CB"
+	$"C6C675CAE5C2DCCC22C0B4CC6FC1C9CC58C04CCC77BF7DCC75BFE5CC75BF25CC"
+	$"76BE75CC68BECDCC72BD19CC44BA83CB5ABBC2CBEAB8F7CAA7B667C866B78FC9"
+	$"A5B4F1C6D3B35FC2CBB3E1C4E1B46EC2CBB68EC2CBB57EC2CBB6B7C34FB730C4"
+	$"47B6F0C3CDB7A1C51CB8DBC68BB831C5E0BA15C7C9BD58C91FBBA6C8B1BDF0C9"
+	$"46BF29C968BE8CC95DC002C974C1B0C939C0DBC963C2FBC8F5C54CC7A9C437C8"
+	$"6CC62FC709C799C562C6F7C644C879C42B0606FF0320C96220C962B3F2C960B5"
+	$"D6C961B4E4C962B5EBC961B615C963B600C960B618C978B617C9A3B618C98EB6"
+	$"17CA95B617CC79B618CB87B617CC792006067F0FC963C963C95EC9A3C9A3C95F"
+	$"CA22C961C9E3C963CAEAC962CC79C962CBB2C961CC79C962CC79C962CC79C962"
+	$"CC79C960CBB2C961CA22C962CAEAC963C9E3021220BCAE20BCAEB31FBCAEB35E"
+	$"BCADB33FBCAEB46EBCAEB68DBCADB57EBCAEB767BCB0B91CBCAFB842BCACB91D"
+	$"BD27B91CBE18B91CBDA0B91CBE22B91FBE35B91DBE2CBE83BE36C94BBE36C3E7"
+	$"BE35CA52BE36CC61BE36CB59BE35CC69BE36CC79BE37CC71BE36CC79BE37CC79"
+	$"C142CC79C142CC71C142CC61C143CC69C143CB59C143C94BC143CA52C143C3E7"
+	$"C143B91FC143BE83C143B91DC14DB91CC160B91CC157B91CC1D9B91CC2CAB91D"
+	$"C251B842C2CDB68EC2CBB768C2C9B57EC2CBB35FC2CBB46EC2CBB33FC2CA20C2"
+	$"CBB31FC2CA20C2CB070A000100023F9FE80000000000003F9FE8430000430000"
+	$"0A000101023F9FE80000000000003F9FE84300004300000A000102023F9FE800"
+	$"00000000003F9FE84300004300000A000103023F9FE80000000000003F9FE843"
+	$"00004300000A000104023F9FE80000000000003F9FE84300004300000A000105"
+	$"023F9FE80000000000003F9FE84300004300000A010106023F9FE80000000000"
+	$"003F9FE8430000430000"
+};
-- 
2.16.4


From 130c764358d2e39203bb6212fb6e062cbee7df45 Mon Sep 17 00:00:00 2001
From: Scott McCreary <scottmc2@gmail.com>
Date: Thu, 2 Feb 2017 17:50:07 -0800
Subject: Fix haiku build


diff --git a/librecad/src/boost.pri b/librecad/src/boost.pri
index a2eb747..b8fa39c 100644
--- a/librecad/src/boost.pri
+++ b/librecad/src/boost.pri
@@ -7,7 +7,7 @@ exists( custom.pri ):include( custom.pri )
 
 BOOST_LIBS =
 
-unix {
+unix:!haiku {
     defineTest( checkBoostIncDir ) {
 
         boostIncDir = $${1}
-- 
2.16.4


From 5908b5c6dbfc0f1cf64da98b061885e007be8ba7 Mon Sep 17 00:00:00 2001
From: Scott McCreary <scottmc2@gmail.com>
Date: Thu, 2 Feb 2017 17:54:43 -0800
Subject: Fix haiku build


diff --git a/librecad/src/lib/generators/lc_makercamsvg.cpp b/librecad/src/lib/generators/lc_makercamsvg.cpp
index 6364e34..eae733e 100644
--- a/librecad/src/lib/generators/lc_makercamsvg.cpp
+++ b/librecad/src/lib/generators/lc_makercamsvg.cpp
@@ -56,6 +56,22 @@
 #include "rs_math.h"
 #include "rs_debug.h"
 
+#ifdef __HAIKU__
+
+#include <string>
+#include <sstream>
+
+namespace patch
+{
+    template < typename T > std::string to_string( const T& n )
+    {
+        std::ostringstream stm ;
+        stm << n ;
+        return stm.str() ;
+    }
+}
+#endif
+
 namespace {
 const std::string NAMESPACE_URI_SVG = "http://www.w3.org/2000/svg";
 const std::string NAMESPACE_URI_LC = "http://www.librecad.org";
-- 
2.16.4


From d5b6c87860b6dce8676a1bd3333315f069fdca25 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Thu, 20 Sep 2018 09:07:09 +0000
Subject: include partial fix from upstream


diff --git a/librecad/src/ui/forms/qg_commandwidget.cpp b/librecad/src/ui/forms/qg_commandwidget.cpp
index 7cd6939..894d5db 100644
--- a/librecad/src/ui/forms/qg_commandwidget.cpp
+++ b/librecad/src/ui/forms/qg_commandwidget.cpp
@@ -27,6 +27,7 @@
 #include <QKeyEvent>
 #include <algorithm>
 
+#include <QAction>
 #include "qg_actionhandler.h"
 #include "rs_commands.h"
 #include "rs_commandevent.h"
diff --git a/librecad/src/ui/generic/widgetcreator.cpp b/librecad/src/ui/generic/widgetcreator.cpp
index ca89ab1..260d9af 100644
--- a/librecad/src/ui/generic/widgetcreator.cpp
+++ b/librecad/src/ui/generic/widgetcreator.cpp
@@ -27,6 +27,8 @@
 #include "widgetcreator.h"
 #include "ui_widgetcreator.h"
 
+#include <QAction>
+#include <QActionGroup>
 #include <QSettings>
 #include <QLineEdit>
 #include <QPushButton>
-- 
2.16.4

