diff --git a/configure.ac b/configure.ac index 9ef4c696..8fc0dd22 100644 --- a/configure.ac +++ b/configure.ac @@ -5,6 +5,9 @@ AC_PREREQ([2.68]) AC_INIT(gitsh, 0.14, hello@thoughtbot.com) AM_INIT_AUTOMAKE([subdir-objects]) +AC_ARG_VAR([VERSION_SUFFIX], [Appended to PACKAGE_VERSION when building, e.g., for pre-release builds]) +AS_IF([test -n "$VERSION_SUFFIX"], [AC_SUBST([PACKAGE_VERSION], ["$PACKAGE_VERSION$VERSION_SUFFIX"])]) + AC_ARG_VAR([RUBY],[The path of the Ruby binary to use]) AC_ARG_VAR( [READLINE_LIB], diff --git a/homebrew/gitsh.rb.in b/homebrew/gitsh.rb.in index fac6316f..98870c2d 100644 --- a/homebrew/gitsh.rb.in +++ b/homebrew/gitsh.rb.in @@ -9,6 +9,12 @@ class Gitsh < Formula url 'https://thoughtbot.github.io/@PACKAGE@/@DIST_ARCHIVES@' sha256 '@DIST_SHA@' + head do + url 'https://github.com/thoughtbot/@PACKAGE@.git' + depends_on 'autoconf' => :build + depends_on 'automake' => :build + end + def self.old_system_ruby? system_ruby_version = `#{SYSTEM_RUBY_PATH} -e "puts RUBY_VERSION"`.chomp system_ruby_version < '2.3.0' @@ -22,6 +28,13 @@ class Gitsh < Formula def install set_ruby_path set_architecture + + if build.head? + system "./autogen.sh" + git_sha = %x(git log -1 --format=%h).chomp + ENV["VERSION_SUFFIX"] = "-head+#{git_sha}" + end + system "./configure", "--disable-debug", "--disable-dependency-tracking", "--disable-silent-rules",