From 0d42de6d9c99c3d1cf945efebc6e0965e57ad534 Mon Sep 17 00:00:00 2001 From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com> Date: Tue, 5 Nov 2019 05:42:20 +0100 Subject: [PATCH] issue #29: Local Homebrew formula for fish 2 --- .travis.yml | 2 +- test/Homebrew-Formula-fish-2.7.1.rb | 60 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 test/Homebrew-Formula-fish-2.7.1.rb diff --git a/.travis.yml b/.travis.yml index 948b523..ee0ed9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: addons: homebrew: packages: - - 'https://raw.githubusercontent.com/Homebrew/homebrew-core/799fef191cd2beac06930e1d1a8e7f308bd0f4b1/Formula/fish.rb' # 2.7.1 + - 'test/Homebrew-Formula-fish-2.7.1.rb' update: true # TODO: build should be green without, but isn't - os: osx env: FISH=3 diff --git a/test/Homebrew-Formula-fish-2.7.1.rb b/test/Homebrew-Formula-fish-2.7.1.rb new file mode 100644 index 0000000..3a463db --- /dev/null +++ b/test/Homebrew-Formula-fish-2.7.1.rb @@ -0,0 +1,60 @@ +class HomebrewFormulaFish271 < Formula + desc "User-friendly command-line shell for UNIX-like operating systems" + homepage "https://fishshell.com" + url "https://github.com/fish-shell/fish-shell/releases/download/2.7.1/fish-2.7.1.tar.gz" + mirror "https://fishshell.com/files/2.7.1/fish-2.7.1.tar.gz" + sha256 "e42bb19c7586356905a58578190be792df960fa81de35effb1ca5a5a981f0c5a" + + bottle do + sha256 "affac16a396410a500241266dbbbd8752562c9b800d9e4f2ef8de279c6fdb6aa" => :high_sierra + sha256 "335538a7ea7f9613474f7321af0a1d519b61b0fc4be97a1744a7ea7bef7ff7e3" => :sierra + sha256 "463cfa8edc0603761f25e0ba4e49524f69a1d856263d370d1de5fb8698dd5ccf" => :el_capitan + end + + head do + url "https://github.com/fish-shell/fish-shell.git", :shallow => false + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "doxygen" => :build + end + + depends_on "pcre2" + + def install + system "autoreconf", "--no-recursive" if build.head? + + # In Homebrew's 'superenv' sed's path will be incompatible, so + # the correct path is passed into configure here. + args = %W[ + --prefix=#{prefix} + --with-extra-functionsdir=#{HOMEBREW_PREFIX}/share/fish/vendor_functions.d + --with-extra-completionsdir=#{HOMEBREW_PREFIX}/share/fish/vendor_completions.d + --with-extra-confdir=#{HOMEBREW_PREFIX}/share/fish/vendor_conf.d + SED=/usr/bin/sed + ] + system "./configure", *args + system "make", "install" + end + + def caveats; <<~EOS + You will need to add: + #{HOMEBREW_PREFIX}/bin/fish + to /etc/shells. + + Then run: + chsh -s #{HOMEBREW_PREFIX}/bin/fish + to make fish your default shell. + EOS + end + + def post_install + (pkgshare/"vendor_functions.d").mkpath + (pkgshare/"vendor_completions.d").mkpath + (pkgshare/"vendor_conf.d").mkpath + end + + test do + system "#{bin}/fish", "-c", "echo" + end +end