├── .github ├── dependabot.yml └── workflows │ └── update.yml ├── Formula ├── tideways-php@8.0.rb ├── tideways-php@8.1.rb ├── tideways-php@8.2.rb ├── tideways-php@8.3.rb ├── tideways-php@8.4.rb ├── tideways-php@8.5.rb ├── tideways-cli.rb └── tideways-daemon.rb ├── Abstract └── abstract-tideways-php-extension.rb ├── README.md └── scripts └── update_formula.php /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | day: "wednesday" 8 | time: "12:00" 9 | -------------------------------------------------------------------------------- /Formula/tideways-php@8.0.rb: -------------------------------------------------------------------------------- 1 | # typed: false 2 | # frozen_string_literal: true 3 | 4 | require File.expand_path("../Abstract/abstract-tideways-php-extension", __dir__) 5 | 6 | class TidewaysPhpAT80 < AbstractTidewaysPhpExtension 7 | init 8 | version "5.32.0" 9 | checksum = { 10 | "macos-arm" => "a21f0caa2f35dd7c3e14d3b363a1f93644995da5a591b36573a395dfafc706c8", 11 | "macos-x86" => "dd238b76ee5e6bf7f01ab2ac73a70e7ff7b74f31cf05ae3fc3f930e8562d6fad", 12 | "arm64" => "1d55e67a9ac3bba7df08d26367b039df5f2397bb48063a290f131c9b4ee475dc", 13 | "x86_64" => "5fc9b1d3ddcf86495823a8765e7f316bd86355fdb7ad17fd3fc098b4c2f3a90f", 14 | } 15 | 16 | if OS.linux? 17 | os = "" 18 | arch = Hardware::CPU.arm? ? "arm64" : "x86_64" 19 | else 20 | os = "macos-" 21 | arch = Hardware::CPU.arm? ? "arm" : "x86" 22 | end 23 | 24 | url "https://tideways.s3.amazonaws.com/extension/#{version}/tideways-php-#{version}-#{os}#{arch}.tar.gz" 25 | sha256 checksum["#{os}#{arch}"] 26 | 27 | def install 28 | prefix.install "tideways-php-#{php_version}.so" 29 | write_config_file 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Formula/tideways-php@8.1.rb: -------------------------------------------------------------------------------- 1 | # typed: false 2 | # frozen_string_literal: true 3 | 4 | require File.expand_path("../Abstract/abstract-tideways-php-extension", __dir__) 5 | 6 | class TidewaysPhpAT81 < AbstractTidewaysPhpExtension 7 | init 8 | version "5.32.0" 9 | checksum = { 10 | "macos-arm" => "a21f0caa2f35dd7c3e14d3b363a1f93644995da5a591b36573a395dfafc706c8", 11 | "macos-x86" => "dd238b76ee5e6bf7f01ab2ac73a70e7ff7b74f31cf05ae3fc3f930e8562d6fad", 12 | "arm64" => "1d55e67a9ac3bba7df08d26367b039df5f2397bb48063a290f131c9b4ee475dc", 13 | "x86_64" => "5fc9b1d3ddcf86495823a8765e7f316bd86355fdb7ad17fd3fc098b4c2f3a90f", 14 | } 15 | 16 | if OS.linux? 17 | os = "" 18 | arch = Hardware::CPU.arm? ? "arm64" : "x86_64" 19 | else 20 | os = "macos-" 21 | arch = Hardware::CPU.arm? ? "arm" : "x86" 22 | end 23 | 24 | url "https://tideways.s3.amazonaws.com/extension/#{version}/tideways-php-#{version}-#{os}#{arch}.tar.gz" 25 | sha256 checksum["#{os}#{arch}"] 26 | 27 | def install 28 | prefix.install "tideways-php-#{php_version}.so" 29 | write_config_file 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Formula/tideways-php@8.2.rb: -------------------------------------------------------------------------------- 1 | # typed: false 2 | # frozen_string_literal: true 3 | 4 | require File.expand_path("../Abstract/abstract-tideways-php-extension", __dir__) 5 | 6 | class TidewaysPhpAT82 < AbstractTidewaysPhpExtension 7 | init 8 | version "5.32.0" 9 | checksum = { 10 | "macos-arm" => "a21f0caa2f35dd7c3e14d3b363a1f93644995da5a591b36573a395dfafc706c8", 11 | "macos-x86" => "dd238b76ee5e6bf7f01ab2ac73a70e7ff7b74f31cf05ae3fc3f930e8562d6fad", 12 | "arm64" => "1d55e67a9ac3bba7df08d26367b039df5f2397bb48063a290f131c9b4ee475dc", 13 | "x86_64" => "5fc9b1d3ddcf86495823a8765e7f316bd86355fdb7ad17fd3fc098b4c2f3a90f", 14 | } 15 | 16 | if OS.linux? 17 | os = "" 18 | arch = Hardware::CPU.arm? ? "arm64" : "x86_64" 19 | else 20 | os = "macos-" 21 | arch = Hardware::CPU.arm? ? "arm" : "x86" 22 | end 23 | 24 | url "https://tideways.s3.amazonaws.com/extension/#{version}/tideways-php-#{version}-#{os}#{arch}.tar.gz" 25 | sha256 checksum["#{os}#{arch}"] 26 | 27 | def install 28 | prefix.install "tideways-php-#{php_version}.so" 29 | write_config_file 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Formula/tideways-php@8.3.rb: -------------------------------------------------------------------------------- 1 | # typed: false 2 | # frozen_string_literal: true 3 | 4 | require File.expand_path("../Abstract/abstract-tideways-php-extension", __dir__) 5 | 6 | class TidewaysPhpAT83 < AbstractTidewaysPhpExtension 7 | init 8 | version "5.32.0" 9 | checksum = { 10 | "macos-arm" => "a21f0caa2f35dd7c3e14d3b363a1f93644995da5a591b36573a395dfafc706c8", 11 | "macos-x86" => "dd238b76ee5e6bf7f01ab2ac73a70e7ff7b74f31cf05ae3fc3f930e8562d6fad", 12 | "arm64" => "1d55e67a9ac3bba7df08d26367b039df5f2397bb48063a290f131c9b4ee475dc", 13 | "x86_64" => "5fc9b1d3ddcf86495823a8765e7f316bd86355fdb7ad17fd3fc098b4c2f3a90f", 14 | } 15 | 16 | if OS.linux? 17 | os = "" 18 | arch = Hardware::CPU.arm? ? "arm64" : "x86_64" 19 | else 20 | os = "macos-" 21 | arch = Hardware::CPU.arm? ? "arm" : "x86" 22 | end 23 | 24 | url "https://tideways.s3.amazonaws.com/extension/#{version}/tideways-php-#{version}-#{os}#{arch}.tar.gz" 25 | sha256 checksum["#{os}#{arch}"] 26 | 27 | def install 28 | prefix.install "tideways-php-#{php_version}.so" 29 | write_config_file 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Formula/tideways-php@8.4.rb: -------------------------------------------------------------------------------- 1 | # typed: false 2 | # frozen_string_literal: true 3 | 4 | require File.expand_path("../Abstract/abstract-tideways-php-extension", __dir__) 5 | 6 | class TidewaysPhpAT84 < AbstractTidewaysPhpExtension 7 | init 8 | version "5.32.0" 9 | checksum = { 10 | "macos-arm" => "a21f0caa2f35dd7c3e14d3b363a1f93644995da5a591b36573a395dfafc706c8", 11 | "macos-x86" => "dd238b76ee5e6bf7f01ab2ac73a70e7ff7b74f31cf05ae3fc3f930e8562d6fad", 12 | "arm64" => "1d55e67a9ac3bba7df08d26367b039df5f2397bb48063a290f131c9b4ee475dc", 13 | "x86_64" => "5fc9b1d3ddcf86495823a8765e7f316bd86355fdb7ad17fd3fc098b4c2f3a90f", 14 | } 15 | 16 | if OS.linux? 17 | os = "" 18 | arch = Hardware::CPU.arm? ? "arm64" : "x86_64" 19 | else 20 | os = "macos-" 21 | arch = Hardware::CPU.arm? ? "arm" : "x86" 22 | end 23 | 24 | url "https://tideways.s3.amazonaws.com/extension/#{version}/tideways-php-#{version}-#{os}#{arch}.tar.gz" 25 | sha256 checksum["#{os}#{arch}"] 26 | 27 | def install 28 | prefix.install "tideways-php-#{php_version}.so" 29 | write_config_file 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Formula/tideways-php@8.5.rb: -------------------------------------------------------------------------------- 1 | # typed: false 2 | # frozen_string_literal: true 3 | 4 | require File.expand_path("../Abstract/abstract-tideways-php-extension", __dir__) 5 | 6 | class TidewaysPhpAT85 < AbstractTidewaysPhpExtension 7 | init 8 | version "5.32.0" 9 | checksum = { 10 | "macos-arm" => "a21f0caa2f35dd7c3e14d3b363a1f93644995da5a591b36573a395dfafc706c8", 11 | "macos-x86" => "dd238b76ee5e6bf7f01ab2ac73a70e7ff7b74f31cf05ae3fc3f930e8562d6fad", 12 | "arm64" => "1d55e67a9ac3bba7df08d26367b039df5f2397bb48063a290f131c9b4ee475dc", 13 | "x86_64" => "5fc9b1d3ddcf86495823a8765e7f316bd86355fdb7ad17fd3fc098b4c2f3a90f", 14 | } 15 | 16 | if OS.linux? 17 | os = "" 18 | arch = Hardware::CPU.arm? ? "arm64" : "x86_64" 19 | else 20 | os = "macos-" 21 | arch = Hardware::CPU.arm? ? "arm" : "x86" 22 | end 23 | 24 | url "https://tideways.s3.amazonaws.com/extension/#{version}/tideways-php-#{version}-#{os}#{arch}.tar.gz" 25 | sha256 checksum["#{os}#{arch}"] 26 | 27 | def install 28 | prefix.install "tideways-php-#{php_version}.so" 29 | write_config_file 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Formula/tideways-cli.rb: -------------------------------------------------------------------------------- 1 | require "formula" 2 | 3 | class TidewaysCli < Formula 4 | homepage 'https://tideways.com' 5 | version "1.2.14" 6 | checksum = { 7 | "macos-arm64" => "7dca4dfd8be999903f105c5fa965954df17a45cc2078f7f4259e38df46cf2d35", 8 | "macos-amd64" => "b4b37807824d2abefe57566054a644711a5f6302cd07ce03de2c76bc620d9d78", 9 | "linux-arm64" => "f229f268a6a3cf73807a05ce7af35facc605987f6c842bed08ce0e129822e941", 10 | "linux-amd64" => "7f1f21fc99954beb361b39366d442b7be31f3810ae5e55477a46ac908764d5cf", 11 | } 12 | 13 | if OS.linux? 14 | os = "linux" 15 | arch = Hardware::CPU.arm? ? "arm64" : "amd64" 16 | else 17 | os = "macos" 18 | arch = Hardware::CPU.arm? ? "arm64" : "amd64" 19 | end 20 | 21 | url "https://tideways.s3.amazonaws.com/cli/#{version}/tideways-cli_#{os}_#{arch}-#{version}.tar.gz" 22 | sha256 checksum["#{os}-#{arch}"] 23 | 24 | def install 25 | bin.install "tideways" 26 | end 27 | 28 | test do 29 | system opt_bin/"tideways", "version" 30 | end 31 | 32 | def caveats 33 | return <<~EOS 34 | Follow the instructions on Tideways Profiler website 35 | to import your application settings: 36 | 37 | https://app.tideways.io/user/cli-import-settings 38 | EOS 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /Formula/tideways-daemon.rb: -------------------------------------------------------------------------------- 1 | require "formula" 2 | 3 | class TidewaysDaemon < Formula 4 | homepage 'https://tideways.com' 5 | version "1.11.4" 6 | checksum = { 7 | "macos-arm64" => "e5f484a9a4c3474bbabe742e22ff1c46e20c95f1437f0daf87db85cc07fb9d3b", 8 | "macos-amd64" => "3c6c12601406417654f85062f9af981a3548ceaa04c463e692b4c3277d0052b8", 9 | "linux-aarch64" => "e606bbdca07243683f2f6dedf9338baddded41ae0ee5e84dfc2dba23f99b56e3", 10 | "linux-amd64" => "c07895364a2268f1781e113a7670505e518c393aa2e8cab42fb1c22057f26d19", 11 | } 12 | 13 | if OS.linux? 14 | os = "linux" 15 | arch = Hardware::CPU.arm? ? "aarch64" : "amd64" 16 | else 17 | os = "macos" 18 | arch = Hardware::CPU.arm? ? "arm64" : "amd64" 19 | end 20 | 21 | url "https://tideways.s3.amazonaws.com/daemon/#{version}/tideways-daemon_#{os}_#{arch}-#{version}.tar.gz" 22 | sha256 checksum["#{os}-#{arch}"] 23 | 24 | def install 25 | bin.install 'tideways-daemon' 26 | end 27 | 28 | def post_install 29 | (var/"log/tideways").mkpath 30 | end 31 | 32 | service do 33 | run [opt_bin/"tideways-daemon", "--address", "127.0.0.1:9135", "--env", "development"] 34 | log_path var/"log/tideways/daemon.log" 35 | end 36 | 37 | test do 38 | system opt_bin/"tideways-daemon", "-version" 39 | end 40 | 41 | def caveats 42 | <<~EOS 43 | 44 | Please contact support@tideways.com if you have problems setting up the daemon. 45 | 46 | EOS 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /Abstract/abstract-tideways-php-extension.rb: -------------------------------------------------------------------------------- 1 | # typed: false 2 | # frozen_string_literal: true 3 | # https://raw.githubusercontent.com/shivammathur/homebrew-extensions/master/Abstract/abstract-php-extension.rb 4 | 5 | class AbstractTidewaysPhpExtension < Formula 6 | desc "Tideways PHP Profiler Extension" 7 | homepage 'https://tideways.com' 8 | 9 | def caveats 10 | <<~EOS 11 | To finish installing tideways for PHP #{php_version}: 12 | * #{pkgetc/"tideways.ini"} was created, 13 | do not forget to remove it upon extension removal. 14 | * Validate installation by running php -m 15 | EOS 16 | end 17 | 18 | test do 19 | output = shell_output("#{Formula[php_formula].opt_bin}/php -m").downcase 20 | assert_match(/tideways/, output, "failed to find extension in php -m output") 21 | end 22 | 23 | private 24 | 25 | delegate [:php_version] => :"self.class" 26 | 27 | def module_path 28 | opt_prefix/"tideways-php-#{php_version}.so" 29 | end 30 | 31 | def config_filepath 32 | etc/"php"/php_version/"conf.d"/"20-tideways.ini" 33 | end 34 | 35 | def write_config_file 36 | (buildpath/"tideways.ini").write <<~EOS 37 | ; See https://support.tideways.com/documentation/setup/configuration/configure-tideways-globally-via-php-ini.html 38 | extension="#{module_path}" 39 | tideways.api_key= 40 | tideways.connection=tcp://127.0.0.1:9135 41 | 42 | ; This setting is used if the current project is a "Profiling Space", disabling any monitoring. 43 | tideways.monitor=none 44 | EOS 45 | pkgetc.install buildpath/"tideways.ini" 46 | rm config_filepath if config_filepath.exist? && !config_filepath.symlink? 47 | ln_s pkgetc/"tideways.ini", config_filepath unless config_filepath.symlink? 48 | end 49 | 50 | class << self 51 | attr_reader :php_version 52 | 53 | def init 54 | class_name = name.split("::").last 55 | matches = /(\w+)AT(\d)(\d)/.match(class_name) 56 | @php_version = "#{matches[2]}.#{matches[3]}" if matches 57 | end 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /.github/workflows/update.yml: -------------------------------------------------------------------------------- 1 | name: Update 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/**' 9 | schedule: 10 | - cron: "0 11 * * *" 11 | workflow_dispatch: 12 | 13 | permissions: 14 | contents: write 15 | 16 | jobs: 17 | update: 18 | name: Update Versions 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v6 22 | with: 23 | fetch-depth: 0 24 | - uses: actions/setup-go@v6 25 | with: 26 | go-version: stable 27 | cache: false 28 | - name: Run scripts/update_formula.php 29 | run: php scripts/update_formula.php 30 | - name: Commit changes. 31 | env: 32 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 33 | run: | 34 | set -x 35 | 36 | go install github.com/planetscale/ghcommit@latest 37 | 38 | if ! git diff --quiet Formula/tideways-php@*; then 39 | changed_files=() 40 | for f in Formula/tideways-php@*; do 41 | changed_files+=(--add "$f") 42 | done 43 | ghcommit -r ${{ github.repository }} \ 44 | -b master \ 45 | "${changed_files[@]}" \ 46 | --message "Update to tideways-php $(awk '$1 == "version"{gsub(/"/,"",$2); print $2}' ${changed_files[1]})" 47 | git pull --autostash 48 | fi 49 | 50 | if ! git diff --quiet Formula/tideways-daemon.rb; then 51 | ghcommit -r ${{ github.repository }} \ 52 | -b master \ 53 | --add Formula/tideways-daemon.rb \ 54 | --message "Update to tideways-daemon $(awk '$1 == "version"{gsub(/"/,"",$2); print $2}' Formula/tideways-daemon.rb)" 55 | git pull --autostash 56 | fi 57 | 58 | if ! git diff --quiet Formula/tideways-cli.rb; then 59 | ghcommit -r ${{ github.repository }} \ 60 | -b master \ 61 | --add Formula/tideways-cli.rb \ 62 | --message "Update to tideways-cli $(awk '$1 == "version"{gsub(/"/,"",$2); print $2}' Formula/tideways-cli.rb)" 63 | git pull --autostash 64 | fi 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Homebrew Formulas for Tideways Profiler 2 | 3 | With this repository you can install the Tideways Profiler Daemon, Commandline-Tool and PHP Extension via Homebrew. 4 | 5 | > **Warning:** This only works with homebrew PHP installations for now. 6 | 7 | 1. Tap this repository 8 | 9 | brew tap tideways/homebrew-profiler 10 | 11 | 2. Install PHP Extension (if you have `homebrew-php`) 12 | 13 | brew install tideways-php@8.0 14 | brew install tideways-php@8.1 15 | brew install tideways-php@8.2 16 | brew install tideways-php@8.3 17 | brew install tideways-php@8.4 18 | brew install tideways-php@8.5 19 | 20 | 4. Install Daemon 21 | 22 | brew install tideways-daemon 23 | 24 | 5. Install Commandline Tool 25 | 26 | brew install tideways-cli 27 | 28 | ## Feedback: Help us improve Installation 29 | 30 | If using this homebrew recipe is at any point complicated for you or not 31 | intuitive that is our mistake. Please help us improve installation by sending 32 | notes to [support@tideways.com](mailto:support@tideways.com). 33 | 34 | ## Acknowledgements 35 | 36 | This work is based on [homebrew-php](https://github.com/Homebrew/homebrew-php) 37 | and [shivamathur/homebrew-extensins](https://github.com/shivammathur/homebrew-extensions) 38 | and uses parts of their codebase to work with different PHP versions. 39 | 40 | ## License 41 | 42 | Covers code in this repository only: https://github.com/tideways/homebrew-profiler 43 | 44 | Copyright (c) 2014-2023 Tideways GmbH 45 | 46 | Permission is hereby granted, free of charge, to any person obtaining a copy of 47 | this software and associated documentation files (the "Software"), to deal in 48 | the Software without restriction, including without limitation the rights to 49 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 50 | of the Software, and to permit persons to whom the Software is furnished to do 51 | so, subject to the following conditions: 52 | 53 | The above copyright notice and this permission notice shall be included in all 54 | copies or substantial portions of the Software. 55 | 56 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 57 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 58 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 59 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 60 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 61 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 62 | SOFTWARE. 63 | -------------------------------------------------------------------------------- /scripts/update_formula.php: -------------------------------------------------------------------------------- 1 | "{$hashMacosArm}", 36 | "macos-x86" => "{$hashMacosX86}", 37 | "arm64" => "{$hashLinuxArm64}", 38 | "x86_64" => "{$hashLinuxX86_64}", 39 | } 40 | 41 | if OS.linux? 42 | os = "" 43 | arch = Hardware::CPU.arm? ? "arm64" : "x86_64" 44 | else 45 | os = "macos-" 46 | arch = Hardware::CPU.arm? ? "arm" : "x86" 47 | end 48 | 49 | url "https://tideways.s3.amazonaws.com/extension/#{version}/tideways-php-#{version}-#{os}#{arch}.tar.gz" 50 | sha256 checksum["#{os}#{arch}"] 51 | 52 | def install 53 | prefix.install "tideways-php-#{php_version}.so" 54 | write_config_file 55 | end 56 | end 57 | 58 | FORMULA, 59 | ); 60 | } 61 | 62 | echo "tideways-daemon", PHP_EOL; 63 | $daemonVersion = $currentVersions['daemon']['version'] ?? throw new RuntimeException("Current Tideways extension version not found in current versions payload."); 64 | $hashMacosArm64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/daemon/{$daemonVersion}/tideways-daemon_macos_arm64-{$daemonVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine macOS ARM64 hash."); 65 | $hashMacosAmd64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/daemon/{$daemonVersion}/tideways-daemon_macos_amd64-{$daemonVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine macOS AMD64 hash."); 66 | $hashLinuxAarch64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/daemon/{$daemonVersion}/tideways-daemon_linux_aarch64-{$daemonVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine Linux aarch64 hash."); 67 | $hashLinuxAmd64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/daemon/{$daemonVersion}/tideways-daemon_linux_amd64-{$daemonVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine Linux AMD64 hash."); 68 | 69 | file_put_contents( 70 | __DIR__ . '/../Formula/tideways-daemon.rb', 71 | << "{$hashMacosArm64}", 79 | "macos-amd64" => "{$hashMacosAmd64}", 80 | "linux-aarch64" => "{$hashLinuxAarch64}", 81 | "linux-amd64" => "{$hashLinuxAmd64}", 82 | } 83 | 84 | if OS.linux? 85 | os = "linux" 86 | arch = Hardware::CPU.arm? ? "aarch64" : "amd64" 87 | else 88 | os = "macos" 89 | arch = Hardware::CPU.arm? ? "arm64" : "amd64" 90 | end 91 | 92 | url "https://tideways.s3.amazonaws.com/daemon/#{version}/tideways-daemon_#{os}_#{arch}-#{version}.tar.gz" 93 | sha256 checksum["#{os}-#{arch}"] 94 | 95 | def install 96 | bin.install 'tideways-daemon' 97 | end 98 | 99 | def post_install 100 | (var/"log/tideways").mkpath 101 | end 102 | 103 | service do 104 | run [opt_bin/"tideways-daemon", "--address", "127.0.0.1:9135", "--env", "development"] 105 | log_path var/"log/tideways/daemon.log" 106 | end 107 | 108 | test do 109 | system opt_bin/"tideways-daemon", "-version" 110 | end 111 | 112 | def caveats 113 | <<~EOS 114 | 115 | Please contact support@tideways.com if you have problems setting up the daemon. 116 | 117 | EOS 118 | end 119 | end 120 | 121 | FORMULA, 122 | ); 123 | 124 | 125 | echo "tideways-cli", PHP_EOL; 126 | $cliVersion = $currentVersions['cli']['version'] ?? throw new RuntimeException("Current Tideways extension version not found in current versions payload."); 127 | $hashMacosArm64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/cli/{$cliVersion}/tideways-cli_macos_arm64-{$cliVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine macOS ARM64 hash."); 128 | $hashMacosAmd64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/cli/{$cliVersion}/tideways-cli_macos_amd64-{$cliVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine macOS AMD64 hash."); 129 | $hashLinuxArm64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/cli/{$cliVersion}/tideways-cli_linux_arm64-{$cliVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine Linux ARM64 hash."); 130 | $hashLinuxAmd64 = hash_file('sha256', "https://tideways.s3.amazonaws.com/cli/{$cliVersion}/tideways-cli_linux_amd64-{$cliVersion}.tar.gz") ?: throw new RuntimeException("Failed to determine Linux AMD64 hash."); 131 | 132 | file_put_contents( 133 | __DIR__ . '/../Formula/tideways-cli.rb', 134 | << "{$hashMacosArm64}", 142 | "macos-amd64" => "{$hashMacosAmd64}", 143 | "linux-arm64" => "{$hashLinuxArm64}", 144 | "linux-amd64" => "{$hashLinuxAmd64}", 145 | } 146 | 147 | if OS.linux? 148 | os = "linux" 149 | arch = Hardware::CPU.arm? ? "arm64" : "amd64" 150 | else 151 | os = "macos" 152 | arch = Hardware::CPU.arm? ? "arm64" : "amd64" 153 | end 154 | 155 | url "https://tideways.s3.amazonaws.com/cli/#{version}/tideways-cli_#{os}_#{arch}-#{version}.tar.gz" 156 | sha256 checksum["#{os}-#{arch}"] 157 | 158 | def install 159 | bin.install "tideways" 160 | end 161 | 162 | test do 163 | system opt_bin/"tideways", "version" 164 | end 165 | 166 | def caveats 167 | return <<~EOS 168 | Follow the instructions on Tideways Profiler website 169 | to import your application settings: 170 | 171 | https://app.tideways.io/user/cli-import-settings 172 | EOS 173 | end 174 | end 175 | 176 | FORMULA, 177 | ); 178 | --------------------------------------------------------------------------------