Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build on FreeBSD #18

Open
2 of 3 tasks
dBitech opened this issue Oct 1, 2022 · 4 comments
Open
2 of 3 tasks

Does not build on FreeBSD #18

dBitech opened this issue Oct 1, 2022 · 4 comments

Comments

@dBitech
Copy link
Contributor

dBitech commented Oct 1, 2022

  • on Freebsd make is not GNU make, need to use gmake in its place
  • FreeBSD does not have bash by default, and when it does it's installed in /usr/local/bin not /bin
  • FreeBSD, like Apple/Darwin does not have statfs, but instead expects the use of the underlying headers
    sys/types.h
    sys/sysctl.h
    sys/param.h
    sys/mount.h
@dBitech
Copy link
Contributor Author

dBitech commented Oct 2, 2022

Let me just state this here as a quick reference prior to creating a PR, siple 2 line change will allow it to build on FreeBSD

@@ -0,0 +1,11 @@
+--- Makefile.orig      2022-10-01 05:32:53.792152000 -0700
++++ Makefile   2022-10-01 05:12:27.694746000 -0700
+@@ -1,7 +1,7 @@
+ PREFIX ?= /usr/local
+ MANDIR ?= $(PREFIX)/share/man/man1/
+ BUILDTYPE ?= Release
+-SHELL = /bin/bash
++SHELL = /bin/sh
+
+ # inherit from env if set
+ CC := $(CC)
diff --git a/graphics/tippecanoe/files/patch--main.cpp b/graphics/tippecanoe/files/patch--main.cpp
new file mode 100644
index 000000000000..c368d938feb5
--- /dev/null
+++ b/graphics/tippecanoe/files/patch--main.cpp
@@ -0,0 +1,11 @@
+--- main.cpp.orig      2022-10-01 05:33:25.984494000 -0700
++++ main.cpp   2022-10-01 05:14:45.679349000 -0700
+@@ -34,7 +34,7 @@
+ #include <map>
+ #include <cmath>
+
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__FreeBSD__)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #include <sys/param.h>

@e-n-f
Copy link
Collaborator

e-n-f commented Oct 5, 2022

Thanks! The thing that keeps me from switching to /bin/sh on other platforms is that make parallel-test uses the <(…) syntax to treat a pipeline as a named file. Is this supported in your /bin/sh?

@dBitech
Copy link
Contributor Author

dBitech commented Oct 5, 2022

Apparently, it does not.
. The quick fix in my mind is to set the SHELL to bash for only the parallel-test target though something like

+-parallel-test:
++parallel-test: $(eval SHELL:=/bin/bash)

That would keep the Linux shell happy, and make the target on FreeBSD invalid. I suspect the vast majority of people would just be trying to get a built binary, vs Dev QA.

A more complete fix would be OS detection, and shell verification, and then cascade off of that, but that would require a fair bit of additional work and complexity.

@dBitech
Copy link
Contributor Author

dBitech commented Feb 18, 2023

PR #72 submitted

e-n-f pushed a commit that referenced this issue Feb 24, 2023
* Make tippecanoe build on FreeBSD in responce to issue 18 (#18)

* Make conditional FreeBSD specific, instead of otherway around.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants