Skip to content

Commit d28c7c1

Browse files
committed
ci: add basic darwin workflow
1 parent a7593ff commit d28c7c1

File tree

6 files changed

+36
-15
lines changed

6 files changed

+36
-15
lines changed

.github/workflows/CI-darwin.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Darwin
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: macos-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Install dependencies
13+
run: brew install automake bzip2 cmake git gpatch gnutls ossp-uuid libtool
14+
15+
- name: Build
16+
run: make
17+
18+
- name: Show version
19+
run: ./src/proxysql --version

INSTALL.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The list of currently supported operating systems for native packaging is:
2626
- Fedora 33,24
2727
- OpenSUSE 15
2828
- AlmaLinux 8,9
29-
29+
3030
Download a __deb__ or __rpm__ installer file for your OS and architecture from:
3131

3232
https://github.com/sysown/proxysql/releases
@@ -111,7 +111,7 @@ https://github.com/ProxySQL/docker-images/tree/main/build-clang-images
111111
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:
112112

113113
```bash
114-
brew install automake bzip2 cmake make git gpatch gnutls ossp-uuid
114+
brew install automake bzip2 cmake make git gpatch gnutls ossp-uuid libtool
115115
```
116116

117117
Go to the directory where you cloned the repo (or unpacked the tarball) and run:

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export MAKE
4242
export CURVER
4343

4444
### detect compiler support for c++11/17
45-
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')
45+
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
4646
ifneq ($(CPLUSPLUS),201703L)
47-
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')
47+
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
4848
LEGACY_BUILD := 1
4949
ifneq ($(CPLUSPLUS),201103L)
5050
$(error Compiler must support at least c++11)
@@ -235,7 +235,7 @@ build_tap_test_debug: build_tap_tests_debug
235235
build_tap_tests_debug: build_src_debug
236236
cd test/tap && OPTZ="${O0} -ggdb -DDEBUG" CC=${CC} CXX=${CXX} ${MAKE} debug
237237

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

deps/Makefile

+7-5
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ endif
2828

2929

3030
### detect compiler support for c++11/17
31-
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')
31+
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
3232
ifneq ($(CPLUSPLUS),201703L)
33-
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')
33+
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
3434
ifneq ($(CPLUSPLUS),201103L)
3535
$(error Compiler must support at least c++11)
3636
endif
@@ -74,7 +74,7 @@ libssl/openssl/libssl.a:
7474
# cd libssl/openssl && patch crypto/asn1/a_time.c < ../a_time.c-multiplication-overflow.patch
7575
cd libssl/openssl && ./config no-ssl3 no-tests
7676
cd libssl/openssl && CC=${CC} CXX=${CXX} ${MAKE}
77-
cd libssl/openssl && ln -fsT . lib # curl wants this path
77+
cd libssl/openssl && ln -fs . lib # curl wants this path
7878

7979
libssl: libssl/openssl/libssl.a
8080

@@ -92,7 +92,9 @@ ifeq ($(UNAME_S),FreeBSD)
9292
sed -i -e 's/\/bin\/bash/\/usr\/local\/bin\/bash/' libhttpserver/libhttpserver/bootstrap
9393
endif
9494
ifeq ($(SYS_KERN),Darwin)
95-
sed -i -e 's/glibtoolize/libtoolize/' libhttpserver/libhttpserver/bootstrap
95+
ifeq (, $(shell which glibtoolize))
96+
sed -i -e 's/glibtoolize/libtoolize/' libhttpserver/libhttpserver/bootstrap
97+
endif
9698
endif
9799
cd libhttpserver/libhttpserver && ./bootstrap && mkdir build
98100
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
@@ -159,7 +161,7 @@ lz4: lz4/lz4/lib/liblz4.a
159161

160162
clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib-static.a:
161163
cd clickhouse-cpp && rm -rf clickhouse-cpp-*/ || true
162-
cd clickhouse-cpp && ln -fsT clickhouse-cpp-2.3.0 clickhouse-cpp
164+
cd clickhouse-cpp && ln -fs clickhouse-cpp-2.3.0 clickhouse-cpp
163165
cd clickhouse-cpp && tar -zxf v2.3.0.tar.gz && sync
164166
cd clickhouse-cpp/clickhouse-cpp && patch clickhouse/base/wire_format.h < ../wire_format.patch
165167
cd clickhouse-cpp/clickhouse-cpp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .

lib/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ endif
9595

9696

9797
### detect compiler support for c++11/17
98-
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')
98+
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
9999
ifneq ($(CPLUSPLUS),201703L)
100-
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')
100+
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
101101
ifneq ($(CPLUSPLUS),201103L)
102102
$(error Compiler must support at least c++11)
103103
endif

src/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ endif
105105

106106

107107
### detect compiler support for c++11/17
108-
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')
108+
CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3)
109109
ifneq ($(CPLUSPLUS),201703L)
110-
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')
110+
CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3)
111111
ifneq ($(CPLUSPLUS),201103L)
112112
$(error Compiler must support at least c++11)
113113
endif

0 commit comments

Comments
 (0)