Skip to content

Commit

Permalink
Merge pull request #25 from cdalvaro/audit_formulae
Browse files Browse the repository at this point in the history
Audit formulae
  • Loading branch information
cdalvaro authored Nov 20, 2020
2 parents 9991465 + 22dc407 commit 59d8b6e
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ github.token }}
branch: main
branch: master

- name: Delete branch
if: github.event.pull_request.head.repo.fork == false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test-bot:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
os: [macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Homebrew
Expand Down
45 changes: 22 additions & 23 deletions Formula/cpp-jwt.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
class CppJwt < Formula
desc 'JSON Web Token library for C++'
homepage 'https://github.com/arun11299/cpp-jwt'
url 'https://github.com/arun11299/cpp-jwt/archive/v1.3.tar.gz'
sha256 '792889f08dd1acbc14129d11e013f9ef46e663c545ea366dd922402d8becbe05'
head 'https://github.com/arun11299/cpp-jwt.git'
bottle :unneeded
desc "JSON Web Token library for C++"
homepage "https://github.com/arun11299/cpp-jwt"
url "https://github.com/arun11299/cpp-jwt/archive/v1.3.tar.gz"
sha256 "792889f08dd1acbc14129d11e013f9ef46e663c545ea366dd922402d8becbe05"
head "https://github.com/arun11299/cpp-jwt.git"

option 'with-nlohmann-json', "Use nlohmann-json library instead of the vendored one"
livecheck do
url "https://github.com/arun11299/cpp-jwt/releases/latest"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
end

option "with-nlohmann-json", "Use nlohmann-json library instead of the vendored one"

depends_on 'cmake' => :build
depends_on 'nlohmann-json' => :optional
depends_on 'openssl@1.1'
depends_on "cmake" => :build
depends_on "openssl@1.1"
depends_on "nlohmann-json" => :optional

def install
custom_args = [
"-DCPP_JWT_BUILD_EXAMPLES=OFF",
"-DCPP_JWT_BUILD_TESTS=OFF",
]

if build.with? "nlohmann-json"
custom_args << "-DCPP_JWT_USE_VENDORED_NLOHMANN_JSON=OFF"
else
custom_args << "-DCPP_JWT_USE_VENDORED_NLOHMANN_JSON=ON"
end
use_vendored_nlohmann = build.with?("nlohmann-json") ? "OFF" : "ON"
custom_args << "-DCPP_JWT_USE_VENDORED_NLOHMANN_JSON=#{use_vendored_nlohmann}"

system "cmake", ".", *std_cmake_args, *custom_args
system "make", "install"
end

test do
(testpath / 'test.cpp').write <<~EOS
(testpath / "test.cpp").write <<~EOS
#include <iostream>
#include <map>
#include <chrono>
Expand All @@ -52,14 +53,12 @@ def install
EOS

custom_args = []
if !build.with? "nlohmann-json"
custom_args << "-DCPP_JWT_USE_VENDORED_NLOHMANN_JSON"
end
custom_args << "-DCPP_JWT_USE_VENDORED_NLOHMANN_JSON" if build.without? "nlohmann-json"

system ENV.cxx, "-I#{include}", '-std=c++14',
"-I#{Formula['openssl@1.1'].include}",
system ENV.cxx, "-I#{include}", "-std=c++14",
"-I#{Formula["openssl@1.1"].include}",
*custom_args,
'test.cpp', '-o', 'test'
system './test'
"test.cpp", "-o", "test"
system "./test"
end
end
15 changes: 12 additions & 3 deletions Formula/cpp-zmq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ class CppZmq < Formula
url "https://github.com/zeromq/cppzmq/archive/v4.7.1.tar.gz"
sha256 "9853e0437d834cbed5d3c223bf1d755cadee70e7c964c6e42c4c6783dee5d02c"
head "https://github.com/zeromq/cppzmq.git"
bottle :unneeded

livecheck do
url "https://github.com/zeromq/cppzmq/releases/latest"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
end

depends_on "cmake" => :build
depends_on "zmq"
depends_on "pkg-config" => :build
depends_on "zeromq"

def install
system "cmake", ".", *std_cmake_args
custom_args = [
"-DCPPZMQ_BUILD_TESTS=OFF",
]

system "cmake", ".", *std_cmake_args, *custom_args
system "make", "install"
end

Expand Down
18 changes: 10 additions & 8 deletions Formula/howard-hinnant-date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ class HowardHinnantDate < Formula
desc "C++ library for date and time operations based on <chrono>"
homepage "https://github.com/HowardHinnant/date"
url "https://github.com/HowardHinnant/date/archive/v3.0.0.tar.gz"
head "https://github.com/HowardHinnant/date.git"
sha256 "87bba2eaf0ebc7ec539e5e62fc317cb80671a337c1fb1b84cb9e4d42c6dbebe3"
bottle :unneeded
license "MIT"
head "https://github.com/HowardHinnant/date.git"

livecheck do
url "https://github.com/HowardHinnant/date/releases/latest"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
end

option "without-string-view", "Disable C++ string view"

Expand All @@ -15,14 +20,11 @@ def install
"-DENABLE_DATE_TESTING=OFF",
"-DUSE_SYSTEM_TZ_DB=ON",
"-DBUILD_SHARED_LIBS=ON",
"-DBUILD_TZ_LIB=ON"
"-DBUILD_TZ_LIB=ON",
]

if build.with? "string-view"
custom_args << "-DDISABLE_STRING_VIEW=OFF"
else
custom_args << "-DDISABLE_STRING_VIEW=ON"
end
disable_string_view = build.with?("string-view") ? "OFF" : "ON"
custom_args << "-DDISABLE_STRING_VIEW=#{disable_string_view}"

system "cmake", ".", *std_cmake_args, *custom_args
system "make", "install"
Expand Down
6 changes: 5 additions & 1 deletion Formula/salt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ class Salt < Formula
url "https://files.pythonhosted.org/packages/b5/45/a20ff8a3cad48b50a924ee9c65f2df0e214de4fa282c4feef2e1d6a0b886/salt-3002.2.tar.gz"
sha256 "bd6d29621ce8e099412777cd396af35474aa112bb0999b5da804387d87290075"
license "Apache-2.0"
head "https://github.com/saltstack/salt.git", :branch => "develop", :shallow => false
head "https://github.com/saltstack/salt.git", branch: "develop", shallow: false

livecheck do
url :stable
end

depends_on "swig" => :build
depends_on "libgit2"
Expand Down
8 changes: 3 additions & 5 deletions Formula/simple-web-server.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
class SimpleWebServer < Formula
desc "A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio"
desc "HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio"
homepage "https://gitlab.com/eidheim/Simple-Web-Server"
url "https://gitlab.com/eidheim/Simple-Web-Server/-/archive/v3.1.1/Simple-Web-Server-v3.1.1.tar.gz"
sha256 "f8f656d941647199e0a2db3cb07788b0e8c30d0f019d28e6ee9281bc48db132d"
head "https://gitlab.com/eidheim/Simple-Web-Server.git"
bottle :unneeded

depends_on "cmake" => :build
depends_on "openssl"
depends_on "boost"
depends_on "openssl"

def install
# ENV.deparallelize # if your formula fails when building in parallel
system "cmake", ".", *std_cmake_args
system "make", "install" # if this fails, try separate make/make install steps
system "make", "install"
end
end
13 changes: 12 additions & 1 deletion Formula/wxmac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@ class Wxmac < Formula
homepage "https://www.wxwidgets.org"
url "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4.tar.bz2"
sha256 "3ca3a19a14b407d0cdda507a7930c2e84ae1c8e74f946e0144d2fa7d881f1a94"
license "wxWindows"
revision 1
head "https://github.com/wxWidgets/wxWidgets.git"
bottle :unneeded

livecheck do
url "https://github.com/wxWidgets/wxWidgets/releases/latest"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
end

option "with-enable-abort", "apply patch patch-make-public-enable-abort"

depends_on "jpeg"
depends_on "libpng"
depends_on "libtiff"

on_linux do
depends_on "pkg-config" => :build
end

if build.with?("enable-abort")
patch do
url "https://github.com/cdalvaro/homebrew-tap/raw/master/formula-patches/wxmac/patch-make-public-enable-abort.diff"
Expand All @@ -32,6 +42,7 @@ def install
"--enable-svg",
"--enable-unicode",
"--enable-webkit",
"--enable-webview",
"--with-expat",
"--with-libjpeg",
"--with-libpng",
Expand Down

0 comments on commit 59d8b6e

Please sign in to comment.