slazav / mapsoft2

Programs for map handling, based on mapsoft2-libs
https://slazav.github.io/mapsoft2/
GNU General Public License v3.0
6 stars 1 forks source link

Build on macOS #65

Closed sikmir closed 1 year ago

sikmir commented 1 year ago

I've managed to build mapsoft2 on macOS and it runs for me. Here is a patch:

diff --git i/filename/filename.cpp w/filename/filename.cpp
index 76ac4f7..34c6e81 100644
--- i/filename/filename.cpp
+++ w/filename/filename.cpp
@@ -4,6 +4,12 @@
 #include "err/err.h"
 #include "filename.h"

+#if defined(__APPLE__)
+#define st_atim st_atimespec
+#define st_ctim st_ctimespec
+#define st_mtim st_mtimespec
+#endif
+
 bool
 file_ext_check(const std::string &fname, const char *ext){
   int lf=fname.size();
diff --git i/tmpdir/tmpdir.cpp w/tmpdir/tmpdir.cpp
index 6d40564..051b105 100644
--- i/tmpdir/tmpdir.cpp
+++ w/tmpdir/tmpdir.cpp
@@ -5,6 +5,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <unistd.h>

 #include <zip.h>

It fixes the following errors:

The following tests failed, so I skipped them for now:

slazav commented 1 year ago

Thank you very much! I will commit your patches and look into test errors (the last one looks like a real error).

slazav commented 1 year ago

Patches are applied. Also I believe I fixed the problem with point and rect tests. I still do not have any idea about iconv.test, any additional information would be useful

slazav commented 1 year ago

I hope I fixed it. Could you please try to compile it with all tests (and reopen the issue if needed)?

sikmir commented 1 year ago

All tests are OK now. The build is fine.