Browse Source

Update webkit-build-archive (#4959)

* webkit-build-archive

* depends_on: sierra, high sierra
master
commitay 7 years ago
committed by GitHub
parent
commit
f8006cc501
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      Casks/webkit-build-archive.rb
  2. 13
      Casks/webkit-nightly.rb

35
Casks/webkit-build-archive.rb

@ -0,0 +1,35 @@
cask 'webkit-build-archive' do
version :latest
sha256 :no_check
url do
require 'open-uri'
base_url = 'https://webkit.org/build-archives/'
macos_release = if MacOS.version == :sierra
%r{href="([^"]+mac\-sierra[^"]+.zip)"}
else
%r{href="([^"]+mac\-highsierra[^"]+.zip)"}
end
file = open(base_url).read.scan(macos_release).flatten.first
file.to_s
end
name 'WebKit Build Archive'
homepage 'https://webkit.org/build-archives/'
depends_on macos: [
:sierra,
:high_sierra,
]
# shim script (https://github.com/caskroom/homebrew-cask/issues/18809)
shimscript = "#{staged_path}/webkit.wrapper.sh"
binary shimscript, target: 'webkit'
preflight do
IO.write shimscript, <<~EOS
#!/bin/bash
cd "$(dirname "$(readlink -n "${0}")")" && \
'#{staged_path}/run-webkit-archive' "${@}"
EOS
end
end

13
Casks/webkit-nightly.rb

@ -1,13 +0,0 @@
cask 'webkit-nightly' do
version :latest
sha256 :no_check
url do
require 'open-uri'
open('https://webkit.org/downloads/') { |landing_page| landing_page.read[%r{https:\/\/builds-nightly.webkit.org\/files\/trunk\/mac\/WebKit-SVN-r\d+.dmg}] }
end
name 'WebKit Nightly'
homepage 'https://webkit.org/downloads/'
app 'WebKit.app'
end
Loading…
Cancel
Save