aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authordinkypumpkin2011-03-16 02:07:39 +0000
committerAdam Vandenberg2011-03-20 17:05:36 -0700
commitd70595ceca4d948b75524830158111d423755f90 (patch)
treebef102a281e0b3a0ac788d436874d36f65a5ca4f /Library
parent1019f5b137076dded3f64f3da21b4d92dc7c2868 (diff)
downloadhomebrew-d70595ceca4d948b75524830158111d423755f90.tar.bz2
ffmpeg: fix version stamp for HEAD builds
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/ffmpeg.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/Library/Formula/ffmpeg.rb b/Library/Formula/ffmpeg.rb
index c06f3a1b7..7ed359eb8 100644
--- a/Library/Formula/ffmpeg.rb
+++ b/Library/Formula/ffmpeg.rb
@@ -53,6 +53,29 @@ class Ffmpeg < Formula
end
end
+ write_version_file if ARGV.build_head?
+
system "make install"
end
+
+ # Makefile expects to run in git repo and generate a version number
+ # with 'git describe --always' (see version.sh) but Homebrew build
+ # runs in temp copy created via git checkout-index, so 'git describe'
+ # does not work. Work around by writing VERSION file in build directory
+ # to be picked up by version.sh. Note that VERSION file will already
+ # exist in release versions, so this only applies to git HEAD builds.
+ def write_version_file
+ return if File.exists?("VERSION")
+ git_tag = "UNKNOWN"
+ Dir.chdir(cached_download) do
+ ret = `git describe --always`
+ if not $?.success?
+ opoo "Could not determine build version from git repository - set to #{git_tag}"
+ else
+ git_tag = ret
+ end
+ end
+ File.open("VERSION","w") {|f| f.puts "git-#{git_tag}"}
+ end
+
end