Просмотр исходного кода

Merge pull request #81 from paullouisageneau/workflow-macos

Add MacOS build to workflow
Paul-Louis Ageneau 5 лет назад
Родитель
Сommit
dd05e4b8ce

+ 19 - 3
.github/workflows/build-gnutls.yml

@@ -7,7 +7,7 @@ on:
     branches:
     - master
 jobs:
-  build:
+  build-ubuntu:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v2
@@ -18,7 +18,23 @@ jobs:
     - name: cmake
       run: cmake -B build -DUSE_JUICE=1 -DUSE_GNUTLS=1
     - name: make
-      run: (cd build; make)
+      run: (cd build; make -j2)
+    - name: test
+      run: ./build/tests
+  build-macos:
+    runs-on: macos-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: install packages
+      run: brew install gnutls nettle
+    - name: submodules
+      run: git submodule update --init --recursive
+    - name: cmake
+      run: cmake -B build -DUSE_JUICE=1 -DUSE_GNUTLS=1
+      env:
+# hack to bypass EPERM issue on sendto()
+        CFLAGS: -DJUICE_ENABLE_ADDRS_LOCALHOST
+    - name: make
+      run: (cd build; make -j2)
     - name: test
       run: ./build/tests
-

+ 2 - 2
.github/workflows/build-nice.yml

@@ -7,7 +7,7 @@ on:
     branches:
     - master
 jobs:
-  build:
+  build-ubuntu:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v2
@@ -18,7 +18,7 @@ jobs:
     - name: cmake
       run: cmake -B build -DUSE_JUICE=0 -DUSE_GNUTLS=1
     - name: make
-      run: (cd build; make)
+      run: (cd build; make -j2)
     - name: test
       run: ./build/tests
 

+ 21 - 3
.github/workflows/build-openssl.yml

@@ -7,7 +7,7 @@ on:
     branches:
     - master
 jobs:
-  build:
+  build-ubuntu:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@v2
@@ -18,7 +18,25 @@ jobs:
     - name: cmake
       run: cmake -B build -DUSE_JUICE=1 -DUSE_GNUTLS=0
     - name: make
-      run: (cd build; make)
+      run: (cd build; make -j2)
+    - name: test
+      run: ./build/tests
+  build-macos:
+    runs-on: macos-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: install packages
+      run: brew reinstall [email protected]
+    - name: submodules
+      run: git submodule update --init --recursive
+    - name: cmake
+      run: cmake -B build -DUSE_JUICE=1 -DUSE_GNUTLS=0
+      env:
+        OPENSSL_ROOT_DIR: /usr/local/opt/openssl
+        OPENSSL_LIBRARIES: /usr/local/opt/openssl/lib
+# hack to bypass EPERM issue on sendto()
+        CFLAGS: -DJUICE_ENABLE_ADDRS_LOCALHOST
+    - name: make
+      run: (cd build; make -j2)
     - name: test
       run: ./build/tests
-

+ 1 - 1
deps/libjuice

@@ -1 +1 @@
-Subproject commit 511b19f5168825f1d72e79bee4aef8f3b5a36fca
+Subproject commit 6f6faa578396960a5f426582ed12db2747e4f68d

+ 2 - 1
src/certificate.cpp

@@ -254,7 +254,8 @@ certificate_ptr make_certificate_impl(string commonName) {
 		throw std::runtime_error("Unable to generate key pair");
 
 	const size_t serialSize = 16;
-	const auto *commonNameBytes = reinterpret_cast<const unsigned char *>(commonName.c_str());
+	auto *commonNameBytes =
+	    reinterpret_cast<unsigned char *>(const_cast<char *>(commonName.c_str()));
 
 	if (!X509_gmtime_adj(X509_get_notBefore(x509.get()), 3600 * -1) ||
 	    !X509_gmtime_adj(X509_get_notAfter(x509.get()), 3600 * 24 * 365) ||