From 5d1bcd7fc0bff49c42783bff4d549e23a79cf34f Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 5 Apr 2021 13:54:14 +0200 Subject: Add MacOS support --- README.rst | 18 ++++++++++++++++++ svg-flatten/Makefile | 6 +++++- svg-flatten/include/gerbolyze.hpp | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index d3824ad..66c01b7 100644 --- a/README.rst +++ b/README.rst @@ -124,6 +124,24 @@ Arch pip3 install --user git+https://git.jaseg.de/pcb-tools-extension.git pip3 install --user gerbolyze --no-binary gerbolyze +macOS (via Homebrew) +~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: shell + # Tested on a fresh Mac OS 10.15.7 Catalina installation + + # Requires homebrew. To install, run: + # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"\n + # --> Now, restart the terminal app to load new $PATH from /etc/paths <-- + + brew install python3 rustup pugixml cairo pango opencv pkg-config + + rustup-init + cargo install usvg + + pip3 install git+https://git.jaseg.de/pcb-tools-extension.git + pip3 install gerbolyze --no-binary gerbolyze + Build from source (any distro) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/svg-flatten/Makefile b/svg-flatten/Makefile index 25c8048..5f22a59 100644 --- a/svg-flatten/Makefile +++ b/svg-flatten/Makefile @@ -66,7 +66,11 @@ $(BUILDDIR)/%.o: %.cpp $(BUILDDIR)/$(TARGET): $(SOURCES:%.cpp=$(BUILDDIR)/%.o) @mkdir -p $(dir $@) - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ -Wl,--start-group $^ -lstdc++fs -Wl,--end-group + if [ $$(uname -s) = "Darwin" ]; then \ + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^; \ + else \ + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ -Wl,--start-group $^ -lstdc++fs -Wl,--end-group; \ + fi .PHONY: install install: diff --git a/svg-flatten/include/gerbolyze.hpp b/svg-flatten/include/gerbolyze.hpp index aea8748..ed93bbc 100644 --- a/svg-flatten/include/gerbolyze.hpp +++ b/svg-flatten/include/gerbolyze.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "svg_pattern.h" -- cgit