Skip to content

Commit

Permalink
ci: add basic darwin workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Apr 25, 2024
1 parent a7593ff commit d28c7c1
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/CI-darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Darwin

on:
push:

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: brew install automake bzip2 cmake git gpatch gnutls ossp-uuid libtool

- name: Build
run: make

- name: Show version
run: ./src/proxysql --version
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The list of currently supported operating systems for native packaging is:
- Fedora 33,24
- OpenSUSE 15
- AlmaLinux 8,9

Download a __deb__ or __rpm__ installer file for your OS and architecture from:

https://github.com/sysown/proxysql/releases
Expand Down Expand Up @@ -111,7 +111,7 @@ https://github.com/ProxySQL/docker-images/tree/main/build-clang-images
On modern Mac OSX, ProxySQL's dependencies are not fully satisfied by the tools included with the XCode/clang toolkit. Using the [Homebrew](https://brew.sh/) OSX package manager, dependencies can be installed and located on OSX like this:

```bash
brew install automake bzip2 cmake make git gpatch gnutls ossp-uuid
brew install automake bzip2 cmake make git gpatch gnutls ossp-uuid libtool
```

Go to the directory where you cloned the repo (or unpacked the tarball) and run:
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export MAKE
export CURVER

### detect compiler support for c++11/17
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
ifneq ($(CPLUSPLUS),201703L)
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
LEGACY_BUILD := 1
ifneq ($(CPLUSPLUS),201103L)
$(error Compiler must support at least c++11)
Expand Down Expand Up @@ -235,7 +235,7 @@ build_tap_test_debug: build_tap_tests_debug
build_tap_tests_debug: build_src_debug
cd test/tap && OPTZ="${O0} -ggdb -DDEBUG" CC=${CC} CXX=${CXX} ${MAKE} debug

# ClickHouse build targets are now default build targets.
# ClickHouse build targets are now default build targets.
# To maintain backward compatibility, ClickHouse targets are still available.
.PHONY: build_deps_clickhouse
build_deps_clickhouse: build_deps_default
Expand Down Expand Up @@ -289,7 +289,7 @@ SYS_ARCH := $(shell uname -m)
REL_ARCH := $(subst x86_64,amd64,$(subst aarch64,arm64,$(SYS_ARCH)))
RPM_ARCH := .$(SYS_ARCH)
DEB_ARCH := _$(REL_ARCH)
REL_VERS := $(shell echo ${GIT_VERSION} | grep -Po '(?<=^v|^)[\d\.]+')
REL_VERS := $(shell echo ${GIT_VERSION} | awk -F'[.-]' '{print $1"."$2"."$3}')
RPM_VERS := -$(REL_VERS)-1
DEB_VERS := _$(REL_VERS)

Expand Down
12 changes: 7 additions & 5 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ endif


### detect compiler support for c++11/17
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
ifneq ($(CPLUSPLUS),201703L)
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
ifneq ($(CPLUSPLUS),201103L)
$(error Compiler must support at least c++11)
endif
Expand Down Expand Up @@ -74,7 +74,7 @@ libssl/openssl/libssl.a:
# cd libssl/openssl && patch crypto/asn1/a_time.c < ../a_time.c-multiplication-overflow.patch
cd libssl/openssl && ./config no-ssl3 no-tests
cd libssl/openssl && CC=${CC} CXX=${CXX} ${MAKE}
cd libssl/openssl && ln -fsT . lib # curl wants this path
cd libssl/openssl && ln -fs . lib # curl wants this path

libssl: libssl/openssl/libssl.a

Expand All @@ -92,7 +92,9 @@ ifeq ($(UNAME_S),FreeBSD)
sed -i -e 's/\/bin\/bash/\/usr\/local\/bin\/bash/' libhttpserver/libhttpserver/bootstrap
endif
ifeq ($(SYS_KERN),Darwin)
sed -i -e 's/glibtoolize/libtoolize/' libhttpserver/libhttpserver/bootstrap
ifeq (, $(shell which glibtoolize))
sed -i -e 's/glibtoolize/libtoolize/' libhttpserver/libhttpserver/bootstrap
endif
endif
cd libhttpserver/libhttpserver && ./bootstrap && mkdir build
cd libhttpserver/libhttpserver/build && LDFLAGS=-L$(shell pwd)/libmicrohttpd/libmicrohttpd/src/microhttpd/.libs/ CPPFLAGS=-I$(shell pwd)/libmicrohttpd/libmicrohttpd/src/include ../configure --disable-doxygen-doc --disable-doxygen-dot --disable-doxygen-man --disable-doxygen-html --enable-fastopen=false --disable-examples
Expand Down Expand Up @@ -159,7 +161,7 @@ lz4: lz4/lz4/lib/liblz4.a

clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib-static.a:
cd clickhouse-cpp && rm -rf clickhouse-cpp-*/ || true
cd clickhouse-cpp && ln -fsT clickhouse-cpp-2.3.0 clickhouse-cpp
cd clickhouse-cpp && ln -fs clickhouse-cpp-2.3.0 clickhouse-cpp
cd clickhouse-cpp && tar -zxf v2.3.0.tar.gz && sync
cd clickhouse-cpp/clickhouse-cpp && patch clickhouse/base/wire_format.h < ../wire_format.patch
cd clickhouse-cpp/clickhouse-cpp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
Expand Down
4 changes: 2 additions & 2 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ endif


### detect compiler support for c++11/17
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
ifneq ($(CPLUSPLUS),201703L)
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
ifneq ($(CPLUSPLUS),201103L)
$(error Compiler must support at least c++11)
endif
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ endif


### detect compiler support for c++11/17
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
ifneq ($(CPLUSPLUS),201703L)
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL')
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
ifneq ($(CPLUSPLUS),201103L)
$(error Compiler must support at least c++11)
endif
Expand Down

0 comments on commit d28c7c1

Please sign in to comment.