GitHub PullRequestReviewCommentEvent at 2014-03-24 18:58:02
Repository: homebrew
Actor: mikemcquaid
Payload: {"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/10900162","id":10900162,"diff_hunk":"@@ -16,25 +52,39 @@ class X264 < Formula\n \n   depends_on 'yasm' => :build\n \n-  option '10-bit', 'Build a 10-bit x264 (default: 8-bit)'\n+  option \"without-shared\", \"doesn't build shared library\"\n+  option \"without-static\", \"doesn't build static library\"\n+  option \"bit-depth=10\", \"set output bit depth 10\"\n+  option \"with-strip\", \"add -s to CFLAGS and LDFLAGS\"\n+  option \"with-pic\", \"build position-independent code\"\n \n   def install\n-    # https://github.com/Homebrew/homebrew/pull/19594\n-    ENV.deparallelize\n+    args = [\"--prefix=#{prefix}\"]\n+    args << \"--enable-shared\" unless build.without? \"shared\"\n+    args << \"--enable-static\" unless build.without? \"static\"\n+    args << \"--bit-depth=10\" if build.include? \"bit-depth=10\"\n+    args << \"--enable-strip\" if build.with? \"strip\"\n+    args << \"--enable-pic\" if build.with? \"pic\"\n+\n+    system \"./configure\", *args\n+\n     if build.head?\n-      ENV['GIT_DIR'] = cached_download/'.git'\n-      system './version.sh'\n+      git = GitVersion.new(@active_spec.downloader.cached_location)\n+      _version = \"r\" + git.get_revision\n+      _hash = git.get_head_hash\n+    else\n+      _version = version.to_s\n+      _hash = url.slice(/h=(\\w+);/, 1).slice(0..6)\n     end\n-    args = [\"--prefix=#{prefix}\", \"--enable-shared\"]\n-    args << \"--bit-depth=10\" if build.include? '10-bit'\n \n-    system \"./configure\", *args\n+    inreplace \"x264_config.h\" do |s|\n+      s.gsub! \"X264_VERSION \\\"\\\"\", \"X264_VERSION \\\" #{_version} #{_hash}\\\"\"\n+      s.gsub! \".x\", \".#{_version[1..-1]} #{_hash}\"\n+    end\n \n-    if MacOS.prefer_64_bit?\n-      inreplace 'config.mak' do |s|\n-        soflags = s.get_make_var 'SOFLAGS'\n-        s.change_make_var! 'SOFLAGS', soflags.gsub(' -Wl,-read_only_relocs,suppress', '')\n-      end\n+    File.open(\"x264_config.h\", \"a\") do |file|\n+      file << \"#define X264_REV #{_version[1..-1]}\\n\"\n+      file << \"#define X264_REV_DIFF 0\\n\"\n     end","path":"Library/Formula/x264.rb","position":103,"original_position":103,"commit_id":"b9e8294e4a8cd4e37b0bd3b6755b8f1d96e54233","original_commit_id":"b9e8294e4a8cd4e37b0bd3b6755b8f1d96e54233","user":{"login":"mikemcquaid","id":125011,"avatar_url":"https://avatars.githubusercontent.com/u/125011?","gravatar_id":"215e0166d4d8265395c5d9076da73c70","url":"https://api.github.com/users/mikemcquaid","html_url":"https://github.com/mikemcquaid","followers_url":"https://api.github.com/users/mikemcquaid/followers","following_url":"https://api.github.com/users/mikemcquaid/following{/other_user}","gists_url":"https://api.github.com/users/mikemcquaid/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemcquaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemcquaid/subscriptions","organizations_url":"https://api.github.com/users/mikemcquaid/orgs","repos_url":"https://api.github.com/users/mikemcquaid/repos","events_url":"https://api.github.com/users/mikemcquaid/events{/privacy}","received_events_url":"https://api.github.com/users/mikemcquaid/received_events","type":"User","site_admin":true},"body":"We need to work out a solution that doesn't involve manually writing to files and using `inreplace.`","created_at":"2014-03-24T18:58:02Z","updated_at":"2014-03-24T18:58:02Z","html_url":"https://github.com/Homebrew/homebrew/pull/27828#discussion_r10900162","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/27828","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/10900162"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/27828#discussion_r10900162"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/27828"}}}}