Updating Homebrew...
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/cask).
==> New Formulae
amtk kustomize range-v3
aws-okta libsignal-protocol-c safe
badtouch lsusb serverless
black luarocks sfst
cash-cli micronaut sonarqube-lts
docker-credential-helper-ecr miniserve squashfuse
docker-machine-driver-hyperkit pcapplusplus thors-serializer
fauna-shell perltidy weaver
gambit petsc-complex wiremock-standalone
gptfdisk pijul wskdeploy
gradio prettier xcodegen
helmfile pulumi xsimd
infrakit pyside yarn-completion
kubernetes-service-catalog-client python-yq zlog
==> Updated Formulae
automake ✔ fbi-servefiles libpcap puzzles
cmake ✔ fd libphonenumber py2cairo
cockroach ✔ fdclone libpq py3cairo
eigen ✔ fdroidserver libpqxx pyenv
libpng ✔ feh libpst pyinvoke
numpy ✔ ffmpeg libqalculate qbs
openssl ✔ ffmpeg@2.8 librdkafka qcachegrind
subversion ✔ fibjs librealsense qemu
abcde file-formula libsoup qjackctl
abcm2ps file-roller libssh qpdf
ace fio libtensorflow qtkeychain
acpica firebase-cli libtorrent-rasterbar quicktype
activemq flintrock libtrace rabbitmq
adr-tools flow libuv radare2
advancemame fluent-bit libvirt rakudo-star
agda flyway libwps rancher-cli
aircrack-ng fmt libxkbcommon raylib
allure fn lighttpd re2
amazon-ecs-cli folly link-grammar reattach-to-user-namespace
angband fonttools linkerd redis
angle-grinder fortio liquibase rename
angular-cli fq liquigraph restic
annie freeciv llvm riemann-client
ansible freeimage lmod ripgrep
ansible-cmdb freetds log4cplus rocksdb
ansiweather fribidi logtalk roll
ant frugal lrzsz root
ant@1.9 fruit lsof roswell
apache-arrow fselect lua rsyslog
apache-arrow-glib fuseki lua@5.1 rtv
apache-flink futhark lxc ruby-build
app-engine-python fwknop lynis ruby-install
appscale-tools fwup lynx rust
arangodb gammaray macvim rustup-init
argyll-cms gauche mafft s-nail
ark gcc mapcrafter s3cmd
arm-linux-gnueabihf-binutils gdb mariadb s3fs
armadillo gdbm mariadb@10.0 samtools
arpack gegl mariadb@10.1 sane-backends
artifactory geoipupdate mariadb@10.2 sbcl
asdf geos math-comp sbt
ask-cli geoserver mbedtls sbtenv
ats2-postiats get_iplayer mdds sccache
aws-elasticbeanstalk giflib mdp sceptre
aws-sdk-cpp gimme megatools schema-evolution-manager
awscli git-annex memcached schismtracker
azure-cli git-archive-all menhir scrcpy
b2-tools git-extras mercurial selenium-server-standalone
babel git-ftp meson sfk
babl git-lfs metabase shairport-sync
bacula-fd git-quick-stats micro shellharden
ballerina gitbucket mikutter shfmt
bareos-client giter8 mill shibboleth-sp
bartycrouch gitlab-gem mingw-w64 singular
bat gitlab-runner minimal-racket sipp
bats-core gjstest mint skaffold
bazel glib mitmproxy skafos
bcftools glib-networking mkcert skinny
bdw-gc globus-toolkit mkdocs skktools
bear glslviewer mkl-dnn sleuthkit
beast gmt@4 mkvtoolnix snakemake
bench gnatsd mlkit sonarqube
bettercap gnome-builder modd sord
bgpstream gnome-latex modules spdlog
binaryen gnu-prolog monero sphinx-doc
bind gnumeric mongo-c-driver spotbugs
binutils gnupg mongo-cxx-driver sqlmap
bit gnupg@1.4 mongodb sqoop
bitcoin gnuradio mongodb@3.6 squid
bitrise gnutls mongoose sratoolkit
bitwarden-cli go-bindata mono ssh-copy-id
blockhash go-jira mosquitto ssh-permit-a38
bowtie2 go-statik mpd sshguard
buildifier gobuster mpop sshrc
byobu gocryptfs mr sshtrix
byteman goenv mrtg sslsplit
bzt goffice msgpack sslyze
cabextract gomplate msitools stanford-ner
cake goreleaser mujs stanford-parser
camlp4 gosu mutt stern
camlp5 gpac mvtools stone-soup
capstone gr-osmosdr mypy suite-sparse
cargo-completion gradle mysql sundials
cassandra grafana mysql-client suricata
ccextractor grails mysql@5.5 swift
ccrypt grakn mysql@5.6 swift-protobuf
ceres-solver graphite2 mysql@5.7 swiftformat
certbot groonga nagios swiftlint
cfr-decompiler groovy nativefier syncthing
cglm groovysdk naturaldocs sysdig
chakra grpc nco talloc
charm grunt-completion neo4j tarantool
checkstyle gsoap neomutt taskell
chrome-cli gst-editing-services neovim tbox
chronograf gst-libav net-snmp telegraf
cimg gst-plugins-bad nginx teleport
circleci gst-plugins-base nifi tepl
citus gst-plugins-good nnn termius
ckan gst-plugins-ugly node terraform
clamav gst-python node-build terraform_landscape
clblast gst-rtsp-server node@6 terragrunt
clingo gst-validate node@8 the_platinum_searcher
clojure gstreamer nodeenv the_silver_searcher
closure-compiler gtk-vnc npth tig
cmark-gfm guile nsd tiger-vnc
collectd gupnp ntl tippecanoe
commandbox gutenberg ntp titlecase
composer hadolint nuget tkdiff
conan hadoop nuxeo tmate
confluent-oss hana nvc tmux-xpanes
confuse haproxy nyancat todolist
conjure-up harfbuzz ocaml tomcat@8
consul hashcat ocaml-num tor
convox hcloud ocamlbuild tox
coq heroku ocamlsdl traefik
corsixth hexgui ocrmypdf trafficserver
couchdb hh octave translate-shell
cquery highlight odpi trash
credstash hive ola travis
creduce hlint open-mpi triton
cromwell hopenpgp-tools openapi-generator ttfautohint
cryptol hss openblas tty-solitaire
crystal htslib opencoarrays tup
csvkit httpd opendetex twarc
csvprintf hub openimageio twoping
curl hugo opensaml txr
cython hyperfine openshift-cli typescript
dar hyperscan openssh u-boot-tools
darksky-weather i2p openssl@1.1 ubertooth
dartsim icdiff openvdb uhd
dateutils igv osc unixodbc
dbus imagemagick osmium-tool upx
dcd imagemagick@6 osquery urh
dcos-cli imageoptim-cli overmind uriparser
ddclient influxdb p11-kit utf8proc
deark ios-webkit-debug-proxy packer util-linux
dep ipfs paket uwsgi
dependency-check ipython pandoc v8
dhall-json ipython@5 pango vala
di isl parallel vapoursynth
diff-pdf jboss-forge pari vault
diffoscope jenkins passenger vcftools
discount jenkins-job-builder pazpar2 vdirsyncer
distcc jenkins-lts pc6001vx vegeta
dita-ot jfrog-cli-go pcb2gcode verilator
django-completion jhipster pdftoedn vert.x
dlib jlog pdftoipe vim
dmd joplin pegtl vips
dnscrypt-proxy jpeg-archive percona-server-mongodb virtuoso
dnsdist jpeg-turbo percona-server@5.6 vnu
docfx json-fortran percona-toolkit vowpal-wabbit
docker jsonnet perl-build vrpn
docker-completion juju pgbouncer vsts-cli
docker-compose jump pgcli wabt
docker-compose-completion kafka pgplot wandio
docker-credential-helper kerl pgpool-ii watchexec
dovecot kitchen-sync php webdis
draco knot php-code-sniffer webpack
dropbear knot-resolver php-cs-fixer webtorrent-cli
druid kompose php@5.6 weechat
dscanner kontena php@7.0 whois
dtc kops php@7.1 wine
duck kotlin phplint winetricks
duply kube-aws phpmyadmin wiredtiger
dwarfutils kubecfg phpunit wireguard-tools
dxpy kubectx picard-tools wireshark
dynare kubeless pilosa wp-cli
e2fsprogs kubernetes-cli pkcs11-helper wtf
eccodes kubernetes-helm plantuml wxmac
efl lablgtk platformio xapian
elektra landscaper pmd xml-security-c
elixir latex2rtf pony-stable xml-tooling-c
elm lensfun ponyc xmrig
elvish lf poppler xonsh
emscripten libatomic_ops postgresql xtensor
ephemeralpg libcouchbase postgresql@9.4 yafc
erlang libdazzle postgresql@9.5 yara
erlang@19 libdill postgresql@9.6 yarn
erlang@20 libdvbpsi pre-commit yaz
etcd libextractor prest ykman
ethereum libfixbuf presto yle-dl
exercism libgit2 primesieve you-get
exomizer libgpg-error prometheus youtube-dl
expat libgphoto2 proselint yq
exploitdb libgsf protobuf-c zabbix
f3 libhdhomerun protobuf@2.6 zanata-client
faas-cli libical proxychains-ng zebra
fabric libmagic pspg zero-install
fakeroot libomp pulseaudio zimg
fastqc libosmium pushpin znc
==> Deleted Formulae
artifactory-cli-go boot2docker-completion ghc@8.0 gpg-agent wry
boot2docker dirmngr gnupg@2.0 node@4
==> Installing dependencies for wget: gettext, libunistring, libidn2, openssl
==> Installing wget dependency: gettext
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gettext--0.19.8.1.high_sierra.bottle.tar.gz
==> Caveats
gettext is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD gettext library & some software gets confused if both are in the library path.
If you need to have gettext first in your PATH run:
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
For compilers to find gettext you may need to set:
export LDFLAGS="-L/usr/local/opt/gettext/lib"
export CPPFLAGS="-I/usr/local/opt/gettext/include"
==> Summary
🍺 /usr/local/Cellar/gettext/0.19.8.1: 1,935 files, 16.9MB
==> Installing wget dependency: libunistring
==> Downloading https://homebrew.bintray.com/bottles/libunistring-0.9.10.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libunistring--0.9.10.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libunistring/0.9.10: 54 files, 4.4MB
==> Installing wget dependency: libidn2
==> Downloading https://homebrew.bintray.com/bottles/libidn2-2.0.5.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libidn2--2.0.5.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libidn2/2.0.5: 68 files, 668.6KB
==> Installing wget dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2p.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl--1.0.2p.high_sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/openssl/1.0.2p: 1,793 files, 12.3MB
==> Installing wget
==> Downloading https://homebrew.bintray.com/bottles/wget-1.19.5.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring wget--1.19.5.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/wget/1.19.5: 50 files, 3.7MB
==> Caveats
==> gettext
gettext is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD gettext library & some software gets confused if both are in the library path.
If you need to have gettext first in your PATH run:
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
For compilers to find gettext you may need to set:
export LDFLAGS="-L/usr/local/opt/gettext/lib"
export CPPFLAGS="-I/usr/local/opt/gettext/include"
==> openssl
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
When I test the new installation with wget --help
, it tells me it is GNU Wget 1.19.5
and gives me the help text. The command man wget
also works at this point. Running which wget
tells me that the installation is at /usr/local/bin/wget, and ls -l /usr/local/bin/wget
tells me that it’s a pointer to ../Cellar/wget/1.19.5/bin/wget
. That is consistent with what Homebrew reported during the installation.
As an aside, note that wget
will only retrieve URLs that give it permission, and it respects the Robot Exclusion Standard (/robots.txt). So, for example, if you try to download a site that doesn’t want to be scraped, you’ll get a 403 Forbidden
error.
$ wget pcpitstop.com
--2018-08-27 11:18:20-- http://pcpitstop.com/
Resolving pcpitstop.com (pcpitstop.com)... 104.20.82.39, 104.20.83.39
Connecting to pcpitstop.com (pcpitstop.com)|104.20.82.39|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.pcpitstop.com/ [following]
--2018-08-27 11:18:20-- http://www.pcpitstop.com/
Resolving www.pcpitstop.com (www.pcpitstop.com)... 104.20.83.39, 104.20.82.39
Connecting to www.pcpitstop.com (www.pcpitstop.com)|104.20.83.39|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2018-08-27 11:18:20 ERROR 403: Forbidden.
By contrast, curl
will blithely download the single pages you request, whether or not the site has robot exclusions. curl http://www.pcpitstop.com
will output a bunch of HTML from the site’s home page.
As an example where wget
will work fine, consider this example from the Gnu wget
documentation:
wget ftp://ftp.gnu.org/pub/gnu/
links index.html
I tried it, and the wget
part worked, but the links
command wasn’t found:
$ wget ftp://ftp.gnu.org/pub/gnu/
--2018-08-27 11:35:34-- ftp://ftp.gnu.org/pub/gnu/
=> ‘.listing’
Resolving ftp.gnu.org (ftp.gnu.org)... 208.118.235.20
Connecting to ftp.gnu.org (ftp.gnu.org)|208.118.235.20|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /pub/gnu ... done.
==> PASV ... done. ==> LIST ... done.
.listing [ <=> ] 24.87K --.-KB/s in 0.01s
2018-08-27 11:35:34 (2.11 MB/s) - ‘.listing’ saved [25466]
Removed ‘.listing’.
Wrote HTML-ized index to ‘index.html’ [37782].
Martins-Retina-MacBook:~ martinheller$ links index.html
-bash: links: command not found
What should you do to install links
? Your first guess is probably correct:
$ brew install links
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/cask).
==> New Formulae
eslint geogram go@1.10 json11 luit
==> Updated Formulae
go ✔ diff-pdf gmt@4 libphonenumber pdal tomcat
hdf5 ✔ dynare godep libtensorflow pdftoedn tomcat-native
angular-cli elasticsearch@5.6 goenv mdcat pdftoipe tomcat@7
armadillo elixir gromacs meson perl-build tomcat@8
augeas feedgnuplot hcloud minizinc plantuml vtk
awscli field3d iso-codes mkcert poppler yubico-piv-tool
bwfmetaedit flann jenkins nco prettier zsh-completions
caffe folly jenkins-job-builder ncview s6
cimg git-cola kallisto netcdf saxon
ckan git-quick-stats kibana@5.6 nghttp2 sratoolkit
convox gitlab-runner libbi octave svtplay-dl
dartsim gmt libmatio pcl thors-serializer
==> Downloading https://homebrew.bintray.com/bottles/links-2.16.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring links--2.16.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/links/2.16: 19 files, 1.8MB
Martins-Retina-MacBook:~ martinheller$ links index.html
By the way, an alternative to links
on MacOS is simply to open the HTML file in your browser. From the command line, that’s open index.html
.
Query Homebrew
You saw above that Homebrew will list the recipes that have changed in its directory after an automatic update and will flag the installed recipes that have changed in bold with green checkmarks ✔. You can also ask Homebrew to show you what it currently has installed:
$ brew ls
apr cockroach gflags jpeg links pcre subversion
apr-util delve glog leveldb lmdb perl swig
autoconf eigen go libidn2 nmap pkg-config szip
automake fontconfig gperftools libpng numpy readline webp
boost freetype graphviz libtiff opencv scons wget
boost-python gd hdf5 libtool openexr snappy
cmake gettext ilmbase libunistring openssl sqlite
Any option flags are passed to ls
, for example:
$ brew ls -l
total 0
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:37 apr
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:37 apr-util
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 autoconf
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 automake
drwxr-xr-x 4 martinheller admin 128 Jan 5 2017 boost
drwxr-xr-x 4 martinheller admin 128 Jan 5 2017 boost-python
drwxr-xr-x 4 martinheller admin 128 Dec 9 2016 cmake
drwxr-xr-x 3 martinheller admin 96 Dec 15 2017 cockroach
drwxr-xr-x 4 martinheller admin 128 Jul 5 14:03 delve
drwxr-xr-x 4 martinheller admin 128 Dec 9 2016 eigen
drwxr-xr-x 3 martinheller admin 96 Jan 5 2017 fontconfig
drwxr-xr-x 3 martinheller admin 96 Jan 5 2017 freetype
drwxr-xr-x 3 martinheller admin 96 Jan 5 2017 gd
drwxr-xr-x 3 martinheller staff 96 Aug 24 14:33 gettext
drwxr-xr-x 4 martinheller admin 128 Dec 9 2016 gflags
drwxr-xr-x 4 martinheller admin 128 Dec 9 2016 glog
drwxr-xr-x 3 martinheller admin 96 Jul 5 14:03 go
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 gperftools
drwxr-xr-x 4 martinheller admin 128 Jan 5 2017 graphviz
drwxr-xr-x 4 martinheller admin 128 Jan 5 2017 hdf5
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 ilmbase
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 jpeg
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 leveldb
drwxr-xr-x 3 martinheller staff 96 Aug 24 14:34 libidn2
drwxr-xr-x 5 martinheller admin 160 Jan 5 2017 libpng
drwxr-xr-x 4 martinheller admin 128 Dec 9 2016 libtiff
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 libtool
drwxr-xr-x 3 martinheller staff 96 Aug 24 14:34 libunistring
drwxr-xr-x 3 martinheller staff 96 Aug 27 11:37 links
drwxr-xr-x 4 martinheller admin 128 Jan 5 2017 lmdb
drwxr-xr-x 3 martinheller admin 96 Mar 22 14:29 nmap
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 numpy
drwxr-xr-x 4 martinheller admin 128 Jan 5 2017 opencv
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 openexr
drwxr-xr-x 6 martinheller staff 192 Aug 24 14:34 openssl
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:37 pcre
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:37 perl
drwxr-xr-x 4 martinheller admin 128 Apr 9 16:37 pkg-config
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:37 readline
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:38 scons
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 snappy
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:37 sqlite
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:38 subversion
drwxr-xr-x 3 martinheller admin 96 Apr 9 16:37 swig
drwxr-xr-x 3 martinheller admin 96 Oct 19 2016 szip
drwxr-xr-x 3 martinheller admin 96 Jan 5 2017 webp
drwxr-xr-x 3 martinheller staff 96 Aug 24 14:34 wget
You can use list
as well; ls
is an alias for list
.
How can you find out what Homebrew supports? It’s a long list, so you probably wouldn’t want to output it in your terminal window, although you can search your current installed core and cask formula lists with brew search <name>
or brew search --desc <keyword>
. The core list of Homebrew packages is on the web, however, which can sometimes be more convenient, since you can scroll through and search with CMD-f:
A list of core Homebrew formulae, or package definitions, is available online.
You can also ask Homebrew about its commands:
$ brew commands
Built-in commands
--cache cat doctor link postinstall tap untap
--cellar cleanup fetch list prune tap-info update
--env command gist-logs log readall tap-pin update-report
--prefix commands help migrate reinstall tap-unpin update-reset
--repository config home missing search uninstall upgrade
--version deps info options sh unlink uses
analytics desc install outdated style unpack vendor-install
cask diy leaves pin switch unpin
Built-in developer commands
audit create irb mirror release-notes test
bottle edit linkage prof ruby tests
bump-formula-pr formula man pull tap-new update-test
And you can ask Homebrew to see the source code of any Homebrew formula on your machine, whether or not it is installed:
$ brew cat delve
class Delve < Formula
desc "Debugger for the Go programming language."
homepage "https://github.com/derekparker/delve"
url "https://github.com/derekparker/delve/archive/v1.0.0.tar.gz"
version "1.0.0"
sha256 "38117c9db41db23a27a1c2e99be17d7fb73d1653de0751ee1262b460a2b26dc4"
head "https://github.com/derekparker/delve.git"
depends_on "go" => :build
def install
dlv_cert = "dlv-cert"
File.open("dlv-cert.cfg", "w") do |file|
file.write(%(
[ req ]
default_bits = 2048 # RSA key size
encrypt_key = no # Protect private key
default_md = sha512 # MD to use
prompt = no # Prompt for DN
distinguished_name = codesign_dn # DN template
[ codesign_dn ]
commonName = "dlv-cert"
[ codesign_reqext ]
keyUsage = critical,digitalSignature
extendedKeyUsage = critical,codeSigning
))
end
find_output = `security find-certificate -Z -p -c #{dlv_cert}
Library/Keychains/System.keychain`
if find_output.start_with? "SHA-1 hash"
ohai "#{dlv_cert} is already installed, no need to create it"
else
ohai "Generating #{dlv_cert}"
system "openssl", "req", "-new", "-newkey", "rsa:2048", "-x509", \
"-days", "3650", "-nodes", "-config", "#{dlv_cert}.cfg", \
"-extensions", "codesign_reqext", "-batch", \
"-out", "#{dlv_cert}.cer", "-keyout", "#{dlv_cert}.key"
ohai "[SUDO] Installing #{dlv_cert} as root"
system "sudo", "security", "add-trusted-cert", "-d", "-r", "trustRoot", \
"-k", "/Library/Keychains/System.keychain", "#{dlv_cert}.cer"
system "sudo", "security", "import", "#{dlv_cert}.key", "-A", \
"-k", "/Library/Keychains/System.keychain"
ohai "[SUDO] Killing taskgated"
system "sudo", "pkill", "-f", "/usr/libexec/taskgated"
end
mkdir_p buildpath/"src/github.com/derekparker"
ln_sf buildpath, buildpath/"src/github.com/derekparker/delve"
ENV["GOBIN"] = buildpath
ENV["GOPATH"] = buildpath
ENV["CERT"] = dlv_cert
if head?
system "make", "build"
else
system "make", "build", "BUILD_SHA=v#{version}"
end
bin.install "dlv"
end
def caveats; <<~EOS
If you get "could not launch process: could not fork/exec", you need to try
in a new terminal.
When uninstalling, to remove the dlv-cert certificate, run this command:
$ sudo security delete-certificate -t -c dlv-cert /Library/Keychains/System.keychain
Alternatively, you may want to delete from the Keychain (with the Imported private key).
EOS
end
test do
system bin/"dlv", "version"
end
end
You can quickly find out where any Homebrew formula is hosted and what it does:
$ brew info gdbm
gdbm: stable 1.18 (bottled)
GNU database manager
https://www.gnu.org/software/gdbm/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/gdbm.rb
==> Options
--with-libgdbm-compat
Build libgdbm_compat, a compatibility layer which provides UNIX-like dbm and ndbm interfaces.
For additional description, you can bring up the formula’s home page in your default browser:
$ brew home gdbm
You may be interested in knowing the dependencies of one or more brew
formulae without seeing all the Ruby code, for example:
$ brew deps mongodb
gdbm
openssl
python@2
readline
sqlite