CombinedText stringlengths 4 3.42M |
|---|
require "albacore"
require "release/filesystem"
reportsPath = "reports"
version = ENV["BUILD_NUMBER"]
desc "Inits the build"
task :initBuild do
FileSystem.EnsurePath(reportsPath)
end
desc "Generate assembly info."
assemblyinfo :assemblyInfo => :initBuild do |asm|
asm.version = version
asm.company_name = "Ultraviolet Catastrophe"
asm.product_name = "Hid Library"
asm.title = "Hid Library"
asm.description = "Hid communication library."
asm.copyright = "Copyright (c) 2011 Ultraviolet Catastrophe"
asm.output_file = "src/Current/HidLibrary/Properties/AssemblyInfo.cs"
end
desc "Builds the library."
msbuild :buildLibrary => :assemblyInfo do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/Current/HidLibrary/HidLibrary.csproj"
end
#desc "Builds the test project."
#msbuild :buildTestProject => :buildLibrary do |msb|
# msb.properties :configuration => :Release
# msb.targets :Clean, :Build
# msb.solution = "src/Tests/Tests.csproj"
#end
#desc "NUnit Test Runner"
#nunit :unitTests => :buildTestProject do |nunit|
# nunit.command = "src/packages/NUnit.2.5.9.10348/Tools/nunit-console.exe"
# nunit.assemblies "src/Tests/bin/Release/Tests.dll"
# nunit.options "/xml=#{reportsPath}/TestResult.xml"
#end
nugetApiKey = ENV["NUGET_API_KEY"]
deployPath = "deploy"
packagePath = File.join(deployPath, "package")
nuspec = "hidlibrary.nuspec"
packageLibPath = File.join(packagePath, "lib")
binPath = "src/HidLibrary/bin/Release"
desc "Prep the package folder"
task :prepPackage => :buildLibrary do
FileSystem.DeleteDirectory(deployPath)
FileSystem.EnsurePath(packageLibPath)
FileSystem.CopyFiles(File.join(binPath, "HidLibrary.dll"), packageLibPath)
FileSystem.CopyFiles(File.join(binPath, "HidLibrary.pdb"), packageLibPath)
end
desc "Create the nuspec"
nuspec :createSpec => :prepPackage do |nuspec|
nuspec.id = "hidlibrary"
nuspec.version = version
nuspec.authors = "Mike O'Brien"
nuspec.owners = "Mike O'Brien"
nuspec.title = "Hid Library"
nuspec.description = "This library enables you to enumerate and communicate with Hid compatible USB devices in .NET."
nuspec.summary = "This library enables you to enumerate and communicate with Hid compatible USB devices in .NET."
nuspec.language = "en-US"
nuspec.licenseUrl = "https://github.com/mikeobrien/HidLibrary/blob/master/LICENSE"
nuspec.projectUrl = "https://github.com/mikeobrien/HidLibrary"
nuspec.iconUrl = "https://github.com/mikeobrien/HidLibrary/raw/master/misc/hidlibrary.png"
nuspec.working_directory = packagePath
nuspec.output_file = nuspec
nuspec.tags = "usb hid"
end
desc "Create the nuget package"
nugetpack :createPackage => :createSpec do |nugetpack|
nugetpack.nuspec = File.join(packagePath, nuspec)
nugetpack.base_folder = packagePath
nugetpack.output = deployPath
end
desc "Push the nuget package"
nugetpush :pushPackage => :createPackage do |nuget|
nuget.apikey = nugetApiKey
nuget.package = File.join(deployPath, "hidlibrary.#{version}.nupkg")
end
Mods for TeamCity migration.
require "albacore"
require "release/filesystem"
reportsPath = "reports"
version = ENV["BUILD_NUMBER"]
desc "Inits the build"
task :initBuild do
FileSystem.EnsurePath(reportsPath)
end
desc "Generate assembly info."
assemblyinfo :assemblyInfo => :initBuild do |asm|
asm.version = version
asm.company_name = "Ultraviolet Catastrophe"
asm.product_name = "Hid Library"
asm.title = "Hid Library"
asm.description = "Hid communication library."
asm.copyright = "Copyright (c) 2011 Ultraviolet Catastrophe"
asm.output_file = "src/Current/HidLibrary/Properties/AssemblyInfo.cs"
end
desc "Builds the library."
msbuild :buildLibrary => :assemblyInfo do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/Current/HidLibrary/HidLibrary.csproj"
end
#desc "Builds the test project."
#msbuild :buildTestProject => :buildLibrary do |msb|
# msb.properties :configuration => :Release
# msb.targets :Clean, :Build
# msb.solution = "src/Tests/Tests.csproj"
#end
#desc "NUnit Test Runner"
#nunit :unitTests => :buildTestProject do |nunit|
# nunit.command = "src/packages/NUnit.2.5.9.10348/Tools/nunit-console.exe"
# nunit.assemblies "src/Tests/bin/Release/Tests.dll"
# nunit.options "/xml=#{reportsPath}/TestResult.xml"
#end
nugetApiKey = ENV["NUGET_API_KEY"]
deployPath = "deploy"
packagePath = File.join(deployPath, "package")
nuspecName = "hidlibrary.nuspec"
packageLibPath = File.join(packagePath, "lib")
binPath = "src/HidLibrary/bin/Release"
desc "Prep the package folder"
task :prepPackage => :buildLibrary do
FileSystem.DeleteDirectory(deployPath)
FileSystem.EnsurePath(packageLibPath)
FileSystem.CopyFiles(File.join(binPath, "HidLibrary.dll"), packageLibPath)
FileSystem.CopyFiles(File.join(binPath, "HidLibrary.pdb"), packageLibPath)
end
desc "Create the nuspec"
nuspec :createSpec => :prepPackage do |nuspec|
nuspec.id = "hidlibrary"
nuspec.version = version
nuspec.authors = "Mike O'Brien"
nuspec.owners = "Mike O'Brien"
nuspec.title = "Hid Library"
nuspec.description = "This library enables you to enumerate and communicate with Hid compatible USB devices in .NET."
nuspec.summary = "This library enables you to enumerate and communicate with Hid compatible USB devices in .NET."
nuspec.language = "en-US"
nuspec.licenseUrl = "https://github.com/mikeobrien/HidLibrary/blob/master/LICENSE"
nuspec.projectUrl = "https://github.com/mikeobrien/HidLibrary"
nuspec.iconUrl = "https://github.com/mikeobrien/HidLibrary/raw/master/misc/hidlibrary.png"
nuspec.working_directory = packagePath
nuspec.output_file = nuspecName
nuspec.tags = "usb hid"
end
desc "Create the nuget package"
nugetpack :createPackage => :createSpec do |nugetpack|
nugetpack.nuspec = File.join(packagePath, nuspecName)
nugetpack.base_folder = packagePath
nugetpack.output = deployPath
end
desc "Push the nuget package"
nugetpush :pushPackage => :createPackage do |nuget|
nuget.apikey = nugetApiKey
nuget.package = File.join(deployPath, "hidlibrary.#{version}.nupkg")
end |
require "albacore"
require "release/robocopy"
task :default => [:deployBinaries]
desc "Generate assembly info."
assemblyinfo :assemblyInfo do |asm|
asm.version = ENV["GO_PIPELINE_LABEL"]
asm.company_name = "Ultraviolet Catastrophe"
asm.product_name = "WCF REST Contrib"
asm.title = "WCF REST Contrib"
asm.description = "Goodies for WCF REST."
asm.copyright = "Copyright (c) 2010 Ultraviolet Catastrophe"
asm.output_file = "src/WcfRestContrib/Properties/AssemblyInfo.cs"
end
/*
desc "Updates the sample application wcf rest contrib assembly version."
task :updateSampleVersion
end
*/
desc "Builds the application."
msbuild :build => [:assemblyInfo] do |msb|
msb.path_to_command = File.join(ENV['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/WcfRestContrib.sln"
end
desc "Zips and eploys the application binaries."
zip :deployBinaries => [:build] do |zip|
zip.directories_to_zip "src/WcfRestContrib/bin/Release"
zip.output_file = "WcfRestContrib_$(ENV['GO_PIPELINE_LABEL']).zip"
zip.output_path = "D:/Websites/public.mikeobrien.net/wwwroot/Releases/WcfRestContrib/"
end
Build mods.
require "albacore"
require "release/robocopy"
task :default => [:deployBinaries]
desc "Generate assembly info."
assemblyinfo :assemblyInfo do |asm|
asm.version = ENV["GO_PIPELINE_LABEL"]
asm.company_name = "Ultraviolet Catastrophe"
asm.product_name = "WCF REST Contrib"
asm.title = "WCF REST Contrib"
asm.description = "Goodies for WCF REST."
asm.copyright = "Copyright (c) 2010 Ultraviolet Catastrophe"
asm.output_file = "src/WcfRestContrib/Properties/AssemblyInfo.cs"
end
desc "Builds the application."
msbuild :build => [:assemblyInfo] do |msb|
msb.path_to_command = File.join(ENV['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/WcfRestContrib.sln"
end
desc "Zips and eploys the application binaries."
zip :deployBinaries => [:build] do |zip|
zip.directories_to_zip "src/WcfRestContrib/bin/Release"
zip.output_file = "WcfRestContrib_$(ENV['GO_PIPELINE_LABEL']).zip"
zip.output_path = "D:/Websites/public.mikeobrien.net/wwwroot/Releases/WcfRestContrib/"
end
|
require "albacore"
require "release/robocopy"
require "release/common"
require "rubygems"
require "rake/gempackagetask"
ReleasePath = "D:/Websites/public.mikeobrien.net/wwwroot/Releases/WcfRestContrib/#{ENV['GO_PIPELINE_LABEL']}"
task :default => [:deploySample]
desc "Inits the build"
task :initBuild do
Common.EnsurePath("reports")
end
desc "Generate assembly info."
assemblyinfo :assemblyInfo => :initBuild do |asm|
asm.version = ENV["GO_PIPELINE_LABEL"]
asm.company_name = "Ultraviolet Catastrophe"
asm.product_name = "Wcf Rest Contrib"
asm.title = "Wcf Rest Contrib"
asm.description = "Goodies for Wcf Rest."
asm.copyright = "Copyright (c) 2010 Ultraviolet Catastrophe"
asm.output_file = "src/WcfRestContrib/Properties/AssemblyInfo.cs"
end
desc "Set assembly version in web.config"
task :setAssemblyVersion => :assemblyInfo do
path = "src/NielsBohrLibrary/Web.config"
project = Common.ReadAllFileText(path)
project = project.gsub("WcfRestContrib, Version=1.0.0.0,", "WcfRestContrib, Version=#{ENV['GO_PIPELINE_LABEL']},")
Common.WriteAllFileText(path, project)
end
desc "Builds the library."
msbuild :buildLibrary => :setAssemblyVersion do |msb|
msb.path_to_command = File.join(ENV['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/WcfRestContrib/WcfRestContrib.csproj"
end
desc "Builds the test project."
msbuild :buildTestProject => :buildLibrary do |msb|
msb.path_to_command = File.join(ENV['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/WcfRestContrib.Tests/WcfRestContrib.Tests.csproj"
end
desc "Builds the sample app."
msbuild :buildSampleApp => :buildTestProject do |msb|
msb.path_to_command = File.join(ENV['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/NielsBohrLibrary/NielsBohrLibrary.csproj"
end
desc "Set assembly reference in the sample project."
task :addSampleAssemblyReference => :buildSampleApp do
path = "src/NielsBohrLibrary/NielsBohrLibrary.csproj"
replace = /<ProjectReference.*<\/ProjectReference>/m
reference = "<Reference Include=\"WcfRestContrib\"><HintPath>bin\WcfRestContrib.dll</HintPath></Reference>"
project = Common.ReadAllFileText(path)
project = project.gsub(replace, reference)
Common.WriteAllFileText(path, project)
end
desc "Builds the installer."
msbuild :buildInstaller => :addSampleAssemblyReference do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/Installer/Installer.wixproj"
end
desc "NUnit Test Runner"
nunit :unitTests => :buildInstaller do |nunit|
nunit.path_to_command = "lib/nunit/net-2.0/nunit-console.exe"
nunit.assemblies "src/WcfRestContrib.Tests/bin/Release/WcfRestContrib.Tests.dll"
nunit.options "/xml=reports/TestResult.xml"
end
desc "Inits the deploy"
task :initDeploy => :unitTests do
Common.EnsurePath(ReleasePath)
end
desc "Deploys the installer"
task :deployInstaller => :initDeploy do
path = "src/Installer/bin/Release/"
File.rename("#{path}WcfRestContrib.msi", "#{ReleasePath}/WcfRestContrib_#{ENV['GO_PIPELINE_LABEL']}.msi")
end
desc "Zips and eploys the application binaries."
zip :deployBinaries => :deployInstaller do |zip|
zip.directories_to_zip "src/WcfRestContrib/bin/Release"
zip.output_file = "WcfRestContrib_#{ENV['GO_PIPELINE_LABEL']}.zip"
zip.output_path = ReleasePath
end
desc "Zips and eploys the application binaries."
zip :deploySample => :deployBinaries do |zip|
zip.directories_to_zip "src/NielsBohrLibrary"
zip.output_file = "WcfRestContribSample_#{ENV['GO_PIPELINE_LABEL']}.zip"
zip.output_path = ReleasePath
end
desc "Prepares the gem files to be packaged."
task :prepareGemFiles => :deploySample do
gem = "gem"
lib = "#{gem}/files/lib"
docs = "#{gem}/files/docs"
pkg = "#{gem}/pkg"
Common.DeleteDirectory(gem)
Common.EnsurePath(lib)
Common.EnsurePath(pkg)
Common.EnsurePath(docs)
Common.CopyFiles("src/WcfRestContrib/bin/Release/*", lib)
Common.CopyFiles("src/docs/**/*", docs)
end
desc "Creates gem"
task :createGem => :prepareGemFiles do
FileUtils.cd("gem/files") do
spec = Gem::Specification.new do |spec|
spec.platform = Gem::Platform::RUBY
spec.summary = "Goodies for .NET WCF Rest"
spec.name = "wcfrestcontrib"
spec.version = "#{ENV['GO_PIPELINE_LABEL']}"
spec.files = Dir["lib/**/*"] + Dir["docs/**/*"]
spec.authors = ["Mike O'Brien"]
spec.homepage = "http://github.com/mikeobrien/WcfRestContrib"
spec.description = "The WCF REST Contrib library adds functionality to the current .NET WCF REST implementation."
end
Rake::GemPackageTask.new(spec) do |package|
package.package_dir = "../pkg"
end
Rake::Task["package"].invoke
end
end
desc "Push the gem to ruby gems"
task :pushGem => :createGem do
result = system("gem", "push", "gem/pkg/wcfrestcontrib-#{ENV['GO_PIPELINE_LABEL']}.gem")
end
desc "Tag the current release"
task :tagRelease do
result = system("git", "tag", "-a", "v#{ENV['GO_PIPELINE_LABEL']}", "-m", "release-v#{ENV['GO_PIPELINE_LABEL']}")
result = system("git", "push", "--tags")
end
Upgrading the rake file.
require "albacore"
require "release/robocopy"
require "release/common"
require "rubygems"
require "rake/gempackagetask"
ReleasePath = "D:/Websites/public.mikeobrien.net/wwwroot/Releases/WcfRestContrib/#{ENV['GO_PIPELINE_LABEL']}"
task :default => [:deploySample]
desc "Inits the build"
task :initBuild do
Common.EnsurePath("reports")
end
desc "Generate assembly info."
assemblyinfo :assemblyInfo => :initBuild do |asm|
asm.version = ENV["GO_PIPELINE_LABEL"]
asm.company_name = "Ultraviolet Catastrophe"
asm.product_name = "Wcf Rest Contrib"
asm.title = "Wcf Rest Contrib"
asm.description = "Goodies for Wcf Rest."
asm.copyright = "Copyright (c) 2010 Ultraviolet Catastrophe"
asm.output_file = "src/WcfRestContrib/Properties/AssemblyInfo.cs"
end
desc "Set assembly version in web.config"
task :setAssemblyVersion => :assemblyInfo do
path = "src/NielsBohrLibrary/Web.config"
project = Common.ReadAllFileText(path)
project = project.gsub("WcfRestContrib, Version=1.0.0.0,", "WcfRestContrib, Version=#{ENV['GO_PIPELINE_LABEL']},")
Common.WriteAllFileText(path, project)
end
desc "Builds the library."
msbuild :buildLibrary => :setAssemblyVersion do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/WcfRestContrib/WcfRestContrib.csproj"
end
desc "Builds the test project."
msbuild :buildTestProject => :buildLibrary do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/WcfRestContrib.Tests/WcfRestContrib.Tests.csproj"
end
desc "Builds the sample app."
msbuild :buildSampleApp => :buildTestProject do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/NielsBohrLibrary/NielsBohrLibrary.csproj"
end
desc "Set assembly reference in the sample project."
task :addSampleAssemblyReference => :buildSampleApp do
path = "src/NielsBohrLibrary/NielsBohrLibrary.csproj"
replace = /<ProjectReference.*<\/ProjectReference>/m
reference = "<Reference Include=\"WcfRestContrib\"><HintPath>bin\WcfRestContrib.dll</HintPath></Reference>"
project = Common.ReadAllFileText(path)
project = project.gsub(replace, reference)
Common.WriteAllFileText(path, project)
end
desc "Builds the installer."
msbuild :buildInstaller => :addSampleAssemblyReference do |msb|
msb.properties :configuration => :Release
msb.targets :Clean, :Build
msb.solution = "src/Installer/Installer.wixproj"
end
desc "NUnit Test Runner"
nunit :unitTests => :buildInstaller do |nunit|
nunit.path_to_command = "lib/nunit/net-2.0/nunit-console.exe"
nunit.assemblies "src/WcfRestContrib.Tests/bin/Release/WcfRestContrib.Tests.dll"
nunit.options "/xml=reports/TestResult.xml"
end
desc "Inits the deploy"
task :initDeploy => :unitTests do
Common.EnsurePath(ReleasePath)
end
desc "Deploys the installer"
task :deployInstaller => :initDeploy do
path = "src/Installer/bin/Release/"
File.rename("#{path}WcfRestContrib.msi", "#{ReleasePath}/WcfRestContrib_#{ENV['GO_PIPELINE_LABEL']}.msi")
end
desc "Zips and eploys the application binaries."
zip :deployBinaries => :deployInstaller do |zip|
zip.directories_to_zip "src/WcfRestContrib/bin/Release"
zip.output_file = "WcfRestContrib_#{ENV['GO_PIPELINE_LABEL']}.zip"
zip.output_path = ReleasePath
end
desc "Zips and eploys the application binaries."
zip :deploySample => :deployBinaries do |zip|
zip.directories_to_zip "src/NielsBohrLibrary"
zip.output_file = "WcfRestContribSample_#{ENV['GO_PIPELINE_LABEL']}.zip"
zip.output_path = ReleasePath
end
desc "Prepares the gem files to be packaged."
task :prepareGemFiles => :deploySample do
gem = "gem"
lib = "#{gem}/files/lib"
docs = "#{gem}/files/docs"
pkg = "#{gem}/pkg"
Common.DeleteDirectory(gem)
Common.EnsurePath(lib)
Common.EnsurePath(pkg)
Common.EnsurePath(docs)
Common.CopyFiles("src/WcfRestContrib/bin/Release/*", lib)
Common.CopyFiles("src/docs/**/*", docs)
end
desc "Creates gem"
task :createGem => :prepareGemFiles do
FileUtils.cd("gem/files") do
spec = Gem::Specification.new do |spec|
spec.platform = Gem::Platform::RUBY
spec.summary = "Goodies for .NET WCF Rest"
spec.name = "wcfrestcontrib"
spec.version = "#{ENV['GO_PIPELINE_LABEL']}"
spec.files = Dir["lib/**/*"] + Dir["docs/**/*"]
spec.authors = ["Mike O'Brien"]
spec.homepage = "http://github.com/mikeobrien/WcfRestContrib"
spec.description = "The WCF REST Contrib library adds functionality to the current .NET WCF REST implementation."
end
Rake::GemPackageTask.new(spec) do |package|
package.package_dir = "../pkg"
end
Rake::Task["package"].invoke
end
end
desc "Push the gem to ruby gems"
task :pushGem => :createGem do
result = system("gem", "push", "gem/pkg/wcfrestcontrib-#{ENV['GO_PIPELINE_LABEL']}.gem")
end
desc "Tag the current release"
task :tagRelease do
result = system("git", "tag", "-a", "v#{ENV['GO_PIPELINE_LABEL']}", "-m", "release-v#{ENV['GO_PIPELINE_LABEL']}")
result = system("git", "push", "--tags")
end
|
# This initializer is for the Sentry exception tracking system.
#
# "Raven" is the ruby library that is the client to sentry, and it's
# config file would be "config/raven.yml". If that config doesn't exist,
# nothing happens. If it *does*, we register a callback with Canvas::Errors
# so that every time an exception is reported, we can fire off a sentry
# call to track it and aggregate it for us.
settings = ConfigFile.load("raven")
if settings.present?
require "raven/base"
Raven.configure do |config|
config.silence_ready = true
config.dsn = settings[:dsn]
config.tags = settings.fetch(:tags, {}).merge('canvas_revision' => Canvas.revision)
config.release = Canvas.revision
config.sanitize_fields += Rails.application.config.filter_parameters.map(&:to_s)
config.sanitize_credit_cards = false
config.excluded_exceptions += %w{
AuthenticationMethods::AccessTokenError
ActionController::InvalidAuthenticityToken
}
end
Rails.configuration.to_prepare do
Canvas::Errors.register!(:sentry_notification) do |exception, data|
setting = Setting.get("sentry_error_logging_enabled", 'true')
SentryProxy.capture(exception, data) if setting == 'true'
end
end
end
have sentry use our configured rails logger
Change-Id: I31863e1a2f040b27a35c8b3d9c1ccb1539b67945
Reviewed-on: https://gerrit.instructure.com/71156
Tested-by: Jenkins
Reviewed-by: Simon Williams <088e16a1019277b15d58faf0541e11910eb756f6@instructure.com>
Product-Review: Brian Palmer <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@instructure.com>
QA-Review: Brian Palmer <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@instructure.com>
# This initializer is for the Sentry exception tracking system.
#
# "Raven" is the ruby library that is the client to sentry, and it's
# config file would be "config/raven.yml". If that config doesn't exist,
# nothing happens. If it *does*, we register a callback with Canvas::Errors
# so that every time an exception is reported, we can fire off a sentry
# call to track it and aggregate it for us.
settings = ConfigFile.load("raven")
if settings.present?
require "raven/base"
Raven.configure do |config|
config.logger = Rails.logger
config.silence_ready = true
config.dsn = settings[:dsn]
config.tags = settings.fetch(:tags, {}).merge('canvas_revision' => Canvas.revision)
config.release = Canvas.revision
config.sanitize_fields += Rails.application.config.filter_parameters.map(&:to_s)
config.sanitize_credit_cards = false
config.excluded_exceptions += %w{
AuthenticationMethods::AccessTokenError
ActionController::InvalidAuthenticityToken
}
end
Rails.configuration.to_prepare do
Canvas::Errors.register!(:sentry_notification) do |exception, data|
setting = Setting.get("sentry_error_logging_enabled", 'true')
SentryProxy.capture(exception, data) if setting == 'true'
end
end
end
|
Adds missing sentry config file
if ENV['SENTRY_DSN']
require 'sentry-raven'
Raven.configure do |config|
config.dsn = ENV['SENTRY_DSN']
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
end
end
|
# frozen_string_literal: true
require "datadog/statsd" if Rails.env.production?
require "./lib/github_classroom/null_statsd"
module GitHubClassroom
APP_NAME = ENV["HEROKU_APP_NAME"] || "github-classroom"
DYNO = ENV["DYNO"] || 1
def self.statsd
@statsd ||= if Rails.env.production?
::Datadog::Statsd.new("localhost", 8125, tags: ["application:#{APP_NAME}", "dyno_id:#{DYNO}"])
else
::GitHubClassroom::NullStatsD.new
end
end
end
ActiveSupport::Notifications.subscribe('process_action.action_controller') do |_name, start_time, finish_time, _id, payload|
next if payload[:path] =~ /\A\/peek/
total_time = finish_time - start_time
GitHubClassroom.statsd.timing("request.response_time", total_time)
end
hound
# frozen_string_literal: true
require "datadog/statsd" if Rails.env.production?
require "./lib/github_classroom/null_statsd"
module GitHubClassroom
APP_NAME = ENV["HEROKU_APP_NAME"] || "github-classroom"
DYNO = ENV["DYNO"] || 1
def self.statsd
@statsd ||= if Rails.env.production?
::Datadog::Statsd.new("localhost", 8125, tags: ["application:#{APP_NAME}", "dyno_id:#{DYNO}"])
else
::GitHubClassroom::NullStatsD.new
end
end
end
ActiveSupport::Notifications.subscribe("process_action.action_controller") do |_, start_time, finish_time, _id, payload|
next if payload[:path].match? %r{\A\/peek/}
total_time = finish_time - start_time
GitHubClassroom.statsd.timing("request.response_time", total_time)
end
|
# https://devcenter.heroku.com/articles/config-vars
if ENV['STRIPE_PUBLISHABLE_KEY'].nil?
Rails.logger.warn('STRIPE_PUBLISHABLE_KEY undefined')
end
if ENV['STRIPE_SECRET_KEY'].nil?
Rails.logger.warn('STRIPE_SECRET_KEY undefined')
end
::STRIPE_PUBLISHABLE_KEY = ENV['STRIPE_PUBLISHABLE_KEY']
Stripe.api_key = ENV['STRIPE_SECRET_KEY']
StripeEvent.signing_secret = ENV['STRIPE_SIGNING_SECRET']
# Using `reloader.to_prepare` per
# https://github.com/integrallis/stripe_event/issues/134
Rails.application.reloader.to_prepare do
StripeEvent.configure do |events|
events.subscribe 'charge.', Stripe::ChargeEventHandler.new
end
end
Try reverting this change to attempt to fix Stripe integration
# https://devcenter.heroku.com/articles/config-vars
if ENV['STRIPE_PUBLISHABLE_KEY'].nil?
Rails.logger.warn('STRIPE_PUBLISHABLE_KEY undefined')
end
if ENV['STRIPE_SECRET_KEY'].nil?
Rails.logger.warn('STRIPE_SECRET_KEY undefined')
end
::STRIPE_PUBLISHABLE_KEY = ENV['STRIPE_PUBLISHABLE_KEY']
Stripe.api_key = ENV['STRIPE_SECRET_KEY']
StripeEvent.signing_secret = ENV['STRIPE_SIGNING_SECRET']
# Using `reloader.to_prepare` per
# https://github.com/integrallis/stripe_event/issues/134
StripeEvent.configure do |events|
events.subscribe 'charge.', Stripe::ChargeEventHandler.new
end
|
require 'base64'
require_dependency 'carto/user_authenticator'
require_dependency 'carto/email_cleaner'
Rails.configuration.middleware.use RailsWarden::Manager do |manager|
manager.default_strategies :password, :api_authentication
manager.failure_app = SessionsController
end
module LoginEventTrigger
def trigger_login_event(user)
CartoGearsApi::Events::EventManager.instance.notify(CartoGearsApi::Events::UserLoginEvent.new(user))
# From the very beginning it's been assumed that after login you go to the dashboard, and
# we're using that event as a synonymous to "last logged in date". Now you can skip dashboard
# after login (see #11946), so marking that event on authentication is more accurate with the
# meaning (although not with the name).
user.view_dashboard
end
end
# Setup Session Serialization
class Warden::SessionSerializer
def serialize(user)
user.username
end
def deserialize(username)
::User.filter(username: username).first
end
end
Warden::Strategies.add(:password) do
include Carto::UserAuthenticator
include Carto::EmailCleaner
include LoginEventTrigger
def valid_password_strategy_for_user(user)
user.organization.nil? || user.organization.auth_username_password_enabled
end
def authenticate!
if params[:email] && params[:password]
if (user = authenticate(clean_email(params[:email]), params[:password]))
if user.enabled? && valid_password_strategy_for_user(user)
trigger_login_event(user)
success!(user, :message => "Success")
request.flash['logged'] = true
elsif !user.enable_account_token.nil?
throw(:warden, :action => 'account_token_authentication_error', :user_id => user.id)
else
fail!
end
else
fail!
end
else
fail!
end
end
end
Warden::Strategies.add(:enable_account_token) do
include LoginEventTrigger
def authenticate!
if params[:id]
user = ::User.where(enable_account_token: params[:id]).first
if user
user.enable_account_token = nil
user.save
trigger_login_event(user)
success!(user)
else
fail!
end
else
fail!
end
end
end
Warden::Strategies.add(:oauth) do
include LoginEventTrigger
def valid_oauth_strategy_for_user(user)
user.organization.nil? || user.organization.auth_github_enabled
end
def authenticate!
fail! unless params[:oauth_api]
oauth_api = params[:oauth_api]
user = oauth_api.user
if user && oauth_api.config.valid_method_for?(user)
trigger_login_event(user)
success!(user)
else
fail!
end
end
end
Warden::Strategies.add(:ldap) do
include LoginEventTrigger
def authenticate!
(fail! and return) unless (params[:email] && params[:password])
user = nil
begin
user = Carto::Ldap::Manager.new.authenticate(params[:email], params[:password])
rescue Carto::Ldap::LDAPUserNotPresentAtCartoDBError => exception
throw(:warden, action: 'ldap_user_not_at_cartodb',
cartodb_username: exception.cartodb_username, organization_id: exception.organization_id,
ldap_username: exception.ldap_username, ldap_email: exception.ldap_email)
end
# Fails, but do not stop processin other strategies (allows fallbacks)
return unless user
trigger_login_event(user)
success!(user, :message => "Success")
request.flash['logged'] = true
end
end
Warden::Strategies.add(:api_authentication) do
def authenticate!
# WARNING: The following code is a modified copy of the oauth10_token method from
# oauth-plugin-0.4.0.pre4/lib/oauth/controllers/application_controller_methods.rb
# It also checks token class like does the oauth10_access_token method of that same file
if ClientApplication.verify_request(request) do |request_proxy|
@oauth_token = ClientApplication.find_token(request_proxy.token)
if @oauth_token.respond_to?(:provided_oauth_verifier=)
@oauth_token.provided_oauth_verifier=request_proxy.oauth_verifier
end
# return the token secret and the consumer secret
[(@oauth_token.nil? ? nil : @oauth_token.secret), (@oauth_token.nil? || @oauth_token.client_application.nil? ? nil : @oauth_token.client_application.secret)]
end
if @oauth_token && @oauth_token.is_a?(::AccessToken)
user = ::User.find_with_custom_fields(@oauth_token.user_id)
if user.enable_account_token.nil?
success!(user) and return
else
throw(:warden, :action => 'account_token_authentication_error', :user_id => user.id)
end
end
end
throw(:warden)
end
end
Warden::Strategies.add(:api_key) do
def valid?
params[:api_key].present?
end
# We don't want to store a session and send a response cookie
def store?
false
end
def authenticate!
begin
if (api_key = params[:api_key]) && api_key.present?
user_name = CartoDB.extract_subdomain(request)
if $users_metadata.HMGET("rails:users:#{user_name}", "map_key").first == api_key
user_id = $users_metadata.HGET "rails:users:#{user_name}", 'id'
return fail! if user_id.blank?
user = ::User[user_id]
success!(user)
else
return fail!
end
else
return fail!
end
rescue
return fail!
end
end
end
Warden::Strategies.add(:http_header_authentication) do
include LoginEventTrigger
def valid?
Carto::HttpHeaderAuthentication.new.valid?(request)
end
def authenticate!
user = Carto::HttpHeaderAuthentication.new.get_user(request)
return fail! unless user.present?
trigger_login_event(user)
success!(user)
rescue => e
CartoDB.report_exception(e, "Authenticating with http_header_authentication", user: user)
return fail!
end
end
Warden::Strategies.add(:saml) do
include LoginEventTrigger
include Carto::EmailCleaner
def organization_from_request
subdomain = CartoDB.extract_subdomain(request)
Carto::Organization.where(name: subdomain).first if subdomain
end
def saml_service(organization = organization_from_request)
Carto::SamlService.new(organization) if organization
end
def valid?
params[:SAMLResponse].present? && saml_service.try(:enabled?)
end
def authenticate!
organization = organization_from_request
saml_service = Carto::SamlService.new(organization)
email = clean_email(saml_service.get_user_email(params[:SAMLResponse]))
user = organization.users.where(email: email).first
if user
if user.try(:enabled?)
trigger_login_event(user)
success!(user, message: "Success")
request.flash['logged'] = true
else
fail!
end
else
throw(:warden,
action: 'saml_user_not_in_carto',
organization_id: organization.id,
saml_email: email)
end
rescue => e
CartoDB::Logger.error(message: "Authenticating with SAML", exception: e)
return fail!
end
end
# @see ApplicationController.update_session_security_token
Warden::Manager.after_set_user except: :fetch do |user, auth, opts|
auth.session(opts[:scope])[:sec_token] = Digest::SHA1.hexdigest(user.crypted_password)
# Only at the editor, and only after new authentications, destroy other sessions
# @see #4656
warden_proxy = auth.env['warden']
# On testing there is no warden global so we cannot run this logic
if warden_proxy
warden_sessions = auth.env['rack.session'].to_hash.select do |key, _|
key.start_with?("warden.user") && !key.end_with?(".session")
end
warden_sessions.each do |_, value|
unless value == user.username
warden_proxy.logout(value) if warden_proxy.authenticated?(value)
end
end
end
end
Warden::Strategies.add(:user_creation) do
include LoginEventTrigger
def authenticate!
username = params[:username]
user = ::User.where(username: username).first
return fail! unless user
user_creation = Carto::UserCreation.where(user_id: user.id).first
return fail! unless user_creation
if user_creation.autologin?
trigger_login_event(user)
success!(user, :message => "Success")
else
fail!
end
end
end
module Carto::Api::AuthApiAuthentication
# We don't want to store a session and send a response cookie
def store?
false
end
def valid?
base64_auth.present? || params[:api_key].present?
end
def base64_auth
match = AUTH_HEADER_RE.match(request.headers['Authorization'])
match && match[:auth]
end
def authenticate_user(require_master_key)
if base64_auth.present?
decoded_auth = Base64.decode64(base64_auth)
user_name, token = decoded_auth.split(':')
return fail! unless user_name == CartoDB.extract_subdomain(request)
else
token = params[:api_key]
user_name = CartoDB.extract_subdomain(request)
end
user_id = $users_metadata.HGET("rails:users:#{user_name}", 'id')
api_key = Carto::ApiKey.where(user_id: user_id, token: token)
api_key = require_master_key ? api_key.master : api_key
unless api_key.exists?
user = ::User[user_id]
return success!(user) if user.api_key == token
end
return fail! unless api_key.exists?
success!(::User[user_id])
rescue
fail!
end
def request_api_key
return @request_api_key if @request_api_key
if base64_auth.present?
decoded_auth = Base64.decode64(base64_auth)
user_name, token = decoded_auth.split(':')
user_id = $users_metadata.HGET("rails:users:#{user_name}", 'id')
else
token = params[:api_key]
user_name = CartoDB.extract_subdomain(request)
user_id = $users_metadata.HGET "rails:users:#{user_name}", 'id'
end
@request_api_key = Carto::ApiKey.where(user_id: user_id, token: token).first
# TODO: remove this block when all api keys are in sync
if !@request_api_key && (user = ::User[user_id]).api_key == token
@request_api_key = user.api_keys.create_in_memory_master
end
@request_api_key
end
private
AUTH_HEADER_RE = /basic\s(?<auth>\w+)/i
end
Warden::Strategies.add(:auth_api) do
include Carto::Api::AuthApiAuthentication
def authenticate!
authenticate_user(true)
end
end
Warden::Strategies.add(:any_auth_api) do
include Carto::Api::AuthApiAuthentication
def authenticate!
authenticate_user(false)
end
end
remove old auth strategy
require 'base64'
require_dependency 'carto/user_authenticator'
require_dependency 'carto/email_cleaner'
Rails.configuration.middleware.use RailsWarden::Manager do |manager|
manager.default_strategies :password, :api_authentication
manager.failure_app = SessionsController
end
module LoginEventTrigger
def trigger_login_event(user)
CartoGearsApi::Events::EventManager.instance.notify(CartoGearsApi::Events::UserLoginEvent.new(user))
# From the very beginning it's been assumed that after login you go to the dashboard, and
# we're using that event as a synonymous to "last logged in date". Now you can skip dashboard
# after login (see #11946), so marking that event on authentication is more accurate with the
# meaning (although not with the name).
user.view_dashboard
end
end
# Setup Session Serialization
class Warden::SessionSerializer
def serialize(user)
user.username
end
def deserialize(username)
::User.filter(username: username).first
end
end
Warden::Strategies.add(:password) do
include Carto::UserAuthenticator
include Carto::EmailCleaner
include LoginEventTrigger
def valid_password_strategy_for_user(user)
user.organization.nil? || user.organization.auth_username_password_enabled
end
def authenticate!
if params[:email] && params[:password]
if (user = authenticate(clean_email(params[:email]), params[:password]))
if user.enabled? && valid_password_strategy_for_user(user)
trigger_login_event(user)
success!(user, :message => "Success")
request.flash['logged'] = true
elsif !user.enable_account_token.nil?
throw(:warden, :action => 'account_token_authentication_error', :user_id => user.id)
else
fail!
end
else
fail!
end
else
fail!
end
end
end
Warden::Strategies.add(:enable_account_token) do
include LoginEventTrigger
def authenticate!
if params[:id]
user = ::User.where(enable_account_token: params[:id]).first
if user
user.enable_account_token = nil
user.save
trigger_login_event(user)
success!(user)
else
fail!
end
else
fail!
end
end
end
Warden::Strategies.add(:oauth) do
include LoginEventTrigger
def valid_oauth_strategy_for_user(user)
user.organization.nil? || user.organization.auth_github_enabled
end
def authenticate!
fail! unless params[:oauth_api]
oauth_api = params[:oauth_api]
user = oauth_api.user
if user && oauth_api.config.valid_method_for?(user)
trigger_login_event(user)
success!(user)
else
fail!
end
end
end
Warden::Strategies.add(:ldap) do
include LoginEventTrigger
def authenticate!
(fail! and return) unless (params[:email] && params[:password])
user = nil
begin
user = Carto::Ldap::Manager.new.authenticate(params[:email], params[:password])
rescue Carto::Ldap::LDAPUserNotPresentAtCartoDBError => exception
throw(:warden, action: 'ldap_user_not_at_cartodb',
cartodb_username: exception.cartodb_username, organization_id: exception.organization_id,
ldap_username: exception.ldap_username, ldap_email: exception.ldap_email)
end
# Fails, but do not stop processin other strategies (allows fallbacks)
return unless user
trigger_login_event(user)
success!(user, :message => "Success")
request.flash['logged'] = true
end
end
Warden::Strategies.add(:api_authentication) do
def authenticate!
# WARNING: The following code is a modified copy of the oauth10_token method from
# oauth-plugin-0.4.0.pre4/lib/oauth/controllers/application_controller_methods.rb
# It also checks token class like does the oauth10_access_token method of that same file
if ClientApplication.verify_request(request) do |request_proxy|
@oauth_token = ClientApplication.find_token(request_proxy.token)
if @oauth_token.respond_to?(:provided_oauth_verifier=)
@oauth_token.provided_oauth_verifier=request_proxy.oauth_verifier
end
# return the token secret and the consumer secret
[(@oauth_token.nil? ? nil : @oauth_token.secret), (@oauth_token.nil? || @oauth_token.client_application.nil? ? nil : @oauth_token.client_application.secret)]
end
if @oauth_token && @oauth_token.is_a?(::AccessToken)
user = ::User.find_with_custom_fields(@oauth_token.user_id)
if user.enable_account_token.nil?
success!(user) and return
else
throw(:warden, :action => 'account_token_authentication_error', :user_id => user.id)
end
end
end
throw(:warden)
end
end
Warden::Strategies.add(:http_header_authentication) do
include LoginEventTrigger
def valid?
Carto::HttpHeaderAuthentication.new.valid?(request)
end
def authenticate!
user = Carto::HttpHeaderAuthentication.new.get_user(request)
return fail! unless user.present?
trigger_login_event(user)
success!(user)
rescue => e
CartoDB.report_exception(e, "Authenticating with http_header_authentication", user: user)
return fail!
end
end
Warden::Strategies.add(:saml) do
include LoginEventTrigger
include Carto::EmailCleaner
def organization_from_request
subdomain = CartoDB.extract_subdomain(request)
Carto::Organization.where(name: subdomain).first if subdomain
end
def saml_service(organization = organization_from_request)
Carto::SamlService.new(organization) if organization
end
def valid?
params[:SAMLResponse].present? && saml_service.try(:enabled?)
end
def authenticate!
organization = organization_from_request
saml_service = Carto::SamlService.new(organization)
email = clean_email(saml_service.get_user_email(params[:SAMLResponse]))
user = organization.users.where(email: email).first
if user
if user.try(:enabled?)
trigger_login_event(user)
success!(user, message: "Success")
request.flash['logged'] = true
else
fail!
end
else
throw(:warden,
action: 'saml_user_not_in_carto',
organization_id: organization.id,
saml_email: email)
end
rescue => e
CartoDB::Logger.error(message: "Authenticating with SAML", exception: e)
return fail!
end
end
# @see ApplicationController.update_session_security_token
Warden::Manager.after_set_user except: :fetch do |user, auth, opts|
auth.session(opts[:scope])[:sec_token] = Digest::SHA1.hexdigest(user.crypted_password)
# Only at the editor, and only after new authentications, destroy other sessions
# @see #4656
warden_proxy = auth.env['warden']
# On testing there is no warden global so we cannot run this logic
if warden_proxy
warden_sessions = auth.env['rack.session'].to_hash.select do |key, _|
key.start_with?("warden.user") && !key.end_with?(".session")
end
warden_sessions.each do |_, value|
unless value == user.username
warden_proxy.logout(value) if warden_proxy.authenticated?(value)
end
end
end
end
Warden::Strategies.add(:user_creation) do
include LoginEventTrigger
def authenticate!
username = params[:username]
user = ::User.where(username: username).first
return fail! unless user
user_creation = Carto::UserCreation.where(user_id: user.id).first
return fail! unless user_creation
if user_creation.autologin?
trigger_login_event(user)
success!(user, :message => "Success")
else
fail!
end
end
end
module Carto::Api::AuthApiAuthentication
# We don't want to store a session and send a response cookie
def store?
false
end
def valid?
base64_auth.present? || params[:api_key].present?
end
def base64_auth
match = AUTH_HEADER_RE.match(request.headers['Authorization'])
match && match[:auth]
end
def authenticate_user(require_master_key)
if base64_auth.present?
decoded_auth = Base64.decode64(base64_auth)
user_name, token = decoded_auth.split(':')
return fail! unless user_name == CartoDB.extract_subdomain(request)
else
token = params[:api_key]
user_name = CartoDB.extract_subdomain(request)
end
user_id = $users_metadata.HGET("rails:users:#{user_name}", 'id')
api_key = Carto::ApiKey.where(user_id: user_id, token: token)
api_key = require_master_key ? api_key.master : api_key
unless api_key.exists?
user = ::User[user_id]
return success!(user) if user.api_key == token
end
return fail! unless api_key.exists?
success!(::User[user_id])
rescue
fail!
end
def request_api_key
return @request_api_key if @request_api_key
if base64_auth.present?
decoded_auth = Base64.decode64(base64_auth)
user_name, token = decoded_auth.split(':')
user_id = $users_metadata.HGET("rails:users:#{user_name}", 'id')
else
token = params[:api_key]
user_name = CartoDB.extract_subdomain(request)
user_id = $users_metadata.HGET "rails:users:#{user_name}", 'id'
end
@request_api_key = Carto::ApiKey.where(user_id: user_id, token: token).first
# TODO: remove this block when all api keys are in sync
if !@request_api_key && (user = ::User[user_id]).api_key == token
@request_api_key = user.api_keys.create_in_memory_master
end
@request_api_key
end
private
AUTH_HEADER_RE = /basic\s(?<auth>\w+)/i
end
Warden::Strategies.add(:auth_api) do
include Carto::Api::AuthApiAuthentication
def authenticate!
authenticate_user(true)
end
end
Warden::Strategies.add(:any_auth_api) do
include Carto::Api::AuthApiAuthentication
def authenticate!
authenticate_user(false)
end
end
|
Pod::Spec.new do |s|
s.name = 'CJPAdController'
s.version = '1.7.1'
s.summary = 'A simple, easy way to add iAd and AdMob ads to a view controller.'
s.description = <<-DESC
CJPAdController is a singleton class allowing easy implementation of iAd and AdMob ads in your iOS app. It supports all devices and orientations.
* Choose which one serves as your default ads, and the other will show whenever an ad is not available.
* Option to display the ads at the top or the bottom of your views.
* Automatically hides from view when there are no ads to display.
* Support for removing ads permanently, for example if you have set up an in-app purchase to remove them.
DESC
s.screenshots = ['http://i.imgur.com/dxUHvLK.png', 'http://i.imgur.com/rvdpr2Z.png']
s.license = 'MIT'
s.homepage = 'http://chrisphillips.co.uk'
s.author = { 'Chris Phillips' => 'chrisjp88@gmail.com' }
s.social_media_url = 'http://twitter.com/ChrisJP88'
s.platform = :ios, '6.0'
s.source = {
:git => 'https://github.com/chrisjp/CJPAdController.git',
:tag => s.version.to_s
}
s.source_files = 'CJPAdController/*.{h,m}'
s.frameworks = 'iAd', 'AdSupport'
s.requires_arc = true
s.dependency 'Google-Mobile-Ads-SDK', '~> 7.5'
s.pod_target_xcconfig = {
'FRAMEWORK_SEARCH_PATHS' => '$(PODS_ROOT)/Google-Mobile-Ads-SDK/**',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => '1'
}
end
value should be YES, not 1
Pod::Spec.new do |s|
s.name = 'CJPAdController'
s.version = '1.7.1'
s.summary = 'A simple, easy way to add iAd and AdMob ads to a view controller.'
s.description = <<-DESC
CJPAdController is a singleton class allowing easy implementation of iAd and AdMob ads in your iOS app. It supports all devices and orientations.
* Choose which one serves as your default ads, and the other will show whenever an ad is not available.
* Option to display the ads at the top or the bottom of your views.
* Automatically hides from view when there are no ads to display.
* Support for removing ads permanently, for example if you have set up an in-app purchase to remove them.
DESC
s.screenshots = ['http://i.imgur.com/dxUHvLK.png', 'http://i.imgur.com/rvdpr2Z.png']
s.license = 'MIT'
s.homepage = 'http://chrisphillips.co.uk'
s.author = { 'Chris Phillips' => 'chrisjp88@gmail.com' }
s.social_media_url = 'http://twitter.com/ChrisJP88'
s.platform = :ios, '6.0'
s.source = {
:git => 'https://github.com/chrisjp/CJPAdController.git',
:tag => s.version.to_s
}
s.source_files = 'CJPAdController/*.{h,m}'
s.frameworks = 'iAd', 'AdSupport'
s.requires_arc = true
s.dependency 'Google-Mobile-Ads-SDK', '~> 7.5'
s.pod_target_xcconfig = {
'FRAMEWORK_SEARCH_PATHS' => '$(PODS_ROOT)/Google-Mobile-Ads-SDK/**',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES'
}
end |
require 'test_helper'
class UserTest < ActiveSupport::TestCase
def setup
@user = User.new(name: Faker::Name.name, email: 'user@example.com',
password: 'foobar', password_confirmation: 'foobar',
telephone: Faker::PhoneNumber.phone_number, dob: Faker::Date.between(70.years.ago, 18.years.ago),
privilege: 1)
end
test 'should be valid' do
assert @user.valid?
end
test 'name should be present' do
@user.name = ' '
assert_not @user.valid?
end
test 'name should not be too long' do
@user.name = 'a' * 51
assert_not @user.valid?
end
test 'dob should be present' do
@user.dob = ''
assert_not @user.valid?
end
test 'dob should be before today' do
@user.dob = Date.today
assert_not @user.valid?
@user.dob = Date.today >> 6
assert_not @user.valid?
end
test 'telephone should be present' do
@user.telephone = ''
assert_not @user.valid?
end
test 'telephone should not be too long' do
@user.telephone = '1' * 17
assert_not @user.valid?
end
test 'email should be present' do
@user.email = ' '
assert_not @user.valid?
end
test 'email should not be too long' do
@user.email = 'a' * 244 + '@example.com'
assert_not @user.valid?
end
test 'email validation should accept valid addresses' do
valid_addresses = %w[user@example.com USER@foo.COM A_US-ER@foo.bar.org
first.last@foo.jp alice+bob@baz.cn]
valid_addresses.each do |valid_address|
@user.email = valid_address
assert @user.valid?, "#{valid_address.inspect} should be valid"
end
end
test 'email validation should reject invalid addresses' do
invalid_addresses = %w[user@example,com user_at_foo.org user.name@example.
foo@bar_baz.com foo@bar+baz.com]
invalid_addresses.each do |invalid_address|
@user.email = invalid_address
assert_not @user.valid?, "#{invalid_address.inspect} should be invalid"
end
end
test 'email addresses should be unique' do
duplicate_user = @user.dup
duplicate_user.email = @user.email.upcase
@user.save
assert_not duplicate_user.valid?
end
test 'email addresses should be saved as lower-case' do
mixed_case_email = 'Foo@ExAMPle.CoM'
@user.email = mixed_case_email
@user.save
assert_equal mixed_case_email.downcase, @user.reload.email
end
end
Validate and test privilege levels for a user.
require 'test_helper'
class UserTest < ActiveSupport::TestCase
def setup
@user = User.new(name: Faker::Name.name, email: 'user@example.com',
password: 'foobar', password_confirmation: 'foobar',
telephone: Faker::PhoneNumber.phone_number, dob: Faker::Date.between(70.years.ago, 18.years.ago),
privilege: 1)
end
test 'should be valid' do
assert @user.valid?
end
test 'name should be present' do
@user.name = ' '
assert_not @user.valid?
end
test 'name should not be too long' do
@user.name = 'a' * 51
assert_not @user.valid?
end
test 'dob should be present' do
@user.dob = ''
assert_not @user.valid?
end
test 'dob should be before today' do
@user.dob = Date.today
assert_not @user.valid?
@user.dob = Date.today >> 6
assert_not @user.valid?
end
test 'privilege should be present' do
@user.privilege = nil
assert_not @user.valid?
end
test 'invalid privilege level' do
@user.privilege = -1
assert_not @user.valid?
@user.privilege = 3
assert_not @user.valid?
@user.privilege = Faker::Lorem.word
assert_not @user.valid?
end
test 'telephone should be present' do
@user.telephone = ''
assert_not @user.valid?
end
test 'telephone should not be too long' do
@user.telephone = '1' * 17
assert_not @user.valid?
end
test 'email should be present' do
@user.email = ' '
assert_not @user.valid?
end
test 'email should not be too long' do
@user.email = 'a' * 244 + '@example.com'
assert_not @user.valid?
end
test 'email validation should accept valid addresses' do
valid_addresses = %w[user@example.com USER@foo.COM A_US-ER@foo.bar.org
first.last@foo.jp alice+bob@baz.cn]
valid_addresses.each do |valid_address|
@user.email = valid_address
assert @user.valid?, "#{valid_address.inspect} should be valid"
end
end
test 'email validation should reject invalid addresses' do
invalid_addresses = %w[user@example,com user_at_foo.org user.name@example.
foo@bar_baz.com foo@bar+baz.com]
invalid_addresses.each do |invalid_address|
@user.email = invalid_address
assert_not @user.valid?, "#{invalid_address.inspect} should be invalid"
end
end
test 'email addresses should be unique' do
duplicate_user = @user.dup
duplicate_user.email = @user.email.upcase
@user.save
assert_not duplicate_user.valid?
end
test 'email addresses should be saved as lower-case' do
mixed_case_email = 'Foo@ExAMPle.CoM'
@user.email = mixed_case_email
@user.save
assert_equal mixed_case_email.downcase, @user.reload.email
end
end
|
id = 'spellbook'
times = 10
require 'open-uri'
require 'em-http-request'
require 'async-rack'
require 'rest-graph'
use Rack::ContentType
use Rack::Reloader
module RG
module_function
def create env
RestGraph.new(:log_method => env['rack.logger'].method(:debug))
end
end
run Rack::Builder.new{
map('/async'){
run lambda{ |env|
RG.create(env).multi(*([[:get, id]]*times)){ |r|
env['async.callback'].call [200, {}, r.map(&:inspect)]
}
throw :async
}
}
map('/sync'){
run lambda{ |env|
[200, {}, (0...times).map{ RG.create(env).get(id) }.map(&:inspect)]
}
}
}
don't query me lol...
id = '4'
times = 10
require 'open-uri'
require 'em-http-request'
require 'async-rack'
require 'rest-graph'
use Rack::ContentType
use Rack::Reloader
module RG
module_function
def create env
RestGraph.new(:log_method => env['rack.logger'].method(:debug))
end
end
run Rack::Builder.new{
map('/async'){
run lambda{ |env|
RG.create(env).multi(*([[:get, id]]*times)){ |r|
env['async.callback'].call [200, {}, r.map(&:inspect)]
}
throw :async
}
}
map('/sync'){
run lambda{ |env|
[200, {}, (0...times).map{ RG.create(env).get(id) }.map(&:inspect)]
}
}
}
|
# CorePage will be the basis for all other pages we create,
# there should be an instance of this page saved in the @world object upon each scenario's creation.
# Eventually this page will become the recorder/basis for how we will record interactions with the DB and others.
class CorePage
### Setup ###
#############
def initialize(world, root_page=false)
@world = world
@ledger = @world.ledger
unless root_page
@elements = {}
create_common_elements
create_elements
end
end
### Step Definition Methods ###
###############################
def fill(data_name=nil)
data_name ||= @world.data_target
data = input_data(data_name)
raise ArgumentError, "ERROR: Method: [input_data] of class [#{self.class}] should return a Hash\n" unless data.class == Hash
data.each_key do |element_name|
raise 'Element in data set does not exist on the page!' unless @elements.keys.include?(element_name)
@elements[element_name].fill(data[element_name])
end
end
def click_on(element_name)
@elements[element_name].click
end
def hover_over(element_name)
@elements[element_name].hover
end
def validate_content
data = expected_data()
raise ArgumentError, "ERROR: Method: [expected_data] of class [#{self.class}] should return a Hash\n" unless data.class == Hash
@world.validation_engine.enter_validation_mode
@elements.values.each do |element|
element.validate(data[element.name])
end
@world.validation_engine.exit_validation_mode
end
### Data ###
############
def input_data(data_name)
@world.data_engine.get_input_data(yml_file, data_name)
end
def expected_data(data_name = "DEFAULT")
@world.data_engine.get_expected_data(yml_file, data_name)
end
def yml_file
#The extra long gunk here basically just looks for the file that has the 'create_elements' method defined inside it and replaces the .rb extension with .yml
self.class.instance_method(:create_elements).source_location.first.gsub(/\.rb$/,".yml")
end
def browser
@world.browser
end
end
create new helper methods matching the api defined in core page
# CorePage will be the basis for all other pages we create,
# there should be an instance of this page saved in the @world object upon each scenario's creation.
# Eventually this page will become the recorder/basis for how we will record interactions with the DB and others.
class CorePage
### Setup ###
#############
def initialize(world, root_page=false)
@world = world
@ledger = @world.ledger
unless root_page
@elements = {}
create_common_elements
create_elements
end
end
### Step Definition Methods ###
###############################
def fill(data_name=nil)
data_name ||= @world.data_target
data = input_data(data_name)
raise ArgumentError, "ERROR: Method: [input_data] of class [#{self.class}] should return a Hash\n" unless data.class == Hash
data.each_key do |element_name|
raise 'Element in data set does not exist on the page!' unless @elements.keys.include?(element_name)
@elements[element_name].fill(data[element_name])
end
end
def click_on(element_name)
@elements[element_name].click
end
def hover_over(element_name)
@elements[element_name].hover
end
def activate(element_name)
@elements[element_name].activate
end
def deactivate(element_name)
@elements[element_name].deactivate
end
def wait_for(element_name, timeout: 3)
CoreUtils.wait_until(timeout) { @elements[element_name].present? }
end
def validate_content
data = expected_data()
raise ArgumentError, "ERROR: Method: [expected_data] of class [#{self.class}] should return a Hash\n" unless data.class == Hash
@world.validation_engine.enter_validation_mode
@elements.values.each do |element|
element.validate(data[element.name])
end
@world.validation_engine.exit_validation_mode
end
### Data ###
############
def input_data(data_name)
@world.data_engine.get_input_data(yml_file, data_name)
end
def expected_data(data_name = "DEFAULT")
@world.data_engine.get_expected_data(yml_file, data_name)
end
def yml_file
#The extra long gunk here basically just looks for the file that has the 'create_elements' method defined inside it and replaces the .rb extension with .yml
self.class.instance_method(:create_elements).source_location.first.gsub(/\.rb$/,".yml")
end
def browser
@world.browser
end
end |
Initial commit
# A Nested Array to Model a Bingo Board SOLO CHALLENGE
# I spent [#] hours on this challenge.
# Release 0: Pseudocode
# Outline:
=begin
# Create a method to generate a letter ( b, i, n, g, o) and a number (1-100)
#fill in the outline here
Create an array with the symbols B, I, N, G, O
Shuffle the array
Pick the first element of this array to get a letter - call it L
Randomly choose an integer between 1 and 100 - call it N
# Check the called column for the number called.
#fill in the outline here
FOR row in 1 to 5
Check whether the L-th entry in row equals N
# If the number is in the column, replace with an 'x'
#fill in the outline here
IF TRUE
Replace N with the symbol X
# Display a column to the console
#fill in the outline here
Let C = column number
FOR row in 1 to 5
Print the C-th element of row
# Display the board to the console (prettily)
#fill in the outline here
FOR board_row in 1 to 5
FOR board_column in 1 to 5
Print board_column
=end
# Initial Solution
class BingoBoard
def initialize(board)
@bingo_board = board
end
# Create a method to generate a letter ( b, i, n, g, o) and a number (1-100)
def call
@letters = {'B' => 0, 'I' => 1, 'N' => 2, 'G' => 3, 'O' => 4}
@letter_keys = @letters.keys
@call_letter = @letter_keys.shuffle[0]
#@call_letter = 'I'
@call_number = 1 + rand(99)
#@call_number = 31
return [@call_letter, @call_number]
#return ['B', 22]
end
# Check the called column for the number called.
def check
@bingo_board.each do |row|
if row[@letters[@call_letter]] == @call_number
row[@letters[@call_letter]] = 'X'
#p row
end
end
end
def display_board
puts ' B I N G O'
@bingo_board.each do |row|
for i in @letter_keys
if (row[@letters[i]] == 'X' || row[@letters[i]] < 10)
if (i == 'B')
print '| ' + row[@letters[i]].to_s + ' |'
elsif (i != 'O')
print ' ' + row[@letters[i]].to_s + ' |'
else
puts ' ' + row[@letters[i]].to_s + ' |'
end
elsif (row[@letters[i]] < 100)
if (i == 'B')
print '| ' + row[@letters[i]].to_s + ' |'
elsif (i != 'O')
print ' ' + row[@letters[i]].to_s + ' |'
else
puts ' ' + row[@letters[i]].to_s + ' |'
end
else
if (i == 'B')
print '| ' + row[@letters[i]].to_s + ' |'
elsif (i != 'O')
print ' ' + row[@letters[i]].to_s + ' |'
else
puts ' ' + row[@letters[i]].to_s + ' |'
end
end
end
end
end
end
# Refactored Solution
class BingoBoard
def initialize(board)
@bingo_board = board
end
# Create a method to generate a letter ( b, i, n, g, o) and a number (1-100)
def call
@letters = {'B' => 0, 'I' => 1, 'N' => 2, 'G' => 3, 'O' => 4}
@letter_keys = @letters.keys
@call_letter = @letter_keys.shuffle[0]
# @call_letter = 'I'
@call_number = 1 + rand(99)
# @call_number = 31
return [@call_letter, @call_number]
# return ['B', 22]
end
# Check the called column for the number called.
def check
@bingo_board.each do |row|
if row[@letters[@call_letter]] == @call_number
row[@letters[@call_letter]] = 'X'
end
end
end
def display_board
puts ' B I N G O'
@bingo_board.each do |row|
for i in @letter_keys
if (row[@letters[i]] == 'X' || row[@letters[i]] < 10)
(i == 'B')?(print '| ' + row[@letters[i]].to_s + ' |'):((i != 'O')?(print ' ' + row[@letters[i]].to_s + ' |'):(puts ' ' + row[@letters[i]].to_s + ' |'))
elsif (row[@letters[i]] < 100)
(i == 'B')?(print '| ' + row[@letters[i]].to_s + ' |'):((i != 'O')?(print ' ' + row[@letters[i]].to_s + ' |'):(puts ' ' + row[@letters[i]].to_s + ' |'))
else
(i == 'B')?(print '| ' + row[@letters[i]].to_s + ' |'):((i != 'O')?(print ' ' + row[@letters[i]].to_s + ' |'):(puts ' ' + row[@letters[i]].to_s + ' |'))
end
end # end of for
end # end of do
end
end
#DRIVER CODE (I.E. METHOD CALLS) GO BELOW THIS LINE
# Too test the call and check methods, I forced specific values on lines 129, 131, and 133.
# I tried running at least 20 times and was not able to generate a matching call -pair otherwise.
board = [[47, 44, 71, 8, 88],
[22, 69, 75, 65, 73],
[83, 85, 97, 89, 57],
[25, 31, 96, 68, 51],
[75, 70, 54, 80, 83]]
new_game = BingoBoard.new(board)
#new_game.display_board
p new_game.call
p new_game.check
puts " "
new_game.display_board
puts " "
#Reflection
=begin
1. How difficult was pseudocoding this challenge? What do you think of your pseudocoding style?
This challenge was a lot easier to pseudocode since the game process was broken down into three distinct steps:
(i) Call the ball, (ii) Check the board, and (iii) Display the board.
I think my pseudo-code is improving.
The shape of my pseudocode more closely matches the shape of the iniitial code.
2. What are the benefits of using a class for this challenge?
By using a class, we define the only methods that can be used to define the game's state.
You can't cheat by writing a method that changes the board's numbers.
Changing the numbers on the board requires defining a new game.
3. How can you access coordinates in a nested array?
In a 2-dimensionaal array A (i.e. array of arrays), you can access the element in the i-th row
and j-th column by using (A[i])[j]
4. What methods did you use to access and modify the array?
I used very basic each methods on the board. I also created a hash with keys, the letters in BINGO,
and values, the digits 0 through 4, and used these as indices to access various arrays defined.
5. Give an example of a new method you learned while reviewing the Ruby docs.
Based on what you see in the docs, what purpose does it serve, and how is it called?
I learned how to pick an element at random from an array using
the .sample method. Instead of having to randomly select an index and then choosing the element at that index,
the .sample method is a shortcut. If we have an array called example_array, then example_array.sample returns
a randomly chosen elemt from example_array.
6. How did you determine what should be an instance variable versus a local variable?
I'm not sure if there is a stricter criterion than ... If a variable needs to be used in more than one class-method,
make it an instance variable. Also, if something outside of the class needs to get or set the variable, then make it an instance variable.
Otherwise, make it a local variable.
7. What do you feel is most improved in your refactored solution?
The display_board method was easily the most improved after using the ternary operator.
I tried to find a way to shorten the code in the arguments of the ternary operator, but couldn't.
=end |
# encoding: UTF-8
Gem::Specification.new do |s|
s.name = "sunspot-queue"
s.homepage = "https://github.com/gaffneyc/sunspot-queue"
s.summary = "Background search indexing using existing worker systems."
s.require_path = "lib"
s.authors = ["Chris Gaffney"]
s.email = ["gaffneyc@gmail.com"]
s.version = "0.9.0"
s.platform = Gem::Platform::RUBY
s.files = Dir.glob("{lib,spec}/**/*") + %w[LICENSE README.md]
s.add_dependency "resque"
s.add_dependency "sunspot_rails", ">= 1.3.0"
s.add_development_dependency "rspec", "~> 2.10.0"
s.add_development_dependency "resque_spec"
s.add_development_dependency "sunspot_solr"
s.add_development_dependency "sqlite3"
s.add_development_dependency "activerecord"
s.add_development_dependency "guard"
s.add_development_dependency "guard-rspec"
s.add_development_dependency "guard-bundler"
end
Add rake as a development dependency.
Rake is acting odd unless it's run through bundle exec.
# encoding: UTF-8
Gem::Specification.new do |s|
s.name = "sunspot-queue"
s.homepage = "https://github.com/gaffneyc/sunspot-queue"
s.summary = "Background search indexing using existing worker systems."
s.require_path = "lib"
s.authors = ["Chris Gaffney"]
s.email = ["gaffneyc@gmail.com"]
s.version = "0.9.0"
s.platform = Gem::Platform::RUBY
s.files = Dir.glob("{lib,spec}/**/*") + %w[LICENSE README.md]
s.add_dependency "resque"
s.add_dependency "sunspot_rails", ">= 1.3.0"
s.add_development_dependency "rake"
s.add_development_dependency "rspec", "~> 2.10.0"
s.add_development_dependency "resque_spec"
s.add_development_dependency "sunspot_solr"
s.add_development_dependency "sqlite3"
s.add_development_dependency "activerecord"
s.add_development_dependency "guard"
s.add_development_dependency "guard-rspec"
s.add_development_dependency "guard-bundler"
end
|
cask '1password-beta' do
version '7.2.3.BETA-0'
sha256 '9de6ddd549c4dd7a63f5674ab01252a3c4f3cf56c06784c2395cc21f4c1a0499'
url "https://c.1password.com/dist/1P/mac#{version.major}/1Password-#{version}.zip"
appcast "https://app-updates.agilebits.com/product_history/OPM#{version.major}"
name '1Password'
homepage 'https://1password.com/'
auto_updates true
app "1Password #{version.major}.app"
zap trash: [
'~/Library/Application Scripts/2BUA8C4S2C.com.agilebits.onepassword-osx-helper',
'~/Library/Containers/2BUA8C4S2C.com.agilebits.onepassword-osx-helper',
'~/Library/Containers/com.agilebits.onepassword-osx',
'~/Library/Group Containers/2BUA8C4S2C.com.agilebits',
]
end
Update 1password-beta to 7.2.3.BETA-1 (#6585)
cask '1password-beta' do
version '7.2.3.BETA-1'
sha256 '132d6537fd434fdd445436d2ebce6635711ca23578b77e7fcf287d7f90f40de4'
url "https://c.1password.com/dist/1P/mac#{version.major}/1Password-#{version}.zip"
appcast "https://app-updates.agilebits.com/product_history/OPM#{version.major}"
name '1Password'
homepage 'https://1password.com/'
auto_updates true
app "1Password #{version.major}.app"
zap trash: [
'~/Library/Application Scripts/2BUA8C4S2C.com.agilebits.onepassword-osx-helper',
'~/Library/Containers/2BUA8C4S2C.com.agilebits.onepassword-osx-helper',
'~/Library/Containers/com.agilebits.onepassword-osx',
'~/Library/Group Containers/2BUA8C4S2C.com.agilebits',
]
end
|
cask "1password-beta" do
arch = Hardware::CPU.intel? ? "x86_64" : "aarch64"
version "8.4.0-53.BETA"
if Hardware::CPU.intel?
sha256 "7397c84ad26403a088d6871b8fb7d8466df658eec7f484d1c7c82d5905150424"
else
sha256 "99bfc1d808a2982ec5a81a8aef9ae9a3645e715cd3437fde04fa8e51586de734"
end
url "https://downloads.1password.com/mac/1Password-#{version}-#{arch}.zip"
name "1Password"
desc "Password manager that keeps all passwords secure behind one password"
homepage "https://1password.com/"
livecheck do
url "https://app-updates.agilebits.com/product_history/OPM#{version.major}"
regex(%r{href=.*?/1Password[._-]?v?(\d+(?:.\d+)*(?:[._-]BETA))[._-]?\$ARCH\.zip}i)
end
auto_updates true
conflicts_with cask: "1password"
depends_on macos: ">= :high_sierra"
app "1Password.app"
zap trash: [
"~/Library/Application Scripts/2BUA8C4S2C.com.1password.browser-helper",
"~/Library/Application Scripts/2BUA8C4S2C.com.1password.1password",
"~/Library/Containers/2BUA8C4S2C.com.1password.browser-helper",
"~/Library/Containers/com.1password.1password",
"~/Library/Group Containers/2BUA8C4S2C.com.1password",
]
end
Update 1password-beta from 8.4.0-53.BETA to 8.5.0-17.BETA (#12648)
cask "1password-beta" do
arch = Hardware::CPU.intel? ? "x86_64" : "aarch64"
version "8.5.0-17.BETA"
if Hardware::CPU.intel?
sha256 "929f352a6b7fda15f94420dde32ed8d44be9d0079ec01717c866ae2630c4c268"
else
sha256 "8f68f5751cb916c5a8956585e92b0446cbd341479c3a401599e0c4fd303667a7"
end
url "https://downloads.1password.com/mac/1Password-#{version}-#{arch}.zip"
name "1Password"
desc "Password manager that keeps all passwords secure behind one password"
homepage "https://1password.com/"
livecheck do
url "https://app-updates.agilebits.com/product_history/OPM#{version.major}"
regex(%r{href=.*?/1Password[._-]?v?(\d+(?:.\d+)*(?:[._-]BETA))[._-]?\$ARCH\.zip}i)
end
auto_updates true
conflicts_with cask: "1password"
depends_on macos: ">= :high_sierra"
app "1Password.app"
zap trash: [
"~/Library/Application Scripts/2BUA8C4S2C.com.1password.browser-helper",
"~/Library/Application Scripts/2BUA8C4S2C.com.1password.1password",
"~/Library/Containers/2BUA8C4S2C.com.1password.browser-helper",
"~/Library/Containers/com.1password.1password",
"~/Library/Group Containers/2BUA8C4S2C.com.1password",
]
end
|
cask "1password-beta" do
arch arm: "aarch64", intel: "x86_64"
version "8.9.7-7.BETA"
sha256 arm: "699bca4e2d623b78c9334c791360397f2107c10602bc0e1c5ee986418c8fbdf7",
intel: "d5ffb38eac0efd39e551e8b01e9e010b4e06bd1eba435435a9a31ee8291b0e27"
url "https://downloads.1password.com/mac/1Password-#{version}-#{arch}.zip"
name "1Password"
desc "Password manager that keeps all passwords secure behind one password"
homepage "https://1password.com/"
livecheck do
url "https://app-updates.agilebits.com/product_history/OPM#{version.major}"
regex(%r{href=.*?/1Password[._-]?v?(\d+(?:.\d+)*(?:[._-]BETA))[._-]?\$ARCH\.zip}i)
end
auto_updates true
conflicts_with cask: "1password"
depends_on macos: ">= :high_sierra"
app "1Password.app"
zap trash: [
"~/Library/Application Scripts/2BUA8C4S2C.com.1password.*",
"~/Library/Application Support/1Password",
"~/Library/Application Support/CrashReporter/1Password*",
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.1password.1password.sfl2",
"~/Library/Containers/2BUA8C4S2C.com.1password.browser-helper",
"~/Library/Containers/com.1password.1password",
"~/Library/Group Containers/2BUA8C4S2C.com.1password",
"~/Library/Saved Application State/com.1password.1password.savedState",
]
end
1password-beta 8.9.7-17.BETA
Update 1password-beta from 8.9.7-7.BETA to 8.9.7-17.BETA
Closes #14830.
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
cask "1password-beta" do
arch arm: "aarch64", intel: "x86_64"
version "8.9.7-17.BETA"
sha256 arm: "e374cbed6a181656e54702021989adc750241f52ee0c5eb7960a903a0d56b613",
intel: "bd7edcadd0d53f7d73594000b39140cd9d24d2f228585b4b15ab4624d75b39f1"
url "https://downloads.1password.com/mac/1Password-#{version}-#{arch}.zip"
name "1Password"
desc "Password manager that keeps all passwords secure behind one password"
homepage "https://1password.com/"
livecheck do
url "https://app-updates.agilebits.com/product_history/OPM#{version.major}"
regex(%r{href=.*?/1Password[._-]?v?(\d+(?:.\d+)*(?:[._-]BETA))[._-]?\$ARCH\.zip}i)
end
auto_updates true
conflicts_with cask: "1password"
depends_on macos: ">= :high_sierra"
app "1Password.app"
zap trash: [
"~/Library/Application Scripts/2BUA8C4S2C.com.1password.*",
"~/Library/Application Support/1Password",
"~/Library/Application Support/CrashReporter/1Password*",
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.1password.1password.sfl2",
"~/Library/Containers/2BUA8C4S2C.com.1password.browser-helper",
"~/Library/Containers/com.1password.1password",
"~/Library/Group Containers/2BUA8C4S2C.com.1password",
"~/Library/Saved Application State/com.1password.1password.savedState",
]
end
|
cask 'activity-audit' do
version '1.1.5'
sha256 '5e37e7912e679c0392c25125f577a639a73e8aaef7f7364c4364b29e12726ebb'
url "https://www.dssw.co.uk/activityaudit/dsswactivityaudit-#{version.delete('.')}.dmg"
name 'Activity Audit'
appcast 'https://version.dssw.co.uk/activityaudit/standard',
:sha256 => 'ac63a66d06ecf116f7ad04b5b680b12f0534e07685e6eb9dfe4e13f9b03ce508'
homepage 'https://www.dssw.co.uk/activityaudit'
license :commercial
app 'Activity Audit.app'
end
activity-audit.rb: RuboCop (master), RuboCop-cask (master) auto-correct
cask 'activity-audit' do
version '1.1.5'
sha256 '5e37e7912e679c0392c25125f577a639a73e8aaef7f7364c4364b29e12726ebb'
url "https://www.dssw.co.uk/activityaudit/dsswactivityaudit-#{version.delete('.')}.dmg"
appcast 'https://version.dssw.co.uk/activityaudit/standard',
:sha256 => 'ac63a66d06ecf116f7ad04b5b680b12f0534e07685e6eb9dfe4e13f9b03ce508'
name 'Activity Audit'
homepage 'https://www.dssw.co.uk/activityaudit'
license :commercial
app 'Activity Audit.app'
end
|
cask 'apache-couchdb' do
version '3.0.0'
sha256 '09f85a7c93f96db1a9669dd6af9c9fcff2862223419d06b908d54b6f8feb4e68'
# couchdbneighbourhoodie.fra1.digitaloceanspaces.com was verified as official when first introduced to the cask
url "https://couchdbneighbourhoodie.fra1.digitaloceanspaces.com/downloads/#{version}/mac/Apache-CouchDB.zip"
appcast 'https://docs.couchdb.org/en/stable/whatsnew/index.html'
name 'Apache CouchDB'
homepage 'https://couchdb.apache.org/'
app 'Apache CouchDB.app'
zap trash: [
'~/Library/Application Support/CouchDB',
'~/Library/Caches/org.apache.couchdb',
'~/Library/Logs/couchdb.log',
'~/Library/Logs/couchdb.log.old',
'~/Library/Preferences/org.apache.couchdb.plist',
]
end
apache-couchdb.rb: Add trailing slash to verified comment
cask 'apache-couchdb' do
version '3.0.0'
sha256 '09f85a7c93f96db1a9669dd6af9c9fcff2862223419d06b908d54b6f8feb4e68'
# couchdbneighbourhoodie.fra1.digitaloceanspaces.com/ was verified as official when first introduced to the cask
url "https://couchdbneighbourhoodie.fra1.digitaloceanspaces.com/downloads/#{version}/mac/Apache-CouchDB.zip"
appcast 'https://docs.couchdb.org/en/stable/whatsnew/index.html'
name 'Apache CouchDB'
homepage 'https://couchdb.apache.org/'
app 'Apache CouchDB.app'
zap trash: [
'~/Library/Application Support/CouchDB',
'~/Library/Caches/org.apache.couchdb',
'~/Library/Logs/couchdb.log',
'~/Library/Logs/couchdb.log.old',
'~/Library/Preferences/org.apache.couchdb.plist',
]
end
|
cask 'battery-report' do
version :latest
sha256 :no_check
url 'https://www.dssw.co.uk/batteryreport/dsswbatteryreport.dmg'
name 'Battery Report'
appcast 'https://version.dssw.co.uk/batteryreport/standard',
:sha256 => 'a8dc71fa600b5ab05dded9de519da81aa3853ee0d8d0b2753177d4041443b420'
homepage 'https://www.dssw.co.uk/batteryreport'
license :commercial
app 'Battery Report.app'
end
battery-report.rb: RuboCop (master), RuboCop-cask (master) auto-correct
cask 'battery-report' do
version :latest
sha256 :no_check
url 'https://www.dssw.co.uk/batteryreport/dsswbatteryreport.dmg'
appcast 'https://version.dssw.co.uk/batteryreport/standard',
:sha256 => 'a8dc71fa600b5ab05dded9de519da81aa3853ee0d8d0b2753177d4041443b420'
name 'Battery Report'
homepage 'https://www.dssw.co.uk/batteryreport'
license :commercial
app 'Battery Report.app'
end
|
cask 'coconutbattery' do
if MacOS.version <= :mavericks
version '3.3.4'
sha256 '0edf6bdaf28fb3cc9c242fd916c348fbbae30a5356ddc1d6e5158d50f96d740d'
url "https://www.coconut-flavour.com/downloads/coconutBattery_#{version.dots_to_underscores}.zip"
elsif MacOS.version <= :yosemite
version '3.6.4'
sha256 '8e289fb4a75cb117fc1d7861020c9ab2384b09dfd18f066c7fadfc9d42c3ac56'
url "https://www.coconut-flavour.com/downloads/coconutBattery_#{version}.zip"
else
version '3.7'
sha256 '0993860896d498ffc4bf9c6b6f25d724bfa0a967b19fb211eb347547118f3a2e'
url "https://www.coconut-flavour.com/downloads/coconutBattery_#{version}.zip"
appcast 'https://coconut-flavour.com/updates/coconutBattery.xml'
end
name 'coconutBattery'
homepage 'https://www.coconut-flavour.com/coconutbattery/'
auto_updates true
app 'coconutBattery.app'
uninstall launchctl: 'com.coconut-flavour.coconutBattery-Menu',
quit: 'com.coconut-flavour.coconutBattery-Menu'
zap trash: [
'~/Library/Application Support/coconutBattery',
'~/Library/Caches/com.coconut-flavour.coconutBattery*',
'~/Library/Group Containers/*.coconut-flavour.coconutBattery',
'~/Library/Preferences/com.coconut-flavour.coconutBattery.plist',
'~/Library/Saved Application State/com.coconut-flavour.coconutBattery.savedState',
]
end
Update coconutbattery to 3.7.1 (#53218)
cask 'coconutbattery' do
if MacOS.version <= :mavericks
version '3.3.4'
sha256 '0edf6bdaf28fb3cc9c242fd916c348fbbae30a5356ddc1d6e5158d50f96d740d'
url "https://www.coconut-flavour.com/downloads/coconutBattery_#{version.dots_to_underscores}.zip"
elsif MacOS.version <= :yosemite
version '3.6.4'
sha256 '8e289fb4a75cb117fc1d7861020c9ab2384b09dfd18f066c7fadfc9d42c3ac56'
url "https://www.coconut-flavour.com/downloads/coconutBattery_#{version}.zip"
else
version '3.7.1'
sha256 'cfa524513346d6a0ea096a39b3dd3955df4a04af65bbb191d3989b17e81f8bf8'
url "https://www.coconut-flavour.com/downloads/coconutBattery_#{version}.zip"
appcast 'https://coconut-flavour.com/updates/coconutBattery.xml'
end
name 'coconutBattery'
homepage 'https://www.coconut-flavour.com/coconutbattery/'
auto_updates true
app 'coconutBattery.app'
uninstall launchctl: 'com.coconut-flavour.coconutBattery-Menu',
quit: 'com.coconut-flavour.coconutBattery-Menu'
zap trash: [
'~/Library/Application Support/coconutBattery',
'~/Library/Caches/com.coconut-flavour.coconutBattery*',
'~/Library/Group Containers/*.coconut-flavour.coconutBattery',
'~/Library/Preferences/com.coconut-flavour.coconutBattery.plist',
'~/Library/Saved Application State/com.coconut-flavour.coconutBattery.savedState',
]
end
|
cask 'discord-canary' do
version '0.0.185'
sha256 'ac2c49cd8e5d069c8a8b32b27b67b5d204d3909093613c3206c8027fedf7c394'
url "https://cdn-canary.discordapp.com/apps/osx/#{version}/DiscordCanary.dmg"
appcast 'https://discordapp.com/api/canary/updates?platform=osx',
checkpoint: '29bbbf008a4fc177a2ae295e6f65f494bac46beb702eeece4938f287fca1c7f5'
name 'Discord Canary'
homepage 'https://discordapp.com/'
auto_updates true
app 'Discord Canary.app'
zap trash: [
'~/Library/Application Support/discordcanary',
'~/Library/Caches/com.hnc.DiscordCanary',
'~/Library/Caches/com.hnc.DiscordCanary.ShipIt',
'~/Library/Cookies/com.hnc.DiscordCanary.binarycookies',
'~/Library/Preferences/com.hnc.DiscordCanary.helper.plist',
'~/Library/Preferences/com.hnc.DiscordCanary.plist',
'~/Library/Saved Application State/com.hnc.DiscordCanary.savedState',
]
end
Update discord-canary to 0.0.186 (#5301)
cask 'discord-canary' do
version '0.0.186'
sha256 '42aa36770283503b75df899ed64459e1e773f03497667f15ceccb4fc4afbee13'
url "https://cdn-canary.discordapp.com/apps/osx/#{version}/DiscordCanary.dmg"
appcast 'https://discordapp.com/api/canary/updates?platform=osx',
checkpoint: 'fea7dc564e0e6ccd7ca2e6762e86c7cac1ebea98c3df5050c57ddc9ac304d3d1'
name 'Discord Canary'
homepage 'https://discordapp.com/'
auto_updates true
app 'Discord Canary.app'
zap trash: [
'~/Library/Application Support/discordcanary',
'~/Library/Caches/com.hnc.DiscordCanary',
'~/Library/Caches/com.hnc.DiscordCanary.ShipIt',
'~/Library/Cookies/com.hnc.DiscordCanary.binarycookies',
'~/Library/Preferences/com.hnc.DiscordCanary.helper.plist',
'~/Library/Preferences/com.hnc.DiscordCanary.plist',
'~/Library/Saved Application State/com.hnc.DiscordCanary.savedState',
]
end
|
class FontAhuramzda < Cask
version '1.000'
sha256 '5a8afb0b24ceeb98f1ef121406ceecb124f2a300c5ee7877a7ff6abdd697b160'
url 'http://openfontlibrary.org/assets/downloads/ahuramazda/b2c0eeb9186f389749746f075b5a1abf/ahuramazda.zip'
homepage 'http://openfontlibrary.org/font/ahuramazda/'
font 'Ahuramazda-Avestan-Font-1.0/ahuramazda.ttf'
end
add license stanza, font-ahuramzda
class FontAhuramzda < Cask
version '1.000'
sha256 '5a8afb0b24ceeb98f1ef121406ceecb124f2a300c5ee7877a7ff6abdd697b160'
url 'http://openfontlibrary.org/assets/downloads/ahuramazda/b2c0eeb9186f389749746f075b5a1abf/ahuramazda.zip'
homepage 'http://openfontlibrary.org/font/ahuramazda/'
license :unknown
font 'Ahuramazda-Avestan-Font-1.0/ahuramazda.ttf'
end
|
add font-miltonian.rb, source: Google
class FontMiltonian < Cask
url 'https://googlefontdirectory.googlecode.com/hg-history/67342bc472599b4c32201ee4a002fe59a6447a42/ofl/miltonian/Miltonian-Regular.ttf'
homepage 'http://www.google.com/fonts/specimen/Miltonian'
version '1.005'
sha256 '532610500b71c639e2f6b26efb0ea9ac348c09882721dfa44699fff693f23ad1'
font 'Miltonian-Regular.ttf'
end
|
cask 'font-palemonas' do
version '3.0'
sha256 'ad576fc82d1f67824cc10cde6c1778016ecf16702bcc2353f0d3884f2283a978'
url "http://www.vlkk.lt/media/public/file/Palemonas/Palemonas-#{version.dots_to_underscores}.zip"
name 'Palemonas'
homepage 'http://www.vlkk.lt/palemonas'
container type: :zip
font "Palemonas-#{version}/Palemonas-nm.ttf"
font "Palemonas-#{version}/Palemonas-bd.ttf"
font "Palemonas-#{version}/Palemonas-it.ttf"
font "Palemonas-#{version}/Palemonas-bi.ttf"
end
Update font-palemonas to 3.1 (#923)
cask 'font-palemonas' do
version '3.1'
sha256 '342dbc5c62787c0a966a43f9da4dbc06171d1dc72925f8a0f355441a8b9ca2b6'
url "http://www.vlkk.lt/media/public/file/Palemonas/Palemonas-#{version}.zip"
name 'Palemonas'
homepage 'http://www.vlkk.lt/palemonas'
container type: :zip
font "Palemonas-#{version}/Palem#{version}-nm.ttf"
font "Palemonas-#{version}/Palem#{version}-bd.ttf"
font "Palemonas-#{version}/Palem#{version}-it.ttf"
font "Palemonas-#{version}/Palem#{version}-bi.ttf"
end
|
cask 'gog-downloader' do
version '1.2_512'
sha256 '353604a2123feacf438c6586b3ec20967dca637b0a97d36203adbc3e1dfdefce'
url "https://static.gog.com/download/d3/mac-stable/GOG_Downloader_#{version}.zip"
appcast 'https://api.gog.com/en/downloader2/status/mac-stable',
checkpoint: 'a3c972e56f751b534b16c9c63930e6e663c0643123a09f9cc6ec921a7b4d1afb'
name 'GOG Downloader'
homepage 'https://www.gog.com/downloader'
app 'GOG Downloader.app'
zap delete: [
'~/Library/Application Support/GOG Downloader',
'~/Library/Caches/com.gog.downloader',
'~/Library/Preferences/com.gog.downloader.plist',
'~/Library/Saved Application State/com.gog.downloader.savedState',
]
end
Update gog-downloader to 1.2_512 (#33760)
cask 'gog-downloader' do
version '1.2_512'
sha256 '353604a2123feacf438c6586b3ec20967dca637b0a97d36203adbc3e1dfdefce'
url "https://static.gog.com/download/d3/mac-stable/GOG_Downloader_#{version}.zip"
appcast 'https://api.gog.com/en/downloader2/status/mac-stable',
checkpoint: '60f99d34cce116b973608660d9788c437cc1af77a9e447aee9b5b25e74c7cf2e'
name 'GOG Downloader'
homepage 'https://www.gog.com/downloader'
app 'GOG Downloader.app'
zap delete: [
'~/Library/Application Support/GOG Downloader',
'~/Library/Caches/com.gog.downloader',
'~/Library/Preferences/com.gog.downloader.plist',
'~/Library/Saved Application State/com.gog.downloader.savedState',
]
end
|
cask :v1 => 'handbrakebatch' do
version :latest
sha256 :no_check
url 'http://www.osomac.com/appcasts/handbrakebatch/HandBrakeBatch.zip'
appcast 'https://www.osomac.com/appcasts/handbrakebatch/HandBrakeBatch.xml'
name 'HandBrakeBatch'
homepage 'http://www.osomac.com/apps/osx/handbrake-batch/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'HandBrakeBatch.app'
end
handbrakebatch.rb: added discontinued caveat
cask :v1 => 'handbrakebatch' do
version :latest
sha256 :no_check
url 'http://www.osomac.com/appcasts/handbrakebatch/HandBrakeBatch.zip'
appcast 'https://www.osomac.com/appcasts/handbrakebatch/HandBrakeBatch.xml'
name 'HandBrakeBatch'
homepage 'http://www.osomac.com/apps/osx/handbrake-batch/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'HandBrakeBatch.app'
caveats do
discontinued
end
end
|
cask 'libreoffice-rc' do
version '6.0.0.3'
sha256 'b0e4bbac457a76a62240ae807c96f30fc0e94749a9d8622f47f0669cbf5783ac'
# documentfoundation.org/libreoffice was verified as official when first introduced to the cask
url "https://download.documentfoundation.org/libreoffice/testing/#{version.major_minor_patch}/mac/x86_64/LibreOffice_#{version}_MacOS_x86-64.dmg"
appcast 'https://download.documentfoundation.org/libreoffice/testing/',
checkpoint: '553053c6a1ddfcd56d80be711fcae47ee5e675531c84311c0b2a25500fb87ef2'
name 'LibreOffice Release Candidate'
homepage 'https://www.libreoffice.org/download/pre-releases/'
gpg "#{url}.asc", key_id: 'c2839ecad9408fbe9531c3e9f434a1efafeeaea3'
auto_updates true
conflicts_with cask: [
'libreoffice',
'libreoffice-still',
]
depends_on macos: '>= :mavericks'
app 'LibreOffice.app'
binary "#{appdir}/LibreOffice.app/Contents/MacOS/gengal"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/regmerge"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/regview"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/senddoc"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/ui-previewer"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/uno"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/unoinfo"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/unopkg"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/uri-encode"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/xpdfimport"
# shim script (https://github.com/caskroom/homebrew-cask/issues/18809)
shimscript = "#{staged_path}/soffice.wrapper.sh"
binary shimscript, target: 'soffice'
preflight do
IO.write shimscript, <<~EOS
#!/bin/sh
'#{appdir}/LibreOffice.app/Contents/MacOS/soffice' "$@"
EOS
end
zap trash: [
'~/Library/Application Support/LibreOffice',
'~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.libreoffice.script.sfl*',
'~/Library/Preferences/org.libreoffice.script.plist',
'~/Library/Saved Application State/org.libreoffice.script.savedState',
]
end
Update libreoffice-rc to 6.0.1.1 (#5236)
cask 'libreoffice-rc' do
version '6.0.1.1'
sha256 'b1ac5664c51fcaa21964771f438234f9ad5e57a70e70f9a68955034275ec2030'
# documentfoundation.org/libreoffice was verified as official when first introduced to the cask
url "https://download.documentfoundation.org/libreoffice/testing/#{version.major_minor_patch}/mac/x86_64/LibreOffice_#{version}_MacOS_x86-64.dmg"
appcast 'https://download.documentfoundation.org/libreoffice/testing/',
checkpoint: 'feab073cab29504e4c6603097f421b902700da1821b4efc39cd8652948776731'
name 'LibreOffice Release Candidate'
homepage 'https://www.libreoffice.org/download/pre-releases/'
gpg "#{url}.asc", key_id: 'c2839ecad9408fbe9531c3e9f434a1efafeeaea3'
auto_updates true
conflicts_with cask: [
'libreoffice',
'libreoffice-still',
]
depends_on macos: '>= :mavericks'
app 'LibreOffice.app'
binary "#{appdir}/LibreOffice.app/Contents/MacOS/gengal"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/regmerge"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/regview"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/senddoc"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/ui-previewer"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/uno"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/unoinfo"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/unopkg"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/uri-encode"
binary "#{appdir}/LibreOffice.app/Contents/MacOS/xpdfimport"
# shim script (https://github.com/caskroom/homebrew-cask/issues/18809)
shimscript = "#{staged_path}/soffice.wrapper.sh"
binary shimscript, target: 'soffice'
preflight do
IO.write shimscript, <<~EOS
#!/bin/sh
'#{appdir}/LibreOffice.app/Contents/MacOS/soffice' "$@"
EOS
end
zap trash: [
'~/Library/Application Support/LibreOffice',
'~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.libreoffice.script.sfl*',
'~/Library/Preferences/org.libreoffice.script.plist',
'~/Library/Saved Application State/org.libreoffice.script.savedState',
]
end
|
class LogmeinClient < Cask
version :latest
sha256 :no_check
url 'https://secure.logmein.com/welcome/labs/LogMeInIgnition.dmg'
homepage 'https://secure.logmein.com/products/pro/learnmore/desktopapp.aspx'
app 'LogMeInIgnition.app', :target => 'LogMeIn Client.app'
end
add license stanza to logmein-client
class LogmeinClient < Cask
version :latest
sha256 :no_check
url 'https://secure.logmein.com/welcome/labs/LogMeInIgnition.dmg'
homepage 'https://secure.logmein.com/products/pro/learnmore/desktopapp.aspx'
license :unknown
app 'LogMeInIgnition.app', :target => 'LogMeIn Client.app'
end
|
cask "microsoft-word" do
version "16.49.21050901"
sha256 "3b948f9031d337276ef87e9b372a7386ee846efe929cd16714bae596c9336f0c"
url "https://officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/Microsoft_Word_#{version}_Installer.pkg",
verified: "officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/"
appcast "https://docs.microsoft.com/en-us/officeupdates/update-history-office-for-mac"
name "Microsoft Word"
desc "Word processor"
homepage "https://products.office.com/en-US/word"
auto_updates true
conflicts_with cask: "microsoft-office"
depends_on cask: "microsoft-auto-update"
depends_on macos: ">= :sierra"
pkg "Microsoft_Word_#{version}_Installer.pkg",
choices: [
{
"choiceIdentifier" => "com.microsoft.autoupdate", # Office16_all_autoupdate.pkg
"choiceAttribute" => "selected",
"attributeSetting" => 0,
},
]
uninstall pkgutil: [
"com.microsoft.package.Microsoft_Word.app",
"com.microsoft.pkg.licensing",
],
launchctl: "com.microsoft.office.licensingV2.helper"
zap trash: [
"~/Library/Application Scripts/com.microsoft.Word",
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.word.sfl*",
"~/Library/Application Support/CrashReporter/Microsoft Word_*.plist",
"~/Library/Containers/com.microsoft.Word",
"~/Library/Preferences/com.microsoft.Word.plist",
]
end
Update microsoft-word.rb (#105564)
cask "microsoft-word" do
version "16.49.21050901"
sha256 "3b948f9031d337276ef87e9b372a7386ee846efe929cd16714bae596c9336f0c"
url "https://officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/Microsoft_Word_#{version}_Installer.pkg",
verified: "officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/"
name "Microsoft Word"
desc "Word processor"
homepage "https://products.office.com/en-US/word"
livecheck do
url "https://go.microsoft.com/fwlink/p/?linkid=525134"
strategy :header_match
end
auto_updates true
conflicts_with cask: "microsoft-office"
depends_on cask: "microsoft-auto-update"
depends_on macos: ">= :sierra"
pkg "Microsoft_Word_#{version}_Installer.pkg",
choices: [
{
"choiceIdentifier" => "com.microsoft.autoupdate", # Office16_all_autoupdate.pkg
"choiceAttribute" => "selected",
"attributeSetting" => 0,
},
]
uninstall pkgutil: [
"com.microsoft.package.Microsoft_Word.app",
"com.microsoft.pkg.licensing",
],
launchctl: "com.microsoft.office.licensingV2.helper"
zap trash: [
"~/Library/Application Scripts/com.microsoft.Word",
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.word.sfl*",
"~/Library/Application Support/CrashReporter/Microsoft Word_*.plist",
"~/Library/Containers/com.microsoft.Word",
"~/Library/Preferences/com.microsoft.Word.plist",
]
end
|
cask 'openinterminal' do
version '0.9.0'
sha256 'd875a1f588745b5e7c8b1411bc9fa0b6dc003cb40ad1a2e62df6bd3923c80d9d'
url "https://github.com/Ji4n1ng/OpenInTerminal/releases/download/#{version}/OpenInTerminal.app.zip"
appcast 'https://github.com/Ji4n1ng/OpenInTerminal/releases.atom'
name 'OpenInTerminal'
homepage 'https://github.com/Ji4n1ng/OpenInTerminal'
app 'OpenInTerminal.app'
end
Update OpenInTerminal from 0.9.0 to 0.9.1 (#63315)
* Add OpenInTerminal.app v0.9.0
* Update OpenInTerminal from 0.9.0 to 0.9.1
cask 'openinterminal' do
version '0.9.1'
sha256 '246427c3099c8ab4cbac4cebee8a56555f218f2f87c1afc6a896ed49240caeff'
url "https://github.com/Ji4n1ng/OpenInTerminal/releases/download/#{version}/OpenInTerminal.app.zip"
appcast 'https://github.com/Ji4n1ng/OpenInTerminal/releases.atom'
name 'OpenInTerminal'
homepage 'https://github.com/Ji4n1ng/OpenInTerminal'
app 'OpenInTerminal.app'
end
|
cask "origami-studio" do
version "249675454"
sha256 "97c425a5844201a00f5b81b05f5217628b2a837bf15fe0842036dc6fc2b4c0af"
# fb.me/ was verified as official when first introduced to the cask
url "https://fb.me/getorigamistudio"
appcast "https://www.facebook.com/mobile_builds/appcast.xml?app_id=892075810923571"
name "Origami Studio"
homepage "https://origami.design/"
depends_on macos: ">= :sierra"
app "Origami Studio.app"
end
Update origami-studio from 249675454 to 252227598 (#91203)
cask "origami-studio" do
version "252227598"
sha256 "716b7d0d0596464bb5dd100e7d7bb687da0b38e4809d13548d32c229a765d82c"
# facebook.com/designtools/ was verified as official when first introduced to the cask
url "https://facebook.com/designtools/origami/"
# The appcast will fail CI due to its Cache-Control settings
appcast "https://www.facebook.com/mobile_builds/appcast.xml?app_id=892075810923571&flavor=production"
name "Origami Studio"
desc "Design, animate, and prototype design tool from Facebook"
homepage "https://origami.design/"
depends_on macos: ">= :sierra"
app "Origami Studio.app"
end
|
cask "origami-studio" do
version "117.0.0.9.214,376426660"
sha256 :no_check
url "https://facebook.com/designtools/origami/",
verified: "facebook.com/designtools/"
name "Origami Studio"
desc "Design, animate, and prototype design tool from Facebook"
homepage "https://origami.design/"
livecheck do
url "https://m.facebook.com/mobile_builds/appcast.xml?app_id=892075810923571&amp%3Bflavor=production"
strategy :sparkle
end
depends_on macos: ">= :sierra"
app "Origami Studio.app"
end
origami-studio 118.0.0.6.216,379547664
Update origami-studio from 117.0.0.9.214 to 118.0.0.6.216
Closes #126671.
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
cask "origami-studio" do
version "118.0.0.6.216,379547664"
sha256 :no_check
url "https://facebook.com/designtools/origami/",
verified: "facebook.com/designtools/"
name "Origami Studio"
desc "Design, animate, and prototype design tool from Facebook"
homepage "https://origami.design/"
livecheck do
url "https://m.facebook.com/mobile_builds/appcast.xml?app_id=892075810923571&amp%3Bflavor=production"
strategy :sparkle
end
depends_on macos: ">= :sierra"
app "Origami Studio.app"
end
|
cask 'radiant-player' do
version '1.9.0'
sha256 '568647981af6acf71f000b969c174805fa44e17246f3dbe021abc9aa4b00e0a6'
# github.com/radiant-player/radiant-player-mac was verified as official when first introduced to the cask
url "https://github.com/radiant-player/radiant-player-mac/releases/download/v#{version}/radiant-player-v#{version}.zip"
appcast 'https://github.com/radiant-player/radiant-player-mac/releases.atom',
checkpoint: '405d119dd4265aa9ea899c1aed15d3c1124c5a7147f46b1c2a97066a70bcef8c'
name 'Radiant Player'
homepage 'https://radiant-player.github.io/radiant-player-mac/'
license :mit
app 'Radiant Player.app'
end
updated radiant-player (1.10.0) (#23724)
cask 'radiant-player' do
version '1.10.0'
sha256 'c85fc44250832448bbab401a99fd21d9880fdb612d666c85b9d797abf9c783ec'
# github.com/radiant-player/radiant-player-mac was verified as official when first introduced to the cask
url "https://github.com/radiant-player/radiant-player-mac/releases/download/v#{version}/radiant-player-v#{version}.zip"
appcast 'https://github.com/radiant-player/radiant-player-mac/releases.atom',
checkpoint: '29e59b740579d1eeace5209b948d24de7b6e53702357893638c19735102ad737'
name 'Radiant Player'
homepage 'https://radiant-player.github.io/radiant-player-mac/'
license :mit
app 'Radiant Player.app'
end
|
Add Simply Fortran v2.33 (#29200)
* Add Simply Fortran v2.33
* Update Simply Fortran to use version string interpolation in URL.
* Remove slash
cask 'simply-fortran' do
version '2.33'
sha256 'bc35e918a62c605ba6a1a7ebbc8100a28f9250cd09a59346ab6dc78ed7238a5b'
# download.approximatrix.com/sfortran was verified as official when first introduced to the cask
url "https://download.approximatrix.com/sfortran/#{version}/SimplyFortran-#{version}.dmg"
name 'Simply Fortran'
homepage 'http://simplyfortran.com/'
app 'Simply Fortran.app'
end
|
cask 'tableau-public' do
version '2020.2.2'
sha256 '90e5f4b76448d2dab753fdd4cf2198f89680136856ac44e5ae6882187af5071e'
url "https://downloads.tableau.com/public/TableauPublic-#{version.dots_to_hyphens}.dmg"
appcast 'https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://www.tableau.com/downloads/public/mac',
must_contain: version.dots_to_hyphens
name 'Tableau Public'
homepage 'https://public.tableau.com/s/'
pkg 'Tableau Public.pkg'
uninstall pkgutil: [
'com.tableausoftware.FLEXNet.*',
'com.tableausoftware.Public.app',
]
end
tableau-public: fix RuboCop style.
See https://github.com/Homebrew/brew/pull/7867.
cask "tableau-public" do
version "2020.2.2"
sha256 "90e5f4b76448d2dab753fdd4cf2198f89680136856ac44e5ae6882187af5071e"
url "https://downloads.tableau.com/public/TableauPublic-#{version.dots_to_hyphens}.dmg"
appcast "https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://www.tableau.com/downloads/public/mac",
must_contain: version.dots_to_hyphens
name "Tableau Public"
homepage "https://public.tableau.com/s/"
pkg "Tableau Public.pkg"
uninstall pkgutil: [
"com.tableausoftware.FLEXNet.*",
"com.tableausoftware.Public.app",
]
end
|
cask 'telegram-alpha' do
version '5.8.1-185688,2323'
sha256 '70e9e705587b5feb331d1dc766706b67ba36c757d0f989ecc1707a239544ac4e'
# hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f was verified as official when first introduced to the cask
url "https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f/app_versions/#{version.after_comma}?format=zip"
appcast 'https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f'
name 'Telegram for macOS'
name 'Telegram Swift'
homepage 'https://macos.telegram.org/'
auto_updates true
conflicts_with cask: 'telegram'
depends_on macos: '>= :yosemite'
app 'Telegram.app'
end
Update telegram-alpha from 5.8.1-185688,2323 to 5.8.2-185882,2360 (#8213)
cask 'telegram-alpha' do
version '5.8.2-185882,2360'
sha256 '1f45cbe25163c98b730bdf48b237868025641187fd1502c4e9c35f51b81d8a4a'
# hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f was verified as official when first introduced to the cask
url "https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f/app_versions/#{version.after_comma}?format=zip"
appcast 'https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f'
name 'Telegram for macOS'
name 'Telegram Swift'
homepage 'https://macos.telegram.org/'
auto_updates true
conflicts_with cask: 'telegram'
depends_on macos: '>= :yosemite'
app 'Telegram.app'
end
|
cask 'telegram-alpha' do
version '3.6-110016,727'
sha256 '22328c3822e9d5d49c76fd60d9b82a1c5a109b468a42963b260049208e26eb88'
# hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f was verified as official when first introduced to the cask
url "https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f/app_versions/#{version.after_comma}?format=zip"
appcast 'https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f',
checkpoint: '6fc5d9912bc0a92b562c6afaf4c9a85464ee675bd00c2f335f089dfaeea7a2a0'
name 'Telegram for macOS'
name 'Telegram Swift'
homepage 'https://macos.telegram.org/'
auto_updates true
conflicts_with cask: 'telegram'
depends_on macos: '>= :yosemite'
app 'Telegram.app'
end
Update telegram-alpha to 3.6-110155,731 (#4917)
cask 'telegram-alpha' do
version '3.6-110155,731'
sha256 '147eea4513ac57abefd0f8c04e4b406d78c09d800a3e224cdebf951fdfd92a9e'
# hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f was verified as official when first introduced to the cask
url "https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f/app_versions/#{version.after_comma}?format=zip"
appcast 'https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f',
checkpoint: 'bcedd6e780e6289e7607e80320fabe643eb6390059dca6d8b63b1d309034e6fe'
name 'Telegram for macOS'
name 'Telegram Swift'
homepage 'https://macos.telegram.org/'
auto_updates true
conflicts_with cask: 'telegram'
depends_on macos: '>= :yosemite'
app 'Telegram.app'
end
|
cask 'telegram-alpha' do
version '3.7.1-111953,785'
sha256 'ffbb53a03fdaadae1f792359b09e4f213577866bd5e9e3a8b24a366fc1c39212'
# hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f was verified as official when first introduced to the cask
url "https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f/app_versions/#{version.after_comma}?format=zip"
appcast 'https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f',
checkpoint: '8b9d332cdb0154f72fd984613dc5e3de744b9cede5d83a6e79633d162198049f'
name 'Telegram for macOS'
name 'Telegram Swift'
homepage 'https://macos.telegram.org/'
auto_updates true
conflicts_with cask: 'telegram'
depends_on macos: '>= :yosemite'
app 'Telegram.app'
end
Update telegram-alpha to 3.7.1-111991,787 (#5039)
cask 'telegram-alpha' do
version '3.7.1-111991,787'
sha256 '779851db19f0407e0ad3cb5193c9a850f229d2e33ac68d4246c6536259b63a79'
# hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f was verified as official when first introduced to the cask
url "https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f/app_versions/#{version.after_comma}?format=zip"
appcast 'https://rink.hockeyapp.net/api/2/apps/6ed2ac3049e1407387c2f1ffcb74e81f',
checkpoint: 'cbd63cc2c83b5a5dad48fc9461bcb83cb64264870d872d2752189cef7157e3cd'
name 'Telegram for macOS'
name 'Telegram Swift'
homepage 'https://macos.telegram.org/'
auto_updates true
conflicts_with cask: 'telegram'
depends_on macos: '>= :yosemite'
app 'Telegram.app'
end
|
cask 'webkit-nightly' do
version 'r208124'
sha256 '06908a8241c19751105a53907f3e64ca06a352e99779c6c3d248d3422ed332fc'
url "https://builds-nightly.webkit.org/files/trunk/mac/WebKit-SVN-#{version}.dmg"
name 'WebKit Nightly'
homepage 'https://webkit.org/downloads/'
app 'WebKit.app'
end
Webkit Nightly r208172
cask 'webkit-nightly' do
version 'r208172'
sha256 '8807016aa002f70770c74901582237f6484b33288f35b5fcf4934f05faf6b2dd'
url "https://builds-nightly.webkit.org/files/trunk/mac/WebKit-SVN-#{version}.dmg"
name 'WebKit Nightly'
homepage 'https://webkit.org/downloads/'
app 'WebKit.app'
end
|
cask "zoho-workdrive" do
version "2.6.4"
sha256 :no_check
url "https://files-accl.zohopublic.com/public/wdbin/download/46f971e4fc4a32b68ad5d7dade38a7d2",
verified: "files-accl.zohopublic.com/"
name "Zoho WorkDrive"
homepage "https://www.zoho.com/workdrive/desktop-sync.html"
app "Zoho WorkDrive.app"
end
Update zoho-workdrive from 2.6.4 to 2.6.6 (#95531)
cask "zoho-workdrive" do
version "2.6.6"
sha256 :no_check
url "https://files-accl.zohopublic.com/public/wdbin/download/46f971e4fc4a32b68ad5d7dade38a7d2",
verified: "files-accl.zohopublic.com/"
name "Zoho WorkDrive"
homepage "https://www.zoho.com/workdrive/desktop-sync.html"
app "Zoho WorkDrive.app"
end
|
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{octocat_herder}
s.version = "0.1.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jacob Helwig"]
s.date = %q{2011-08-12}
s.description = %q{This gem provides Ruby bindings to the v3 GitHub API}
s.email = %q{jacob@technosorcery.net}
s.extra_rdoc_files = [
"LICENSE",
"README.markdown"
]
s.files = [
".document",
".travis.yml",
"CONTRIBUTING.markdown",
"Gemfile",
"Gemfile.lock",
"LICENSE",
"README.markdown",
"Rakefile",
"VERSION",
"lib/octocat_herder.rb",
"lib/octocat_herder/base.rb",
"lib/octocat_herder/connection.rb",
"lib/octocat_herder/pull_request.rb",
"lib/octocat_herder/pull_request/repo.rb",
"lib/octocat_herder/repository.rb",
"lib/octocat_herder/user.rb",
"octocat_herder.gemspec",
"spec/octocat_herder/connection_spec.rb",
"spec/octocat_herder_spec.rb",
"spec/spec_helper.rb"
]
s.homepage = %q{http://github.com/jhelwig/octocat_herder}
s.licenses = ["BSD"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.7}
s.summary = %q{An interface to the v3 GitHub API}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<httparty>, ["~> 0.7.8"])
s.add_runtime_dependency(%q<link_header>, ["~> 0.0.5"])
s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
s.add_development_dependency(%q<mocha>, ["~> 0.9.12"])
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_development_dependency(%q<rcov>, [">= 0"])
s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
s.add_development_dependency(%q<rdoc>, ["~> 3.8.0"])
s.add_development_dependency(%q<bluecloth>, ["~> 2.1.0"])
else
s.add_dependency(%q<httparty>, ["~> 0.7.8"])
s.add_dependency(%q<link_header>, ["~> 0.0.5"])
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
s.add_dependency(%q<mocha>, ["~> 0.9.12"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<rcov>, [">= 0"])
s.add_dependency(%q<yard>, ["~> 0.6.0"])
s.add_dependency(%q<rdoc>, ["~> 3.8.0"])
s.add_dependency(%q<bluecloth>, ["~> 2.1.0"])
end
else
s.add_dependency(%q<httparty>, ["~> 0.7.8"])
s.add_dependency(%q<link_header>, ["~> 0.0.5"])
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
s.add_dependency(%q<mocha>, ["~> 0.9.12"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<rcov>, [">= 0"])
s.add_dependency(%q<yard>, ["~> 0.6.0"])
s.add_dependency(%q<rdoc>, ["~> 3.8.0"])
s.add_dependency(%q<bluecloth>, ["~> 2.1.0"])
end
end
Regenerate gemspec for version 0.1.2
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{octocat_herder}
s.version = "0.1.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = [%q{Jacob Helwig}]
s.date = %q{2011-10-17}
s.description = %q{This gem provides Ruby bindings to the v3 GitHub API}
s.email = %q{jacob@technosorcery.net}
s.extra_rdoc_files = [
"LICENSE",
"README.markdown"
]
s.files = [
".document",
".travis.yml",
"CONTRIBUTING.markdown",
"Gemfile",
"Gemfile.lock",
"LICENSE",
"README.markdown",
"Rakefile",
"VERSION",
"lib/octocat_herder.rb",
"lib/octocat_herder/base.rb",
"lib/octocat_herder/connection.rb",
"lib/octocat_herder/pull_request.rb",
"lib/octocat_herder/pull_request/repo.rb",
"lib/octocat_herder/repository.rb",
"lib/octocat_herder/user.rb",
"octocat_herder.gemspec",
"spec/octocat_herder/connection_spec.rb",
"spec/octocat_herder_spec.rb",
"spec/spec_helper.rb"
]
s.homepage = %q{http://github.com/jhelwig/octocat_herder}
s.licenses = [%q{BSD}]
s.require_paths = [%q{lib}]
s.rubygems_version = %q{1.8.6}
s.summary = %q{An interface to the v3 GitHub API}
if s.respond_to? :specification_version then
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<httparty>, ["~> 0.7.8"])
s.add_runtime_dependency(%q<link_header>, ["~> 0.0.5"])
s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
s.add_development_dependency(%q<mocha>, ["~> 0.9.12"])
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_development_dependency(%q<rcov>, [">= 0"])
s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
s.add_development_dependency(%q<rdoc>, ["~> 3.8.0"])
s.add_development_dependency(%q<bluecloth>, ["~> 2.1.0"])
else
s.add_dependency(%q<httparty>, ["~> 0.7.8"])
s.add_dependency(%q<link_header>, ["~> 0.0.5"])
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
s.add_dependency(%q<mocha>, ["~> 0.9.12"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<rcov>, [">= 0"])
s.add_dependency(%q<yard>, ["~> 0.6.0"])
s.add_dependency(%q<rdoc>, ["~> 3.8.0"])
s.add_dependency(%q<bluecloth>, ["~> 2.1.0"])
end
else
s.add_dependency(%q<httparty>, ["~> 0.7.8"])
s.add_dependency(%q<link_header>, ["~> 0.0.5"])
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
s.add_dependency(%q<mocha>, ["~> 0.9.12"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<rcov>, [">= 0"])
s.add_dependency(%q<yard>, ["~> 0.6.0"])
s.add_dependency(%q<rdoc>, ["~> 3.8.0"])
s.add_dependency(%q<bluecloth>, ["~> 2.1.0"])
end
end
|
require File.expand_path("../lib/omniauth-orcid/version", __FILE__)
Gem::Specification.new do |s|
s.authors = ["Gudmundur A. Thorisson"]
s.email = %q{gthorisson@gmail.com}
s.name = "omniauth-orcid"
s.homepage = %q{https://github.com/gthorisson/omniauth-orcid}
s.summary = %q{ORCID OAuth 2.0 Strategy for OmniAuth 1.0}
s.date = Date.today
s.description = %q{Enables third-party client apps to connect to the ORCID API and access/update protected profile data }
s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE.txt", "*.md", "Rakefile", "Gemfile", "demo.rb", "config.yml", "omniauth-orcid.gemspec"]
s.require_paths = ["lib"]
s.version = OmniAuth::ORCID::VERSION
s.extra_rdoc_files = ["README.md"]
# Declary dependencies here, rather than in the Gemfile
s.add_dependency 'omniauth', '~> 1.0'
s.add_dependency 'omniauth-oauth2', '~> 1.1'
end
Fix "undefined method `today' for Date:Class" error.
require "date"
require File.expand_path("../lib/omniauth-orcid/version", __FILE__)
Gem::Specification.new do |s|
s.authors = ["Gudmundur A. Thorisson"]
s.email = %q{gthorisson@gmail.com}
s.name = "omniauth-orcid"
s.homepage = %q{https://github.com/gthorisson/omniauth-orcid}
s.summary = %q{ORCID OAuth 2.0 Strategy for OmniAuth 1.0}
s.date = Date.today
s.description = %q{Enables third-party client apps to connect to the ORCID API and access/update protected profile data }
s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE.txt", "*.md", "Rakefile", "Gemfile", "demo.rb", "config.yml", "omniauth-orcid.gemspec"]
s.require_paths = ["lib"]
s.version = OmniAuth::ORCID::VERSION
s.extra_rdoc_files = ["README.md"]
# Declary dependencies here, rather than in the Gemfile
s.add_dependency 'omniauth', '~> 1.0'
s.add_dependency 'omniauth-oauth2', '~> 1.1'
end
|
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/omniauth_crowd/version', __FILE__)
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |gem|
gem.authors = ["Robert Di Marco"]
gem.email = ["rob@innovationontherun.com"]
gem.description = "This is an OmniAuth provider for Atlassian Crowd's REST API. It allows you to easily integrate your Rack application in with Atlassian Crowd."
gem.summary = "An OmniAuth provider for Atlassian Crowd REST API"
gem.homepage = "http://github.com/robdimarco/omniauth_crowd"
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.name = "omniauth_crowd"
gem.require_paths = ["lib"]
gem.version = OmniAuth::Crowd::VERSION
gem.add_dependency 'omniauth', '~> 1.0'
gem.add_dependency 'nokogiri', '>= 1.4.4'
gem.add_dependency 'activesupport', '>= 0'
gem.add_development_dependency(%q<rack>, [">= 0"])
gem.add_development_dependency(%q<rake>, [">= 0"])
gem.add_development_dependency(%q<rack-test>, [">= 0"])
gem.add_development_dependency(%q<rspec>, ["~> 3.0.0"])
gem.add_development_dependency(%q<webmock>)
gem.add_development_dependency(%q<bundler>, ["> 1.0.0"])
end
Make a runtime dependency so gems included on deployment
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/omniauth_crowd/version', __FILE__)
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |gem|
gem.authors = ["Robert Di Marco"]
gem.email = ["rob@innovationontherun.com"]
gem.description = "This is an OmniAuth provider for Atlassian Crowd's REST API. It allows you to easily integrate your Rack application in with Atlassian Crowd."
gem.summary = "An OmniAuth provider for Atlassian Crowd REST API"
gem.homepage = "http://github.com/robdimarco/omniauth_crowd"
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.name = "omniauth_crowd"
gem.require_paths = ["lib"]
gem.version = OmniAuth::Crowd::VERSION
gem.add_runtime_dependency 'omniauth', '~> 1.0'
gem.add_runtime_dependency 'nokogiri', '>= 1.4.4'
gem.add_runtime_dependency 'activesupport', '>= 0'
gem.add_development_dependency(%q<rack>, [">= 0"])
gem.add_development_dependency(%q<rake>, [">= 0"])
gem.add_development_dependency(%q<rack-test>, [">= 0"])
gem.add_development_dependency(%q<rspec>, ["~> 3.0.0"])
gem.add_development_dependency(%q<webmock>)
gem.add_development_dependency(%q<bundler>, ["> 1.0.0"])
end
|
class Method
attr_reader :owner, :receiver, :name
def initialize(receiver, method, name)
@receiver = receiver
@owner = receiver.class
@name = name
@method = method
end
def arity
@method.arity
end
def parameters
`#{@method}.$$parameters`
end
def source_location
`#{@method}.$$source_location` || ['(eval)', 0]
end
def comments
`#{@method}.$$comments` || []
end
def call(*args, &block)
%x{
#@method.$$p = block;
return #@method.apply(#@receiver, args);
}
end
alias [] call
def unbind
UnboundMethod.new(@owner, @method, @name)
end
def to_proc
%x{
var proc = function () { return self.$call.apply(self, $slice.call(arguments)); };
proc.$$unbound = #@method;
proc.$$is_lambda = true;
return proc;
}
end
def inspect
"#<Method: #{@receiver.class}##@name>"
end
end
class UnboundMethod
attr_reader :owner, :name
def initialize(owner, method, name)
@owner = owner
@method = method
@name = name
end
def arity
@method.arity
end
def parameters
`#{@method}.$$parameters`
end
def source_location
`#{@method}.$$source_location` || ['(eval)', 0]
end
def comments
`#{@method}.$$comments` || []
end
def bind(object)
# TODO: re-enable when Module#< is fixed
# unless object.class <= @owner
# raise TypeError, "can't bind singleton method to a different class"
# end
Method.new(object, @method, @name)
end
def inspect
"#<UnboundMethod: #{@owner.name}##@name>"
end
end
Replace method wrapper with simple bound function
class Method
attr_reader :owner, :receiver, :name
def initialize(receiver, method, name)
@receiver = receiver
@owner = receiver.class
@name = name
@method = method
end
def arity
@method.arity
end
def parameters
`#{@method}.$$parameters`
end
def source_location
`#{@method}.$$source_location` || ['(eval)', 0]
end
def comments
`#{@method}.$$comments` || []
end
def call(*args, &block)
%x{
#@method.$$p = block;
return #@method.apply(#@receiver, args);
}
end
alias [] call
def unbind
UnboundMethod.new(@owner, @method, @name)
end
def to_proc
%x{
var proc = self.$call.bind(self);
proc.$$unbound = #@method;
proc.$$is_lambda = true;
return proc;
}
end
def inspect
"#<Method: #{@receiver.class}##@name>"
end
end
class UnboundMethod
attr_reader :owner, :name
def initialize(owner, method, name)
@owner = owner
@method = method
@name = name
end
def arity
@method.arity
end
def parameters
`#{@method}.$$parameters`
end
def source_location
`#{@method}.$$source_location` || ['(eval)', 0]
end
def comments
`#{@method}.$$comments` || []
end
def bind(object)
# TODO: re-enable when Module#< is fixed
# unless object.class <= @owner
# raise TypeError, "can't bind singleton method to a different class"
# end
Method.new(object, @method, @name)
end
def inspect
"#<UnboundMethod: #{@owner.name}##@name>"
end
end
|
module Spree
class FrontendConfiguration < Preferences::Configuration
preference :coupon_codes_enabled, :boolean, default: true # Determines if we show coupon code form at cart and checkout
preference :http_cache_enabled, :boolean, default: true
preference :locale, :string, default: Rails.application.config.i18n.default_locale
preference :products_filters, :array, default: %w(keywords price sort_by)
preference :additional_filters_partials, :array, default: %w()
preference :remember_me_enabled, :boolean, default: true
end
end
Default config locale should be nil
Starting with Spree 4.2 locale is Store-based not application wide set
module Spree
class FrontendConfiguration < Preferences::Configuration
preference :coupon_codes_enabled, :boolean, default: true # Determines if we show coupon code form at cart and checkout
preference :http_cache_enabled, :boolean, default: true
preference :locale, :string, default: nil
preference :products_filters, :array, default: %w(keywords price sort_by)
preference :additional_filters_partials, :array, default: %w()
preference :remember_me_enabled, :boolean, default: true
end
end
|
namespace :juggernaut do
desc "Reinstall the Juggernaut js and swf files"
task :reinstall do
load "#{File.dirname(__FILE__)}/../install.rb"
end
end
namespace :juggernaut do
desc 'Compile the juggernaut flash file'
task :compile_flash do
`mtasc -header 1:1:1 -main -swf media/juggernaut.swf media/juggernaut.as`
end
end
Needs version - 8
namespace :juggernaut do
desc "Reinstall the Juggernaut js and swf files"
task :reinstall do
load "#{File.dirname(__FILE__)}/../install.rb"
end
end
namespace :juggernaut do
desc 'Compile the juggernaut flash file'
task :compile_flash do
`mtasc -version 8 -header 1:1:1 -main -swf media/juggernaut.swf media/juggernaut.as`
end
end
|
# Attributes and methods for raster works
module RasterBehavior
extend ActiveSupport::Concern
include ::CurationConcerns::GenericWorkBehavior
include ::CurationConcerns::BasicMetadata
include ::BasicGeoMetadata
included do
# Raster Works can aggregate one or many Vector Works
# This provides the the ability to link extracted vector features projected to different CRS's to the source raster data set
aggregates :vectors, predicate: RDF::Vocab::ORE.aggregates,
class_name: '::Vector',
type_validator: type_validator
# Raster Works can aggregate one or many metadata files
aggregates :metadata_files, predicate: RDF::Vocab::ORE.aggregates,
class_name: '::RasterMetadataFile',
type_validator: type_validator
# Raster Works can only link to GenericFile resources as members if they are instances of GeoConcerns::RasterFile
filters_association :members, as: :raster_files, condition: :concerns_raster_file?
end
# Inspects whether or not this Object is a Raster Work
# @return [Boolean]
def concerns_raster?
true
end
# Inspects whether or not this Object is a Raster File
# @return [Boolean]
def concerns_raster_file?
false
end
# Retrieve all Image Works for which georeferencing generates this Raster Work
# @return [Array]
def images
aggregated_by.select { |parent| parent.class.included_modules.include?(::ImageBehavior) }
end
# Retrieve the only Image Works for which georeferencing generates this Raster Work
# @return [GeoConcerns::Image]
def image
images.first
end
end
Removing trailing whitespace within the RasterBehavior Module
# Attributes and methods for raster works
module RasterBehavior
extend ActiveSupport::Concern
include ::CurationConcerns::GenericWorkBehavior
include ::CurationConcerns::BasicMetadata
include ::BasicGeoMetadata
included do
# Raster Works can aggregate one or many Vector Works
# This provides the the ability to link extracted vector features projected to different CRS's to the source raster data set
aggregates :vectors, predicate: RDF::Vocab::ORE.aggregates,
class_name: '::Vector',
type_validator: type_validator
# Raster Works can aggregate one or many metadata files
aggregates :metadata_files, predicate: RDF::Vocab::ORE.aggregates,
class_name: '::RasterMetadataFile',
type_validator: type_validator
# Raster Works can only link to GenericFile resources as members if they are instances of GeoConcerns::RasterFile
filters_association :members, as: :raster_files, condition: :concerns_raster_file?
end
# Inspects whether or not this Object is a Raster Work
# @return [Boolean]
def concerns_raster?
true
end
# Inspects whether or not this Object is a Raster File
# @return [Boolean]
def concerns_raster_file?
false
end
# Retrieve all Image Works for which georeferencing generates this Raster Work
# @return [Array]
def images
aggregated_by.select { |parent| parent.class.included_modules.include?(::ImageBehavior) }
end
# Retrieve the only Image Works for which georeferencing generates this Raster Work
# @return [GeoConcerns::Image]
def image
images.first
end
end
|
Create nyc-farmers-markets.gemspec
Gem::Specification.new do |s|
s.name = 'nyc-farmers-markets'
s.version = '0.0.0'
s.date = '2016-01-28'
s.summary = "An wrapper for the NYC Farmers Markets API"
s.description = "A simple hello world gem"
s.authors = ["Kevin McCormack"]
s.email = 'wittyman37@yahoo.com'
s.files = ["lib/nyc-farmers-markets.rb"]
s.homepage =
'http://rubygems.org/gems/nyc-farmers-markets'
s.license = 'MIT'
end
|
[Add] FirebaseInAppMessagingSwift (10.2.0)
Pod::Spec.new do |s|
s.name = 'FirebaseInAppMessagingSwift'
s.version='10.2.0'
s.summary = 'Swift Extensions for Firebase In-App Messaging'
s.description = <<-DESC
FirebaseInAppMessaging is the headless component of Firebase In-App Messaging on iOS client side.
See more product details at https://firebase.google.com/products/in-app-messaging/ about Firebase In-App Messaging.
DESC
s.homepage = 'https://developers.google.com/'
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
s.authors = 'Google, Inc.'
s.source = {
:git => 'https://github.com/Firebase/firebase-ios-sdk.git',
:tag => 'CocoaPods-10.2.0.nightly'
}
s.swift_version = '5.3'
s.ios.deployment_target = '13.0'
s.cocoapods_version = '>= 1.4.0'
s.prefix_header_file = false
s.source_files = [
'FirebaseInAppMessaging/Swift/Source/**/*.swift',
]
s.test_spec 'unit' do |unit_tests|
unit_tests.scheme = { :code_coverage => true }
unit_tests.source_files = 'FirebaseInAppMessaging/Swift/Tests/Unit/*.swift'
unit_tests.requires_app_host = true
end
s.framework = 'UIKit'
s.dependency 'FirebaseInAppMessaging', '~> 10.0-beta'
end
|
[Add] FirebaseMLModelDownloader (9.0.0-beta)
Pod::Spec.new do |s|
s.name = 'FirebaseMLModelDownloader'
s.version = '9.0.0-beta'
s.summary = 'Firebase ML Model Downloader'
s.description = <<-DESC
This is the new ML Model Downloader CocoaPod.
DESC
s.homepage = 'https://firebase.google.com'
s.license = { :type => 'Apache', :file => 'LICENSE' }
s.authors = 'Google, Inc.'
s.source = {
:git => 'https://github.com/firebase/firebase-ios-sdk.git',
:tag => 'CocoaPods-9.0.0.nightly'
}
s.social_media_url = 'https://twitter.com/Firebase'
s.swift_version = '5.3'
ios_deployment_target = '10.0'
osx_deployment_target = '10.12'
tvos_deployment_target = '10.0'
watchos_deployment_target = '6.0'
s.ios.deployment_target = ios_deployment_target
s.osx.deployment_target = osx_deployment_target
s.tvos.deployment_target = tvos_deployment_target
s.watchos.deployment_target = watchos_deployment_target
s.cocoapods_version = '>= 1.4.0'
s.prefix_header_file = false
s.source_files = [
'FirebaseMLModelDownloader/Sources/**/*.swift',
]
s.framework = 'Foundation'
s.dependency 'FirebaseCore', '~> 9.0'
s.dependency 'FirebaseInstallations', '~> 9.0'
s.dependency 'GoogleDataTransport', '~> 9.1'
# TODO: Revisit this dependency
s.dependency 'GoogleUtilities/Logger', '~> 7.7'
s.dependency 'SwiftProtobuf', '~> 1.19'
s.pod_target_xcconfig = {
'GCC_C_LANGUAGE_STANDARD' => 'c99',
'GCC_PREPROCESSOR_DEFINITIONS' => 'FIRMLModelDownloader_VERSION=' + s.version.to_s,
'OTHER_CFLAGS' => '-fno-autolink',
}
s.test_spec 'unit' do |unit_tests|
unit_tests.scheme = { :code_coverage => true }
unit_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
unit_tests.source_files = 'FirebaseMLModelDownloader/Tests/Unit/**/*.swift'
unit_tests.requires_app_host = true
end
s.test_spec 'integration' do |int_tests|
int_tests.scheme = { :code_coverage => true }
int_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
int_tests.source_files = 'FirebaseMLModelDownloader/Tests/Integration/**/*.swift'
int_tests.resources = 'FirebaseMLModelDownloader/Tests/Integration/Resources/GoogleService-Info.plist'
int_tests.requires_app_host = true
end
end
|
module HTML
class Sanitizer
def sanitize(text, options = {})
return text unless sanitizeable?(text)
tokenize(text, options).join
end
def sanitizeable?(text)
!(text.nil? || text.empty? || !text.index("<"))
end
protected
def tokenize(text, options)
tokenizer = HTML::Tokenizer.new(text)
result = []
while token = tokenizer.next
node = Node.parse(nil, 0, 0, token, false)
process_node node, result, options
end
result
end
def process_node(node, result, options)
result << node.to_s
end
end
class FullSanitizer < Sanitizer
def sanitize(text, options = {})
result = super
# strip any comments, and if they have a newline at the end (ie. line with
# only a comment) strip that too
result.gsub!(/<!--(.*?)-->[\n]?/m, "") if result
# Recurse - handle all dirty nested tags
result == text ? result : sanitize(result, options)
end
def process_node(node, result, options)
result << node.to_s if node.class == HTML::Text
end
end
class LinkSanitizer < FullSanitizer
cattr_accessor :included_tags, :instance_writer => false
self.included_tags = Set.new(%w(a href))
def sanitizeable?(text)
!(text.nil? || text.empty? || !((text.index("<a") || text.index("<href")) && text.index(">")))
end
protected
def process_node(node, result, options)
result << node.to_s unless node.is_a?(HTML::Tag) && included_tags.include?(node.name)
end
end
class WhiteListSanitizer < Sanitizer
[:protocol_separator, :uri_attributes, :allowed_attributes, :allowed_tags, :allowed_protocols, :bad_tags,
:allowed_css_properties, :allowed_css_keywords, :shorthand_css_properties].each do |attr|
class_inheritable_accessor attr, :instance_writer => false
end
# A regular expression of the valid characters used to separate protocols like
# the ':' in 'http://foo.com'
self.protocol_separator = /:|(�*58)|(p)|(%|%)3A/
# Specifies a Set of HTML attributes that can have URIs.
self.uri_attributes = Set.new(%w(href src cite action longdesc xlink:href lowsrc))
# Specifies a Set of 'bad' tags that the #sanitize helper will remove completely, as opposed
# to just escaping harmless tags like <font>
self.bad_tags = Set.new(%w(script))
# Specifies the default Set of tags that the #sanitize helper will allow unscathed.
self.allowed_tags = Set.new(%w(strong em b i p code pre tt samp kbd var sub
sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr
acronym a img blockquote del ins))
# Specifies the default Set of html attributes that the #sanitize helper will leave
# in the allowed tag.
self.allowed_attributes = Set.new(%w(href src width height alt cite datetime title class name xml:lang abbr))
# Specifies the default Set of acceptable css properties that #sanitize and #sanitize_css will accept.
self.allowed_protocols = Set.new(%w(ed2k ftp http https irc mailto news gopher nntp telnet webcal xmpp callto
feed svn urn aim rsync tag ssh sftp rtsp afs))
# Specifies the default Set of acceptable css keywords that #sanitize and #sanitize_css will accept.
self.allowed_css_properties = Set.new(%w(azimuth background-color border-bottom-color border-collapse
border-color border-left-color border-right-color border-top-color clear color cursor direction display
elevation float font font-family font-size font-style font-variant font-weight height letter-spacing line-height
overflow pause pause-after pause-before pitch pitch-range richness speak speak-header speak-numeral speak-punctuation
speech-rate stress text-align text-decoration text-indent unicode-bidi vertical-align voice-family volume white-space
width))
# Specifies the default Set of acceptable css keywords that #sanitize and #sanitize_css will accept.
self.allowed_css_keywords = Set.new(%w(auto aqua black block blue bold both bottom brown center
collapse dashed dotted fuchsia gray green !important italic left lime maroon medium none navy normal
nowrap olive pointer purple red right solid silver teal top transparent underline white yellow))
# Specifies the default Set of allowed shorthand css properties for the #sanitize and #sanitize_css helpers.
self.shorthand_css_properties = Set.new(%w(background border margin padding))
# Sanitizes a block of css code. Used by #sanitize when it comes across a style attribute
def sanitize_css(style)
# disallow urls
style = style.to_s.gsub(/url\s*\(\s*[^\s)]+?\s*\)\s*/, ' ')
# gauntlet
if style !~ /^([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*$/ ||
style !~ /^(\s*[-\w]+\s*:\s*[^:;]*(;|$)\s*)*$/
return ''
end
clean = []
style.scan(/([-\w]+)\s*:\s*([^:;]*)/) do |prop,val|
if allowed_css_properties.include?(prop.downcase)
clean << prop + ': ' + val + ';'
elsif shorthand_css_properties.include?(prop.split('-')[0].downcase)
unless val.split().any? do |keyword|
!allowed_css_keywords.include?(keyword) &&
keyword !~ /^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$/
end
clean << prop + ': ' + val + ';'
end
end
end
clean.join(' ')
end
protected
def tokenize(text, options)
options[:parent] = []
options[:attributes] ||= allowed_attributes
options[:tags] ||= allowed_tags
super
end
def process_node(node, result, options)
result << case node
when HTML::Tag
if node.closing == :close
options[:parent].shift
else
options[:parent].unshift node.name
end
process_attributes_for node, options
options[:tags].include?(node.name) ? node : nil
else
bad_tags.include?(options[:parent].first) ? nil : node.to_s.gsub(/</, "<")
end
end
def process_attributes_for(node, options)
return unless node.attributes
node.attributes.keys.each do |attr_name|
value = node.attributes[attr_name].to_s
if !options[:attributes].include?(attr_name) || contains_bad_protocols?(attr_name, value)
node.attributes.delete(attr_name)
else
node.attributes[attr_name] = attr_name == 'style' ? sanitize_css(value) : CGI::escapeHTML(CGI::unescapeHTML(value))
end
end
end
def contains_bad_protocols?(attr_name, value)
uri_attributes.include?(attr_name) &&
(value =~ /(^[^\/:]*):|(�*58)|(p)|(%|%)3A/ && !allowed_protocols.include?(value.split(protocol_separator).first))
end
end
end
html-scanner uses Set and class_inheritable_accessor
require 'set'
require 'active_support/core_ext/class/inheritable_attributes'
module HTML
class Sanitizer
def sanitize(text, options = {})
return text unless sanitizeable?(text)
tokenize(text, options).join
end
def sanitizeable?(text)
!(text.nil? || text.empty? || !text.index("<"))
end
protected
def tokenize(text, options)
tokenizer = HTML::Tokenizer.new(text)
result = []
while token = tokenizer.next
node = Node.parse(nil, 0, 0, token, false)
process_node node, result, options
end
result
end
def process_node(node, result, options)
result << node.to_s
end
end
class FullSanitizer < Sanitizer
def sanitize(text, options = {})
result = super
# strip any comments, and if they have a newline at the end (ie. line with
# only a comment) strip that too
result.gsub!(/<!--(.*?)-->[\n]?/m, "") if result
# Recurse - handle all dirty nested tags
result == text ? result : sanitize(result, options)
end
def process_node(node, result, options)
result << node.to_s if node.class == HTML::Text
end
end
class LinkSanitizer < FullSanitizer
cattr_accessor :included_tags, :instance_writer => false
self.included_tags = Set.new(%w(a href))
def sanitizeable?(text)
!(text.nil? || text.empty? || !((text.index("<a") || text.index("<href")) && text.index(">")))
end
protected
def process_node(node, result, options)
result << node.to_s unless node.is_a?(HTML::Tag) && included_tags.include?(node.name)
end
end
class WhiteListSanitizer < Sanitizer
[:protocol_separator, :uri_attributes, :allowed_attributes, :allowed_tags, :allowed_protocols, :bad_tags,
:allowed_css_properties, :allowed_css_keywords, :shorthand_css_properties].each do |attr|
class_inheritable_accessor attr, :instance_writer => false
end
# A regular expression of the valid characters used to separate protocols like
# the ':' in 'http://foo.com'
self.protocol_separator = /:|(�*58)|(p)|(%|%)3A/
# Specifies a Set of HTML attributes that can have URIs.
self.uri_attributes = Set.new(%w(href src cite action longdesc xlink:href lowsrc))
# Specifies a Set of 'bad' tags that the #sanitize helper will remove completely, as opposed
# to just escaping harmless tags like <font>
self.bad_tags = Set.new(%w(script))
# Specifies the default Set of tags that the #sanitize helper will allow unscathed.
self.allowed_tags = Set.new(%w(strong em b i p code pre tt samp kbd var sub
sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr
acronym a img blockquote del ins))
# Specifies the default Set of html attributes that the #sanitize helper will leave
# in the allowed tag.
self.allowed_attributes = Set.new(%w(href src width height alt cite datetime title class name xml:lang abbr))
# Specifies the default Set of acceptable css properties that #sanitize and #sanitize_css will accept.
self.allowed_protocols = Set.new(%w(ed2k ftp http https irc mailto news gopher nntp telnet webcal xmpp callto
feed svn urn aim rsync tag ssh sftp rtsp afs))
# Specifies the default Set of acceptable css keywords that #sanitize and #sanitize_css will accept.
self.allowed_css_properties = Set.new(%w(azimuth background-color border-bottom-color border-collapse
border-color border-left-color border-right-color border-top-color clear color cursor direction display
elevation float font font-family font-size font-style font-variant font-weight height letter-spacing line-height
overflow pause pause-after pause-before pitch pitch-range richness speak speak-header speak-numeral speak-punctuation
speech-rate stress text-align text-decoration text-indent unicode-bidi vertical-align voice-family volume white-space
width))
# Specifies the default Set of acceptable css keywords that #sanitize and #sanitize_css will accept.
self.allowed_css_keywords = Set.new(%w(auto aqua black block blue bold both bottom brown center
collapse dashed dotted fuchsia gray green !important italic left lime maroon medium none navy normal
nowrap olive pointer purple red right solid silver teal top transparent underline white yellow))
# Specifies the default Set of allowed shorthand css properties for the #sanitize and #sanitize_css helpers.
self.shorthand_css_properties = Set.new(%w(background border margin padding))
# Sanitizes a block of css code. Used by #sanitize when it comes across a style attribute
def sanitize_css(style)
# disallow urls
style = style.to_s.gsub(/url\s*\(\s*[^\s)]+?\s*\)\s*/, ' ')
# gauntlet
if style !~ /^([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*$/ ||
style !~ /^(\s*[-\w]+\s*:\s*[^:;]*(;|$)\s*)*$/
return ''
end
clean = []
style.scan(/([-\w]+)\s*:\s*([^:;]*)/) do |prop,val|
if allowed_css_properties.include?(prop.downcase)
clean << prop + ': ' + val + ';'
elsif shorthand_css_properties.include?(prop.split('-')[0].downcase)
unless val.split().any? do |keyword|
!allowed_css_keywords.include?(keyword) &&
keyword !~ /^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$/
end
clean << prop + ': ' + val + ';'
end
end
end
clean.join(' ')
end
protected
def tokenize(text, options)
options[:parent] = []
options[:attributes] ||= allowed_attributes
options[:tags] ||= allowed_tags
super
end
def process_node(node, result, options)
result << case node
when HTML::Tag
if node.closing == :close
options[:parent].shift
else
options[:parent].unshift node.name
end
process_attributes_for node, options
options[:tags].include?(node.name) ? node : nil
else
bad_tags.include?(options[:parent].first) ? nil : node.to_s.gsub(/</, "<")
end
end
def process_attributes_for(node, options)
return unless node.attributes
node.attributes.keys.each do |attr_name|
value = node.attributes[attr_name].to_s
if !options[:attributes].include?(attr_name) || contains_bad_protocols?(attr_name, value)
node.attributes.delete(attr_name)
else
node.attributes[attr_name] = attr_name == 'style' ? sanitize_css(value) : CGI::escapeHTML(CGI::unescapeHTML(value))
end
end
end
def contains_bad_protocols?(attr_name, value)
uri_attributes.include?(attr_name) &&
(value =~ /(^[^\/:]*):|(�*58)|(p)|(%|%)3A/ && !allowed_protocols.include?(value.split(protocol_separator).first))
end
end
end
|
# frozen_string_literal: true
module Course::LessonPlan::PersonalizationConcern
extend ActiveSupport::Concern
FOMO_LEARNING_RATE_MAX = 1.0
FOMO_LEARNING_RATE_MIN = 0.67
FOMO_LEARNING_RATE_HARD_MIN = 0.5 # No matter how doomed the student is, refuse to go faster than this
FOMO_DATE_ROUNDING_THRESHOLD = 0.8
STRAGGLERS_LEARNING_RATE_MAX = 2.0
STRAGGLERS_LEARNING_RATE_MIN = 1.0
STRAGGLERS_LEARNING_RATE_HARD_MIN = 0.8
STRAGGLERS_DATE_ROUNDING_THRESHOLD = 0.2
STRAGGLERS_FIXES = 1
# Dispatches the call to the correct personalization algorithm
# If the algorithm takes too long (e.g. voodoo AI magic), it is responsible for scheduling an async job
def update_personalized_timeline_for(course_user, timeline_algorithm = nil)
timeline_algorithm ||= course_user.timeline_algorithm
Rails.cache.delete("course/lesson_plan/personalization_concern/#{course_user.id}")
send("algorithm_#{timeline_algorithm}", course_user)
end
# Fixed timeline: Follow reference timeline
# Delete all personal times that are not fixed or submitted
def algorithm_fixed(course_user)
submitted_lesson_plan_item_ids = lesson_plan_items_submission_time_hash(course_user)
course_user.personal_times.where(fixed: false).
where.not(lesson_plan_item_id: submitted_lesson_plan_item_ids.keys).delete_all
end
# Some properties for the following algorithms:
# - We don't shift personal dates that have already passed. This is to prevent items becoming locked
# when students are switched between different algos. There are thus quite a few checks for
# > Time.zone.now. The only exception is the backwards-shifting of already-past deadlines, which
# allows students to slow down their learning more effectively.
# - We don't shift closing dates forward when the item has already opened for the student. This is to
# prevent students from being shocked that their deadlines have shifted forward suddenly.
def algorithm_otot(course_user)
learning_rate_ema = retrieve_or_compute_course_user_data(course_user).last
return if learning_rate_ema.nil?
# Apply the appropriate algo depending on student's leaning rate
learning_rate_ema < 1 ? algorithm_fomo(course_user) : algorithm_stragglers(course_user)
end
def algorithm_fomo(course_user)
submitted_lesson_plan_item_ids, items, learning_rate_ema = retrieve_or_compute_course_user_data(course_user)
return if learning_rate_ema.nil?
# Constrain learning rate
effective_min, effective_max = compute_learning_rate_effective_limits(
course_user, items, submitted_lesson_plan_item_ids, FOMO_LEARNING_RATE_MIN, FOMO_LEARNING_RATE_MAX
)
learning_rate_ema = [FOMO_LEARNING_RATE_HARD_MIN, effective_min, [learning_rate_ema, effective_max].min].max
# Compute personal times for all items
course_tz = course_user.course.time_zone
reference_point = items.first.reference_time_for(course_user).start_at
personal_point = reference_point
course_user.transaction do
items.each do |item|
# Update reference point and personal point
if item.affects_personal_times? && item.id.in?(submitted_lesson_plan_item_ids.keys)
reference_point = item.reference_time_for(course_user).start_at
personal_point = item.time_for(course_user).start_at
end
next if !item.has_personal_times? || item.id.in?(submitted_lesson_plan_item_ids.keys) ||
item.personal_time_for(course_user)&.fixed?
reference_time = item.reference_time_for(course_user)
personal_time = item.find_or_create_personal_time_for(course_user)
# If the user was previously on the stragglers algorithm and just switched over, and has already open
# items, we want to keep those items as they are
next if personal_time.end_at > reference_time.end_at && personal_time.start_at < Time.zone.now
# Update start_at
if personal_time.start_at > Time.zone.now
personal_time.start_at =
round_to_date(
personal_point + ((reference_time.start_at - reference_point) * learning_rate_ema),
course_tz,
FOMO_DATE_ROUNDING_THRESHOLD
)
end
# Hard limits to make sure we don't fail bounds checks
personal_time.start_at = [personal_time.start_at, reference_time.start_at, reference_time.end_at].compact.min
# Update bonus_end_at
if personal_time.bonus_end_at && personal_time.bonus_end_at > Time.zone.now
personal_time.bonus_end_at = reference_time.bonus_end_at
end
# Update end_at
personal_time.end_at = reference_time.end_at if personal_time.end_at && personal_time.end_at > Time.zone.now
personal_time.save!
end
end
end
def algorithm_stragglers(course_user)
submitted_lesson_plan_item_ids, items, learning_rate_ema = retrieve_or_compute_course_user_data(course_user)
return if learning_rate_ema.nil?
# Constrain learning rate
effective_min, effective_max = compute_learning_rate_effective_limits(
course_user, items, submitted_lesson_plan_item_ids, STRAGGLERS_LEARNING_RATE_MIN, STRAGGLERS_LEARNING_RATE_MAX
)
learning_rate_ema = [STRAGGLERS_LEARNING_RATE_HARD_MIN, effective_min, [learning_rate_ema, effective_max].min].max
# Compute personal times for all items
course_tz = course_user.course.time_zone
reference_point = items.first.reference_time_for(course_user).end_at
personal_point = reference_point
course_user.transaction do
items.each do |item|
# Update reference point and personal point
if item.affects_personal_times? && item.id.in?(submitted_lesson_plan_item_ids.keys) &&
item.reference_time_for(course_user).end_at.present?
reference_point = item.reference_time_for(course_user).end_at
personal_point = item.time_for(course_user).end_at
end
next if !item.has_personal_times? || item.id.in?(submitted_lesson_plan_item_ids.keys) ||
item.personal_time_for(course_user)&.fixed? || reference_point.nil?
reference_time = item.reference_time_for(course_user)
personal_time = item.find_or_create_personal_time_for(course_user)
# Update start_at
personal_time.start_at = reference_time.start_at if personal_time.start_at > Time.zone.now
# Update bonus_end_at
if personal_time.bonus_end_at && personal_time.bonus_end_at > Time.zone.now
personal_time.bonus_end_at = reference_time.bonus_end_at
end
# Update end_at
if reference_time.end_at.present?
new_end_at = round_to_date(
personal_point + ((reference_time.end_at - reference_point) * learning_rate_ema),
course_tz,
STRAGGLERS_DATE_ROUNDING_THRESHOLD,
to_2359: true
)
# Hard limits to make sure we don't fail bounds checks
new_end_at = [new_end_at, reference_time.end_at, reference_time.start_at].compact.max
# We don't want to shift the end_at forward if the item is already opened or if the deadline
# has already passed. Backwards is ok.
# Assumption: end_at is >= start_at
if new_end_at > personal_time.end_at || personal_time.start_at > Time.zone.now
personal_time.end_at = new_end_at
end
end
personal_time.save!
end
end
# Fix next few items
items.select { |item| item.has_personal_times? && !item.id.in?(submitted_lesson_plan_item_ids.keys) }.
slice(0, STRAGGLERS_FIXES).
each { |item| item.reload.find_or_create_personal_time_for(course_user).update(fixed: true) }
end
# Returns cached data for the course user, if available, else it does the necessary computations and caches.
# Data returned is an array containing:
# - The submitted lesson plan item IDs
# - The published lesson plan items with reference and personal times, sorted by start_at for user
# - Learning rate computed for the user
# in the above order.
def retrieve_or_compute_course_user_data(course_user)
Rails.cache.fetch("course/lesson_plan/personalization_concern/#{course_user.id}", expires_in: 1.hours) do
submitted_lesson_plan_item_ids = lesson_plan_items_submission_time_hash(course_user)
items = course_user.course.lesson_plan_items.published.
with_reference_times_for(course_user).
with_personal_times_for(course_user).
to_a
items = items.sort_by { |x| x.time_for(course_user).start_at }
items_affects_personal_times = items.select(&:affects_personal_times?)
learning_rate_ema = compute_learning_rate_ema(
course_user, items_affects_personal_times, submitted_lesson_plan_item_ids
)
[submitted_lesson_plan_item_ids, items, learning_rate_ema]
end
end
# Returns { lesson_plan_item_id => submitted_time or nil }
# If the lesson plan item is a key in this hash then we consider the item "submitted" regardless of whether we have a
# submission time for it.
def lesson_plan_items_submission_time_hash(course_user)
lesson_plan_items_submission_time_hash = {}
# Assessments - consider submitted only if submitted_at is present
lesson_plan_items_submission_time_hash.merge!(
course_user.course.assessments.
with_submissions_by(course_user.user).
select { |x| x.submissions.present? && x.submissions.first.submitted_at.present? }.
map { |x| [x.lesson_plan_item.id, x.submissions.first.submitted_at] }.to_h
)
# Videos - consider submitted as long as submission exists
lesson_plan_items_submission_time_hash.merge!(
course_user.course.videos.
with_submissions_by(course_user.user).
select { |x| x.submissions.present? }.
map { |x| [x.lesson_plan_item.id, nil] }.to_h
)
end
# Min/max overall learning rate refers to how early/late a student is allowed to complete the course.
#
# E.g. if max_overall_lr = 2 means a student is allowed to complete a 1-month course over 2 months.
# However, if the student somehow managed to complete half of the course within the first day, then we can allow him
# to continue at lr = 4 and still have the student complete the course over 2 months. This method computes the
# effective limits to preserve the overall min/max lr.
#
# NOTE: It is completely possible for negative results (even -infinity), i.e. student needs to go back in time in
# order to have any hope of completing the course within the limits. The algorithm needs to take care of this.
def compute_learning_rate_effective_limits(
course_user, items, submitted_lesson_plan_item_ids, min_overall_learning_rate, max_overall_learning_rate
)
course_start = items.first.start_at
course_end = items.last.start_at
last_submitted_item =
items.reverse_each.lazy.
select { |item| item.affects_personal_times? && item.id.in?(submitted_lesson_plan_item_ids.keys) }.first
return [min_overall_learning_rate, max_overall_learning_rate] if last_submitted_item.nil?
reference_remaining_time = items.last.start_at - last_submitted_item.reference_time_for(course_user).start_at
min_personal_remaining_time =
course_start +
(min_overall_learning_rate * (course_end - course_start)) - last_submitted_item.time_for(course_user).start_at
max_personal_remaining_time =
course_start +
(max_overall_learning_rate * (course_end - course_start)) - last_submitted_item.time_for(course_user).start_at
[min_personal_remaining_time / reference_remaining_time, max_personal_remaining_time / reference_remaining_time]
end
# Exponential Moving Average (EMA) of the learning rate
def compute_learning_rate_ema(course_user, course_assessments, submitted_lesson_plan_item_ids, alpha = 0.4)
submitted_assessments = course_assessments.
select { |x| x.id.in? submitted_lesson_plan_item_ids.keys }.
select { |x| x.time_for(course_user).end_at.present? }.
sort_by { |x| x.time_for(course_user).start_at }
return nil if submitted_assessments.empty?
learning_rate_ema = 1.0
submitted_assessments.each do |assessment|
times = assessment.time_for(course_user)
next if times.end_at - times.start_at == 0 || submitted_lesson_plan_item_ids[assessment.id].nil?
learning_rate = (submitted_lesson_plan_item_ids[assessment.id] - times.start_at) / (times.end_at - times.start_at)
learning_rate = [learning_rate, 0].max
learning_rate_ema = (alpha * learning_rate) + ((1 - alpha) * learning_rate_ema)
end
learning_rate_ema
end
private
# Round to "nearest" date in course's timezone, NOT user's timezone.
#
# @param [Time] datetime The datetime object to round.
# @param [String] course_tz The timezone of the course.
# @param [Float] threshold How generously we round off. E.g. if `threshold` = 0.8, then a datetime with a time of
# > 0.8 * 1.day will be snapped to the next day.
# @param [Boolean] to_2359 Whether to round off to 2359. This will set the datetime to be 2359 of the date before the
# rounded date.
def round_to_date(datetime, course_tz, threshold = 0.5, to_2359: false)
prev_day = datetime.in_time_zone(course_tz).to_date.in_time_zone(course_tz).in_time_zone
date = ((datetime - prev_day) < threshold ? prev_day : prev_day + 1.day)
to_2359 ? date - 1.minute : date
end
end
style: disable rubocop naming/variablenumber for a line
# frozen_string_literal: true
module Course::LessonPlan::PersonalizationConcern
extend ActiveSupport::Concern
FOMO_LEARNING_RATE_MAX = 1.0
FOMO_LEARNING_RATE_MIN = 0.67
FOMO_LEARNING_RATE_HARD_MIN = 0.5 # No matter how doomed the student is, refuse to go faster than this
FOMO_DATE_ROUNDING_THRESHOLD = 0.8
STRAGGLERS_LEARNING_RATE_MAX = 2.0
STRAGGLERS_LEARNING_RATE_MIN = 1.0
STRAGGLERS_LEARNING_RATE_HARD_MIN = 0.8
STRAGGLERS_DATE_ROUNDING_THRESHOLD = 0.2
STRAGGLERS_FIXES = 1
# Dispatches the call to the correct personalization algorithm
# If the algorithm takes too long (e.g. voodoo AI magic), it is responsible for scheduling an async job
def update_personalized_timeline_for(course_user, timeline_algorithm = nil)
timeline_algorithm ||= course_user.timeline_algorithm
Rails.cache.delete("course/lesson_plan/personalization_concern/#{course_user.id}")
send("algorithm_#{timeline_algorithm}", course_user)
end
# Fixed timeline: Follow reference timeline
# Delete all personal times that are not fixed or submitted
def algorithm_fixed(course_user)
submitted_lesson_plan_item_ids = lesson_plan_items_submission_time_hash(course_user)
course_user.personal_times.where(fixed: false).
where.not(lesson_plan_item_id: submitted_lesson_plan_item_ids.keys).delete_all
end
# Some properties for the following algorithms:
# - We don't shift personal dates that have already passed. This is to prevent items becoming locked
# when students are switched between different algos. There are thus quite a few checks for
# > Time.zone.now. The only exception is the backwards-shifting of already-past deadlines, which
# allows students to slow down their learning more effectively.
# - We don't shift closing dates forward when the item has already opened for the student. This is to
# prevent students from being shocked that their deadlines have shifted forward suddenly.
def algorithm_otot(course_user)
learning_rate_ema = retrieve_or_compute_course_user_data(course_user).last
return if learning_rate_ema.nil?
# Apply the appropriate algo depending on student's leaning rate
learning_rate_ema < 1 ? algorithm_fomo(course_user) : algorithm_stragglers(course_user)
end
def algorithm_fomo(course_user)
submitted_lesson_plan_item_ids, items, learning_rate_ema = retrieve_or_compute_course_user_data(course_user)
return if learning_rate_ema.nil?
# Constrain learning rate
effective_min, effective_max = compute_learning_rate_effective_limits(
course_user, items, submitted_lesson_plan_item_ids, FOMO_LEARNING_RATE_MIN, FOMO_LEARNING_RATE_MAX
)
learning_rate_ema = [FOMO_LEARNING_RATE_HARD_MIN, effective_min, [learning_rate_ema, effective_max].min].max
# Compute personal times for all items
course_tz = course_user.course.time_zone
reference_point = items.first.reference_time_for(course_user).start_at
personal_point = reference_point
course_user.transaction do
items.each do |item|
# Update reference point and personal point
if item.affects_personal_times? && item.id.in?(submitted_lesson_plan_item_ids.keys)
reference_point = item.reference_time_for(course_user).start_at
personal_point = item.time_for(course_user).start_at
end
next if !item.has_personal_times? || item.id.in?(submitted_lesson_plan_item_ids.keys) ||
item.personal_time_for(course_user)&.fixed?
reference_time = item.reference_time_for(course_user)
personal_time = item.find_or_create_personal_time_for(course_user)
# If the user was previously on the stragglers algorithm and just switched over, and has already open
# items, we want to keep those items as they are
next if personal_time.end_at > reference_time.end_at && personal_time.start_at < Time.zone.now
# Update start_at
if personal_time.start_at > Time.zone.now
personal_time.start_at =
round_to_date(
personal_point + ((reference_time.start_at - reference_point) * learning_rate_ema),
course_tz,
FOMO_DATE_ROUNDING_THRESHOLD
)
end
# Hard limits to make sure we don't fail bounds checks
personal_time.start_at = [personal_time.start_at, reference_time.start_at, reference_time.end_at].compact.min
# Update bonus_end_at
if personal_time.bonus_end_at && personal_time.bonus_end_at > Time.zone.now
personal_time.bonus_end_at = reference_time.bonus_end_at
end
# Update end_at
personal_time.end_at = reference_time.end_at if personal_time.end_at && personal_time.end_at > Time.zone.now
personal_time.save!
end
end
end
def algorithm_stragglers(course_user)
submitted_lesson_plan_item_ids, items, learning_rate_ema = retrieve_or_compute_course_user_data(course_user)
return if learning_rate_ema.nil?
# Constrain learning rate
effective_min, effective_max = compute_learning_rate_effective_limits(
course_user, items, submitted_lesson_plan_item_ids, STRAGGLERS_LEARNING_RATE_MIN, STRAGGLERS_LEARNING_RATE_MAX
)
learning_rate_ema = [STRAGGLERS_LEARNING_RATE_HARD_MIN, effective_min, [learning_rate_ema, effective_max].min].max
# Compute personal times for all items
course_tz = course_user.course.time_zone
reference_point = items.first.reference_time_for(course_user).end_at
personal_point = reference_point
course_user.transaction do
items.each do |item|
# Update reference point and personal point
if item.affects_personal_times? && item.id.in?(submitted_lesson_plan_item_ids.keys) &&
item.reference_time_for(course_user).end_at.present?
reference_point = item.reference_time_for(course_user).end_at
personal_point = item.time_for(course_user).end_at
end
next if !item.has_personal_times? || item.id.in?(submitted_lesson_plan_item_ids.keys) ||
item.personal_time_for(course_user)&.fixed? || reference_point.nil?
reference_time = item.reference_time_for(course_user)
personal_time = item.find_or_create_personal_time_for(course_user)
# Update start_at
personal_time.start_at = reference_time.start_at if personal_time.start_at > Time.zone.now
# Update bonus_end_at
if personal_time.bonus_end_at && personal_time.bonus_end_at > Time.zone.now
personal_time.bonus_end_at = reference_time.bonus_end_at
end
# Update end_at
if reference_time.end_at.present?
new_end_at = round_to_date(
personal_point + ((reference_time.end_at - reference_point) * learning_rate_ema),
course_tz,
STRAGGLERS_DATE_ROUNDING_THRESHOLD,
to_2359: true # rubocop:disable Naming/VariableNumber
)
# Hard limits to make sure we don't fail bounds checks
new_end_at = [new_end_at, reference_time.end_at, reference_time.start_at].compact.max
# We don't want to shift the end_at forward if the item is already opened or if the deadline
# has already passed. Backwards is ok.
# Assumption: end_at is >= start_at
if new_end_at > personal_time.end_at || personal_time.start_at > Time.zone.now
personal_time.end_at = new_end_at
end
end
personal_time.save!
end
end
# Fix next few items
items.select { |item| item.has_personal_times? && !item.id.in?(submitted_lesson_plan_item_ids.keys) }.
slice(0, STRAGGLERS_FIXES).
each { |item| item.reload.find_or_create_personal_time_for(course_user).update(fixed: true) }
end
# Returns cached data for the course user, if available, else it does the necessary computations and caches.
# Data returned is an array containing:
# - The submitted lesson plan item IDs
# - The published lesson plan items with reference and personal times, sorted by start_at for user
# - Learning rate computed for the user
# in the above order.
def retrieve_or_compute_course_user_data(course_user)
Rails.cache.fetch("course/lesson_plan/personalization_concern/#{course_user.id}", expires_in: 1.hours) do
submitted_lesson_plan_item_ids = lesson_plan_items_submission_time_hash(course_user)
items = course_user.course.lesson_plan_items.published.
with_reference_times_for(course_user).
with_personal_times_for(course_user).
to_a
items = items.sort_by { |x| x.time_for(course_user).start_at }
items_affects_personal_times = items.select(&:affects_personal_times?)
learning_rate_ema = compute_learning_rate_ema(
course_user, items_affects_personal_times, submitted_lesson_plan_item_ids
)
[submitted_lesson_plan_item_ids, items, learning_rate_ema]
end
end
# Returns { lesson_plan_item_id => submitted_time or nil }
# If the lesson plan item is a key in this hash then we consider the item "submitted" regardless of whether we have a
# submission time for it.
def lesson_plan_items_submission_time_hash(course_user)
lesson_plan_items_submission_time_hash = {}
# Assessments - consider submitted only if submitted_at is present
lesson_plan_items_submission_time_hash.merge!(
course_user.course.assessments.
with_submissions_by(course_user.user).
select { |x| x.submissions.present? && x.submissions.first.submitted_at.present? }.
map { |x| [x.lesson_plan_item.id, x.submissions.first.submitted_at] }.to_h
)
# Videos - consider submitted as long as submission exists
lesson_plan_items_submission_time_hash.merge!(
course_user.course.videos.
with_submissions_by(course_user.user).
select { |x| x.submissions.present? }.
map { |x| [x.lesson_plan_item.id, nil] }.to_h
)
end
# Min/max overall learning rate refers to how early/late a student is allowed to complete the course.
#
# E.g. if max_overall_lr = 2 means a student is allowed to complete a 1-month course over 2 months.
# However, if the student somehow managed to complete half of the course within the first day, then we can allow him
# to continue at lr = 4 and still have the student complete the course over 2 months. This method computes the
# effective limits to preserve the overall min/max lr.
#
# NOTE: It is completely possible for negative results (even -infinity), i.e. student needs to go back in time in
# order to have any hope of completing the course within the limits. The algorithm needs to take care of this.
def compute_learning_rate_effective_limits(
course_user, items, submitted_lesson_plan_item_ids, min_overall_learning_rate, max_overall_learning_rate
)
course_start = items.first.start_at
course_end = items.last.start_at
last_submitted_item =
items.reverse_each.lazy.
select { |item| item.affects_personal_times? && item.id.in?(submitted_lesson_plan_item_ids.keys) }.first
return [min_overall_learning_rate, max_overall_learning_rate] if last_submitted_item.nil?
reference_remaining_time = items.last.start_at - last_submitted_item.reference_time_for(course_user).start_at
min_personal_remaining_time =
course_start +
(min_overall_learning_rate * (course_end - course_start)) - last_submitted_item.time_for(course_user).start_at
max_personal_remaining_time =
course_start +
(max_overall_learning_rate * (course_end - course_start)) - last_submitted_item.time_for(course_user).start_at
[min_personal_remaining_time / reference_remaining_time, max_personal_remaining_time / reference_remaining_time]
end
# Exponential Moving Average (EMA) of the learning rate
def compute_learning_rate_ema(course_user, course_assessments, submitted_lesson_plan_item_ids, alpha = 0.4)
submitted_assessments = course_assessments.
select { |x| x.id.in? submitted_lesson_plan_item_ids.keys }.
select { |x| x.time_for(course_user).end_at.present? }.
sort_by { |x| x.time_for(course_user).start_at }
return nil if submitted_assessments.empty?
learning_rate_ema = 1.0
submitted_assessments.each do |assessment|
times = assessment.time_for(course_user)
next if times.end_at - times.start_at == 0 || submitted_lesson_plan_item_ids[assessment.id].nil?
learning_rate = (submitted_lesson_plan_item_ids[assessment.id] - times.start_at) / (times.end_at - times.start_at)
learning_rate = [learning_rate, 0].max
learning_rate_ema = (alpha * learning_rate) + ((1 - alpha) * learning_rate_ema)
end
learning_rate_ema
end
private
# Round to "nearest" date in course's timezone, NOT user's timezone.
#
# @param [Time] datetime The datetime object to round.
# @param [String] course_tz The timezone of the course.
# @param [Float] threshold How generously we round off. E.g. if `threshold` = 0.8, then a datetime with a time of
# > 0.8 * 1.day will be snapped to the next day.
# @param [Boolean] to_2359 Whether to round off to 2359. This will set the datetime to be 2359 of the date before the
# rounded date.
def round_to_date(datetime, course_tz, threshold = 0.5, to_2359: false)
prev_day = datetime.in_time_zone(course_tz).to_date.in_time_zone(course_tz).in_time_zone
date = ((datetime - prev_day) < threshold ? prev_day : prev_day + 1.day)
to_2359 ? date - 1.minute : date
end
end
|
added basic usage example
require 'object-stream'
require 'socket'
require 'tmpdir'
begin
@dir = Dir.mktmpdir "stream-"
@path = File.join(@dir, "sock")
@dumpfile = File.join(@dir, "dump")
@logfile = File.join(@dir, "log")
type = ARGV.shift.intern
class A
def initialize x, y
@x, @y = x, y
end
def to_msgpack pk = nil
case pk
when MessagePack::Packer
pk.write_array_header(2)
pk.write @x
pk.write @y
return pk
else # nil or IO
MessagePack.pack(self, pk)
end
end
def to_json
[@x, @y].to_json
end
def self.from_serialized ary
new *ary
end
end
File.open(@dumpfile, "w") do |f|
stream = ObjectStream.new(f, type: type)
p stream
stream << "foo" << [:bar, 42] << {"String" => "string"} << "A" << A.new(3,6)
end
data = File.read(@dumpfile)
puts "===== #{data.size} bytes:"
case type
when ObjectStream::MARSHAL_TYPE, ObjectStream::MSGPACK_TYPE
puts data.inspect
when ObjectStream::YAML_TYPE, ObjectStream::JSON_TYPE
puts data
end
puts "====="
a = File.open(@dumpfile, "r") do |f|
stream = ObjectStream.new(f, type: type)
stream.map do |obj|
#p obj
stream.expect {obj == "A" and A}
obj
end
end
p a
ensure
FileUtils.remove_entry @dir
end
|
# frozen_string_literal: true
require_relative 'files_delta'
require_relative 'gnu_unzip'
require_relative 'gnu_zip'
require_relative 'tar_reader'
require_relative 'tar_writer'
require_relative 'traffic_light'
require_relative 'utf8_clean'
require 'securerandom'
require 'timeout'
# [X] Assumes image_name was built by image_builder with a
# Dockerfile augmented by image_dockerfile_augmenter. See
# https://github.com/cyber-dojo-tools/image_builder
# https://github.com/cyber-dojo-tools/image_dockerfile_augmenter
# If image_name is not present on the node, docker will
# attempt to pull it. The browser's kata/run_tests ajax
# call can timeout before the pull completes; this browser
# timeout is different to the Runner.run() call timing out.
class TimeOutRunner
def initialize(externals, id, files, manifest)
@externals = externals
@id = id
@files = files
# Add a random-id to the container name. A container-name
# based on _only_ the id will fail when a container with
# that id exists and is alive. Easily possible in tests.
# Note that remove_container() backgrounds the [docker rm].
random_id = HEX_DIGITS.shuffle[0,8].join
@container_name = ['cyber_dojo_runner', id, random_id].join('_')
@manifest = manifest
end
attr_reader :id, :files, :container_name
def image_name
@manifest['image_name']
end
def max_seconds
@manifest['max_seconds']
end
# - - - - - - - - - - - - - - - - - - - - - -
def run_cyber_dojo_sh
@result = {}
create_container
begin
run
read_text_file_changes
set_traffic_light
@result
ensure
remove_container
end
end
private
include FilesDelta
include TrafficLight
KB = 1024
MB = 1024 * KB
GB = 1024 * MB
SANDBOX_DIR = '/sandbox' # where files are saved to in the container
UID = 41966 # sandbox user - runs /sandbox/cyber-dojo.sh
GID = 51966 # sandbox group - runs /sandbox/cyber-dojo.sh
MAX_FILE_SIZE = 50 * KB # of stdout, stderr, created, changed
HEX_DIGITS = [*('a'..'z'),*('A'..'Z'),*('0'..'9')]
# - - - - - - - - - - - - - - - - - - - - - -
def run
command = main_docker_run_command
stdout,stderr,status,timed_out = nil,nil,nil,nil
r_stdin, w_stdin = IO.pipe
r_stdout, w_stdout = IO.pipe
r_stderr, w_stderr = IO.pipe
w_stdin.write(tgz_of_files)
w_stdin.close
pid = Process.spawn(command, {
pgroup:true, # become process leader
in:r_stdin, # redirection
out:w_stdout, # redirection
err:w_stderr # redirection
})
begin
Timeout::timeout(max_seconds) do
_, ps = Process.waitpid2(pid)
status = ps.exitstatus
timed_out = killed?(status)
end
rescue Timeout::Error
Process_kill_group(pid)
Process_detach(pid)
status = KILLED_STATUS
timed_out = true
ensure
w_stdout.close unless w_stdout.closed?
w_stderr.close unless w_stderr.closed?
stdout = packaged(read_max(r_stdout))
stderr = packaged(read_max(r_stderr))
r_stdout.close
r_stderr.close
end
@result['run_cyber_dojo_sh'] = {
stdout:stdout,
stderr:stderr,
status:status,
timed_out:timed_out
}
end
# - - - - - - - - - - - - - - - - - - - - - -
def tgz_of_files
writer = Tar::Writer.new(sandboxed(files))
Gnu.zip(writer.tar_file)
end
def sandboxed(files)
files.keys.each_with_object({}) do |filename,h|
h["#{unrooted(SANDBOX_DIR)}/#{filename}"] = files[filename]
end
end
def unrooted(path)
# When pathnames have a leading / you get warnings messages
# tar: Removing leading `/' from member names
path[1..-1]
end
# - - - - - - - - - - - - - - - - - - - - - -
def read_max(fd)
fd.read(MAX_FILE_SIZE + 1) || ''
end
# - - - - - - - - - - - - - - - - - - - - - -
def main_docker_run_command
# Assumes a tgz of files on stdin. Untars this into the
# /sandbox/ dir (which must exist [X]) inside the container
# and runs /sandbox/cyber-dojo.sh
#
# [1] The uid/gid are for the user/group called sandbox [X].
# Untars files as this user to set their ownership.
# [2] tar is installed [X].
# [3] tar has the --touch option installed [X].
# (not true in a default Alpine container)
# --touch means 'dont extract file modified time'
# It relates to the files modification-date (stat %y).
# Without it the untarred files may all end up with the same
# modification date. With it, the untarred files have a
# proper date-time file-stamp in all supported OS's.
# [4] tar date-time file-stamps have a granularity < 1 second [X].
# In a default Alpine container the date-time file-stamps
# have a granularity of one second; viz, the microseconds
# value is always zero.
# [5] Don't use [docker exec --workdir] as that requires API version
# 1.35 but CircleCI is currently using Docker Daemon API 1.32
<<~SHELL.strip
docker exec \
--interactive `# piping stdin` \
--user=#{UID}:#{GID} `# [1]` \
#{container_name} \
bash -c \
' `# open quote` \
cd / \
&& \
tar `# [2]` \
--touch `# [3][4]` \
-zxf `# extract tgz file` \
- `# read from stdin` \
&& \
cd /#{SANDBOX_DIR} `# [5]` \
&& \
bash ./cyber-dojo.sh \
' `# close quote`
SHELL
end
# - - - - - - - - - - - - - - - - - - - - - -
def read_text_file_changes
# Approval-style test-frameworks compare actual-text against
# expected-text held inside a 'golden-master' file and, if the
# comparison fails, generate a file holding the actual-text
# ready for human inspection. cyber-dojo supports this by
# tar-piping out all text files (generated inside the container)
# under /sandbox after cyber-dojo.sh has run.
#
# [1] Extract /usr/local/bin/red_amber_green.rb if it exists.
# [2] Ensure filenames are not read as tar command options.
# Eg -J... is a tar compression option.
# This option is not available on Ubuntu 16.04
rag_filename = SecureRandom.urlsafe_base64
docker_tar_pipe_text_files_out =
<<~SHELL.strip
docker exec \
--user=#{UID}:#{GID} \
#{container_name} \
bash -c \
' `# open quote` \
#{copy_rag(rag_filename)} `# [1]`; \
#{ECHO_TRUNCATED_TEXTFILE_NAMES} \
| \
tar \
-C \
#{SANDBOX_DIR} \
-zcf `# create tgz file` \
- `# write to stdout` \
--verbatim-files-from `# [2]` \
-T `# using filenames` \
- `# from stdin` \
' `# close quote`
SHELL
# A crippled container (eg fork-bomb) will likely
# not be running causing the [docker exec] to fail.
# Be careful if you switch to shell.assert() here.
stdout,stderr,status = shell.exec(docker_tar_pipe_text_files_out)
if status === 0
files_now = read_tar_file(Gnu.unzip(stdout))
rag_src = extract_rag(files_now, rag_filename)
created,deleted,changed = *files_delta(files, files_now)
else
@result['diagnostic'] = { 'stderr' => stderr }
rag_src = nil
created,deleted,changed = {}, [], {}
end
@result['rag_src'] = rag_src
@result['run_cyber_dojo_sh'].merge!({
created:created,
deleted:deleted,
changed:changed
})
end
# - - - - - - - - - - - - - - - - - - - - - -
def copy_rag(rag_filename)
rag_src = '/usr/local/bin/red_amber_green.rb'
rag_dst = "#{SANDBOX_DIR}/#{rag_filename}"
# This command must not write anything to stdout/stderr
# since it would be taken as a filename by tar's -T option.
"[ -f #{rag_src} ] && cp #{rag_src} #{rag_dst}"
end
# - - - - - - - - - - - - - - - - - - - - - -
def extract_rag(files_now, rag_filename)
rag_file = files_now.delete(rag_filename)
if rag_file.nil?
nil
else
rag_file['content']
end
end
# - - - - - - - - - - - - - - - - - - - - - -
def read_tar_file(tar_file)
reader = Tar::Reader.new(tar_file)
reader.files.each_with_object({}) do |(filename,content),memo|
memo[filename] = packaged(content)
end
end
# - - - - - - - - - - - - - - - - - - - - - -
# o) Must not contain a single-quote [bash -c '...']
# o) grep -q is --quiet
# o) grep -v is --invert-match
# o) Strip ./ from front of pathed filename in depathed()
# o) The [file] utility must be installed [X]. However,
# it incorrectly reports very small files as binary.
# If size==0,1 assume its a text file.
# o) truncates text files to MAX_FILE_SIZE+1
# This is so truncated?() can detect the truncation.
# The truncate utility must be installed [X].
ECHO_TRUNCATED_TEXTFILE_NAMES =
<<~SHELL.strip
truncate_file() \
{ \
if [ $(stat -c%s "${1}") -gt #{MAX_FILE_SIZE} ]; then \
truncate -s #{MAX_FILE_SIZE+1} "${1}"; \
fi; \
}; \
is_text_file() \
{ \
if file --mime-encoding ${1} | grep -qv "${1}:\\sbinary"; then \
truncate_file "${1}"; \
true; \
elif [ $(stat -c%s "${1}") -lt 2 ]; then \
true; \
else \
false; \
fi; \
}; \
depathed() \
{ \
echo "${1:2}"; \
}; \
export -f truncate_file; \
export -f is_text_file; \
export -f depathed; \
(cd #{SANDBOX_DIR} && find . -type f -exec \
bash -c "is_text_file {} && depathed {}" \\;)
SHELL
# - - - - - - - - - - - - - - - - - - - - - -
# container
# - - - - - - - - - - - - - - - - - - - - - -
def create_container
docker_run_command = [
'docker run',
"--name=#{container_name}",
docker_run_options(image_name, id),
image_name,
"bash -c 'sleep #{max_seconds+2}'"
].join(SPACE)
# This shell.assert will catch errors in the 'outer' docker-run
# command but not errors in the 'inner' sleep command. For example,
# if the container has no bash [X]. Note that --detach is one of
# the docker_run_options.
shell.assert(docker_run_command)
end
# - - - - - - - - - - - - - - - - - - - - - -
def remove_container
# Backgrounded for a small speed-up.
shell.exec("docker rm #{container_name} --force &")
end
# - - - - - - - - - - - - - - - - - - - - - -
def docker_run_options(image_name, id)
# [1] For clang/clang++'s -fsanitize=address
# [2] Makes container removal much faster
<<~SHELL.strip
#{env_vars(image_name, id)} \
#{TMP_FS_SANDBOX_DIR} \
#{TMP_FS_TMP_DIR} \
#{ulimits(image_name)} \
--cap-add=SYS_PTRACE `# [1]` \
--detach `# later docker execs` \
--init `# pid-1 process [2]` \
--rm `# auto rm on exit` \
--user=#{UID}:#{GID} `# not root`
SHELL
end
# - - - - - - - - - - - - - - - - - - - - - -
def env_vars(image_name, id)
[
env_var('IMAGE_NAME', image_name),
env_var('ID', id),
env_var('SANDBOX', SANDBOX_DIR)
].join(SPACE)
end
# - - - - - - - - - - - - - - - - - - - - - -
def env_var(name, value)
# Note: value must not contain a single-quote
"--env CYBER_DOJO_#{name}='#{value}'"
end
# - - - - - - - - - - - - - - - - - - - - - -
TMP_FS_SANDBOX_DIR =
"--tmpfs #{SANDBOX_DIR}:" +
'exec,' + # [1]
'size=50M,' + # [2]
"uid=#{UID}," + # [3]
"gid=#{GID}" # [3]
# Making the sandbox dir a tmpfs should improve speed.
# By default, tmp-fs's are setup as secure mountpoints.
# If you use only '--tmpfs #{SANDBOX_DIR}'
# then a [cat /etc/mtab] will reveal something like
# "tmpfs /sandbox tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k 0 0"
# o) rw = Mount the filesystem read-write.
# o) nosuid = Do not allow set-user-identifier or
# set-group-identifier bits to take effect.
# o) nodev = Do not interpret character or block special devices.
# o) noexec = Do not allow direct execution of any binaries.
# o) relatime = Update inode access times relative to modify/change time.
# So...
# [1] set exec to make binaries and scripts executable.
# [2] limit size of tmp-fs.
# [3] set ownership.
TMP_FS_TMP_DIR = '--tmpfs /tmp:exec,size=50M,mode=1777' # Set /tmp sticky-bit
# - - - - - - - - - - - - - - - - - - - - - -
def ulimits(image_name)
# There is no cpu-ulimit... a cpu-ulimit of 10
# seconds could kill a container after only 5
# seconds... The cpu-ulimit assumes one core.
# The host system running the docker container
# can have multiple cores or use hyperthreading.
# So a piece of code running on 2 cores, both 100%
# utilized could be killed after 5 seconds.
options = [
ulimit('core' , 0 ), # core file size
ulimit('fsize' , 16*MB), # file size
ulimit('locks' , 128 ), # number of file locks
ulimit('nofile', 256 ), # number of files
ulimit('nproc' , 128 ), # number of processes
ulimit('stack' , 8*MB), # stack size
'--memory=512m', # max 512MB ram
'--net=none', # no network
'--pids-limit=128', # no fork bombs
'--security-opt=no-new-privileges', # no escalation
]
unless clang?(image_name)
# [ulimit data] prevents clang's -fsanitize=address option.
options << ulimit('data', 4*GB) # data segment size
end
options.join(SPACE)
end
# - - - - - - - - - - - - - - - - - - - - - -
def ulimit(name, limit)
"--ulimit #{name}=#{limit}"
end
# - - - - - - - - - - - - - - - - - - - - - -
def clang?(image_name)
image_name.start_with?('cyberdojofoundation/clang')
end
# - - - - - - - - - - - - - - - - - - - - - -
# process helpers
# - - - - - - - - - - - - - - - - - - - - - -
def Process_kill_group(pid)
# The [docker run] process running on the _host_ is
# killed by this Process.kill. This does _not_ kill the
# cyber-dojo.sh process running _inside_ the docker
# container. The container is killed by remove_container()
# with a fall-back via [docker run]'s --rm option.
Process.kill(-KILL_SIGNAL, pid) # -ve means kill process-group
rescue Errno::ESRCH
# There may no longer be a process at pid (timeout race).
# If not, you get an exception Errno::ESRCH: No such process
end
# - - - - - - - - - - - - - - - - - - - - - -
def Process_detach(pid)
# Prevents zombie child-process. Don't wait for detach status.
Process.detach(pid)
# There may no longer be a process at pid (timeout race).
# If not, you don't get an exception.
end
# - - - - - - - - - - - - - - - - - - - - - -
def killed?(status)
status === KILLED_STATUS
end
# - - - - - - - - - - - - - - - - - - - - - -
KILL_SIGNAL = 9
KILLED_STATUS = 128 + KILL_SIGNAL
# - - - - - - - - - - - - - - - - - - - - - -
# file content helpers
# - - - - - - - - - - - - - - - - - - - - - -
def packaged(raw_content)
content = Utf8.clean(raw_content)
{
'content' => truncated(content),
'truncated' => truncated?(content)
}
end
def truncated(content)
content[0...MAX_FILE_SIZE]
end
def truncated?(content)
content.size > MAX_FILE_SIZE
end
# - - - - - - - - - - - - - - - - - - - - - -
# externals
# - - - - - - - - - - - - - - - - - - - - - -
def shell
@externals.shell
end
SPACE = ' '
end
Remove extraneous leading slash
# frozen_string_literal: true
require_relative 'files_delta'
require_relative 'gnu_unzip'
require_relative 'gnu_zip'
require_relative 'tar_reader'
require_relative 'tar_writer'
require_relative 'traffic_light'
require_relative 'utf8_clean'
require 'securerandom'
require 'timeout'
# [X] Assumes image_name was built by image_builder with a
# Dockerfile augmented by image_dockerfile_augmenter. See
# https://github.com/cyber-dojo-tools/image_builder
# https://github.com/cyber-dojo-tools/image_dockerfile_augmenter
# If image_name is not present on the node, docker will
# attempt to pull it. The browser's kata/run_tests ajax
# call can timeout before the pull completes; this browser
# timeout is different to the Runner.run() call timing out.
class TimeOutRunner
def initialize(externals, id, files, manifest)
@externals = externals
@id = id
@files = files
# Add a random-id to the container name. A container-name
# based on _only_ the id will fail when a container with
# that id exists and is alive. Easily possible in tests.
# Note that remove_container() backgrounds the [docker rm].
random_id = HEX_DIGITS.shuffle[0,8].join
@container_name = ['cyber_dojo_runner', id, random_id].join('_')
@manifest = manifest
end
attr_reader :id, :files, :container_name
def image_name
@manifest['image_name']
end
def max_seconds
@manifest['max_seconds']
end
# - - - - - - - - - - - - - - - - - - - - - -
def run_cyber_dojo_sh
@result = {}
create_container
begin
run
read_text_file_changes
set_traffic_light
@result
ensure
remove_container
end
end
private
include FilesDelta
include TrafficLight
KB = 1024
MB = 1024 * KB
GB = 1024 * MB
SANDBOX_DIR = '/sandbox' # where files are saved to in the container
UID = 41966 # sandbox user - runs /sandbox/cyber-dojo.sh
GID = 51966 # sandbox group - runs /sandbox/cyber-dojo.sh
MAX_FILE_SIZE = 50 * KB # of stdout, stderr, created, changed
HEX_DIGITS = [*('a'..'z'),*('A'..'Z'),*('0'..'9')]
# - - - - - - - - - - - - - - - - - - - - - -
def run
command = main_docker_run_command
stdout,stderr,status,timed_out = nil,nil,nil,nil
r_stdin, w_stdin = IO.pipe
r_stdout, w_stdout = IO.pipe
r_stderr, w_stderr = IO.pipe
w_stdin.write(tgz_of_files)
w_stdin.close
pid = Process.spawn(command, {
pgroup:true, # become process leader
in:r_stdin, # redirection
out:w_stdout, # redirection
err:w_stderr # redirection
})
begin
Timeout::timeout(max_seconds) do
_, ps = Process.waitpid2(pid)
status = ps.exitstatus
timed_out = killed?(status)
end
rescue Timeout::Error
Process_kill_group(pid)
Process_detach(pid)
status = KILLED_STATUS
timed_out = true
ensure
w_stdout.close unless w_stdout.closed?
w_stderr.close unless w_stderr.closed?
stdout = packaged(read_max(r_stdout))
stderr = packaged(read_max(r_stderr))
r_stdout.close
r_stderr.close
end
@result['run_cyber_dojo_sh'] = {
stdout:stdout,
stderr:stderr,
status:status,
timed_out:timed_out
}
end
# - - - - - - - - - - - - - - - - - - - - - -
def tgz_of_files
writer = Tar::Writer.new(sandboxed(files))
Gnu.zip(writer.tar_file)
end
def sandboxed(files)
files.keys.each_with_object({}) do |filename,h|
h["#{unrooted(SANDBOX_DIR)}/#{filename}"] = files[filename]
end
end
def unrooted(path)
# When pathnames have a leading / you get warnings messages
# tar: Removing leading `/' from member names
path[1..-1]
end
# - - - - - - - - - - - - - - - - - - - - - -
def read_max(fd)
fd.read(MAX_FILE_SIZE + 1) || ''
end
# - - - - - - - - - - - - - - - - - - - - - -
def main_docker_run_command
# Assumes a tgz of files on stdin. Untars this into the
# /sandbox/ dir (which must exist [X]) inside the container
# and runs /sandbox/cyber-dojo.sh
#
# [1] The uid/gid are for the user/group called sandbox [X].
# Untars files as this user to set their ownership.
# [2] tar is installed [X].
# [3] tar has the --touch option installed [X].
# (not true in a default Alpine container)
# --touch means 'dont extract file modified time'
# It relates to the files modification-date (stat %y).
# Without it the untarred files may all end up with the same
# modification date. With it, the untarred files have a
# proper date-time file-stamp in all supported OS's.
# [4] tar date-time file-stamps have a granularity < 1 second [X].
# In a default Alpine container the date-time file-stamps
# have a granularity of one second; viz, the microseconds
# value is always zero.
# [5] Don't use [docker exec --workdir] as that requires API version
# 1.35 but CircleCI is currently using Docker Daemon API 1.32
<<~SHELL.strip
docker exec \
--interactive `# piping stdin` \
--user=#{UID}:#{GID} `# [1]` \
#{container_name} \
bash -c \
' `# open quote` \
cd / \
&& \
tar `# [2]` \
--touch `# [3][4]` \
-zxf `# extract tgz file` \
- `# read from stdin` \
&& \
cd #{SANDBOX_DIR} `# [5]` \
&& \
bash ./cyber-dojo.sh \
' `# close quote`
SHELL
end
# - - - - - - - - - - - - - - - - - - - - - -
def read_text_file_changes
# Approval-style test-frameworks compare actual-text against
# expected-text held inside a 'golden-master' file and, if the
# comparison fails, generate a file holding the actual-text
# ready for human inspection. cyber-dojo supports this by
# tar-piping out all text files (generated inside the container)
# under /sandbox after cyber-dojo.sh has run.
#
# [1] Extract /usr/local/bin/red_amber_green.rb if it exists.
# [2] Ensure filenames are not read as tar command options.
# Eg -J... is a tar compression option.
# This option is not available on Ubuntu 16.04
rag_filename = SecureRandom.urlsafe_base64
docker_tar_pipe_text_files_out =
<<~SHELL.strip
docker exec \
--user=#{UID}:#{GID} \
#{container_name} \
bash -c \
' `# open quote` \
#{copy_rag(rag_filename)} `# [1]`; \
#{ECHO_TRUNCATED_TEXTFILE_NAMES} \
| \
tar \
-C \
#{SANDBOX_DIR} \
-zcf `# create tgz file` \
- `# write to stdout` \
--verbatim-files-from `# [2]` \
-T `# using filenames` \
- `# from stdin` \
' `# close quote`
SHELL
# A crippled container (eg fork-bomb) will likely
# not be running causing the [docker exec] to fail.
# Be careful if you switch to shell.assert() here.
stdout,stderr,status = shell.exec(docker_tar_pipe_text_files_out)
if status === 0
files_now = read_tar_file(Gnu.unzip(stdout))
rag_src = extract_rag(files_now, rag_filename)
created,deleted,changed = *files_delta(files, files_now)
else
@result['diagnostic'] = { 'stderr' => stderr }
rag_src = nil
created,deleted,changed = {}, [], {}
end
@result['rag_src'] = rag_src
@result['run_cyber_dojo_sh'].merge!({
created:created,
deleted:deleted,
changed:changed
})
end
# - - - - - - - - - - - - - - - - - - - - - -
def copy_rag(rag_filename)
rag_src = '/usr/local/bin/red_amber_green.rb'
rag_dst = "#{SANDBOX_DIR}/#{rag_filename}"
# This command must not write anything to stdout/stderr
# since it would be taken as a filename by tar's -T option.
"[ -f #{rag_src} ] && cp #{rag_src} #{rag_dst}"
end
# - - - - - - - - - - - - - - - - - - - - - -
def extract_rag(files_now, rag_filename)
rag_file = files_now.delete(rag_filename)
if rag_file.nil?
nil
else
rag_file['content']
end
end
# - - - - - - - - - - - - - - - - - - - - - -
def read_tar_file(tar_file)
reader = Tar::Reader.new(tar_file)
reader.files.each_with_object({}) do |(filename,content),memo|
memo[filename] = packaged(content)
end
end
# - - - - - - - - - - - - - - - - - - - - - -
# o) Must not contain a single-quote [bash -c '...']
# o) grep -q is --quiet
# o) grep -v is --invert-match
# o) Strip ./ from front of pathed filename in depathed()
# o) The [file] utility must be installed [X]. However,
# it incorrectly reports very small files as binary.
# If size==0,1 assume its a text file.
# o) truncates text files to MAX_FILE_SIZE+1
# This is so truncated?() can detect the truncation.
# The truncate utility must be installed [X].
ECHO_TRUNCATED_TEXTFILE_NAMES =
<<~SHELL.strip
truncate_file() \
{ \
if [ $(stat -c%s "${1}") -gt #{MAX_FILE_SIZE} ]; then \
truncate -s #{MAX_FILE_SIZE+1} "${1}"; \
fi; \
}; \
is_text_file() \
{ \
if file --mime-encoding ${1} | grep -qv "${1}:\\sbinary"; then \
truncate_file "${1}"; \
true; \
elif [ $(stat -c%s "${1}") -lt 2 ]; then \
true; \
else \
false; \
fi; \
}; \
depathed() \
{ \
echo "${1:2}"; \
}; \
export -f truncate_file; \
export -f is_text_file; \
export -f depathed; \
(cd #{SANDBOX_DIR} && find . -type f -exec \
bash -c "is_text_file {} && depathed {}" \\;)
SHELL
# - - - - - - - - - - - - - - - - - - - - - -
# container
# - - - - - - - - - - - - - - - - - - - - - -
def create_container
docker_run_command = [
'docker run',
"--name=#{container_name}",
docker_run_options(image_name, id),
image_name,
"bash -c 'sleep #{max_seconds+2}'"
].join(SPACE)
# This shell.assert will catch errors in the 'outer' docker-run
# command but not errors in the 'inner' sleep command. For example,
# if the container has no bash [X]. Note that --detach is one of
# the docker_run_options.
shell.assert(docker_run_command)
end
# - - - - - - - - - - - - - - - - - - - - - -
def remove_container
# Backgrounded for a small speed-up.
shell.exec("docker rm #{container_name} --force &")
end
# - - - - - - - - - - - - - - - - - - - - - -
def docker_run_options(image_name, id)
# [1] For clang/clang++'s -fsanitize=address
# [2] Makes container removal much faster
<<~SHELL.strip
#{env_vars(image_name, id)} \
#{TMP_FS_SANDBOX_DIR} \
#{TMP_FS_TMP_DIR} \
#{ulimits(image_name)} \
--cap-add=SYS_PTRACE `# [1]` \
--detach `# later docker execs` \
--init `# pid-1 process [2]` \
--rm `# auto rm on exit` \
--user=#{UID}:#{GID} `# not root`
SHELL
end
# - - - - - - - - - - - - - - - - - - - - - -
def env_vars(image_name, id)
[
env_var('IMAGE_NAME', image_name),
env_var('ID', id),
env_var('SANDBOX', SANDBOX_DIR)
].join(SPACE)
end
# - - - - - - - - - - - - - - - - - - - - - -
def env_var(name, value)
# Note: value must not contain a single-quote
"--env CYBER_DOJO_#{name}='#{value}'"
end
# - - - - - - - - - - - - - - - - - - - - - -
TMP_FS_SANDBOX_DIR =
"--tmpfs #{SANDBOX_DIR}:" +
'exec,' + # [1]
'size=50M,' + # [2]
"uid=#{UID}," + # [3]
"gid=#{GID}" # [3]
# Making the sandbox dir a tmpfs should improve speed.
# By default, tmp-fs's are setup as secure mountpoints.
# If you use only '--tmpfs #{SANDBOX_DIR}'
# then a [cat /etc/mtab] will reveal something like
# "tmpfs /sandbox tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k 0 0"
# o) rw = Mount the filesystem read-write.
# o) nosuid = Do not allow set-user-identifier or
# set-group-identifier bits to take effect.
# o) nodev = Do not interpret character or block special devices.
# o) noexec = Do not allow direct execution of any binaries.
# o) relatime = Update inode access times relative to modify/change time.
# So...
# [1] set exec to make binaries and scripts executable.
# [2] limit size of tmp-fs.
# [3] set ownership.
TMP_FS_TMP_DIR = '--tmpfs /tmp:exec,size=50M,mode=1777' # Set /tmp sticky-bit
# - - - - - - - - - - - - - - - - - - - - - -
def ulimits(image_name)
# There is no cpu-ulimit... a cpu-ulimit of 10
# seconds could kill a container after only 5
# seconds... The cpu-ulimit assumes one core.
# The host system running the docker container
# can have multiple cores or use hyperthreading.
# So a piece of code running on 2 cores, both 100%
# utilized could be killed after 5 seconds.
options = [
ulimit('core' , 0 ), # core file size
ulimit('fsize' , 16*MB), # file size
ulimit('locks' , 128 ), # number of file locks
ulimit('nofile', 256 ), # number of files
ulimit('nproc' , 128 ), # number of processes
ulimit('stack' , 8*MB), # stack size
'--memory=512m', # max 512MB ram
'--net=none', # no network
'--pids-limit=128', # no fork bombs
'--security-opt=no-new-privileges', # no escalation
]
unless clang?(image_name)
# [ulimit data] prevents clang's -fsanitize=address option.
options << ulimit('data', 4*GB) # data segment size
end
options.join(SPACE)
end
# - - - - - - - - - - - - - - - - - - - - - -
def ulimit(name, limit)
"--ulimit #{name}=#{limit}"
end
# - - - - - - - - - - - - - - - - - - - - - -
def clang?(image_name)
image_name.start_with?('cyberdojofoundation/clang')
end
# - - - - - - - - - - - - - - - - - - - - - -
# process helpers
# - - - - - - - - - - - - - - - - - - - - - -
def Process_kill_group(pid)
# The [docker run] process running on the _host_ is
# killed by this Process.kill. This does _not_ kill the
# cyber-dojo.sh process running _inside_ the docker
# container. The container is killed by remove_container()
# with a fall-back via [docker run]'s --rm option.
Process.kill(-KILL_SIGNAL, pid) # -ve means kill process-group
rescue Errno::ESRCH
# There may no longer be a process at pid (timeout race).
# If not, you get an exception Errno::ESRCH: No such process
end
# - - - - - - - - - - - - - - - - - - - - - -
def Process_detach(pid)
# Prevents zombie child-process. Don't wait for detach status.
Process.detach(pid)
# There may no longer be a process at pid (timeout race).
# If not, you don't get an exception.
end
# - - - - - - - - - - - - - - - - - - - - - -
def killed?(status)
status === KILLED_STATUS
end
# - - - - - - - - - - - - - - - - - - - - - -
KILL_SIGNAL = 9
KILLED_STATUS = 128 + KILL_SIGNAL
# - - - - - - - - - - - - - - - - - - - - - -
# file content helpers
# - - - - - - - - - - - - - - - - - - - - - -
def packaged(raw_content)
content = Utf8.clean(raw_content)
{
'content' => truncated(content),
'truncated' => truncated?(content)
}
end
def truncated(content)
content[0...MAX_FILE_SIZE]
end
def truncated?(content)
content.size > MAX_FILE_SIZE
end
# - - - - - - - - - - - - - - - - - - - - - -
# externals
# - - - - - - - - - - - - - - - - - - - - - -
def shell
@externals.shell
end
SPACE = ' '
end
|
require "graphability"
class MementoMock
def verify(domain, attribute, value)
value
end
end
g = Graphability.new :memento => MementoMock.new
EM.synchrony do
p g.graph('http://www.ouest-france.fr/ofdernmin_-Coree-du-Nord.-Le-mysterieux-smartphone-de-Kim-Jong-Un_6346-2160823-fils-tous_filDMA.Htm')
EM.stop
end
add exemple
require "graphability"
class MementoMock
def verify(domain, attribute, value)
value
end
end
g = Graphability.new :memento => MementoMock.new
EM.synchrony do
p g.graph('http://www.ouest-france.fr/ofdernmin_-Coree-du-Nord.-Le-mysterieux-smartphone-de-Kim-Jong-Un_6346-2160823-fils-tous_filDMA.Htm')
p g.graph "http://rss.feedsportal.com/c/32389/f/463430/s/296d4474/l/0L0Slinternaute0N0Cactualite0Csociete0Efrance0Cces0Etueurs0Equi0Eont0Eridiculise0Ela0Epolice0C/story01.htm"
EM.stop
end |
Add example HTTP server
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'minx'
require 'rack'
require 'rack/builder'
class Rack::Minx
def initialize(app)
@app = app
end
def call(env)
Minx.spawn do
env['async.callback'].call(@app.call(env))
end
throw :async
end
end
app = Rack::Minx.new(lambda {|env| [200, {}, "Hello, World!\n"] })
Rack::Handler::Thin.run(app)
|
# Notes to run:
# gem install bundler
# bundle install
# rackup
#
# Testing:
# Visit http://localhost:9292/
# Visit http://localhost:9292/?_escaped_fragment_
require 'bundler/setup'
require 'rack/snap_search'
use Rack::Static, urls: ['/img', '/js', '/css'], root: 'public'
use Rack::SnapSearch do |config|
config.email = 'email'
config.key = 'password'
config.on_exception do |exception|
p exception
end
end
class Application
def call(env)
headers = {
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
}
body = File.read('public/index.html')
[ 200, headers, [body] ]
end
end
run Application.new
Setup Rack example showing off all of the options in the middleware within Rack::SnapSearch::Config
# Notes to run:
# gem install bundler
# bundle install
# rackup
#
# Testing:
# Visit http://localhost:9292/
# Visit http://localhost:9292/?_escaped_fragment_
require 'bundler/setup'
require 'rack/snap_search'
use Rack::Static, urls: ['/img', '/js', '/css'], root: 'public'
use Rack::SnapSearch do |config|
# Required: The email to authenticate with.
config.email = 'email@example.com'
# Required: The key to authenticate with.
config.key = 'password'
# Optional: The API URL to send requests to.
config.api_url = 'https://snapsearch.io/api/v1/robot' # Default
# Optional: The CA Cert file to use when sending HTTPS requests to the API.
config.ca_cert_file = SnapSearch.root.join('resources', 'cacert.pem') # Default
# Optional: Extra parameters to send to the API.
config.parameters = {} # Default
# Optional: Whitelisted routes. Should be an Array of Regexp instances.
config.matched_routes = [] # Default
# Optional: Blacklisted routes. Should be an Array of Regexp instances.
config.ignored_routes = [] # Default
# Optional: A path of the JSON file containing the user agent whitelist & blacklist.
config.robots_json = SnapSearch.root.join('resources', 'robots.json') # Default
# Optional: Set to `true` to ignore direct requests to files.
config.check_static_files = false # Default
# Optional: A block to run when an exception occurs when making requests to the API
config.on_exception do |exception|
p exception
end
# Optional: A block to run before the interception of a bot
config.before_intercept do |url|
puts "Before interception\n URL: #{url}"
end
# Optional: A block to run after the interception of a bot
config.after_intercept do |url, response|
puts "After interception\n URL: #{url}\n Response: #{response}"
end
end
class Application
def call(env)
headers = {
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
}
body = File.read('public/index.html')
[ 200, headers, [body] ]
end
end
run Application.new
|
class AnsibleLint < Formula
include Language::Python::Virtualenv
desc "Checks ansible playbooks for practices and behaviour"
homepage "https://github.com/ansible/ansible-lint/"
url "https://files.pythonhosted.org/packages/6a/83/08cd79e47452c0faf9325e19c9a1dd26fabfeaaa8733804165a066c19479/ansible-lint-6.8.7.tar.gz"
sha256 "de3de4e57cd54e17c1ec3a0b4a21d4811838e77d67b56cbe8f91107f2a434432"
license all_of: ["MIT", "GPL-3.0-or-later"]
bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "22cec19bedfc226bd4f4e512256b6997ba4e4553b5bef83044dc7bb8565e4334"
sha256 cellar: :any_skip_relocation, arm64_monterey: "7435ff5d533219ca49634908762feea002afe74594474e4e735cd107130e0eb7"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "bd2021aecf926479f04f17a79741e1667bf9ba5e1b4ceba4ab2cceeea1abf810"
sha256 cellar: :any_skip_relocation, monterey: "2a8be33b49f22c658d1d8be6fd5bc0ce6608b5e81835b41d117947fe0995a210"
sha256 cellar: :any_skip_relocation, big_sur: "1e230a400f71a92c296d22bee4cc5083981bd65ae763ccb23dbb0eb007514065"
sha256 cellar: :any_skip_relocation, catalina: "254e2dad4b6aa44424c5f44d8be97229eb271e9d1c2f717ee76543ae9f69a846"
sha256 cellar: :any_skip_relocation, x86_64_linux: "b14978c5141bf10966a034c08bef44c483afb24d75c2479be709ede266d2118b"
end
depends_on "pkg-config" => :build
depends_on "ansible"
depends_on "black"
depends_on "jsonschema"
depends_on "pygments"
depends_on "python@3.10"
depends_on "pyyaml"
depends_on "yamllint"
resource "ansible-compat" do
url "https://files.pythonhosted.org/packages/37/1a/604884d3655a80476dff5ad3cc9991decc5fb26d3f5df51d38361c3cedb1/ansible-compat-2.2.5.tar.gz"
sha256 "28c7c545fd60ef9c3059cfb2fefd27f92db091ff6b5868f83f121ceb5e1fe1b5"
end
resource "bracex" do
url "https://files.pythonhosted.org/packages/b3/96/d53e290ddf6215cfb24f93449a1835eff566f79a1f332cf046a978df0c9e/bracex-2.3.post1.tar.gz"
sha256 "e7b23fc8b2cd06d3dec0692baabecb249dda94e06a617901ff03a6c56fd71693"
end
resource "commonmark" do
url "https://files.pythonhosted.org/packages/60/48/a60f593447e8f0894ebb7f6e6c1f25dafc5e89c5879fdc9360ae93ff83f0/commonmark-0.9.1.tar.gz"
sha256 "452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"
end
resource "filelock" do
url "https://files.pythonhosted.org/packages/95/55/b897882bffb8213456363e646bf9e9fa704ffda5a7d140edf935a9e02c7b/filelock-3.8.0.tar.gz"
sha256 "55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz"
sha256 "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz"
sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"
end
resource "rich" do
url "https://files.pythonhosted.org/packages/11/23/814edf09ec6470d52022b9e95c23c1bef77f0bc451761e1504ebd09606d3/rich-12.6.0.tar.gz"
sha256 "ba3a3775974105c221d31141f2c116f4fd65c5ceb0698657a11e9f295ec93fd0"
end
resource "ruamel.yaml" do
url "https://files.pythonhosted.org/packages/46/a9/6ed24832095b692a8cecc323230ce2ec3480015fbfa4b79941bd41b23a3c/ruamel.yaml-0.17.21.tar.gz"
sha256 "8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"
end
resource "subprocess-tee" do
url "https://files.pythonhosted.org/packages/48/20/a38a078b58532bd44c4c189c85cc650268d1894a1dcc7080b6e7e9cfe7bb/subprocess-tee-0.3.5.tar.gz"
sha256 "ff5cced589a4b8ac973276ca1ba21bb6e3de600cde11a69947ff51f696efd577"
end
resource "wcmatch" do
url "https://files.pythonhosted.org/packages/b7/94/5dd083fc972655f6689587c3af705aabc8b8e781bacdf22d6d2282fe6142/wcmatch-8.4.1.tar.gz"
sha256 "b1f042a899ea4c458b7321da1b5e3331e3e0ec781583434de1301946ceadb943"
end
def install
virtualenv_install_with_resources
site_packages = Language::Python.site_packages("python3.10")
%w[ansible black jsonschema yamllint].each do |package_name|
package = Formula[package_name].opt_libexec
(libexec/site_packages/"homebrew-#{package_name}.pth").write package/site_packages
end
end
test do
ENV["ANSIBLE_REMOTE_TEMP"] = testpath/"tmp"
(testpath/"playbook.yml").write <<~EOS
---
- hosts: all
gather_facts: false
tasks:
- name: ping
ansible.builtin.ping:
EOS
system bin/"ansible-lint", testpath/"playbook.yml"
end
end
ansible-lint: update 6.8.7 bottle.
class AnsibleLint < Formula
include Language::Python::Virtualenv
desc "Checks ansible playbooks for practices and behaviour"
homepage "https://github.com/ansible/ansible-lint/"
url "https://files.pythonhosted.org/packages/6a/83/08cd79e47452c0faf9325e19c9a1dd26fabfeaaa8733804165a066c19479/ansible-lint-6.8.7.tar.gz"
sha256 "de3de4e57cd54e17c1ec3a0b4a21d4811838e77d67b56cbe8f91107f2a434432"
license all_of: ["MIT", "GPL-3.0-or-later"]
bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "22cec19bedfc226bd4f4e512256b6997ba4e4553b5bef83044dc7bb8565e4334"
sha256 cellar: :any_skip_relocation, arm64_monterey: "7435ff5d533219ca49634908762feea002afe74594474e4e735cd107130e0eb7"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "bd2021aecf926479f04f17a79741e1667bf9ba5e1b4ceba4ab2cceeea1abf810"
sha256 cellar: :any_skip_relocation, ventura: "750e544623f7a3e6f1a4d3474c126e8ff56c2dc44fc51352e6a5818a88c0a1a6"
sha256 cellar: :any_skip_relocation, monterey: "2a8be33b49f22c658d1d8be6fd5bc0ce6608b5e81835b41d117947fe0995a210"
sha256 cellar: :any_skip_relocation, big_sur: "1e230a400f71a92c296d22bee4cc5083981bd65ae763ccb23dbb0eb007514065"
sha256 cellar: :any_skip_relocation, catalina: "254e2dad4b6aa44424c5f44d8be97229eb271e9d1c2f717ee76543ae9f69a846"
sha256 cellar: :any_skip_relocation, x86_64_linux: "b14978c5141bf10966a034c08bef44c483afb24d75c2479be709ede266d2118b"
end
depends_on "pkg-config" => :build
depends_on "ansible"
depends_on "black"
depends_on "jsonschema"
depends_on "pygments"
depends_on "python@3.10"
depends_on "pyyaml"
depends_on "yamllint"
resource "ansible-compat" do
url "https://files.pythonhosted.org/packages/37/1a/604884d3655a80476dff5ad3cc9991decc5fb26d3f5df51d38361c3cedb1/ansible-compat-2.2.5.tar.gz"
sha256 "28c7c545fd60ef9c3059cfb2fefd27f92db091ff6b5868f83f121ceb5e1fe1b5"
end
resource "bracex" do
url "https://files.pythonhosted.org/packages/b3/96/d53e290ddf6215cfb24f93449a1835eff566f79a1f332cf046a978df0c9e/bracex-2.3.post1.tar.gz"
sha256 "e7b23fc8b2cd06d3dec0692baabecb249dda94e06a617901ff03a6c56fd71693"
end
resource "commonmark" do
url "https://files.pythonhosted.org/packages/60/48/a60f593447e8f0894ebb7f6e6c1f25dafc5e89c5879fdc9360ae93ff83f0/commonmark-0.9.1.tar.gz"
sha256 "452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"
end
resource "filelock" do
url "https://files.pythonhosted.org/packages/95/55/b897882bffb8213456363e646bf9e9fa704ffda5a7d140edf935a9e02c7b/filelock-3.8.0.tar.gz"
sha256 "55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz"
sha256 "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz"
sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"
end
resource "rich" do
url "https://files.pythonhosted.org/packages/11/23/814edf09ec6470d52022b9e95c23c1bef77f0bc451761e1504ebd09606d3/rich-12.6.0.tar.gz"
sha256 "ba3a3775974105c221d31141f2c116f4fd65c5ceb0698657a11e9f295ec93fd0"
end
resource "ruamel.yaml" do
url "https://files.pythonhosted.org/packages/46/a9/6ed24832095b692a8cecc323230ce2ec3480015fbfa4b79941bd41b23a3c/ruamel.yaml-0.17.21.tar.gz"
sha256 "8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"
end
resource "subprocess-tee" do
url "https://files.pythonhosted.org/packages/48/20/a38a078b58532bd44c4c189c85cc650268d1894a1dcc7080b6e7e9cfe7bb/subprocess-tee-0.3.5.tar.gz"
sha256 "ff5cced589a4b8ac973276ca1ba21bb6e3de600cde11a69947ff51f696efd577"
end
resource "wcmatch" do
url "https://files.pythonhosted.org/packages/b7/94/5dd083fc972655f6689587c3af705aabc8b8e781bacdf22d6d2282fe6142/wcmatch-8.4.1.tar.gz"
sha256 "b1f042a899ea4c458b7321da1b5e3331e3e0ec781583434de1301946ceadb943"
end
def install
virtualenv_install_with_resources
site_packages = Language::Python.site_packages("python3.10")
%w[ansible black jsonschema yamllint].each do |package_name|
package = Formula[package_name].opt_libexec
(libexec/site_packages/"homebrew-#{package_name}.pth").write package/site_packages
end
end
test do
ENV["ANSIBLE_REMOTE_TEMP"] = testpath/"tmp"
(testpath/"playbook.yml").write <<~EOS
---
- hosts: all
gather_facts: false
tasks:
- name: ping
ansible.builtin.ping:
EOS
system bin/"ansible-lint", testpath/"playbook.yml"
end
end
|
class AnsibleLint < Formula
include Language::Python::Virtualenv
desc "Checks ansible playbooks for practices and behaviour"
homepage "https://github.com/willthames/ansible-lint/"
url "https://files.pythonhosted.org/packages/34/21/0accae0dbc42aef2ec433b0bdaa5d21774939667b45690f5d4a4619b4528/ansible-lint-3.4.13.tar.gz"
sha256 "79df7b490747049c857d47b44a39465ca909860dab0909df0ce48cd4333cf7e4"
bottle do
cellar :any
sha256 "237b38dee0e69d681ba7ac77f3526eff8cdf64e4f6be047f9edf4825be75d987" => :sierra
sha256 "dbafa20d7df97bcf7494419f808c29c465e3a4dd3e989846f9f5696f1fc4646c" => :el_capitan
sha256 "101a557fdc7174d8a97043e13b03e53124bc708e9fba075697d362929c3afc1b" => :yosemite
end
depends_on "pkg-config" => :build
depends_on :python
depends_on "libyaml"
depends_on "openssl@1.1"
### setup_requires dependencies
resource "ansible" do
url "https://files.pythonhosted.org/packages/65/6e/3df94b6bf0e2d8b7d1e9e4e384e312c49c59fce45ccfce3d01dd98084395/ansible-2.3.0.0.tar.gz"
sha256 "299f3907cd566a20e163942fa82b6afc86ef89c2726ba503b90c1a651e82a458"
end
resource "appdirs" do
url "https://files.pythonhosted.org/packages/48/69/d87c60746b393309ca30761f8e2b49473d43450b150cb08f3c6df5c11be5/appdirs-1.4.3.tar.gz"
sha256 "9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92"
end
resource "asn1crypto" do
url "https://files.pythonhosted.org/packages/67/14/5d66588868c4304f804ebaff9397255f6ec5559e46724c2496e0f26e68d6/asn1crypto-0.22.0.tar.gz"
sha256 "cbbadd640d3165ab24b06ef25d1dca09a3441611ac15f6a6b452474fdf0aed1a"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/5b/b9/790f8eafcdab455bcd3bd908161f802c9ce5adbf702a83aa7712fcc345b7/cffi-1.10.0.tar.gz"
sha256 "b3b02911eb1f6ada203b0763ba924234629b51586f72a21faacc638269f4ced5"
end
resource "cryptography" do
url "https://files.pythonhosted.org/packages/81/fb/97d649657687d483753880cf663cf78015e1b8fb495d565feb49f1d56a24/cryptography-1.8.2.tar.gz"
sha256 "8e88ebac371a388024dab3ccf393bf3c1790d21bc3c299d5a6f9f83fb823beda"
end
resource "enum34" do
url "https://files.pythonhosted.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"
sha256 "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/d8/82/28a51052215014efc07feac7330ed758702fc0581347098a81699b5281cb/idna-2.5.tar.gz"
sha256 "3cb5ce08046c4e3a560fc02f138d0ac63e00f8ce5901a56b32ec8b7994082aab"
end
resource "ipaddress" do
url "https://files.pythonhosted.org/packages/4e/13/774faf38b445d0b3a844b65747175b2e0500164b7c28d78e34987a5bfe06/ipaddress-1.0.18.tar.gz"
sha256 "5d8534c8e185f2d8a1fda1ef73f2c8f4b23264e8e30063feeb9511d492a413e1"
end
resource "Jinja2" do
url "https://files.pythonhosted.org/packages/90/61/f820ff0076a2599dd39406dcb858ecb239438c02ce706c8e91131ab9c7f1/Jinja2-2.9.6.tar.gz"
sha256 "ddaa01a212cd6d641401cb01b605f4a4d9f37bfc93043d7f760ec70fb99ff9ff"
end
resource "MarkupSafe" do
url "https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz"
sha256 "a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/c6/70/bb32913de251017e266c5114d0a645f262fb10ebc9bf6de894966d124e35/packaging-16.8.tar.gz"
sha256 "5d50835fdf0a7edf0b55e311b7c887786504efea1177abd7e69329a8e5ea619e"
end
resource "paramiko" do
url "https://files.pythonhosted.org/packages/64/79/5e8baeedb6baf1d5879efa8cd012f801efc232e56a068550ba00d7e82625/paramiko-2.1.2.tar.gz"
sha256 "5fae49bed35e2e3d45c4f7b0db2d38b9ca626312d91119b3991d0ecf8125e310"
end
resource "pyasn1" do
url "https://files.pythonhosted.org/packages/69/17/eec927b7604d2663fef82204578a0056e11e0fc08d485fdb3b6199d9b590/pyasn1-0.2.3.tar.gz"
sha256 "738c4ebd88a718e700ee35c8d129acce2286542daa80a82823a7073644f706ad"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/be/64/1bb257ffb17d01f4a38d7ce686809a736837ad4371bcc5c42ba7a715c3ac/pycparser-2.17.tar.gz"
sha256 "0aac31e917c24cb3357f5a4d5566f2cc91a19ca41862f6c3c22dc60a629673b6"
end
resource "pycrypto" do
url "https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz"
sha256 "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/3c/ec/a94f8cf7274ea60b5413df054f82a8980523efd712ec55a59e7c3357cf7c/pyparsing-2.2.0.tar.gz"
sha256 "0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz"
sha256 "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab"
end
resource "six" do
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
def install
virtualenv_install_with_resources
end
test do
ENV["ANSIBLE_REMOTE_TEMP"] = testpath/"tmp"
(testpath/"playbook.yml").write <<-EOF.undent
---
- hosts: all
gather_facts: False
tasks:
- name: ping
ping:
EOF
system bin/"ansible-lint", testpath/"playbook.yml"
end
end
ansible-lint: update 3.4.13 bottle.
class AnsibleLint < Formula
include Language::Python::Virtualenv
desc "Checks ansible playbooks for practices and behaviour"
homepage "https://github.com/willthames/ansible-lint/"
url "https://files.pythonhosted.org/packages/34/21/0accae0dbc42aef2ec433b0bdaa5d21774939667b45690f5d4a4619b4528/ansible-lint-3.4.13.tar.gz"
sha256 "79df7b490747049c857d47b44a39465ca909860dab0909df0ce48cd4333cf7e4"
bottle do
cellar :any
rebuild 1
sha256 "3db5519fd566a32fd2d288d1bc87d300a9aa23be652eff56976882d37dc15128" => :sierra
sha256 "6818878f35fd2a879c8ab4018a3c5152f875f4cabd1b0e5b113d19a48edaa829" => :el_capitan
sha256 "f6417a4447f78d8f3a8687c27b32683315428f199f644cfa115782813681bbb8" => :yosemite
end
depends_on "pkg-config" => :build
depends_on :python
depends_on "libyaml"
depends_on "openssl@1.1"
### setup_requires dependencies
resource "ansible" do
url "https://files.pythonhosted.org/packages/65/6e/3df94b6bf0e2d8b7d1e9e4e384e312c49c59fce45ccfce3d01dd98084395/ansible-2.3.0.0.tar.gz"
sha256 "299f3907cd566a20e163942fa82b6afc86ef89c2726ba503b90c1a651e82a458"
end
resource "appdirs" do
url "https://files.pythonhosted.org/packages/48/69/d87c60746b393309ca30761f8e2b49473d43450b150cb08f3c6df5c11be5/appdirs-1.4.3.tar.gz"
sha256 "9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92"
end
resource "asn1crypto" do
url "https://files.pythonhosted.org/packages/67/14/5d66588868c4304f804ebaff9397255f6ec5559e46724c2496e0f26e68d6/asn1crypto-0.22.0.tar.gz"
sha256 "cbbadd640d3165ab24b06ef25d1dca09a3441611ac15f6a6b452474fdf0aed1a"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/5b/b9/790f8eafcdab455bcd3bd908161f802c9ce5adbf702a83aa7712fcc345b7/cffi-1.10.0.tar.gz"
sha256 "b3b02911eb1f6ada203b0763ba924234629b51586f72a21faacc638269f4ced5"
end
resource "cryptography" do
url "https://files.pythonhosted.org/packages/81/fb/97d649657687d483753880cf663cf78015e1b8fb495d565feb49f1d56a24/cryptography-1.8.2.tar.gz"
sha256 "8e88ebac371a388024dab3ccf393bf3c1790d21bc3c299d5a6f9f83fb823beda"
end
resource "enum34" do
url "https://files.pythonhosted.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"
sha256 "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/d8/82/28a51052215014efc07feac7330ed758702fc0581347098a81699b5281cb/idna-2.5.tar.gz"
sha256 "3cb5ce08046c4e3a560fc02f138d0ac63e00f8ce5901a56b32ec8b7994082aab"
end
resource "ipaddress" do
url "https://files.pythonhosted.org/packages/4e/13/774faf38b445d0b3a844b65747175b2e0500164b7c28d78e34987a5bfe06/ipaddress-1.0.18.tar.gz"
sha256 "5d8534c8e185f2d8a1fda1ef73f2c8f4b23264e8e30063feeb9511d492a413e1"
end
resource "Jinja2" do
url "https://files.pythonhosted.org/packages/90/61/f820ff0076a2599dd39406dcb858ecb239438c02ce706c8e91131ab9c7f1/Jinja2-2.9.6.tar.gz"
sha256 "ddaa01a212cd6d641401cb01b605f4a4d9f37bfc93043d7f760ec70fb99ff9ff"
end
resource "MarkupSafe" do
url "https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz"
sha256 "a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/c6/70/bb32913de251017e266c5114d0a645f262fb10ebc9bf6de894966d124e35/packaging-16.8.tar.gz"
sha256 "5d50835fdf0a7edf0b55e311b7c887786504efea1177abd7e69329a8e5ea619e"
end
resource "paramiko" do
url "https://files.pythonhosted.org/packages/64/79/5e8baeedb6baf1d5879efa8cd012f801efc232e56a068550ba00d7e82625/paramiko-2.1.2.tar.gz"
sha256 "5fae49bed35e2e3d45c4f7b0db2d38b9ca626312d91119b3991d0ecf8125e310"
end
resource "pyasn1" do
url "https://files.pythonhosted.org/packages/69/17/eec927b7604d2663fef82204578a0056e11e0fc08d485fdb3b6199d9b590/pyasn1-0.2.3.tar.gz"
sha256 "738c4ebd88a718e700ee35c8d129acce2286542daa80a82823a7073644f706ad"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/be/64/1bb257ffb17d01f4a38d7ce686809a736837ad4371bcc5c42ba7a715c3ac/pycparser-2.17.tar.gz"
sha256 "0aac31e917c24cb3357f5a4d5566f2cc91a19ca41862f6c3c22dc60a629673b6"
end
resource "pycrypto" do
url "https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz"
sha256 "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/3c/ec/a94f8cf7274ea60b5413df054f82a8980523efd712ec55a59e7c3357cf7c/pyparsing-2.2.0.tar.gz"
sha256 "0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz"
sha256 "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab"
end
resource "six" do
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
def install
virtualenv_install_with_resources
end
test do
ENV["ANSIBLE_REMOTE_TEMP"] = testpath/"tmp"
(testpath/"playbook.yml").write <<-EOF.undent
---
- hosts: all
gather_facts: False
tasks:
- name: ping
ping:
EOF
system bin/"ansible-lint", testpath/"playbook.yml"
end
end
|
class ApacheGeode < Formula
desc "In-memory Data Grid for fast transactional data processing"
homepage "https://geode.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=geode/1.14.3/apache-geode-1.14.3.tgz"
mirror "https://archive.apache.org/dist/geode/1.14.3/apache-geode-1.14.3.tgz"
mirror "https://downloads.apache.org/geode/1.14.3/apache-geode-1.14.3.tgz"
sha256 "5efb1c71db34ba3b7ce1004579f8b9b7a43eae30f42c37837d5abd68c6d778bd"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "2e9094a76eb50211f616a3f25442d0ef7f32f22d79cb69ba71fad64d99ae3adf"
end
depends_on "openjdk@11"
def install
rm_f "bin/gfsh.bat"
bash_completion.install "bin/gfsh-completion.bash" => "gfsh"
libexec.install Dir["*"]
(bin/"gfsh").write_env_script libexec/"bin/gfsh", Language::Java.java_home_env("11")
end
test do
flags = "--dir #{testpath} --name=geode_locator_brew_test"
output = shell_output("#{bin}/gfsh start locator #{flags}")
assert_match "Cluster configuration service is up and running", output
ensure
quiet_system "pkill", "-9", "-f", "geode_locator_brew_test"
end
end
apache-geode: update 1.14.3 bottle.
class ApacheGeode < Formula
desc "In-memory Data Grid for fast transactional data processing"
homepage "https://geode.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=geode/1.14.3/apache-geode-1.14.3.tgz"
mirror "https://archive.apache.org/dist/geode/1.14.3/apache-geode-1.14.3.tgz"
mirror "https://downloads.apache.org/geode/1.14.3/apache-geode-1.14.3.tgz"
sha256 "5efb1c71db34ba3b7ce1004579f8b9b7a43eae30f42c37837d5abd68c6d778bd"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, all: "65bea795d99a6dec2fb13936bfe830688745805d7799083bcd7223a5cfedf68f"
end
depends_on "openjdk@11"
def install
rm_f "bin/gfsh.bat"
bash_completion.install "bin/gfsh-completion.bash" => "gfsh"
libexec.install Dir["*"]
(bin/"gfsh").write_env_script libexec/"bin/gfsh", Language::Java.java_home_env("11")
end
test do
flags = "--dir #{testpath} --name=geode_locator_brew_test"
output = shell_output("#{bin}/gfsh start locator #{flags}")
assert_match "Cluster configuration service is up and running", output
ensure
quiet_system "pkill", "-9", "-f", "geode_locator_brew_test"
end
end
|
class AtSpi2Core < Formula
desc "Protocol definitions and daemon for D-Bus at-spi"
homepage "https://wiki.linuxfoundation.org/accessibility/"
url "https://download.gnome.org/sources/at-spi2-core/2.30/at-spi2-core-2.30.1.tar.xz"
sha256 "856f1f8f1bf0482a1bc275b18b9f28815d346bc4175004d37e175a1a0e50ca48"
revision 1
bottle do
sha256 "500ac594025a42f969e6166771f551abf0be27afbc0de2048bf0d65e763ee9b4" => :mojave
sha256 "cdca60e8b2787cc2694aa3d744c641bf68f8dfc835065bab63123d53a2c3c622" => :high_sierra
sha256 "11b05e7002247ae75a1f95c381b1bc4fe7839efca2f01ff882fd5b4e23a3668c" => :sierra
end
depends_on "gobject-introspection" => :build
depends_on "intltool" => :build
depends_on "meson-internal" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "python" => :build
depends_on "dbus"
depends_on "gettext"
depends_on "glib"
unless OS.mac?
depends_on "linuxbrew/xorg/xorgproto"
depends_on "linuxbrew/xorg/libx11"
depends_on "linuxbrew/xorg/libxtst"
end
def install
ENV.refurbish_args
mkdir "build" do
system "meson", "--prefix=#{prefix}", ".."
system "ninja"
system "ninja", "install"
end
end
test do
system "#{libexec}/at-spi2-registryd", "-h"
end
end
at-spi2-core: make linux only
class AtSpi2Core < Formula
desc "Protocol definitions and daemon for D-Bus at-spi"
homepage "https://wiki.linuxfoundation.org/accessibility/"
url "https://download.gnome.org/sources/at-spi2-core/2.30/at-spi2-core-2.30.1.tar.xz"
sha256 "856f1f8f1bf0482a1bc275b18b9f28815d346bc4175004d37e175a1a0e50ca48"
revision 1
# tag "linuxbrew"
bottle do
sha256 "500ac594025a42f969e6166771f551abf0be27afbc0de2048bf0d65e763ee9b4" => :mojave
sha256 "cdca60e8b2787cc2694aa3d744c641bf68f8dfc835065bab63123d53a2c3c622" => :high_sierra
sha256 "11b05e7002247ae75a1f95c381b1bc4fe7839efca2f01ff882fd5b4e23a3668c" => :sierra
end
depends_on "gobject-introspection" => :build
depends_on "intltool" => :build
depends_on "meson-internal" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "python" => :build
depends_on "dbus"
depends_on "gettext"
depends_on "glib"
depends_on "linuxbrew/xorg/xorgproto"
depends_on "linuxbrew/xorg/libx11"
depends_on "linuxbrew/xorg/libxtst"
def install
ENV.refurbish_args
mkdir "build" do
system "meson", "--prefix=#{prefix}", "--libdir=#{lib}", ".."
system "ninja"
system "ninja", "install"
end
end
test do
system "#{libexec}/at-spi2-registryd", "-h"
end
end
|
class AtSpi2Core < Formula
desc "Protocol definitions and daemon for D-Bus at-spi"
homepage "http://a11y.org"
url "https://download.gnome.org/sources/at-spi2-core/2.18/at-spi2-core-2.18.3.tar.xz"
sha256 "ada26add94155f97d0f601a20cb7a0e3fd3ba1588c3520b7288316494027d629"
revision 1
bottle do
sha256 "96b67926248f6950a20ea28fde034e9a91b6c4c4a14eb3cd54e0aead53224ce6" => :el_capitan
sha256 "2c413dbe96a387b290cdc2d9079f6c54be5f4409d3e5785779d5b7f3681bebd9" => :yosemite
sha256 "310fe864ee0b4e81fd58e901b02cc9cb16cd8ae21e4cb2438d6e2ff764986d04" => :mavericks
end
depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "gettext"
depends_on "glib"
depends_on "dbus"
depends_on :x11
depends_on "gobject-introspection"
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-introspection=yes"
system "make", "install"
end
end
at-spi2-core: update 2.18.3_1 bottle.
class AtSpi2Core < Formula
desc "Protocol definitions and daemon for D-Bus at-spi"
homepage "http://a11y.org"
url "https://download.gnome.org/sources/at-spi2-core/2.18/at-spi2-core-2.18.3.tar.xz"
sha256 "ada26add94155f97d0f601a20cb7a0e3fd3ba1588c3520b7288316494027d629"
revision 1
bottle do
sha256 "e6740e78c2539493412d8c904d30a9cc5149d054019d3376b7c313f674d8f798" => :el_capitan
sha256 "bec02510d1c9b936eb8949cdfae0c7d6d98c61903a60c86224c31faef601da47" => :yosemite
sha256 "5bae032aa34888e236c7c24b2da29fc4c289b5a6372cbeab360180184bb666ce" => :mavericks
end
depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "gettext"
depends_on "glib"
depends_on "dbus"
depends_on :x11
depends_on "gobject-introspection"
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-introspection=yes"
system "make", "install"
end
end
|
class ChibiScheme < Formula
desc "Small footprint Scheme for use as a C Extension Language"
homepage "https://github.com/ashinn/chibi-scheme"
url "https://github.com/ashinn/chibi-scheme/archive/0.10.tar.gz"
sha256 "ae1d2057138b7f438f01bfb1e072799105faeea1de0ab3cc10860adf373993b3"
license "BSD-3-Clause"
head "https://github.com/ashinn/chibi-scheme.git"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 arm64_big_sur: "18fc48f1b5623936fd24b7259b4bcb0e611a91ebe2354b2e1ca8b3dc99dd3eb6"
sha256 big_sur: "2547ea8be7276702a7db43cd70ca284d74fd7176d612e4b2bab2837343fd3736"
sha256 catalina: "38846d601710212a1e2769fd7415d176f0ee439798108ca022f86328fd23b42d"
sha256 mojave: "e24e63d2279cdc92dd95d61520c031b8c6ed1f57a3bbe5f7c971376c930112a1"
sha256 x86_64_linux: "d1e2da39ca7ade3c5cd55d95132c56ba7d73b6d70c60ad5b55aa0866aa4fc879"
end
def install
ENV.deparallelize
# "make" and "make install" must be done separately
system "make", "PREFIX=#{prefix}"
system "make", "install", "PREFIX=#{prefix}"
end
test do
output = `#{bin}/chibi-scheme -mchibi -e "(for-each write '(0 1 2 3 4 5 6 7 8 9))"`
assert_equal "0123456789", output
assert_equal 0, $CHILD_STATUS.exitstatus
end
end
chibi-scheme: add `head` branch
class ChibiScheme < Formula
desc "Small footprint Scheme for use as a C Extension Language"
homepage "https://github.com/ashinn/chibi-scheme"
url "https://github.com/ashinn/chibi-scheme/archive/0.10.tar.gz"
sha256 "ae1d2057138b7f438f01bfb1e072799105faeea1de0ab3cc10860adf373993b3"
license "BSD-3-Clause"
head "https://github.com/ashinn/chibi-scheme.git", branch: "master"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
sha256 arm64_big_sur: "18fc48f1b5623936fd24b7259b4bcb0e611a91ebe2354b2e1ca8b3dc99dd3eb6"
sha256 big_sur: "2547ea8be7276702a7db43cd70ca284d74fd7176d612e4b2bab2837343fd3736"
sha256 catalina: "38846d601710212a1e2769fd7415d176f0ee439798108ca022f86328fd23b42d"
sha256 mojave: "e24e63d2279cdc92dd95d61520c031b8c6ed1f57a3bbe5f7c971376c930112a1"
sha256 x86_64_linux: "d1e2da39ca7ade3c5cd55d95132c56ba7d73b6d70c60ad5b55aa0866aa4fc879"
end
def install
ENV.deparallelize
# "make" and "make install" must be done separately
system "make", "PREFIX=#{prefix}"
system "make", "install", "PREFIX=#{prefix}"
end
test do
output = `#{bin}/chibi-scheme -mchibi -e "(for-each write '(0 1 2 3 4 5 6 7 8 9))"`
assert_equal "0123456789", output
assert_equal 0, $CHILD_STATUS.exitstatus
end
end
|
require 'formula'
class Chromedriver < Formula
homepage 'http://code.google.com/p/chromedriver/'
url 'http://chromedriver.googlecode.com/files/chromedriver_mac_21.0.1180.4.zip'
sha1 'ea6f2f45c835d3413fde3a7b08e5e3e4db6dc3f9'
def install
bin.install 'chromedriver'
end
end
chromedriver 23.0.1240.0
Closes Homebrew/homebrew#15365.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class Chromedriver < Formula
homepage 'http://code.google.com/p/chromedriver/'
url 'https://chromedriver.googlecode.com/files/chromedriver_mac_23.0.1240.0.zip'
sha1 '20a21cca0a4f0a1e25ee88e1f0bd53acbdba4cc6'
def install
bin.install 'chromedriver'
end
end
|
class ClangFormat < Formula
desc "Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript"
homepage "https://clang.llvm.org/docs/ClangFormat.html"
# The LLVM Project is under the Apache License v2.0 with LLVM Exceptions
license "Apache-2.0"
version_scheme 1
head "https://github.com/llvm/llvm-project.git"
stable do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz"
sha256 "ccd87c254b6aebc5077e4e6977d08d4be888e7eb672c6630a26a15d58b59b528"
resource "clang" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/clang-11.0.1.src.tar.xz"
sha256 "73f572c2eefc5a155e01bcd84815751d722a4d3925f53c144acfb93eeb274b4d"
end
resource "libcxx" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/libcxx-11.0.1.src.tar.xz"
sha256 "9fd5f669621ffea88a2b93e3d99f3a958b5defb954f71bf754709b63275f5e3d"
end
resource "libcxxabi" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/libcxxabi-11.0.1.src.tar.xz"
sha256 "4a697056a5c08621a8380dcaf3836525835aa76b3008d9e8f27abf9270bf683f"
end
end
livecheck do
url :stable
strategy :github_latest
regex(%r{href=.*?/tag/llvmorg[._-]v?(\d+(?:\.\d+)+)}i)
end
bottle do
cellar :any_skip_relocation
sha256 "7978ffd41bd627e9054073763e8fca8a90f282636127bd17719d1b8326885a5e" => :big_sur
sha256 "9b299661bc571c3d711d0203f9b3de3f50b36f744f339ad3261d35ddc5f15db0" => :arm64_big_sur
sha256 "679f98a5595d37a20e018471c3b12ca2bf18ba4e26fe5311caafc24c627b8d9b" => :catalina
sha256 "70bbea9c85e84c730b36bd4ea27c0b219fe902d2a5ef8f9415c33b1653114e3e" => :mojave
end
depends_on "cmake" => :build
depends_on "ninja" => :build
uses_from_macos "libxml2"
uses_from_macos "ncurses"
uses_from_macos "zlib"
def install
if build.head?
ln_s buildpath/"libcxx", buildpath/"llvm/projects/libcxx"
ln_s buildpath/"libcxxabi", buildpath/"llvm/tools/libcxxabi"
ln_s buildpath/"clang", buildpath/"llvm/tools/clang"
else
(buildpath/"projects/libcxx").install resource("libcxx")
(buildpath/"projects/libcxxabi").install resource("libcxxabi")
(buildpath/"tools/clang").install resource("clang")
end
llvmpath = build.head? ? buildpath/"llvm" : buildpath
mkdir llvmpath/"build" do
args = std_cmake_args
args << "-DLLVM_ENABLE_LIBCXX=ON"
args << "-DLLVM_EXTERNAL_PROJECTS=\"clang;libcxx;libcxxabi\""
args << "-DLLVM_EXTERNAL_LIBCXX_SOURCE_DIR=\"#{buildpath/"projects/libcxx"}\""
args << ".."
system "cmake", "-G", "Ninja", *args
system "ninja", "clang-format"
end
bin.install llvmpath/"build/bin/clang-format"
bin.install llvmpath/"tools/clang/tools/clang-format/git-clang-format"
(share/"clang").install Dir[llvmpath/"tools/clang/tools/clang-format/clang-format*"]
end
test do
# NB: below C code is messily formatted on purpose.
(testpath/"test.c").write <<~EOS
int main(char *args) { \n \t printf("hello"); }
EOS
assert_equal "int main(char *args) { printf(\"hello\"); }\n",
shell_output("#{bin}/clang-format -style=Google test.c")
end
end
clang-format: update 11.0.1 bottle.
class ClangFormat < Formula
desc "Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript"
homepage "https://clang.llvm.org/docs/ClangFormat.html"
# The LLVM Project is under the Apache License v2.0 with LLVM Exceptions
license "Apache-2.0"
version_scheme 1
head "https://github.com/llvm/llvm-project.git"
stable do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz"
sha256 "ccd87c254b6aebc5077e4e6977d08d4be888e7eb672c6630a26a15d58b59b528"
resource "clang" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/clang-11.0.1.src.tar.xz"
sha256 "73f572c2eefc5a155e01bcd84815751d722a4d3925f53c144acfb93eeb274b4d"
end
resource "libcxx" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/libcxx-11.0.1.src.tar.xz"
sha256 "9fd5f669621ffea88a2b93e3d99f3a958b5defb954f71bf754709b63275f5e3d"
end
resource "libcxxabi" do
url "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/libcxxabi-11.0.1.src.tar.xz"
sha256 "4a697056a5c08621a8380dcaf3836525835aa76b3008d9e8f27abf9270bf683f"
end
end
livecheck do
url :stable
strategy :github_latest
regex(%r{href=.*?/tag/llvmorg[._-]v?(\d+(?:\.\d+)+)}i)
end
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "210043c597e9bde9a3f0237c1c31a8ef7da945594bbe9ae19dd1dd3775188ca4" => :big_sur
sha256 "a083e51ce20a166020467d8f706dcb5de057df3a597c75e73fe10d5036ad2cce" => :arm64_big_sur
sha256 "c43220c14172612d612f7d04df938b9ad646fdb29531c48cf4fc5a2ad17a196f" => :catalina
sha256 "8db2426af381b430422595e1841dd9d134f37ab8551a1ffbc6025bf2cd852f96" => :mojave
end
depends_on "cmake" => :build
depends_on "ninja" => :build
uses_from_macos "libxml2"
uses_from_macos "ncurses"
uses_from_macos "zlib"
def install
if build.head?
ln_s buildpath/"libcxx", buildpath/"llvm/projects/libcxx"
ln_s buildpath/"libcxxabi", buildpath/"llvm/tools/libcxxabi"
ln_s buildpath/"clang", buildpath/"llvm/tools/clang"
else
(buildpath/"projects/libcxx").install resource("libcxx")
(buildpath/"projects/libcxxabi").install resource("libcxxabi")
(buildpath/"tools/clang").install resource("clang")
end
llvmpath = build.head? ? buildpath/"llvm" : buildpath
mkdir llvmpath/"build" do
args = std_cmake_args
args << "-DLLVM_ENABLE_LIBCXX=ON"
args << "-DLLVM_EXTERNAL_PROJECTS=\"clang;libcxx;libcxxabi\""
args << "-DLLVM_EXTERNAL_LIBCXX_SOURCE_DIR=\"#{buildpath/"projects/libcxx"}\""
args << ".."
system "cmake", "-G", "Ninja", *args
system "ninja", "clang-format"
end
bin.install llvmpath/"build/bin/clang-format"
bin.install llvmpath/"tools/clang/tools/clang-format/git-clang-format"
(share/"clang").install Dir[llvmpath/"tools/clang/tools/clang-format/clang-format*"]
end
test do
# NB: below C code is messily formatted on purpose.
(testpath/"test.c").write <<~EOS
int main(char *args) { \n \t printf("hello"); }
EOS
assert_equal "int main(char *args) { printf(\"hello\"); }\n",
shell_output("#{bin}/clang-format -style=Google test.c")
end
end
|
class ClangFormat < Formula
desc "Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript"
homepage "https://clang.llvm.org/docs/ClangFormat.html"
version "2018-12-18"
stable do
depends_on "subversion" => :build
url "http://llvm.org/svn/llvm-project/llvm/tags/google/stable/2018-12-18/", :using => :svn
resource "clang" do
url "http://llvm.org/svn/llvm-project/cfe/tags/google/stable/2018-12-18/", :using => :svn
end
resource "libcxx" do
url "https://releases.llvm.org/7.0.0/libcxx-7.0.0.src.tar.xz"
sha256 "9b342625ba2f4e65b52764ab2061e116c0337db2179c6bce7f9a0d70c52134f0"
end
end
bottle do
cellar :any_skip_relocation
sha256 "c7b2d5141522cde00e586a0291dbaaf651285905abc52669ee58767fb001798e" => :mojave
sha256 "499498f37f6fc02104e369fec3e8d3352b043cf56ceb52cda5ea57a60e5a8868" => :high_sierra
sha256 "856dedad614fd9a3f490b9d92e734f9ac7d9b3f345bf09b6083d5c1509d90d6d" => :sierra
end
head do
url "https://git.llvm.org/git/llvm.git"
resource "clang" do
url "https://git.llvm.org/git/clang.git"
end
resource "libcxx" do
url "https://git.llvm.org/git/libcxx.git"
end
end
depends_on "cmake" => :build
depends_on "ninja" => :build
depends_on "bison" => :build unless OS.mac?
def install
(buildpath/"projects/libcxx").install resource("libcxx")
(buildpath/"tools/clang").install resource("clang")
mkdir "build" do
args = std_cmake_args
args << "-DCMAKE_OSX_SYSROOT=/" unless MacOS::Xcode.installed?
args << "-DLLVM_ENABLE_LIBCXX=ON"
args << ".."
system "cmake", "-G", "Ninja", *args
system "ninja", "clang-format"
bin.install "bin/clang-format"
end
bin.install "tools/clang/tools/clang-format/git-clang-format"
(share/"clang").install Dir["tools/clang/tools/clang-format/clang-format*"]
end
test do
# NB: below C code is messily formatted on purpose.
(testpath/"test.c").write <<~EOS
int main(char *args) { \n \t printf("hello"); }
EOS
assert_equal "int main(char *args) { printf(\"hello\"); }\n",
shell_output("#{bin}/clang-format -style=Google test.c")
end
end
clang-format: fix build for Linuxbrew
Closes Linuxbrew/homebrew-core#10613.
Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com>
class ClangFormat < Formula
desc "Formatting tools for C, C++, Obj-C, Java, JavaScript, TypeScript"
homepage "https://clang.llvm.org/docs/ClangFormat.html"
version "2018-12-18"
stable do
depends_on "subversion" => :build
url "http://llvm.org/svn/llvm-project/llvm/tags/google/stable/2018-12-18/", :using => :svn
resource "clang" do
url "http://llvm.org/svn/llvm-project/cfe/tags/google/stable/2018-12-18/", :using => :svn
end
resource "libcxx" do
url "https://releases.llvm.org/7.0.0/libcxx-7.0.0.src.tar.xz"
sha256 "9b342625ba2f4e65b52764ab2061e116c0337db2179c6bce7f9a0d70c52134f0"
end
end
bottle do
cellar :any_skip_relocation
sha256 "c7b2d5141522cde00e586a0291dbaaf651285905abc52669ee58767fb001798e" => :mojave
sha256 "499498f37f6fc02104e369fec3e8d3352b043cf56ceb52cda5ea57a60e5a8868" => :high_sierra
sha256 "856dedad614fd9a3f490b9d92e734f9ac7d9b3f345bf09b6083d5c1509d90d6d" => :sierra
end
head do
url "https://git.llvm.org/git/llvm.git"
resource "clang" do
url "https://git.llvm.org/git/clang.git"
end
resource "libcxx" do
url "https://git.llvm.org/git/libcxx.git"
end
end
depends_on "cmake" => :build
depends_on "ninja" => :build
depends_on "subversion" => :build
unless OS.mac?
depends_on "bison" => :build
depends_on "gcc" # needed for libstdc++
depends_on "glibc" => (Formula["glibc"].installed? || OS::Linux::Glibc.system_version < Formula["glibc"].version) ? :recommended : :optional
depends_on "libedit" # llvm requires <histedit.h>
depends_on "ncurses"
depends_on "libxml2"
depends_on "zlib"
needs :cxx11
end
def install
# Reduce memory usage below 4 GB for Circle CI.
ENV["MAKEFLAGS"] = "-j2 -l2.0" if ENV["CIRCLECI"]
(buildpath/"projects/libcxx").install resource("libcxx") if OS.mac?
(buildpath/"tools/clang").install resource("clang")
mkdir "build" do
args = std_cmake_args
args << "-DCMAKE_OSX_SYSROOT=/" unless OS.mac? && MacOS::Xcode.installed?
args << "-DLLVM_ENABLE_LIBCXX=ON" if OS.mac?
args << "-DLLVM_ENABLE_LIBCXX=OFF" unless OS.mac?
args << ".."
system "cmake", "-G", "Ninja", *args
system "ninja", *("-j2" if ENV["CIRCLECI"]), "clang-format"
bin.install "bin/clang-format"
end
bin.install "tools/clang/tools/clang-format/git-clang-format"
(share/"clang").install Dir["tools/clang/tools/clang-format/clang-format*"]
end
test do
# NB: below C code is messily formatted on purpose.
(testpath/"test.c").write <<~EOS
int main(char *args) { \n \t printf("hello"); }
EOS
assert_equal "int main(char *args) { printf(\"hello\"); }\n",
shell_output("#{bin}/clang-format -style=Google test.c")
end
end
|
coffee-script 1.11.1 (new formula)
Closes #6468.
Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>
require "language/node"
class Coffeescript < Formula
desc "Unfancy JavaScript"
homepage "http://coffeescript.org"
url "https://registry.npmjs.org/coffee-script/-/coffee-script-1.11.1.tgz"
sha256 "b004b3a68e1f8b49e81099d5005be222cf49bad06d46979ff22d0184ba667fae"
head "https://github.com/jashkenas/coffeescript.git"
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
(testpath/"test.coffee").write <<-EOS.undent
square = (x) -> x * x
list = [1, 2, 3, 4, 5]
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x
cubes = (math.cube num for num in list)
EOS
system bin/"coffee", "--compile", "test.coffee"
assert File.exist?("test.js"), "test.js was not generated"
end
end
|
class CrosstoolNg < Formula
desc "Tool for building toolchains"
homepage "http://crosstool-ng.org"
url "http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.21.0.tar.bz2"
sha256 "67122ba42657da258f23de4a639bc49c6ca7fe2173b5efba60ce729c6cce7a41"
bottle do
cellar :any_skip_relocation
revision 1
sha256 "12da46c49731e5bdd94b3e209d86bc3a2e0fa4a26e7982a76b07a492641c5e6d" => :el_capitan
sha256 "bce130a66509ebb9a134b1aec50abcbcc505c3d012fecd8d135b9acaf128ef01" => :yosemite
sha256 "46ec6b65cb40a715a166aa6c4544be4028e2ac7d95ce24e15878318529133bea" => :mavericks
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "coreutils" => :build
depends_on "wget"
depends_on "gnu-sed"
depends_on "gawk"
depends_on "binutils"
depends_on "libelf"
depends_on "homebrew/dupes/grep" => :optional
depends_on "homebrew/dupes/make" => :optional
# Avoid superenv to prevent https://github.com/mxcl/homebrew/pull/10552#issuecomment-9736248
env :std
def install
args = ["--prefix=#{prefix}",
"--exec-prefix=#{prefix}",
"--with-objcopy=gobjcopy",
"--with-objdump=gobjdump",
"--with-readelf=greadelf",
"--with-libtool=glibtool",
"--with-libtoolize=glibtoolize",
"--with-install=ginstall",
"--with-sed=gsed",
"--with-awk=gawk",
]
args << "--with-grep=ggrep" if build.with? "grep"
args << "--with-make=#{Formula["make"].opt_bin}/gmake" if build.with? "make"
args << "CFLAGS=-std=gnu89"
system "./configure", *args
# Must be done in two steps
system "make"
system "make", "install"
end
def caveats; <<-EOS.undent
You will need to install modern gcc compiler in order to use this tool.
EOS
end
test do
system "#{bin}/ct-ng", "version"
end
end
crosstool-ng 1.22.0
Closes Homebrew/homebrew#48397.
Signed-off-by: Dominyk Tiller <53e438f55903875d07efdd98a8aaf887e7208dd3@gmail.com>
class CrosstoolNg < Formula
desc "Tool for building toolchains"
homepage "http://crosstool-ng.org"
url "http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.xz"
sha256 "a8b50ddb6e651c3eec990de54bd191f7b8eb88cd4f88be9338f7ae01639b3fba"
bottle do
cellar :any_skip_relocation
revision 1
sha256 "12da46c49731e5bdd94b3e209d86bc3a2e0fa4a26e7982a76b07a492641c5e6d" => :el_capitan
sha256 "bce130a66509ebb9a134b1aec50abcbcc505c3d012fecd8d135b9acaf128ef01" => :yosemite
sha256 "46ec6b65cb40a715a166aa6c4544be4028e2ac7d95ce24e15878318529133bea" => :mavericks
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "coreutils" => :build
depends_on "help2man" => :build
depends_on "wget"
depends_on "gnu-sed"
depends_on "gawk"
depends_on "binutils"
depends_on "libelf"
depends_on "homebrew/dupes/grep" => :optional
depends_on "homebrew/dupes/make" => :optional
# Avoid superenv to prevent https://github.com/mxcl/homebrew/pull/10552#issuecomment-9736248
env :std
def install
args = ["--prefix=#{prefix}",
"--exec-prefix=#{prefix}",
"--with-objcopy=gobjcopy",
"--with-objdump=gobjdump",
"--with-readelf=greadelf",
"--with-libtool=glibtool",
"--with-libtoolize=glibtoolize",
"--with-install=ginstall",
"--with-sed=gsed",
"--with-awk=gawk",
]
args << "--with-grep=ggrep" if build.with? "grep"
args << "--with-make=#{Formula["make"].opt_bin}/gmake" if build.with? "make"
args << "CFLAGS=-std=gnu89"
system "./configure", *args
# Must be done in two steps
system "make"
system "make", "install"
end
def caveats; <<-EOS.undent
You will need to install modern gcc compiler in order to use this tool.
EOS
end
test do
system "#{bin}/ct-ng", "version"
end
end
|
class CrystalLang < Formula
desc "Fast and statically typed, compiled language with Ruby-like syntax"
homepage "http://crystal-lang.org/"
url "https://github.com/crystal-lang/crystal/archive/0.17.1.tar.gz"
sha256 "6ba169c3b61d983c2fe43be21f054f1ca82d46d32e0a5d29bc39778d0d625ffc"
head "https://github.com/manastech/crystal.git"
bottle do
sha256 "5852ffcfb2ebd4f95c95b41e46b204eb45fd6601a955ec11d90893876ffa1539" => :el_capitan
sha256 "068cf05efc6369f777371b7292d9a93a74983e1fa2918dc2103d7487f32e8751" => :yosemite
sha256 "54efd3723c8cd6ccbee51dc01fc08bb45802da86cf06a40e54c9f0ae12d7b089" => :mavericks
end
option "without-release", "Do not build the compiler in release mode"
option "without-shards", "Do not include `shards` dependency manager"
depends_on "libevent"
depends_on "bdw-gc"
depends_on "llvm" => :build
depends_on "libyaml" if build.with?("shards")
resource "boot" do
url "https://github.com/crystal-lang/crystal/releases/download/0.16.0/crystal-0.16.0-1-darwin-x86_64.tar.gz"
version "0.16.0"
sha256 "a41e55b7beecd22a681f53ce5fa4fe7c8cd193ebb87508b1cbd4e211c3e5409e"
end
resource "shards" do
url "https://github.com/ysbaddaden/shards/archive/v0.6.3.tar.gz"
sha256 "5245aebb21af0a5682123732e4f4d476e7aa6910252fb3ffe4be60ee8df03ac2"
end
def install
(buildpath/"boot").install resource("boot")
if build.head?
ENV["CRYSTAL_CONFIG_VERSION"] = `git rev-parse --short HEAD`.strip
else
ENV["CRYSTAL_CONFIG_VERSION"] = version
end
ENV["CRYSTAL_CONFIG_PATH"] = prefix/"src:libs"
ENV.append_path "PATH", "boot/bin"
if build.with? "release"
system "make", "crystal", "release=true"
else
system "make", "deps"
(buildpath/".build").mkpath
system "bin/crystal", "build", "-o", "-D", "without_openssl", "-D", "without_zlib", ".build/crystal", "src/compiler/crystal.cr"
end
if build.with? "shards"
resource("shards").stage do
system buildpath/"bin/crystal", "build", "-o", buildpath/".build/shards", "src/shards.cr"
end
bin.install ".build/shards"
end
bin.install ".build/crystal"
prefix.install "src"
bash_completion.install "etc/completion.bash" => "crystal"
zsh_completion.install "etc/completion.zsh" => "crystal"
end
test do
system "#{bin}/crystal", "eval", "puts 1"
end
end
crystal-lang: update 0.17.1 bottle.
class CrystalLang < Formula
desc "Fast and statically typed, compiled language with Ruby-like syntax"
homepage "http://crystal-lang.org/"
url "https://github.com/crystal-lang/crystal/archive/0.17.1.tar.gz"
sha256 "6ba169c3b61d983c2fe43be21f054f1ca82d46d32e0a5d29bc39778d0d625ffc"
head "https://github.com/manastech/crystal.git"
bottle do
sha256 "a67000224def35d9a03e7ab26260042ad4ab58e3878cf19c8941adc5566c379f" => :el_capitan
sha256 "fcaf698914fade66b3ba67d6444be7d6cf81718a030bd26f902fdef385ce7305" => :yosemite
sha256 "df5228e5fe2fdeb259a2d25f019b416e58061a73988342ed4d2675f208b5ffea" => :mavericks
end
option "without-release", "Do not build the compiler in release mode"
option "without-shards", "Do not include `shards` dependency manager"
depends_on "libevent"
depends_on "bdw-gc"
depends_on "llvm" => :build
depends_on "libyaml" if build.with?("shards")
resource "boot" do
url "https://github.com/crystal-lang/crystal/releases/download/0.16.0/crystal-0.16.0-1-darwin-x86_64.tar.gz"
version "0.16.0"
sha256 "a41e55b7beecd22a681f53ce5fa4fe7c8cd193ebb87508b1cbd4e211c3e5409e"
end
resource "shards" do
url "https://github.com/ysbaddaden/shards/archive/v0.6.3.tar.gz"
sha256 "5245aebb21af0a5682123732e4f4d476e7aa6910252fb3ffe4be60ee8df03ac2"
end
def install
(buildpath/"boot").install resource("boot")
if build.head?
ENV["CRYSTAL_CONFIG_VERSION"] = `git rev-parse --short HEAD`.strip
else
ENV["CRYSTAL_CONFIG_VERSION"] = version
end
ENV["CRYSTAL_CONFIG_PATH"] = prefix/"src:libs"
ENV.append_path "PATH", "boot/bin"
if build.with? "release"
system "make", "crystal", "release=true"
else
system "make", "deps"
(buildpath/".build").mkpath
system "bin/crystal", "build", "-o", "-D", "without_openssl", "-D", "without_zlib", ".build/crystal", "src/compiler/crystal.cr"
end
if build.with? "shards"
resource("shards").stage do
system buildpath/"bin/crystal", "build", "-o", buildpath/".build/shards", "src/shards.cr"
end
bin.install ".build/shards"
end
bin.install ".build/crystal"
prefix.install "src"
bash_completion.install "etc/completion.bash" => "crystal"
zsh_completion.install "etc/completion.zsh" => "crystal"
end
test do
system "#{bin}/crystal", "eval", "puts 1"
end
end
|
class CucumberCpp < Formula
desc "Support for writing Cucumber step definitions in C++"
homepage "https://cucumber.io"
url "https://github.com/cucumber/cucumber-cpp/archive/v0.5.tar.gz"
sha256 "9e1b5546187290b265e43f47f67d4ce7bf817ae86ee2bc5fb338115b533f8438"
revision 4
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "bdb03c9be8588d3f06468697f160a7f79deba63bdc8557e57904c4d73064678f" => :catalina
sha256 "1aa6806faca85d2b63ce287fe4e5f2d61653b845bb1bae9761646464a4d8220e" => :mojave
sha256 "1d0058ed4d37fdf0ae44ab2205e202b603edd295c9d20b32d3c253d816300d29" => :high_sierra
end
depends_on "cmake" => :build
depends_on "ruby" => :test if MacOS.version <= :sierra
depends_on "boost"
def install
args = std_cmake_args + %w[
-DCUKE_DISABLE_GTEST=on
-DCUKE_DISABLE_CPPSPEC=on
-DCUKE_DISABLE_FUNCTIONAL=on
-DCUKE_DISABLE_BOOST_TEST=on
]
system "cmake", ".", *args
system "cmake", "--build", "."
system "make", "install"
end
test do
ENV["GEM_HOME"] = testpath
ENV["BUNDLE_PATH"] = testpath
if MacOS.version >= :mojave && MacOS::CLT.installed?
ENV.delete("CPATH")
ENV["SDKROOT"] = MacOS::CLT.sdk_path(MacOS.version)
elsif MacOS.version == :high_sierra
ENV.delete("CPATH")
ENV.delete("SDKROOT")
end
system "gem", "install", "cucumber", "-v", "3.0.0"
(testpath/"features/test.feature").write <<~EOS
Feature: Test
Scenario: Just for test
Given A given statement
When A when statement
Then A then statement
EOS
(testpath/"features/step_definitions/cucumber.wire").write <<~EOS
host: localhost
port: 3902
EOS
(testpath/"test.cpp").write <<~EOS
#include <cucumber-cpp/generic.hpp>
GIVEN("^A given statement$") {
}
WHEN("^A when statement$") {
}
THEN("^A then statement$") {
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-I#{include}", "-L#{lib}",
"-lcucumber-cpp", "-I#{Formula["boost"].opt_include}",
"-L#{Formula["boost"].opt_lib}", "-lboost_regex", "-lboost_system",
"-lboost_program_options", "-lboost_filesystem", "-lboost_chrono"
begin
pid = fork { exec "./test" }
expected = <<~EOS
Feature: Test
Scenario: Just for test # features\/test.feature:2
Given A given statement # test.cpp:2
When A when statement # test.cpp:4
Then A then statement # test.cpp:6
1 scenario \(1 passed\)
3 steps \(3 passed\)
EOS
assert_match expected, shell_output(testpath/"bin/cucumber")
ensure
Process.kill("SIGINT", pid)
Process.wait(pid)
end
end
end
cucumber-cpp: revision for boost
class CucumberCpp < Formula
desc "Support for writing Cucumber step definitions in C++"
homepage "https://cucumber.io"
url "https://github.com/cucumber/cucumber-cpp/archive/v0.5.tar.gz"
sha256 "9e1b5546187290b265e43f47f67d4ce7bf817ae86ee2bc5fb338115b533f8438"
revision 5
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "bdb03c9be8588d3f06468697f160a7f79deba63bdc8557e57904c4d73064678f" => :catalina
sha256 "1aa6806faca85d2b63ce287fe4e5f2d61653b845bb1bae9761646464a4d8220e" => :mojave
sha256 "1d0058ed4d37fdf0ae44ab2205e202b603edd295c9d20b32d3c253d816300d29" => :high_sierra
end
depends_on "cmake" => :build
depends_on "ruby" => :test if MacOS.version <= :sierra
depends_on "boost"
def install
args = std_cmake_args + %w[
-DCUKE_DISABLE_GTEST=on
-DCUKE_DISABLE_CPPSPEC=on
-DCUKE_DISABLE_FUNCTIONAL=on
-DCUKE_DISABLE_BOOST_TEST=on
]
system "cmake", ".", *args
system "cmake", "--build", "."
system "make", "install"
end
test do
ENV["GEM_HOME"] = testpath
ENV["BUNDLE_PATH"] = testpath
if MacOS.version >= :mojave && MacOS::CLT.installed?
ENV.delete("CPATH")
ENV["SDKROOT"] = MacOS::CLT.sdk_path(MacOS.version)
elsif MacOS.version == :high_sierra
ENV.delete("CPATH")
ENV.delete("SDKROOT")
end
system "gem", "install", "cucumber", "-v", "3.0.0"
(testpath/"features/test.feature").write <<~EOS
Feature: Test
Scenario: Just for test
Given A given statement
When A when statement
Then A then statement
EOS
(testpath/"features/step_definitions/cucumber.wire").write <<~EOS
host: localhost
port: 3902
EOS
(testpath/"test.cpp").write <<~EOS
#include <cucumber-cpp/generic.hpp>
GIVEN("^A given statement$") {
}
WHEN("^A when statement$") {
}
THEN("^A then statement$") {
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-I#{include}", "-L#{lib}",
"-lcucumber-cpp", "-I#{Formula["boost"].opt_include}",
"-L#{Formula["boost"].opt_lib}", "-lboost_regex", "-lboost_system",
"-lboost_program_options", "-lboost_filesystem", "-lboost_chrono"
begin
pid = fork { exec "./test" }
expected = <<~EOS
Feature: Test
Scenario: Just for test # features\/test.feature:2
Given A given statement # test.cpp:2
When A when statement # test.cpp:4
Then A then statement # test.cpp:6
1 scenario \(1 passed\)
3 steps \(3 passed\)
EOS
assert_match expected, shell_output(testpath/"bin/cucumber")
ensure
Process.kill("SIGINT", pid)
Process.wait(pid)
end
end
end
|
class DockerCloud < Formula
desc "SaaS to build, deploy and manage Docker-based applications"
homepage "https://cloud.docker.com/"
url "https://files.pythonhosted.org/packages/28/32/19981b368bd9c64f45217e007dbd42990b1cf108ade46cd68e3687c07d41/docker-cloud-1.0.8.tar.gz"
sha256 "f999de30510fee95f89f6c6096e42219f1cf604e2febf32bfa55bea188dc7d62"
bottle do
cellar :any
sha256 "3230f69c587fe1bccf98893e14542cd4d78675896cc50b8cf85b4c8a6fd97e95" => :sierra
sha256 "ce5c4232c5e571a907bb2c6e23e88a9f1ec10c147d7c2edb4e9ac6b70a9bbc13" => :el_capitan
sha256 "5fbdcf929153c5968cfc4deea8d38d24b63610857c029c2f9f66e2b396b73950" => :yosemite
end
depends_on :python if MacOS.version <= :snow_leopard
depends_on "libyaml"
resource "ago" do
url "https://files.pythonhosted.org/packages/83/1a/17e89f0be2cf69e17fbc96012bd6a2bf6d88a8fd3ac79854cc7007971943/ago-0.0.9.tar.gz"
sha256 "18ab19c41374e6eb55fd9b9d19e988c6dd7033818bb3cd7600269475ba657601"
end
resource "backports.ssl_match_hostname" do
url "https://files.pythonhosted.org/packages/76/21/2dc61178a2038a5cb35d14b61467c6ac632791ed05131dda72c20e7b9e23/backports.ssl_match_hostname-3.5.0.1.tar.gz"
sha256 "502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2"
end
resource "future" do
url "https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz"
sha256 "e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/51/fc/39a3fbde6864942e8bb24c93663734b74e281b984d1b8c4f95d64b0c21f6/python-dateutil-2.6.0.tar.gz"
sha256 "62a2f8df3d66f878373fd0072eacf4ee52194ba302e00082828e0d263b0418d2"
end
resource "python-dockercloud" do
url "https://files.pythonhosted.org/packages/30/20/2be83cb1291102e182052143a1c2461e36b683a03228a55a150265162f88/python-dockercloud-1.0.11.tar.gz"
sha256 "e7752ea88ce5906e70acb22bc0884acf50a6fa0ac148a2bc4fce2bb788830f4b"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz"
sha256 "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/72/46/4abc3f5aaf7bf16a52206bb0c68677a26c216c1e6625c78c5aef695b5359/requests-2.14.2.tar.gz"
sha256 "a274abba399a23e8713ffd2b5706535ae280ebe2b8069ee6a941cb089440d153"
end
resource "six" do
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
resource "tabulate" do
url "https://files.pythonhosted.org/packages/1c/a1/3367581782ce79b727954f7aa5d29e6a439dc2490a9ac0e7ea0a7115435d/tabulate-0.7.7.tar.gz"
sha256 "83a0b8e17c09f012090a50e1e97ae897300a72b35e0c86c0b53d3bd2ae86d8c6"
end
resource "websocket-client" do
url "https://files.pythonhosted.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz"
sha256 "40ac14a0c54e14d22809a5c8d553de5a2ae45de3c60105fae53bcb281b3fe6fb"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resources.each do |r|
r.stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system "#{bin}/docker-cloud", "container"
end
end
docker-cloud 1.0.9
Closes #18245.
Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com>
class DockerCloud < Formula
desc "SaaS to build, deploy and manage Docker-based applications"
homepage "https://cloud.docker.com/"
url "https://files.pythonhosted.org/packages/78/75/511a967ccabff691b57f97bde04cff29af2f493c6ec91a5f57c42badc3b0/docker-cloud-1.0.9.tar.gz"
sha256 "dcddda43b2e9acbadcc3b658a61a35a413a5e623513c72c35c990e6ed15b4f8e"
bottle do
cellar :any
sha256 "3230f69c587fe1bccf98893e14542cd4d78675896cc50b8cf85b4c8a6fd97e95" => :sierra
sha256 "ce5c4232c5e571a907bb2c6e23e88a9f1ec10c147d7c2edb4e9ac6b70a9bbc13" => :el_capitan
sha256 "5fbdcf929153c5968cfc4deea8d38d24b63610857c029c2f9f66e2b396b73950" => :yosemite
end
depends_on :python if MacOS.version <= :snow_leopard
depends_on "libyaml"
resource "ago" do
url "https://files.pythonhosted.org/packages/83/1a/17e89f0be2cf69e17fbc96012bd6a2bf6d88a8fd3ac79854cc7007971943/ago-0.0.9.tar.gz"
sha256 "18ab19c41374e6eb55fd9b9d19e988c6dd7033818bb3cd7600269475ba657601"
end
resource "backports.ssl_match_hostname" do
url "https://files.pythonhosted.org/packages/76/21/2dc61178a2038a5cb35d14b61467c6ac632791ed05131dda72c20e7b9e23/backports.ssl_match_hostname-3.5.0.1.tar.gz"
sha256 "502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2"
end
resource "future" do
url "https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz"
sha256 "e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/51/fc/39a3fbde6864942e8bb24c93663734b74e281b984d1b8c4f95d64b0c21f6/python-dateutil-2.6.0.tar.gz"
sha256 "62a2f8df3d66f878373fd0072eacf4ee52194ba302e00082828e0d263b0418d2"
end
resource "python-dockercloud" do
url "https://files.pythonhosted.org/packages/97/66/776e420e7db5d3c20921e88f1cb333737ace862c8d02234367b32d969525/python-dockercloud-1.0.12.tar.gz"
sha256 "83f4c9d8b2a9dc5abb1404d1bf673d6562866db2dad7765d0deffd8622f924a0"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz"
sha256 "592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/72/46/4abc3f5aaf7bf16a52206bb0c68677a26c216c1e6625c78c5aef695b5359/requests-2.14.2.tar.gz"
sha256 "a274abba399a23e8713ffd2b5706535ae280ebe2b8069ee6a941cb089440d153"
end
resource "six" do
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
resource "tabulate" do
url "https://files.pythonhosted.org/packages/1c/a1/3367581782ce79b727954f7aa5d29e6a439dc2490a9ac0e7ea0a7115435d/tabulate-0.7.7.tar.gz"
sha256 "83a0b8e17c09f012090a50e1e97ae897300a72b35e0c86c0b53d3bd2ae86d8c6"
end
resource "websocket-client" do
url "https://files.pythonhosted.org/packages/a7/2b/0039154583cb0489c8e18313aa91ccd140ada103289c5c5d31d80fd6d186/websocket_client-0.40.0.tar.gz"
sha256 "40ac14a0c54e14d22809a5c8d553de5a2ae45de3c60105fae53bcb281b3fe6fb"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resources.each do |r|
r.stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system "#{bin}/docker-cloud", "container"
end
end
|
class Dylibbundler < Formula
desc "Utility to bundle libraries into executables for macOS"
homepage "https://github.com/auriamg/macdylibbundler"
url "https://github.com/auriamg/macdylibbundler/archive/1.0.0.tar.gz"
sha256 "9e2c892f0cfd7e10cef9af1127fee6c18a4c391463b9fc50574667eec4ec2c60"
license "MIT"
head "https://github.com/auriamg/macdylibbundler.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "d7560a5028b5bb8300dcf33492c54f7fc148c9cd7af0ae58aac40184cb7d28de"
sha256 cellar: :any_skip_relocation, big_sur: "62008e896c348f9714b20c04696595d0e858dd56457845de973c8089b83bde66"
sha256 cellar: :any_skip_relocation, catalina: "ca4b42c902bd1ac60982c99415bb32e7faf3a7be6ef2f40c6961c2e6828daeab"
sha256 cellar: :any_skip_relocation, mojave: "401e1ed1a81e08b88c5c3515677b8b5acbaa11c8c5b9f5ea854a3e8aaa3a4a33"
sha256 cellar: :any_skip_relocation, x86_64_linux: "2b2307946efce558f78aaea82b9abada919dc1e70cbf214fcb012f3fda12ff3e"
end
def install
system "make"
bin.install "dylibbundler"
end
test do
system "#{bin}/dylibbundler", "-h"
end
end
dylibbundler: update 1.0.0 bottle.
class Dylibbundler < Formula
desc "Utility to bundle libraries into executables for macOS"
homepage "https://github.com/auriamg/macdylibbundler"
url "https://github.com/auriamg/macdylibbundler/archive/1.0.0.tar.gz"
sha256 "9e2c892f0cfd7e10cef9af1127fee6c18a4c391463b9fc50574667eec4ec2c60"
license "MIT"
head "https://github.com/auriamg/macdylibbundler.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "6083d2e13e728861798d84a45b48fd1b575d77c6f709628a49f551869887e375"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "d7560a5028b5bb8300dcf33492c54f7fc148c9cd7af0ae58aac40184cb7d28de"
sha256 cellar: :any_skip_relocation, monterey: "fe11e829e5ae179c04a7a576f4536fc59470a0c5a31623a7a8cf5ab0606abdda"
sha256 cellar: :any_skip_relocation, big_sur: "62008e896c348f9714b20c04696595d0e858dd56457845de973c8089b83bde66"
sha256 cellar: :any_skip_relocation, catalina: "ca4b42c902bd1ac60982c99415bb32e7faf3a7be6ef2f40c6961c2e6828daeab"
sha256 cellar: :any_skip_relocation, mojave: "401e1ed1a81e08b88c5c3515677b8b5acbaa11c8c5b9f5ea854a3e8aaa3a4a33"
sha256 cellar: :any_skip_relocation, x86_64_linux: "2b2307946efce558f78aaea82b9abada919dc1e70cbf214fcb012f3fda12ff3e"
end
def install
system "make"
bin.install "dylibbundler"
end
test do
system "#{bin}/dylibbundler", "-h"
end
end
|
require 'formula'
class Ezcomponents < Formula
url 'http://ezcomponents.org/files/downloads/ezcomponents-2009.2.1-lite.tar.bz2'
homepage 'http://ezcomponents.org'
sha1 '2b04826602ded803b2d0a2ce929402c9ece9506c'
def install
(lib+'ezc').install Dir['*']
end
def caveats; <<-EOS.undent
The eZ Components are installed in #{HOMEBREW_PREFIX}/lib/ezc
Remember to update your php include_path if needed
EOS
end
end
ezcomponents: convert from sha1 to sha256
Closes #2065.
Signed-off-by: Andy Blyler <e3579b1e47f273529f0f929453e939a68ede9fd1@blyler.cc>
require 'formula'
class Ezcomponents < Formula
url 'http://ezcomponents.org/files/downloads/ezcomponents-2009.2.1-lite.tar.bz2'
homepage 'http://ezcomponents.org'
sha256 'c7a4933dc8b100711c99cc2cc842da6448da35a4a95e8874342a92c79b8f8721'
def install
(lib+'ezc').install Dir['*']
end
def caveats; <<-EOS.undent
The eZ Components are installed in #{HOMEBREW_PREFIX}/lib/ezc
Remember to update your php include_path if needed
EOS
end
end
|
class Fdroidserver < Formula
include Language::Python::Virtualenv
desc "Create and manage Android app repositories for F-Droid"
homepage "https://f-droid.org"
url "https://files.pythonhosted.org/packages/5d/f6/a3103b11c4608a056bc693bb601c6997f2d482aca5464bb17ac37bd08d4b/fdroidserver-1.0.8.tar.gz"
sha256 "5b3ea8f1ac6255952ecb46c8f70fb90bc085659af9800a96a7041679cac7e2a7"
revision 1
bottle do
cellar :any
rebuild 1
sha256 "6a033da23c65a36571e371be2797ee2993335e8c3be26e44cfd706b48618c97e" => :high_sierra
sha256 "b25eccdf9213678d148ca8c9023baaffffff4f1d807c2effa0401bba7e16094c" => :sierra
sha256 "7280944f84cad4c8d7e60fe7ff4c1d481bcc2b6fe0feb5721052984695d396f2" => :el_capitan
end
depends_on "pkg-config" => :build
depends_on "freetype"
depends_on "jpeg"
depends_on "libtiff"
depends_on "openssl"
depends_on "python"
depends_on "s3cmd"
depends_on "webp"
resource "androguard" do
url "https://files.pythonhosted.org/packages/38/aa/ad6dfc30981f2882477e6dcbae0f358ce47a4a75e0a3ec37a35e7ed641a8/androguard-3.2.0.tar.gz"
sha256 "51f95e483f40eed4a854359550ca6ac6352fb0c4e71cf081a4d0ee17db4cffc3"
end
resource "apache-libcloud" do
url "https://files.pythonhosted.org/packages/2a/b9/dbc5ef54d9b5fd5759a483b5cb7404e470ce4dbe7c944416df346cde8ff5/apache-libcloud-2.3.0.tar.gz"
sha256 "0e2eee3802163bd0605975ed1e284cafc23203919bfa80c0cc5d3cd2543aaf97"
end
resource "appnope" do
url "https://files.pythonhosted.org/packages/26/34/0f3a5efac31f27fabce64645f8c609de9d925fe2915304d1a40f544cff0e/appnope-0.1.0.tar.gz"
sha256 "8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71"
end
resource "args" do
url "https://files.pythonhosted.org/packages/e5/1c/b701b3f4bd8d3667df8342f311b3efaeab86078a840fb826bd204118cc6b/args-0.1.0.tar.gz"
sha256 "a785b8d837625e9b61c39108532d95b85274acd679693b71ebb5156848fcf814"
end
resource "asn1crypto" do
url "https://files.pythonhosted.org/packages/fc/f1/8db7daa71f414ddabfa056c4ef792e1461ff655c2ae2928a2b675bfed6b4/asn1crypto-0.24.0.tar.gz"
sha256 "9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49"
end
resource "backcall" do
url "https://files.pythonhosted.org/packages/84/71/c8ca4f5bb1e08401b916c68003acf0a0655df935d74d93bf3f3364b310e0/backcall-0.1.0.tar.gz"
sha256 "38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4"
end
resource "bcrypt" do
url "https://files.pythonhosted.org/packages/f3/ec/bb6b384b5134fd881b91b6aa3a88ccddaad0103857760711a5ab8c799358/bcrypt-3.1.4.tar.gz"
sha256 "67ed1a374c9155ec0840214ce804616de49c3df9c5bc66740687c1c9b1cd9e8d"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/4d/9c/46e950a6f4d6b4be571ddcae21e7bc846fcbb88f1de3eff0f6dd0a6be55d/certifi-2018.4.16.tar.gz"
sha256 "13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz"
sha256 "e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "clint" do
url "https://files.pythonhosted.org/packages/3d/b4/41ecb1516f1ba728f39ee7062b9dac1352d39823f513bb6f9e8aeb86e26d/clint-0.5.1.tar.gz"
sha256 "05224c32b1075563d0b16d0015faaf9da43aa214e4a2140e51f08789e7a4c5aa"
end
resource "colorama" do
url "https://files.pythonhosted.org/packages/e6/76/257b53926889e2835355d74fec73d82662100135293e17d382e2b74d1669/colorama-0.3.9.tar.gz"
sha256 "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"
end
resource "cryptography" do
url "https://files.pythonhosted.org/packages/ec/b2/faa78c1ab928d2b2c634c8b41ff1181f0abdd9adf9193211bd606ffa57e2/cryptography-2.2.2.tar.gz"
sha256 "9fc295bf69130a342e7a19a39d7bbeb15c0bcaabc7382ec33ef3b2b7d18d2f63"
end
resource "Cycler" do
url "https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz"
sha256 "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8"
end
resource "decorator" do
url "https://files.pythonhosted.org/packages/6f/24/15a229626c775aae5806312f6bf1e2a73785be3402c0acdec5dbddd8c11e/decorator-4.3.0.tar.gz"
sha256 "c39efa13fbdeb4506c476c9b3babf6a718da943dab7811c206005a4a956c080c"
end
resource "docker-py" do
url "https://files.pythonhosted.org/packages/fa/2d/906afc44a833901fc6fed1a89c228e5c88fbfc6bd2f3d2f0497fdfb9c525/docker-py-1.10.6.tar.gz"
sha256 "4c2a75875764d38d67f87bc7d03f7443a3895704efc57962bdf6500b8d4bc415"
end
resource "docker-pycreds" do
url "https://files.pythonhosted.org/packages/9e/7a/109e0a3cc3c19534edd843c16e792c67911b5b4072fdd34ddce90d49f355/docker-pycreds-0.3.0.tar.gz"
sha256 "8b0e956c8d206f832b06aa93a710ba2c3bcbacb5a314449c040b0b814355bbff"
end
resource "future" do
url "https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz"
sha256 "e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb"
end
resource "gitdb2" do
url "https://files.pythonhosted.org/packages/84/11/22e68bd46fd545b17d0a0b200cf75c20e9e7b817726a69ad5f3070fd0d3c/gitdb2-2.0.3.tar.gz"
sha256 "b60e29d4533e5e25bb50b7678bbc187c8f6bcff1344b4f293b2ba55c85795f09"
end
resource "GitPython" do
url "https://files.pythonhosted.org/packages/f1/e4/2879ab718c80bc9261b34f214e27280f63437068582f8813ff2552373196/GitPython-2.1.10.tar.gz"
sha256 "b60b045cf64a321e5b620debb49890099fa6c7be6dfb7fb249027e5d34227301"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/65/c4/80f97e9c9628f3cac9b98bfca0402ede54e0563b56482e3e6e45c43c4935/idna-2.7.tar.gz"
sha256 "684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
end
resource "ipython" do
url "https://files.pythonhosted.org/packages/ee/01/2a85cd07f5a43fa2e86d60001c213647252662d44a0c2e3d69471a058f1b/ipython-6.4.0.tar.gz"
sha256 "eca537aa61592aca2fef4adea12af8e42f5c335004dfa80c78caf80e8b525e5c"
end
resource "ipython_genutils" do
url "https://files.pythonhosted.org/packages/e8/69/fbeffffc05236398ebfcfb512b6d2511c622871dca1746361006da310399/ipython_genutils-0.2.0.tar.gz"
sha256 "eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"
end
resource "jedi" do
url "https://files.pythonhosted.org/packages/49/2f/cdfb8adc8cfc9fc2e5673e724d9b9098619dc1a2772cc6b8af34c6b7bef9/jedi-0.12.1.tar.gz"
sha256 "b409ed0f6913a701ed474a614a3bb46e6953639033e31f769ca7581da5bd1ec1"
end
resource "kiwisolver" do
url "https://files.pythonhosted.org/packages/31/60/494fcce70d60a598c32ee00e71542e52e27c978e5f8219fae0d4ac6e2864/kiwisolver-1.0.1.tar.gz"
sha256 "ce3be5d520b4d2c3e5eeb4cd2ef62b9b9ab8ac6b6fedbaa0e39cdb6f50644278"
end
resource "lxml" do
url "https://files.pythonhosted.org/packages/41/a7/26f3f89efcd33b2f033ff58fe3f0e535e2035d0fae481025eef51bc8ae43/lxml-4.2.2.tar.gz"
sha256 "82f278cd24da1b8a98df89de38946d67381a00e39adef768fd302dc8f4e1c383"
end
resource "matplotlib" do
url "https://files.pythonhosted.org/packages/ec/ed/46b835da53b7ed05bd4c6cae293f13ec26e877d2e490a53a709915a9dcb7/matplotlib-2.2.2.tar.gz"
sha256 "4dc7ef528aad21f22be85e95725234c5178c0f938e2228ca76640e5e84d8cde8"
end
resource "mwclient" do
url "https://files.pythonhosted.org/packages/63/05/ddf7d1b0d3a1dc9ee650dcaef7ddfbb980b4d2f0c41128c5f9e6fed5e8e2/mwclient-0.8.7.tar.gz"
sha256 "3bdaaa48fda6386b190651e49484a549bd0c48b97573dbda34a8b7c4c80430ed"
end
resource "networkx" do
url "https://files.pythonhosted.org/packages/11/42/f951cc6838a4dff6ce57211c4d7f8444809ccbe2134179950301e5c4c83c/networkx-2.1.zip"
sha256 "64272ca418972b70a196cb15d9c85a5a6041f09a2f32e0d30c0255f25d458bb1"
end
resource "numpy" do
url "https://files.pythonhosted.org/packages/d5/6e/f00492653d0fdf6497a181a1c1d46bbea5a2383e7faf4c8ca6d6f3d2581d/numpy-1.14.5.zip"
sha256 "a4a433b3a264dbc9aa9c7c241e87c0358a503ea6394f8737df1683c7c9a102ac"
end
resource "oauthlib" do
url "https://files.pythonhosted.org/packages/df/5f/3f4aae7b28db87ddef18afed3b71921e531ca288dc604eb981e9ec9f8853/oauthlib-2.1.0.tar.gz"
sha256 "ac35665a61c1685c56336bda97d5eefa246f1202618a1d6f34fccb1bdd404162"
end
resource "paramiko" do
url "https://files.pythonhosted.org/packages/29/65/83181630befb17cd1370a6abb9a87957947a43c2332216e5975353f61d64/paramiko-2.4.1.tar.gz"
sha256 "33e36775a6c71790ba7692a73f948b329cf9295a72b0102144b031114bd2a4f3"
end
resource "parso" do
url "https://files.pythonhosted.org/packages/29/c1/fd8a3e5eec85bf160c2b1ea369fdfa585620cf753db021d5db895801e701/parso-0.3.0.tar.gz"
sha256 "d250235e52e8f9fc5a80cc2a5f804c9fefd886b2e67a2b1099cf085f403f8e33"
end
resource "pexpect" do
url "https://files.pythonhosted.org/packages/89/43/07d07654ee3e25235d8cea4164cdee0ec39d1fda8e9203156ebe403ffda4/pexpect-4.6.0.tar.gz"
sha256 "2a8e88259839571d1251d278476f3eec5db26deb73a70be5ed5dc5435e418aba"
end
resource "pickleshare" do
url "https://files.pythonhosted.org/packages/69/fe/dd137d84daa0fd13a709e448138e310d9ea93070620c9db5454e234af525/pickleshare-0.7.4.tar.gz"
sha256 "84a9257227dfdd6fe1b4be1319096c20eb85ff1e82c7932f36efccfe1b09737b"
end
resource "Pillow" do
url "https://files.pythonhosted.org/packages/89/b8/2f49bf71cbd0e9485bb36f72d438421b69b7356180695ae10bd4fd3066f5/Pillow-5.1.0.tar.gz"
sha256 "cee9bc75bff455d317b6947081df0824a8f118de2786dc3d74a3503fd631f4ef"
end
resource "prompt_toolkit" do
url "https://files.pythonhosted.org/packages/8a/ad/cf6b128866e78ad6d7f1dc5b7f99885fb813393d9860778b2984582e81b5/prompt_toolkit-1.0.15.tar.gz"
sha256 "858588f1983ca497f1cf4ffde01d978a3ea02b01c8a26a8bbc5cd2e66d816917"
end
resource "ptyprocess" do
url "https://files.pythonhosted.org/packages/7d/2d/e4b8733cf79b7309d84c9081a4ab558c89d8c89da5961bf4ddb050ca1ce0/ptyprocess-0.6.0.tar.gz"
sha256 "923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0"
end
resource "pyasn1" do
url "https://files.pythonhosted.org/packages/0d/33/3466a3210321a02040e3ab2cd1ffc6f44664301a5d650a7e44be1dc341f2/pyasn1-0.4.3.tar.gz"
sha256 "fb81622d8f3509f0026b0683fe90fea27be7284d3826a5f2edf97f69151ab0fc"
end
resource "pyasn1-modules" do
url "https://files.pythonhosted.org/packages/ab/76/36ab0e099e6bd27ed95b70c2c86c326d3affa59b9b535c63a2f892ac9f45/pyasn1-modules-0.2.1.tar.gz"
sha256 "af00ea8f2022b6287dc375b2c70f31ab5af83989fc6fe9eacd4976ce26cd7ccc"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz"
sha256 "99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/71/2a/2e4e77803a8bd6408a2903340ac498cb0a2181811af7c9ec92cb70b0308a/Pygments-2.2.0.tar.gz"
sha256 "dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
end
resource "PyNaCl" do
url "https://files.pythonhosted.org/packages/08/19/cf56e60efd122fa6d2228118a9b345455b13ffe16a14be81d025b03b261f/PyNaCl-1.2.1.tar.gz"
sha256 "e0d38fa0a75f65f556fb912f2c6790d1fa29b7dd27a1d9cc5591b281321eaaa9"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/3c/ec/a94f8cf7274ea60b5413df054f82a8980523efd712ec55a59e7c3357cf7c/pyparsing-2.2.0.tar.gz"
sha256 "0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/a0/b0/a4e3241d2dee665fea11baec21389aec6886655cd4db7647ddf96c3fad15/python-dateutil-2.7.3.tar.gz"
sha256 "e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8"
end
resource "python-vagrant" do
url "https://files.pythonhosted.org/packages/bb/c6/0a6d22ae1782f261fc4274ea9385b85bf792129d7126575ec2a71d8aea18/python-vagrant-0.5.15.tar.gz"
sha256 "af9a8a9802d382d45dbea96aa3cfbe77c6e6ad65b3fe7b7c799d41ab988179c6"
end
resource "pytz" do
url "https://files.pythonhosted.org/packages/10/76/52efda4ef98e7544321fd8d5d512e11739c1df18b0649551aeccfb1c8376/pytz-2018.4.tar.gz"
sha256 "c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/bd/da/0a49c1a31c60634b93fd1376b3b7966c4f81f2da8263f389cad5b6bbd6e8/PyYAML-4.2b1.tar.gz"
sha256 "ef3a0d5a5e950747f4a39ed7b204e036b37f9bddc7551c1a813b8727515a832e"
end
resource "qrcode" do
url "https://files.pythonhosted.org/packages/8d/b6/beed3d50e1047a2aa6437d3a653e5f31feb7f4de8bc054299dc205682e41/qrcode-6.0.tar.gz"
sha256 "037b0db4c93f44586e37f84c3da3f763874fcac85b2974a69a98e399ac78e1bf"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/54/1f/782a5734931ddf2e1494e4cd615a51ff98e1879cbe9eecbdfeaf09aa75e9/requests-2.19.1.tar.gz"
sha256 "ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a"
end
resource "requests-oauthlib" do
url "https://files.pythonhosted.org/packages/95/be/072464f05b70e4142cb37151e215a2037b08b1400f8a56f2538b76ca6205/requests-oauthlib-1.0.0.tar.gz"
sha256 "8886bfec5ad7afb391ed5443b1f697c6f4ae98d0e5620839d8b4499c032ada3f"
end
resource "ruamel.yaml" do
url "https://files.pythonhosted.org/packages/e0/26/10610091320ac7ad2904649baecc9ab33cd47cbbf3af6a9cbd32d6a4df73/ruamel.yaml-0.15.40.tar.gz"
sha256 "974e91b23273eb6c32aef979a32c20ed0f6c6e4d9c1523611ea10c5fda9b8928"
end
resource "simplegeneric" do
url "https://files.pythonhosted.org/packages/3d/57/4d9c9e3ae9a255cd4e1106bb57e24056d3d0709fc01b2e3e345898e49d5b/simplegeneric-0.8.1.zip"
sha256 "dc972e06094b9af5b855b3df4a646395e43d1c9d0d39ed345b7393560d0b9173"
end
resource "six" do
url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz"
sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
end
resource "smmap2" do
url "https://files.pythonhosted.org/packages/48/d8/25d9b4b875ab3c2400ec7794ceda8093b51101a9d784da608bf65ab5f5f5/smmap2-2.0.3.tar.gz"
sha256 "c7530db63f15f09f8251094b22091298e82bf6c699a6b8344aaaef3f2e1276c3"
end
resource "traitlets" do
url "https://files.pythonhosted.org/packages/a5/98/7f5ef2fe9e9e071813aaf9cb91d1a732e0a68b6c44a32b38cb8e14c3f069/traitlets-4.3.2.tar.gz"
sha256 "9c4bd2d267b7153df9152698efb1050a5d84982d3384a37b2c1f7723ba3e7835"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/3c/d2/dc5471622bd200db1cd9319e02e71bc655e9ea27b8e0ce65fc69de0dac15/urllib3-1.23.tar.gz"
sha256 "a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz"
sha256 "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e"
end
resource "websocket-client" do
url "https://files.pythonhosted.org/packages/28/85/df04ec21c622728316b591c2852fd20a0e74324eeb6ca26f351844ba815f/websocket_client-0.48.0.tar.gz"
sha256 "18f1170e6a1b5463986739d9fd45c4308b0d025c1b2f9b88788d8f69e8a5eb4a"
end
def install
bash_completion.install "completion/bash-completion" => "fdroid"
venv = virtualenv_create(libexec, "python3")
resource("Pillow").stage do
inreplace "setup.py" do |s|
sdkprefix = MacOS::CLT.installed? ? "" : MacOS.sdk_path
s.gsub! "openjpeg.h", "probably_not_a_header_called_this_eh.h"
s.gsub! "ZLIB_ROOT = None", "ZLIB_ROOT = ('#{sdkprefix}/usr/lib', '#{sdkprefix}/usr/include')"
s.gsub! "JPEG_ROOT = None", "JPEG_ROOT = ('#{Formula["jpeg"].opt_prefix}/lib', '#{Formula["jpeg"].opt_prefix}/include')"
s.gsub! "FREETYPE_ROOT = None", "FREETYPE_ROOT = ('#{Formula["freetype"].opt_prefix}/lib', '#{Formula["freetype"].opt_prefix}/include')"
end
# avoid triggering "helpful" distutils code that doesn't recognize Xcode 7 .tbd stubs
ENV.delete "SDKROOT"
ENV.append "CFLAGS", "-I#{MacOS.sdk_path}/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers" unless MacOS::CLT.installed?
venv.pip_install Pathname.pwd
end
# Fix "ld: file not found: /usr/lib/system/libsystem_darwin.dylib" for lxml
ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :sierra
venv.pip_install resource("lxml")
ENV.delete "SDKROOT" # avoid matplotlib build failure on 10.12
venv.pip_install resource("cffi") # or bcrypt fails to build
res = resources.map(&:name).to_set - ["cffi", "lxml", "Pillow"]
res.each do |r|
venv.pip_install resource(r)
end
venv.pip_install_and_link buildpath
doc.install "examples"
end
def caveats; <<~EOS
In order to function, fdroidserver requires that the Android SDK's
"Build-tools" and "Platform-tools" are installed. Also, it is best if the
base path of the Android SDK is set in the standard environment variable
ANDROID_HOME. To install them from the command line, run:
android update sdk --no-ui --all --filter tools,platform-tools,build-tools-25.0.0
EOS
end
test do
# fdroid prefers to work in a dir called 'fdroid'
mkdir testpath/"fdroid" do
mkdir "repo"
mkdir "metadata"
open("config.py", "w") do |f|
f << "gradle = 'gradle'"
end
open("metadata/fake.txt", "w") do |f|
f << "License:GPL-3.0-or-later\n"
f << "Summary:Yup still fake\n"
f << "Categories:Internet\n"
f << "Description:\n"
f << "this is fake\n"
f << ".\n"
end
system "#{bin}/fdroid", "checkupdates", "--verbose", "--allow-dirty"
system "#{bin}/fdroid", "lint", "--verbose"
system "#{bin}/fdroid", "rewritemeta", "fake", "--verbose"
system "#{bin}/fdroid", "scanner", "--verbose"
# TODO: enable once Android SDK build-tools are reliably installed
# ENV["ANDROID_HOME"] = Formula["android-sdk"].opt_prefix
# system "#{bin}/fdroid", "readmeta", "--verbose"
# system "#{bin}/fdroid", "init", "--verbose"
# assert_predicate Pathname.pwd/"config.py", :exist?
# assert_predicate Pathname.pwd/"keystore.jks", :exist?
# system "#{bin}/fdroid", "update", "--create-metadata", "--verbose"
# assert_predicate Pathname.pwd/"metadata", :exist?
# assert_predicate Pathname.pwd/"repo/index.jar", :exist?
end
end
end
fdroidserver: use PyYAML 3.13
class Fdroidserver < Formula
include Language::Python::Virtualenv
desc "Create and manage Android app repositories for F-Droid"
homepage "https://f-droid.org"
url "https://files.pythonhosted.org/packages/5d/f6/a3103b11c4608a056bc693bb601c6997f2d482aca5464bb17ac37bd08d4b/fdroidserver-1.0.8.tar.gz"
sha256 "5b3ea8f1ac6255952ecb46c8f70fb90bc085659af9800a96a7041679cac7e2a7"
revision 1
bottle do
cellar :any
rebuild 1
sha256 "6a033da23c65a36571e371be2797ee2993335e8c3be26e44cfd706b48618c97e" => :high_sierra
sha256 "b25eccdf9213678d148ca8c9023baaffffff4f1d807c2effa0401bba7e16094c" => :sierra
sha256 "7280944f84cad4c8d7e60fe7ff4c1d481bcc2b6fe0feb5721052984695d396f2" => :el_capitan
end
depends_on "pkg-config" => :build
depends_on "freetype"
depends_on "jpeg"
depends_on "libtiff"
depends_on "openssl"
depends_on "python"
depends_on "s3cmd"
depends_on "webp"
resource "androguard" do
url "https://files.pythonhosted.org/packages/38/aa/ad6dfc30981f2882477e6dcbae0f358ce47a4a75e0a3ec37a35e7ed641a8/androguard-3.2.0.tar.gz"
sha256 "51f95e483f40eed4a854359550ca6ac6352fb0c4e71cf081a4d0ee17db4cffc3"
end
resource "apache-libcloud" do
url "https://files.pythonhosted.org/packages/2a/b9/dbc5ef54d9b5fd5759a483b5cb7404e470ce4dbe7c944416df346cde8ff5/apache-libcloud-2.3.0.tar.gz"
sha256 "0e2eee3802163bd0605975ed1e284cafc23203919bfa80c0cc5d3cd2543aaf97"
end
resource "appnope" do
url "https://files.pythonhosted.org/packages/26/34/0f3a5efac31f27fabce64645f8c609de9d925fe2915304d1a40f544cff0e/appnope-0.1.0.tar.gz"
sha256 "8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71"
end
resource "args" do
url "https://files.pythonhosted.org/packages/e5/1c/b701b3f4bd8d3667df8342f311b3efaeab86078a840fb826bd204118cc6b/args-0.1.0.tar.gz"
sha256 "a785b8d837625e9b61c39108532d95b85274acd679693b71ebb5156848fcf814"
end
resource "asn1crypto" do
url "https://files.pythonhosted.org/packages/fc/f1/8db7daa71f414ddabfa056c4ef792e1461ff655c2ae2928a2b675bfed6b4/asn1crypto-0.24.0.tar.gz"
sha256 "9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49"
end
resource "backcall" do
url "https://files.pythonhosted.org/packages/84/71/c8ca4f5bb1e08401b916c68003acf0a0655df935d74d93bf3f3364b310e0/backcall-0.1.0.tar.gz"
sha256 "38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4"
end
resource "bcrypt" do
url "https://files.pythonhosted.org/packages/f3/ec/bb6b384b5134fd881b91b6aa3a88ccddaad0103857760711a5ab8c799358/bcrypt-3.1.4.tar.gz"
sha256 "67ed1a374c9155ec0840214ce804616de49c3df9c5bc66740687c1c9b1cd9e8d"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/4d/9c/46e950a6f4d6b4be571ddcae21e7bc846fcbb88f1de3eff0f6dd0a6be55d/certifi-2018.4.16.tar.gz"
sha256 "13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz"
sha256 "e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "clint" do
url "https://files.pythonhosted.org/packages/3d/b4/41ecb1516f1ba728f39ee7062b9dac1352d39823f513bb6f9e8aeb86e26d/clint-0.5.1.tar.gz"
sha256 "05224c32b1075563d0b16d0015faaf9da43aa214e4a2140e51f08789e7a4c5aa"
end
resource "colorama" do
url "https://files.pythonhosted.org/packages/e6/76/257b53926889e2835355d74fec73d82662100135293e17d382e2b74d1669/colorama-0.3.9.tar.gz"
sha256 "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"
end
resource "cryptography" do
url "https://files.pythonhosted.org/packages/ec/b2/faa78c1ab928d2b2c634c8b41ff1181f0abdd9adf9193211bd606ffa57e2/cryptography-2.2.2.tar.gz"
sha256 "9fc295bf69130a342e7a19a39d7bbeb15c0bcaabc7382ec33ef3b2b7d18d2f63"
end
resource "Cycler" do
url "https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz"
sha256 "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8"
end
resource "decorator" do
url "https://files.pythonhosted.org/packages/6f/24/15a229626c775aae5806312f6bf1e2a73785be3402c0acdec5dbddd8c11e/decorator-4.3.0.tar.gz"
sha256 "c39efa13fbdeb4506c476c9b3babf6a718da943dab7811c206005a4a956c080c"
end
resource "docker-py" do
url "https://files.pythonhosted.org/packages/fa/2d/906afc44a833901fc6fed1a89c228e5c88fbfc6bd2f3d2f0497fdfb9c525/docker-py-1.10.6.tar.gz"
sha256 "4c2a75875764d38d67f87bc7d03f7443a3895704efc57962bdf6500b8d4bc415"
end
resource "docker-pycreds" do
url "https://files.pythonhosted.org/packages/9e/7a/109e0a3cc3c19534edd843c16e792c67911b5b4072fdd34ddce90d49f355/docker-pycreds-0.3.0.tar.gz"
sha256 "8b0e956c8d206f832b06aa93a710ba2c3bcbacb5a314449c040b0b814355bbff"
end
resource "future" do
url "https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz"
sha256 "e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb"
end
resource "gitdb2" do
url "https://files.pythonhosted.org/packages/84/11/22e68bd46fd545b17d0a0b200cf75c20e9e7b817726a69ad5f3070fd0d3c/gitdb2-2.0.3.tar.gz"
sha256 "b60e29d4533e5e25bb50b7678bbc187c8f6bcff1344b4f293b2ba55c85795f09"
end
resource "GitPython" do
url "https://files.pythonhosted.org/packages/f1/e4/2879ab718c80bc9261b34f214e27280f63437068582f8813ff2552373196/GitPython-2.1.10.tar.gz"
sha256 "b60b045cf64a321e5b620debb49890099fa6c7be6dfb7fb249027e5d34227301"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/65/c4/80f97e9c9628f3cac9b98bfca0402ede54e0563b56482e3e6e45c43c4935/idna-2.7.tar.gz"
sha256 "684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
end
resource "ipython" do
url "https://files.pythonhosted.org/packages/ee/01/2a85cd07f5a43fa2e86d60001c213647252662d44a0c2e3d69471a058f1b/ipython-6.4.0.tar.gz"
sha256 "eca537aa61592aca2fef4adea12af8e42f5c335004dfa80c78caf80e8b525e5c"
end
resource "ipython_genutils" do
url "https://files.pythonhosted.org/packages/e8/69/fbeffffc05236398ebfcfb512b6d2511c622871dca1746361006da310399/ipython_genutils-0.2.0.tar.gz"
sha256 "eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"
end
resource "jedi" do
url "https://files.pythonhosted.org/packages/49/2f/cdfb8adc8cfc9fc2e5673e724d9b9098619dc1a2772cc6b8af34c6b7bef9/jedi-0.12.1.tar.gz"
sha256 "b409ed0f6913a701ed474a614a3bb46e6953639033e31f769ca7581da5bd1ec1"
end
resource "kiwisolver" do
url "https://files.pythonhosted.org/packages/31/60/494fcce70d60a598c32ee00e71542e52e27c978e5f8219fae0d4ac6e2864/kiwisolver-1.0.1.tar.gz"
sha256 "ce3be5d520b4d2c3e5eeb4cd2ef62b9b9ab8ac6b6fedbaa0e39cdb6f50644278"
end
resource "lxml" do
url "https://files.pythonhosted.org/packages/41/a7/26f3f89efcd33b2f033ff58fe3f0e535e2035d0fae481025eef51bc8ae43/lxml-4.2.2.tar.gz"
sha256 "82f278cd24da1b8a98df89de38946d67381a00e39adef768fd302dc8f4e1c383"
end
resource "matplotlib" do
url "https://files.pythonhosted.org/packages/ec/ed/46b835da53b7ed05bd4c6cae293f13ec26e877d2e490a53a709915a9dcb7/matplotlib-2.2.2.tar.gz"
sha256 "4dc7ef528aad21f22be85e95725234c5178c0f938e2228ca76640e5e84d8cde8"
end
resource "mwclient" do
url "https://files.pythonhosted.org/packages/63/05/ddf7d1b0d3a1dc9ee650dcaef7ddfbb980b4d2f0c41128c5f9e6fed5e8e2/mwclient-0.8.7.tar.gz"
sha256 "3bdaaa48fda6386b190651e49484a549bd0c48b97573dbda34a8b7c4c80430ed"
end
resource "networkx" do
url "https://files.pythonhosted.org/packages/11/42/f951cc6838a4dff6ce57211c4d7f8444809ccbe2134179950301e5c4c83c/networkx-2.1.zip"
sha256 "64272ca418972b70a196cb15d9c85a5a6041f09a2f32e0d30c0255f25d458bb1"
end
resource "numpy" do
url "https://files.pythonhosted.org/packages/d5/6e/f00492653d0fdf6497a181a1c1d46bbea5a2383e7faf4c8ca6d6f3d2581d/numpy-1.14.5.zip"
sha256 "a4a433b3a264dbc9aa9c7c241e87c0358a503ea6394f8737df1683c7c9a102ac"
end
resource "oauthlib" do
url "https://files.pythonhosted.org/packages/df/5f/3f4aae7b28db87ddef18afed3b71921e531ca288dc604eb981e9ec9f8853/oauthlib-2.1.0.tar.gz"
sha256 "ac35665a61c1685c56336bda97d5eefa246f1202618a1d6f34fccb1bdd404162"
end
resource "paramiko" do
url "https://files.pythonhosted.org/packages/29/65/83181630befb17cd1370a6abb9a87957947a43c2332216e5975353f61d64/paramiko-2.4.1.tar.gz"
sha256 "33e36775a6c71790ba7692a73f948b329cf9295a72b0102144b031114bd2a4f3"
end
resource "parso" do
url "https://files.pythonhosted.org/packages/29/c1/fd8a3e5eec85bf160c2b1ea369fdfa585620cf753db021d5db895801e701/parso-0.3.0.tar.gz"
sha256 "d250235e52e8f9fc5a80cc2a5f804c9fefd886b2e67a2b1099cf085f403f8e33"
end
resource "pexpect" do
url "https://files.pythonhosted.org/packages/89/43/07d07654ee3e25235d8cea4164cdee0ec39d1fda8e9203156ebe403ffda4/pexpect-4.6.0.tar.gz"
sha256 "2a8e88259839571d1251d278476f3eec5db26deb73a70be5ed5dc5435e418aba"
end
resource "pickleshare" do
url "https://files.pythonhosted.org/packages/69/fe/dd137d84daa0fd13a709e448138e310d9ea93070620c9db5454e234af525/pickleshare-0.7.4.tar.gz"
sha256 "84a9257227dfdd6fe1b4be1319096c20eb85ff1e82c7932f36efccfe1b09737b"
end
resource "Pillow" do
url "https://files.pythonhosted.org/packages/89/b8/2f49bf71cbd0e9485bb36f72d438421b69b7356180695ae10bd4fd3066f5/Pillow-5.1.0.tar.gz"
sha256 "cee9bc75bff455d317b6947081df0824a8f118de2786dc3d74a3503fd631f4ef"
end
resource "prompt_toolkit" do
url "https://files.pythonhosted.org/packages/8a/ad/cf6b128866e78ad6d7f1dc5b7f99885fb813393d9860778b2984582e81b5/prompt_toolkit-1.0.15.tar.gz"
sha256 "858588f1983ca497f1cf4ffde01d978a3ea02b01c8a26a8bbc5cd2e66d816917"
end
resource "ptyprocess" do
url "https://files.pythonhosted.org/packages/7d/2d/e4b8733cf79b7309d84c9081a4ab558c89d8c89da5961bf4ddb050ca1ce0/ptyprocess-0.6.0.tar.gz"
sha256 "923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0"
end
resource "pyasn1" do
url "https://files.pythonhosted.org/packages/0d/33/3466a3210321a02040e3ab2cd1ffc6f44664301a5d650a7e44be1dc341f2/pyasn1-0.4.3.tar.gz"
sha256 "fb81622d8f3509f0026b0683fe90fea27be7284d3826a5f2edf97f69151ab0fc"
end
resource "pyasn1-modules" do
url "https://files.pythonhosted.org/packages/ab/76/36ab0e099e6bd27ed95b70c2c86c326d3affa59b9b535c63a2f892ac9f45/pyasn1-modules-0.2.1.tar.gz"
sha256 "af00ea8f2022b6287dc375b2c70f31ab5af83989fc6fe9eacd4976ce26cd7ccc"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz"
sha256 "99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/71/2a/2e4e77803a8bd6408a2903340ac498cb0a2181811af7c9ec92cb70b0308a/Pygments-2.2.0.tar.gz"
sha256 "dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
end
resource "PyNaCl" do
url "https://files.pythonhosted.org/packages/08/19/cf56e60efd122fa6d2228118a9b345455b13ffe16a14be81d025b03b261f/PyNaCl-1.2.1.tar.gz"
sha256 "e0d38fa0a75f65f556fb912f2c6790d1fa29b7dd27a1d9cc5591b281321eaaa9"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/3c/ec/a94f8cf7274ea60b5413df054f82a8980523efd712ec55a59e7c3357cf7c/pyparsing-2.2.0.tar.gz"
sha256 "0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/a0/b0/a4e3241d2dee665fea11baec21389aec6886655cd4db7647ddf96c3fad15/python-dateutil-2.7.3.tar.gz"
sha256 "e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8"
end
resource "python-vagrant" do
url "https://files.pythonhosted.org/packages/bb/c6/0a6d22ae1782f261fc4274ea9385b85bf792129d7126575ec2a71d8aea18/python-vagrant-0.5.15.tar.gz"
sha256 "af9a8a9802d382d45dbea96aa3cfbe77c6e6ad65b3fe7b7c799d41ab988179c6"
end
resource "pytz" do
url "https://files.pythonhosted.org/packages/10/76/52efda4ef98e7544321fd8d5d512e11739c1df18b0649551aeccfb1c8376/pytz-2018.4.tar.gz"
sha256 "c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz"
sha256 "3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf"
end
resource "qrcode" do
url "https://files.pythonhosted.org/packages/8d/b6/beed3d50e1047a2aa6437d3a653e5f31feb7f4de8bc054299dc205682e41/qrcode-6.0.tar.gz"
sha256 "037b0db4c93f44586e37f84c3da3f763874fcac85b2974a69a98e399ac78e1bf"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/54/1f/782a5734931ddf2e1494e4cd615a51ff98e1879cbe9eecbdfeaf09aa75e9/requests-2.19.1.tar.gz"
sha256 "ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a"
end
resource "requests-oauthlib" do
url "https://files.pythonhosted.org/packages/95/be/072464f05b70e4142cb37151e215a2037b08b1400f8a56f2538b76ca6205/requests-oauthlib-1.0.0.tar.gz"
sha256 "8886bfec5ad7afb391ed5443b1f697c6f4ae98d0e5620839d8b4499c032ada3f"
end
resource "ruamel.yaml" do
url "https://files.pythonhosted.org/packages/e0/26/10610091320ac7ad2904649baecc9ab33cd47cbbf3af6a9cbd32d6a4df73/ruamel.yaml-0.15.40.tar.gz"
sha256 "974e91b23273eb6c32aef979a32c20ed0f6c6e4d9c1523611ea10c5fda9b8928"
end
resource "simplegeneric" do
url "https://files.pythonhosted.org/packages/3d/57/4d9c9e3ae9a255cd4e1106bb57e24056d3d0709fc01b2e3e345898e49d5b/simplegeneric-0.8.1.zip"
sha256 "dc972e06094b9af5b855b3df4a646395e43d1c9d0d39ed345b7393560d0b9173"
end
resource "six" do
url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz"
sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
end
resource "smmap2" do
url "https://files.pythonhosted.org/packages/48/d8/25d9b4b875ab3c2400ec7794ceda8093b51101a9d784da608bf65ab5f5f5/smmap2-2.0.3.tar.gz"
sha256 "c7530db63f15f09f8251094b22091298e82bf6c699a6b8344aaaef3f2e1276c3"
end
resource "traitlets" do
url "https://files.pythonhosted.org/packages/a5/98/7f5ef2fe9e9e071813aaf9cb91d1a732e0a68b6c44a32b38cb8e14c3f069/traitlets-4.3.2.tar.gz"
sha256 "9c4bd2d267b7153df9152698efb1050a5d84982d3384a37b2c1f7723ba3e7835"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/3c/d2/dc5471622bd200db1cd9319e02e71bc655e9ea27b8e0ce65fc69de0dac15/urllib3-1.23.tar.gz"
sha256 "a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz"
sha256 "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e"
end
resource "websocket-client" do
url "https://files.pythonhosted.org/packages/28/85/df04ec21c622728316b591c2852fd20a0e74324eeb6ca26f351844ba815f/websocket_client-0.48.0.tar.gz"
sha256 "18f1170e6a1b5463986739d9fd45c4308b0d025c1b2f9b88788d8f69e8a5eb4a"
end
def install
bash_completion.install "completion/bash-completion" => "fdroid"
venv = virtualenv_create(libexec, "python3")
resource("Pillow").stage do
inreplace "setup.py" do |s|
sdkprefix = MacOS::CLT.installed? ? "" : MacOS.sdk_path
s.gsub! "openjpeg.h", "probably_not_a_header_called_this_eh.h"
s.gsub! "ZLIB_ROOT = None", "ZLIB_ROOT = ('#{sdkprefix}/usr/lib', '#{sdkprefix}/usr/include')"
s.gsub! "JPEG_ROOT = None", "JPEG_ROOT = ('#{Formula["jpeg"].opt_prefix}/lib', '#{Formula["jpeg"].opt_prefix}/include')"
s.gsub! "FREETYPE_ROOT = None", "FREETYPE_ROOT = ('#{Formula["freetype"].opt_prefix}/lib', '#{Formula["freetype"].opt_prefix}/include')"
end
# avoid triggering "helpful" distutils code that doesn't recognize Xcode 7 .tbd stubs
ENV.delete "SDKROOT"
ENV.append "CFLAGS", "-I#{MacOS.sdk_path}/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers" unless MacOS::CLT.installed?
venv.pip_install Pathname.pwd
end
# Fix "ld: file not found: /usr/lib/system/libsystem_darwin.dylib" for lxml
ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :sierra
venv.pip_install resource("lxml")
ENV.delete "SDKROOT" # avoid matplotlib build failure on 10.12
venv.pip_install resource("cffi") # or bcrypt fails to build
res = resources.map(&:name).to_set - ["cffi", "lxml", "Pillow"]
res.each do |r|
venv.pip_install resource(r)
end
venv.pip_install_and_link buildpath
doc.install "examples"
end
def caveats; <<~EOS
In order to function, fdroidserver requires that the Android SDK's
"Build-tools" and "Platform-tools" are installed. Also, it is best if the
base path of the Android SDK is set in the standard environment variable
ANDROID_HOME. To install them from the command line, run:
android update sdk --no-ui --all --filter tools,platform-tools,build-tools-25.0.0
EOS
end
test do
# fdroid prefers to work in a dir called 'fdroid'
mkdir testpath/"fdroid" do
mkdir "repo"
mkdir "metadata"
open("config.py", "w") do |f|
f << "gradle = 'gradle'"
end
open("metadata/fake.txt", "w") do |f|
f << "License:GPL-3.0-or-later\n"
f << "Summary:Yup still fake\n"
f << "Categories:Internet\n"
f << "Description:\n"
f << "this is fake\n"
f << ".\n"
end
system "#{bin}/fdroid", "checkupdates", "--verbose", "--allow-dirty"
system "#{bin}/fdroid", "lint", "--verbose"
system "#{bin}/fdroid", "rewritemeta", "fake", "--verbose"
system "#{bin}/fdroid", "scanner", "--verbose"
# TODO: enable once Android SDK build-tools are reliably installed
# ENV["ANDROID_HOME"] = Formula["android-sdk"].opt_prefix
# system "#{bin}/fdroid", "readmeta", "--verbose"
# system "#{bin}/fdroid", "init", "--verbose"
# assert_predicate Pathname.pwd/"config.py", :exist?
# assert_predicate Pathname.pwd/"keystore.jks", :exist?
# system "#{bin}/fdroid", "update", "--create-metadata", "--verbose"
# assert_predicate Pathname.pwd/"metadata", :exist?
# assert_predicate Pathname.pwd/"repo/index.jar", :exist?
end
end
end
|
require "language/node"
class FirebaseCli < Formula
desc "Firebase command-line tools"
homepage "https://firebase.google.com/docs/cli/"
url "https://registry.npmjs.org/firebase-tools/-/firebase-tools-10.7.0.tgz"
sha256 "a07cd44f845f95e9401fc6a58e0484bdb4e16ab0dbd89219d8c4a5c6e0162019"
license "MIT"
head "https://github.com/firebase/firebase-tools.git", branch: "master"
bottle do
sha256 arm64_monterey: "0d6936cd4cd5d2ded711f086169f5543f151aa8cded1d0079f0116bc7600a009"
sha256 arm64_big_sur: "ee726ee6fa730375d0f360e8b73460180284a7a21c0e72dbe6fb7601c0fd005c"
sha256 cellar: :any_skip_relocation, monterey: "b3585eeb65b5b89af0cdc8aaa3274e5eb56248d55bc7e5c1a265269385c3da9a"
sha256 cellar: :any_skip_relocation, big_sur: "b3585eeb65b5b89af0cdc8aaa3274e5eb56248d55bc7e5c1a265269385c3da9a"
sha256 cellar: :any_skip_relocation, catalina: "b3585eeb65b5b89af0cdc8aaa3274e5eb56248d55bc7e5c1a265269385c3da9a"
sha256 cellar: :any_skip_relocation, x86_64_linux: "5e04e26d68d90f35d722e76eeda5a7448ab0c8c3477f3509e2efead63fde334b"
end
depends_on "node"
uses_from_macos "expect" => :test
on_macos do
depends_on "macos-term-size"
end
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
term_size_vendor_dir = libexec/"lib/node_modules/firebase-tools/node_modules/term-size/vendor"
term_size_vendor_dir.rmtree # remove pre-built binaries
if OS.mac?
macos_dir = term_size_vendor_dir/"macos"
macos_dir.mkpath
# Replace the vendored pre-built term-size with one we build ourselves
ln_sf (Formula["macos-term-size"].opt_bin/"term-size").relative_path_from(macos_dir), macos_dir
end
end
test do
(testpath/"test.exp").write <<~EOS
spawn #{bin}/firebase login:ci --no-localhost
expect "Paste"
EOS
assert_match "authorization code", shell_output("expect -f test.exp")
end
end
firebase-cli: update 10.7.0 bottle.
require "language/node"
class FirebaseCli < Formula
desc "Firebase command-line tools"
homepage "https://firebase.google.com/docs/cli/"
url "https://registry.npmjs.org/firebase-tools/-/firebase-tools-10.7.0.tgz"
sha256 "a07cd44f845f95e9401fc6a58e0484bdb4e16ab0dbd89219d8c4a5c6e0162019"
license "MIT"
head "https://github.com/firebase/firebase-tools.git", branch: "master"
bottle do
sha256 arm64_monterey: "fc97923311b14a6f3e1bb518184dfc9b14a73801880581cad1c3f4f7ed7ef2fc"
sha256 arm64_big_sur: "cce070f4b142b22b93604a6558863d5c7fd84b99aace05cff86b12c8d8dfa724"
sha256 cellar: :any_skip_relocation, monterey: "b0879596b9b464054e3f2d01df161ae7b8bb33eb4afbeb3f0a3ccbec85c0363d"
sha256 cellar: :any_skip_relocation, big_sur: "b0879596b9b464054e3f2d01df161ae7b8bb33eb4afbeb3f0a3ccbec85c0363d"
sha256 cellar: :any_skip_relocation, catalina: "b0879596b9b464054e3f2d01df161ae7b8bb33eb4afbeb3f0a3ccbec85c0363d"
sha256 cellar: :any_skip_relocation, x86_64_linux: "febef05116cb934bf904b2955070722aa98e5f7d3203f15374f4c7575f1d506f"
end
depends_on "node"
uses_from_macos "expect" => :test
on_macos do
depends_on "macos-term-size"
end
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
term_size_vendor_dir = libexec/"lib/node_modules/firebase-tools/node_modules/term-size/vendor"
term_size_vendor_dir.rmtree # remove pre-built binaries
if OS.mac?
macos_dir = term_size_vendor_dir/"macos"
macos_dir.mkpath
# Replace the vendored pre-built term-size with one we build ourselves
ln_sf (Formula["macos-term-size"].opt_bin/"term-size").relative_path_from(macos_dir), macos_dir
end
end
test do
(testpath/"test.exp").write <<~EOS
spawn #{bin}/firebase login:ci --no-localhost
expect "Paste"
EOS
assert_match "authorization code", shell_output("expect -f test.exp")
end
end
|
require "language/node"
class FirebaseCli < Formula
desc "Firebase command-line tools"
homepage "https://firebase.google.com/docs/cli/"
url "https://registry.npmjs.org/firebase-tools/-/firebase-tools-11.2.2.tgz"
sha256 "cdccfce1fe39abe2c7f3323da8dd2011d4c259820a8d69cbddfee87b0953febd"
license "MIT"
head "https://github.com/firebase/firebase-tools.git", branch: "master"
bottle do
sha256 arm64_monterey: "2f8d3993c63dcb1c3422db222ced8cd4a5a321e8b3f7d7d026598d652ce1978d"
sha256 arm64_big_sur: "afada1476deb451450b384ae9eb127a4f7042738a76312cc01d3aacf2891dc4b"
sha256 cellar: :any_skip_relocation, monterey: "0ad77e2525d2b5ed03d86b461ec9e1a94cdaaeb780a951df72c09fd675de7de2"
sha256 cellar: :any_skip_relocation, big_sur: "0ad77e2525d2b5ed03d86b461ec9e1a94cdaaeb780a951df72c09fd675de7de2"
sha256 cellar: :any_skip_relocation, catalina: "0ad77e2525d2b5ed03d86b461ec9e1a94cdaaeb780a951df72c09fd675de7de2"
sha256 cellar: :any_skip_relocation, x86_64_linux: "d3c29a794e58f6728de21f7d7ab6d349d83f7dc0a6ca99d76500b1c9bc447975"
end
depends_on "node"
uses_from_macos "expect" => :test
on_macos do
depends_on "macos-term-size"
end
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
term_size_vendor_dir = libexec/"lib/node_modules/firebase-tools/node_modules/term-size/vendor"
term_size_vendor_dir.rmtree # remove pre-built binaries
if OS.mac?
macos_dir = term_size_vendor_dir/"macos"
macos_dir.mkpath
# Replace the vendored pre-built term-size with one we build ourselves
ln_sf (Formula["macos-term-size"].opt_bin/"term-size").relative_path_from(macos_dir), macos_dir
end
end
test do
(testpath/"test.exp").write <<~EOS
spawn #{bin}/firebase login:ci --no-localhost
expect "Paste"
EOS
assert_match "authorization code", shell_output("expect -f test.exp")
end
end
firebase-cli: update 11.2.2 bottle.
require "language/node"
class FirebaseCli < Formula
desc "Firebase command-line tools"
homepage "https://firebase.google.com/docs/cli/"
url "https://registry.npmjs.org/firebase-tools/-/firebase-tools-11.2.2.tgz"
sha256 "cdccfce1fe39abe2c7f3323da8dd2011d4c259820a8d69cbddfee87b0953febd"
license "MIT"
head "https://github.com/firebase/firebase-tools.git", branch: "master"
bottle do
sha256 arm64_monterey: "93448b7838923482c2880424bf01010ccd5d0d24f8aad16052c158efcf356060"
sha256 arm64_big_sur: "e2a1a9e02c84d0871b5205847ceb5d95ada6d69407ac9db69c2455465a4f10bf"
sha256 cellar: :any_skip_relocation, monterey: "fcc330d243a2183c41efe73e6c1587726fb429ae448e03f4c04076a1194bb296"
sha256 cellar: :any_skip_relocation, big_sur: "fcc330d243a2183c41efe73e6c1587726fb429ae448e03f4c04076a1194bb296"
sha256 cellar: :any_skip_relocation, catalina: "fcc330d243a2183c41efe73e6c1587726fb429ae448e03f4c04076a1194bb296"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6b609f5ea2fe21e58ab0b7118e0e9e8ce7ce5a9004c91ddead88f8ba0c927b17"
end
depends_on "node"
uses_from_macos "expect" => :test
on_macos do
depends_on "macos-term-size"
end
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
term_size_vendor_dir = libexec/"lib/node_modules/firebase-tools/node_modules/term-size/vendor"
term_size_vendor_dir.rmtree # remove pre-built binaries
if OS.mac?
macos_dir = term_size_vendor_dir/"macos"
macos_dir.mkpath
# Replace the vendored pre-built term-size with one we build ourselves
ln_sf (Formula["macos-term-size"].opt_bin/"term-size").relative_path_from(macos_dir), macos_dir
end
end
test do
(testpath/"test.exp").write <<~EOS
spawn #{bin}/firebase login:ci --no-localhost
expect "Paste"
EOS
assert_match "authorization code", shell_output("expect -f test.exp")
end
end
|
require "language/node"
class FirebaseCli < Formula
desc "Firebase command-line tools"
homepage "https://firebase.google.com/docs/cli/"
url "https://registry.npmjs.org/firebase-tools/-/firebase-tools-3.18.5.tgz"
sha256 "def0a2cba955204a8e6e302e17f2e839d79774b8278bac69583fe8054f69cf88"
head "https://github.com/firebase/firebase-tools.git"
bottle do
cellar :any_skip_relocation
sha256 "cf47338b513727463ec7f6742c14e071747cf60aed3501385cd5e2107e055e18" => :high_sierra
sha256 "1fe484a81bc7dc568e4f8fa7038a37d549beedf191e4124ed749b8def98f73d1" => :sierra
sha256 "e900fc7106623d90aa084c275bb30cbf11fad6912356b066325ca2eca8c9d368" => :el_capitan
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
(testpath/"test.exp").write <<~EOS
spawn #{bin}/firebase login:ci --no-localhost
expect "Paste"
EOS
assert_match "authorization code", shell_output("expect -f test.exp")
end
end
firebase-cli: update 3.18.5 bottle.
require "language/node"
class FirebaseCli < Formula
desc "Firebase command-line tools"
homepage "https://firebase.google.com/docs/cli/"
url "https://registry.npmjs.org/firebase-tools/-/firebase-tools-3.18.5.tgz"
sha256 "def0a2cba955204a8e6e302e17f2e839d79774b8278bac69583fe8054f69cf88"
head "https://github.com/firebase/firebase-tools.git"
bottle do
cellar :any_skip_relocation
sha256 "a81d011013251b724ff4d3c2aeddf39039531235733fba9c2bbd74fa0b4c4c36" => :high_sierra
sha256 "86b250eb022a5bd9315bf1f8d830560d20a34ae105465491c80ac91c142d188a" => :sierra
sha256 "1d3bf8d9b8c22764b4a34c692eaeee39bded3500a23019a4720867600a34f830" => :el_capitan
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
(testpath/"test.exp").write <<~EOS
spawn #{bin}/firebase login:ci --no-localhost
expect "Paste"
EOS
assert_match "authorization code", shell_output("expect -f test.exp")
end
end
|
class ForkCleaner < Formula
desc "Cleans up old and inactive forks on your GitHub account"
homepage "https://github.com/caarlos0/fork-cleaner"
url "https://github.com/caarlos0/fork-cleaner/archive/v1.4.3.tar.gz"
sha256 "5a71b3d454ac030522ea5fd8f78b90432d4a9a299c2b923388e7f9ee223795d8"
bottle do
cellar :any_skip_relocation
sha256 "ba35506a75b9214f547ab1247e00a1774da42b7b6caf5ad7838786a4311d82aa" => :mojave
sha256 "1186f25c26a39b69cc5a45a48b60f8f663dbd7ac450fd7b69b20941d798cb11b" => :high_sierra
sha256 "c4f6ff2fb271638993210665fa49a44a6bb57f40116f87e7f1872029dc10000f" => :sierra
end
depends_on "dep" => :build
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
dir = buildpath/"src/github.com/caarlos0/fork-cleaner"
dir.install buildpath.children
cd dir do
system "dep", "ensure", "-vendor-only"
system "make"
bin.install "fork-cleaner"
prefix.install_metafiles
end
end
test do
output = shell_output("#{bin}/fork-cleaner 2>&1", 1)
assert_match "missing github token", output
end
end
fork-cleaner: update 1.4.3 bottle for Linuxbrew.
Closes Linuxbrew/homebrew-core#10101.
Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com>
class ForkCleaner < Formula
desc "Cleans up old and inactive forks on your GitHub account"
homepage "https://github.com/caarlos0/fork-cleaner"
url "https://github.com/caarlos0/fork-cleaner/archive/v1.4.3.tar.gz"
sha256 "5a71b3d454ac030522ea5fd8f78b90432d4a9a299c2b923388e7f9ee223795d8"
bottle do
cellar :any_skip_relocation
sha256 "ba35506a75b9214f547ab1247e00a1774da42b7b6caf5ad7838786a4311d82aa" => :mojave
sha256 "1186f25c26a39b69cc5a45a48b60f8f663dbd7ac450fd7b69b20941d798cb11b" => :high_sierra
sha256 "c4f6ff2fb271638993210665fa49a44a6bb57f40116f87e7f1872029dc10000f" => :sierra
sha256 "cf86f8a3f2748f21fb727a8f2f9b5fd864dc3e7f25985261187da88e7ddee45f" => :x86_64_linux
end
depends_on "dep" => :build
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
dir = buildpath/"src/github.com/caarlos0/fork-cleaner"
dir.install buildpath.children
cd dir do
system "dep", "ensure", "-vendor-only"
system "make"
bin.install "fork-cleaner"
prefix.install_metafiles
end
end
test do
output = shell_output("#{bin}/fork-cleaner 2>&1", 1)
assert_match "missing github token", output
end
end
|
require 'formula'
require File.expand_path("../../Requirements/gdal_third_party", Pathname.new(__FILE__).realpath)
class GdalFilegdb < Formula
homepage 'http://www.gdal.org/ogr/drv_filegdb.html'
url 'http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz'
sha1 'b4df76e2c0854625d2bedce70cc1eaf4205594ae'
option 'with-docs', 'Intall third-party library documentation and examples'
depends_on GdalThirdParty
depends_on 'gdal'
resource 'filegdb' do
url "file://#{ENV['GDAL_THIRD_PARTY']}/FileGDB_API_1_3-64.zip"
sha1 '95ba7e3da555508c8be10b8dbb6ad88a71b03f49'
version '1.3'
end
def install
# stage third-party libs in prefix
fgdb = prefix/'filegdb'
fgdb.mkpath
fgdb_opt = opt_prefix/'filegdb'
resource('filegdb').stage do
docs = %W[doc samples xmlResources]
Dir['*'].each do |rsc|
fgdb.install rsc unless build.without? 'docs' and docs.include? rsc
end
end
# update third-party libs
cd fgdb/'lib' do
system 'install_name_tool', '-id',
"#{fgdb_opt}/lib/libFileGDBAPI.dylib",
'libFileGDBAPI.dylib'
system 'install_name_tool', '-id',
"#{fgdb_opt}/lib/libfgdbunixrtl.dylib",
'libfgdbunixrtl.dylib'
system 'install_name_tool', '-change',
'@rpath/libfgdbunixrtl.dylib',
"#{fgdb_opt}/lib/libfgdbunixrtl.dylib",
'libFileGDBAPI.dylib'
end
gdal = Formula.factory('gdal')
(lib/'gdalplugins').mkpath
# cxx flags
args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts
-Iogr/ogrsf_frmts/filegdb -I#{fgdb}/include]
# source files
Dir['ogr/ogrsf_frmts/filegdb/*.c*'].each do |src|
args.concat %W[#{src}]
end
# plugin dylib
# TODO: can the compatibility_version be 1.10.0?
args.concat %W[
-dynamiclib
-install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_FileGDB.dylib
-current_version #{version}
-compatibility_version #{version}
-o #{lib}/gdalplugins/ogr_FileGDB.dylib
-undefined dynamic_lookup
]
# ld flags
args.concat %W[-L#{fgdb}/lib -lFileGDBAPI]
# build and install shared plugin
if ENV.compiler == :clang && MacOS.version >= :mavericks
# fixes to make plugin work with gdal possibly built against libc++
# NOTE: works, but I don't know if it is a sane fix
# see: http://forums.arcgis.com/threads/95958-OS-X-Mavericks
# https://gist.github.com/jctull/f4d620cd5f1560577d17
# TODO: needs removed as soon as ESRI updates filegbd binaries for libc++
cxxstdlib_check :skip
args.unshift "-mmacosx-version-min=10.8" # better than -stdlib=libstdc++ ?
end
system ENV.cxx, *args
end
def caveats; <<-EOS.undent
This formula provides a plugin that allows GDAL or OGR to access geospatial
data stored in its format. In order to use the shared plugin, you will need
to set the following enviroment variable:
export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins
The FileGDB libraries are `keg-only`. To build software that uses them, add
to the following environment variables:
CPPFLAGS: -I#{opt_prefix}/filegdb/include
LDFLAGS: -L#{opt_prefix}/filegdb/lib
============================== IMPORTANT ==============================
If compiled using clang (default) on 10.9+ this plugin was built against
libstdc++ (like filegdb binaries), which may load into your GDAL, but
possibly be incompatible. Please report any issues to:
https://github.com/dakcarto/homebrew-osgeo4mac/issues
EOS
end
end
gdal-filegdb: update to work with filegdb-api formula
require 'formula'
class GdalFilegdb < Formula
homepage 'http://www.gdal.org/ogr/drv_filegdb.html'
url 'http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz'
sha1 'b4df76e2c0854625d2bedce70cc1eaf4205594ae'
depends_on "filegdb-api"
depends_on 'gdal'
def install
filegdb_opt = Formula.factory('filegdb-api').opt_prefix
(lib/'gdalplugins').mkpath
# cxx flags
args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts
-Iogr/ogrsf_frmts/filegdb -I#{filegdb_opt}/include/filegdb]
# source files
Dir['ogr/ogrsf_frmts/filegdb/*.c*'].each do |src|
args.concat %W[#{src}]
end
# plugin dylib
# TODO: can the compatibility_version be 1.10.0?
args.concat %W[
-dynamiclib
-install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_FileGDB.dylib
-current_version #{version}
-compatibility_version #{version}
-o #{lib}/gdalplugins/ogr_FileGDB.dylib
-undefined dynamic_lookup
]
# ld flags
args.concat %W[-L#{filegdb_opt}/lib -lFileGDBAPI]
# build and install shared plugin
if ENV.compiler == :clang && MacOS.version >= :mavericks
# fixes to make plugin work with gdal possibly built against libc++
# NOTE: works, but I don't know if it is a sane fix
# see: http://forums.arcgis.com/threads/95958-OS-X-Mavericks
# https://gist.github.com/jctull/f4d620cd5f1560577d17
# TODO: needs removed as soon as ESRI updates filegdb binaries for libc++
cxxstdlib_check :skip
args.unshift "-mmacosx-version-min=10.8" # better than -stdlib=libstdc++ ?
end
system ENV.cxx, *args
end
def caveats; <<-EOS.undent
This formula provides a plugin that allows GDAL or OGR to access geospatial
data stored in its format. In order to use the shared plugin, you will need
to set the following enviroment variable:
export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins
============================== IMPORTANT ==============================
If compiled using clang (default) on 10.9+ this plugin was built against
libstdc++ (like filegdb binaries), which may load into your GDAL, but
possibly be incompatible. Please report any issues to:
https://github.com/dakcarto/homebrew-osgeo4mac/issues
EOS
end
end
|
require 'formula'
class GdalPlugins < Formula
homepage 'http://www.gdal.org/'
url 'http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz'
sha1 'b4df76e2c0854625d2bedce70cc1eaf4205594ae'
option 'with-grass' 'Build GRASS plugin from homebrew `gdal-grass` package'
depends_on 'gdal'
depends_on 'gdal-grass' if build.with? 'grass'
def install
grass = Formula.factory('grass')
system "./configure", "--prefix=#{prefix}",
"--disable-debug",
"--disable-dependency-tracking",
"--with-gdal=#{HOMEBREW_PREFIX}/bin/gdal-config",
"--with-grass=#{grass.prefix}/grass-#{grass.version}",
"--with-autoload=#{lib}/gdalplugins"
inreplace "Makefile", 'mkdir', 'mkdir -p'
system "make install"
end
def caveats; <<-EOS.undent
This formula provides a plugins that allows GDAL and OGR to access geospatial
data sources in other geospatial tools or formats. In order to use the
plugin, you will need to add the following path to the GDAL_DRIVER_PATH
enviroment variable:
#{HOMEBREW_PREFIX}/lib/gdalplugins
EOS
end
end
Remove gdal-plugins, in favor of individual ones
|
class GeocodeGlib < Formula
desc "GNOME library for gecoding and reverse geocoding"
homepage "https://gitlab.gnome.org/GNOME/geocode-glib"
url "https://download.gnome.org/sources/geocode-glib/3.26/geocode-glib-3.26.4.tar.xz"
sha256 "2d9a6826d158470449a173871221596da0f83ebdcff98b90c7049089056a37aa"
license "GPL-2.0-or-later"
revision 1
bottle do
sha256 cellar: :any, arm64_monterey: "cd7f32a773538d43539177540e21bee914a32fab1ac0497e9867cf49bc7926fe"
sha256 cellar: :any, arm64_big_sur: "a87fb2ae45e7bc56fd06e61f0260217506aaa6fadd4040305b424fbc3e292ac8"
sha256 cellar: :any, monterey: "657fcab9602371c260494510436cecf83e37f7526e2d96fd9ee87b133fd73547"
sha256 cellar: :any, big_sur: "46f8b7fb5ae054a58b11bf54b7869335fa7b29b82875dbe4f14b9aa50b43c7cb"
sha256 cellar: :any, catalina: "f4715dbb2ed9bb363a61f0e40c885f3218262d87bf1a22a1f341c6acdab3cf56"
sha256 x86_64_linux: "705672b2c649c9dad5061d9d010d6faa106f67a278e90eab7c6b6a7a8f66e9ca"
end
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "glib"
depends_on "gtk+3"
depends_on "json-glib"
depends_on "libsoup"
def install
ENV.prepend_path "XDG_DATA_DIRS", HOMEBREW_PREFIX/"share"
system "meson", *std_meson_args, "build",
"-Denable-installed-tests=false",
"-Denable-gtk-doc=false",
"-Dsoup2=false"
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end
def post_install
system Formula["gtk+3"].opt_bin/"gtk3-update-icon-cache", "-f", "-t", "#{HOMEBREW_PREFIX}/share/icons/hicolor"
end
test do
(testpath/"test.c").write <<~EOS
#include <geocode-glib/geocode-glib.h>
int main(int argc, char *argv[]) {
GeocodeLocation *loc = geocode_location_new(1.0, 1.0, 1.0);
return 0;
}
EOS
pkg_config_flags = shell_output("pkg-config --cflags --libs geocode-glib-2.0").chomp.split
system ENV.cc, "test.c", "-o", "test", *pkg_config_flags
system "./test"
end
end
geocode-glib: update 3.26.4_1 bottle.
class GeocodeGlib < Formula
desc "GNOME library for gecoding and reverse geocoding"
homepage "https://gitlab.gnome.org/GNOME/geocode-glib"
url "https://download.gnome.org/sources/geocode-glib/3.26/geocode-glib-3.26.4.tar.xz"
sha256 "2d9a6826d158470449a173871221596da0f83ebdcff98b90c7049089056a37aa"
license "GPL-2.0-or-later"
revision 1
bottle do
sha256 cellar: :any, arm64_ventura: "810645cd7021c31a2b79a367a46341a119235b6edd9762d520f2e4742d85a152"
sha256 cellar: :any, arm64_monterey: "cd7f32a773538d43539177540e21bee914a32fab1ac0497e9867cf49bc7926fe"
sha256 cellar: :any, arm64_big_sur: "a87fb2ae45e7bc56fd06e61f0260217506aaa6fadd4040305b424fbc3e292ac8"
sha256 cellar: :any, monterey: "657fcab9602371c260494510436cecf83e37f7526e2d96fd9ee87b133fd73547"
sha256 cellar: :any, big_sur: "46f8b7fb5ae054a58b11bf54b7869335fa7b29b82875dbe4f14b9aa50b43c7cb"
sha256 cellar: :any, catalina: "f4715dbb2ed9bb363a61f0e40c885f3218262d87bf1a22a1f341c6acdab3cf56"
sha256 x86_64_linux: "705672b2c649c9dad5061d9d010d6faa106f67a278e90eab7c6b6a7a8f66e9ca"
end
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "glib"
depends_on "gtk+3"
depends_on "json-glib"
depends_on "libsoup"
def install
ENV.prepend_path "XDG_DATA_DIRS", HOMEBREW_PREFIX/"share"
system "meson", *std_meson_args, "build",
"-Denable-installed-tests=false",
"-Denable-gtk-doc=false",
"-Dsoup2=false"
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end
def post_install
system Formula["gtk+3"].opt_bin/"gtk3-update-icon-cache", "-f", "-t", "#{HOMEBREW_PREFIX}/share/icons/hicolor"
end
test do
(testpath/"test.c").write <<~EOS
#include <geocode-glib/geocode-glib.h>
int main(int argc, char *argv[]) {
GeocodeLocation *loc = geocode_location_new(1.0, 1.0, 1.0);
return 0;
}
EOS
pkg_config_flags = shell_output("pkg-config --cflags --libs geocode-glib-2.0").chomp.split
system ENV.cc, "test.c", "-o", "test", *pkg_config_flags
system "./test"
end
end
|
class GitFlowAvh < Formula
desc "AVH edition of git-flow"
homepage "https://github.com/petervanderdoes/gitflow-avh"
stable do
url "https://github.com/petervanderdoes/gitflow-avh/archive/1.12.0.tar.gz"
sha256 "3de0d33376fbbfa11d0a0f7d49e2d743f322ff89920c070593b2bbb4187f2af5"
resource "completion" do
url "https://github.com/petervanderdoes/git-flow-completion/archive/0.6.0.tar.gz"
sha256 "b1b78b785aa2c06f81cc29fcf03a7dfc451ad482de67ca0d89cdb0f941f5594b"
end
end
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "49d4943048b8b46ce59de703b7eba29f3967dbf74f967b2a8aea6326a71b6977" => :mojave
sha256 "8bb41dc59b2157b9f287f24d1c6f509038ef4c7644847ffc6922a0eb2eab8de7" => :high_sierra
sha256 "8bb41dc59b2157b9f287f24d1c6f509038ef4c7644847ffc6922a0eb2eab8de7" => :sierra
sha256 "8bb41dc59b2157b9f287f24d1c6f509038ef4c7644847ffc6922a0eb2eab8de7" => :el_capitan
end
head do
url "https://github.com/petervanderdoes/gitflow-avh.git", :branch => "develop"
resource "completion" do
url "https://github.com/petervanderdoes/git-flow-completion.git", :branch => "develop"
end
end
depends_on "gnu-getopt"
conflicts_with "git-flow", :because => "Both install `git-flow` binaries and completions"
def install
system "make", "prefix=#{libexec}", "install"
(bin/"git-flow").write <<~EOS
#!/bin/bash
export FLAGS_GETOPT_CMD=#{Formula["gnu-getopt"].opt_bin}/getopt
exec "#{libexec}/bin/git-flow" "$@"
EOS
resource("completion").stage do
bash_completion.install "git-flow-completion.bash"
zsh_completion.install "git-flow-completion.zsh"
fish_completion.install "git.fish"
end
end
test do
system "git", "init"
system "#{bin}/git-flow", "init", "-d"
system "#{bin}/git-flow", "config"
assert_equal "develop", shell_output("git symbolic-ref --short HEAD").chomp
end
end
git-flow-avh: update 1.12.0 bottle.
class GitFlowAvh < Formula
desc "AVH edition of git-flow"
homepage "https://github.com/petervanderdoes/gitflow-avh"
stable do
url "https://github.com/petervanderdoes/gitflow-avh/archive/1.12.0.tar.gz"
sha256 "3de0d33376fbbfa11d0a0f7d49e2d743f322ff89920c070593b2bbb4187f2af5"
resource "completion" do
url "https://github.com/petervanderdoes/git-flow-completion/archive/0.6.0.tar.gz"
sha256 "b1b78b785aa2c06f81cc29fcf03a7dfc451ad482de67ca0d89cdb0f941f5594b"
end
end
bottle do
cellar :any_skip_relocation
sha256 "40d9fbe7b2edc783565efe4d7fa5842fb8e855dbb9d6af8871cec797ff84fd14" => :mojave
sha256 "d1f0b434f4931a703155c274daad453f3c6f75122f42090d0c6231ef62365dc9" => :high_sierra
sha256 "d1f0b434f4931a703155c274daad453f3c6f75122f42090d0c6231ef62365dc9" => :sierra
end
head do
url "https://github.com/petervanderdoes/gitflow-avh.git", :branch => "develop"
resource "completion" do
url "https://github.com/petervanderdoes/git-flow-completion.git", :branch => "develop"
end
end
depends_on "gnu-getopt"
conflicts_with "git-flow", :because => "Both install `git-flow` binaries and completions"
def install
system "make", "prefix=#{libexec}", "install"
(bin/"git-flow").write <<~EOS
#!/bin/bash
export FLAGS_GETOPT_CMD=#{Formula["gnu-getopt"].opt_bin}/getopt
exec "#{libexec}/bin/git-flow" "$@"
EOS
resource("completion").stage do
bash_completion.install "git-flow-completion.bash"
zsh_completion.install "git-flow-completion.zsh"
fish_completion.install "git.fish"
end
end
test do
system "git", "init"
system "#{bin}/git-flow", "init", "-d"
system "#{bin}/git-flow", "config"
assert_equal "develop", shell_output("git symbolic-ref --short HEAD").chomp
end
end
|
class GumboParser < Formula
desc "C99 library for parsing HTML5"
homepage "https://github.com/google/gumbo-parser"
url "https://github.com/google/gumbo-parser/archive/v0.10.1.tar.gz"
sha256 "28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad"
bottle do
cellar :any
sha256 "892139aee69838ab17bd6b117a2eb3af8b121015bf522f5b167ff3d7a112dd5f" => :yosemite
sha256 "61ba0bf840ec3cd221925c572c56605861eb31bca7c843bfd8df08e278f43c91" => :mavericks
sha256 "3eb7dd014c9e3fd8d7bf1b49d513e42f1f7d1bd76af2c5e38d20a0c29d231c05" => :mountain_lion
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
system "./autogen.sh"
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include "gumbo.h"
int main() {
GumboOutput* output = gumbo_parse("<h1>Hello, World!</h1>");
gumbo_destroy_output(&kGumboDefaultOptions, output);
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-L#{lib}", "-lgumbo", "-o", "test"
system "./test"
end
end
gumbo-parser: update 0.10.1 bottle.
class GumboParser < Formula
desc "C99 library for parsing HTML5"
homepage "https://github.com/google/gumbo-parser"
url "https://github.com/google/gumbo-parser/archive/v0.10.1.tar.gz"
sha256 "28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad"
bottle do
cellar :any
sha256 "56f5446eb431b628655748659a8a7479466e00addf7d90070464364a3f3cafa9" => :el_capitan
sha256 "02169cdaafcf9343bacf98e0e34b1f7383eb0b1b89385965d81796e110f8c38f" => :yosemite
sha256 "efc9658f05e6543d7faed663ef7106c5720e72a86672d7ef000372babade1e43" => :mavericks
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
system "./autogen.sh"
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include "gumbo.h"
int main() {
GumboOutput* output = gumbo_parse("<h1>Hello, World!</h1>");
gumbo_destroy_output(&kGumboDefaultOptions, output);
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-L#{lib}", "-lgumbo", "-o", "test"
system "./test"
end
end
|
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.07.09.tar.gz"
sha256 "e9400ddc22e3857065177e7db86029696ea9582f3cf6f4e60de51f2f4caa4fdb"
# package version - reset to 0 when HHVM version changes
revision 0
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
update bottle for nightly on 10.13.6
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.07.09.tar.gz"
sha256 "e9400ddc22e3857065177e7db86029696ea9582f3cf6f4e60de51f2f4caa4fdb"
# package version - reset to 0 when HHVM version changes
revision 0
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "fca769cbcd583dde600255d35eb94c167bab98f6157f7353dc49738f9260d074" => :high_sierra
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.11.03.tar.gz"
sha256 "c191fd6f736bdf9281b4402c9d55f35af0b9a292d174ae88fc02f6bbd4b845b7"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "c8cbe3b4cfed2f2f8b2d3676672592e16c5e72ff5ff16b5574041362d227f71a" => :mojave
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2019.11.03 on 10.13.6
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.11.03.tar.gz"
sha256 "c191fd6f736bdf9281b4402c9d55f35af0b9a292d174ae88fc02f6bbd4b845b7"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "c8cbe3b4cfed2f2f8b2d3676672592e16c5e72ff5ff16b5574041362d227f71a" => :mojave
sha256 "5707dec7cca414c89390445bedb00d15ca69d9ee8d8b0991ca2d364803623a8c" => :high_sierra
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.07.12.tar.gz"
sha256 "ab62d86403120d5cccaac671f2c1a2cf68cefc0d0c255cfa1b2d0a28ef93d161"
# package version - reset to 0 when HHVM version changes
revision 0
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "e7ba7fb8207ea81d2c04f03a7977645106f63cfb15b809f0737f8c69558d6590" => :mojave
sha256 "1cdd6e882d9a589ea31a644546441459e05a2d9646f755024158b74dabc2a344" => :high_sierra
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Update nightly version
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.07.13.tar.gz"
sha256 "1719c3ab661dceb606051a2fea51764acc7336eccd3b92123076fd3d5caa52a0"
# package version - reset to 0 when HHVM version changes
revision 0
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.11.18.tar.gz"
sha256 "2e881c9d86963a464566b4acebf2aa8b7a69f279785a3591fa81d55deec900a8"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "9a6b490bd0b972a756cc2ff6d5b08483b3f27ddefce0fdecd6899ab5b5d5439b" => :mojave
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2019.11.18 on 10.13.6
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.11.18.tar.gz"
sha256 "2e881c9d86963a464566b4acebf2aa8b7a69f279785a3591fa81d55deec900a8"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "9a6b490bd0b972a756cc2ff6d5b08483b3f27ddefce0fdecd6899ab5b5d5439b" => :mojave
sha256 "b5331874f20732c3a9b18ec1984a54bd045f8062da5f01fd810eb04b6cccd67e" => :high_sierra
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2020.05.25.tar.gz"
sha256 "9086c47803428caf2d3c8dbfd3657ed4a65d0e0e584ef129dfff36e0f42e8402"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "fa1d609aeb09e3ae27ac6e12f29c621202230c98ef6509700ce9cfd48504d15c" => :catalina
sha256 "13c2814e5d39242e36d8a0f8ff9a7f82fcf8037e946b3d9fe0dc8d9c05fbc731" => :mojave
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Updated hhvm-nightly.rb recipe to 2020.05.26
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2020.05.26.tar.gz"
sha256 "b6e392b33e2dc221aff97e36600e7a45492d970a577796f9dd55d98524193611"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.01.20.tar.gz"
sha256 "c3fcb22f29d6a281c7818ecdba34aea4869ae3bf01f4fa23281cc0de700af869"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "5492a8a1abc6b71832dfb71c8c90aaa11490871d7e9c9e354f97ff8ca57bf856" => :catalina
sha256 "0211912699c261ba8d3c7acbc0bfcdeeea1520b8c97c237ef85f663bc92f1bad" => :mojave
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
:xa
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Updated hhvm-nightly.rb recipe to 2021.01.21
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.01.21.tar.gz"
sha256 "f47b97b2daeaf60be29c2992b545e3aff1bf6dbd178124dc345f6c42df5da2a4"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
:xa
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.11.27.tar.gz"
sha256 "74bb08ecfa5bf26406d59794328a06484d76b6331d3ee882f2cfa86f887b3612"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "d5378c4de23a1440b2374abd0217d28bebc83fa1341cf64f98ad4b6a7a2b2354" => :mojave
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2019.11.27 on 10.13.6
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2019.11.27.tar.gz"
sha256 "74bb08ecfa5bf26406d59794328a06484d76b6331d3ee882f2cfa86f887b3612"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "d5378c4de23a1440b2374abd0217d28bebc83fa1341cf64f98ad4b6a7a2b2354" => :mojave
sha256 "662bc08bf3f686740966d938ebba57fc5a5527f8406b3a461cc9e669a8c7abb0" => :high_sierra
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.06.30.tar.gz"
sha256 "9f196f6622ba6ace28ab5de1a3f63bade11c6d6b3ce3f24ed2b70d57d2dfdc82"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 catalina: "7595d94bc75176040283117f9c01e2ed353838476e1336bf28b19813f4dfcfa5"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Updated hhvm-nightly.rb recipe to 2021.07.01
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.07.01.tar.gz"
sha256 "4b59cf08ffe1745a7130d50445f0b490a5e97ed073e5d0658b9f8e984c5ab4eb"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2020.02.22.tar.gz"
sha256 "a570f5b08708d8f36f6f370d5b4a30647477eb630dbcc519ecc6188df478e08a"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "d7771624fafa748284fab073b545fa8fa52ad1723765e04e1cb1d87b47041486" => :mojave
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2020.02.22 on 10.15.3
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2020.02.22.tar.gz"
sha256 "a570f5b08708d8f36f6f370d5b4a30647477eb630dbcc519ecc6188df478e08a"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "9970cfd2007d4cc3ab70d9f400cf9b6b15ce87b176d23f9b8ea34bed43ff2a9a" => :catalina
sha256 "d7771624fafa748284fab073b545fa8fa52ad1723765e04e1cb1d87b47041486" => :mojave
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.11.08.tar.gz"
sha256 "c4a87ebc95caf1d28f61287a3c828473baabee2e95c070f2cc64722987d7b67d"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "re2c" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make", "-j1", "hack", "hack_rust_ffi_bridge_targets"
system "make" # pickups up -jN from MAKEFLAGS from brew
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2021.11.08 on 10.15.7
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.11.08.tar.gz"
sha256 "c4a87ebc95caf1d28f61287a3c828473baabee2e95c070f2cc64722987d7b67d"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 catalina: "5a0f2b00191ac4204d93a0440a39802b1cdf001a8fa9f7c43fc313880109b8a3"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "re2c" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make", "-j1", "hack", "hack_rust_ffi_bridge_targets"
system "make" # pickups up -jN from MAKEFLAGS from brew
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2022.04.09.tar.gz"
sha256 "45548672b51337df23815b715b3a55eed3b5a9919a38aa4d508a7b8dce4f299f"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "cmake" => :build
depends_on "dwarfutils"
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "re2c" => :build
depends_on "wget" => :build
# Provides the CLI utility `realpath`
depends_on "aardvark_shell_utils" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "fribidi"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "krb5"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make", "-j1", "hack_rust_ffi_bridge_targets"
system "make" # pickups up -jN from MAKEFLAGS from brew
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2022.04.09 on 10.15.7
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2022.04.09.tar.gz"
sha256 "45548672b51337df23815b715b3a55eed3b5a9919a38aa4d508a7b8dce4f299f"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 catalina: "40ed86cab9fdeaa6eef35d667a7a894243b5ed3b0f4ef4a3694110fb638b8c05"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "cmake" => :build
depends_on "dwarfutils"
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "re2c" => :build
depends_on "wget" => :build
# Provides the CLI utility `realpath`
depends_on "aardvark_shell_utils" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "fribidi"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "krb5"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make", "-j1", "hack_rust_ffi_bridge_targets"
system "make" # pickups up -jN from MAKEFLAGS from brew
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2020.03.21.tar.gz"
sha256 "72149eb37639101daf6f01ad5ce5fa10b4392563d50aef4a331ad52b5514ca27"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "4e5d6375015663972447571786c45c384e6c26e59e64ee6f1ce7ccce5970b8ba" => :catalina
sha256 "34adbee23cb99c1075541e6ba84f9f8d43148744b0fce116de76840e17e57b3d" => :mojave
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2020.03.21 on 10.13.6
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2020.03.21.tar.gz"
sha256 "72149eb37639101daf6f01ad5ce5fa10b4392563d50aef4a331ad52b5514ca27"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 "4e5d6375015663972447571786c45c384e6c26e59e64ee6f1ce7ccce5970b8ba" => :catalina
sha256 "34adbee23cb99c1075541e6ba84f9f8d43148744b0fce116de76840e17e57b3d" => :mojave
sha256 "bb889e2459c302c39d2a8b122e01b9fe1ed27377cae1d784168af58a6a3acb7f" => :high_sierra
end
class << Hardware::CPU
def optimization_flags
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige at some real-world workloads,
# and sandybridge is an old enough architecture that we're going to assume
# that HHVM users have it.
OPTIMIZATION_FLAGS.merge({nehalem: "-march=sandybridge"})
end
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "double-conversion" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
def install
cmake_args = %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2022.04.21.tar.gz"
sha256 "2948feeec949eb098871f728500e9334c7a3b03bc35a847327be0b2df03fec06"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "cmake" => :build
depends_on "dwarfutils"
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "re2c" => :build
depends_on "wget" => :build
# Provides the CLI utility `realpath`
depends_on "aardvark_shell_utils" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "fribidi"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "krb5"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make", "-j1", "hack_rust_ffi_bridge_targets"
system "make" # pickups up -jN from MAKEFLAGS from brew
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Added bottle for 2022.04.21 on 10.15.7
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2022.04.21.tar.gz"
sha256 "2948feeec949eb098871f728500e9334c7a3b03bc35a847327be0b2df03fec06"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 catalina: "88eb3040a5d651a05d817f3d6876002819ee2473e11308a8604580df4944e982"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "bison" => :build
depends_on "cmake" => :build
depends_on "dwarfutils"
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "re2c" => :build
depends_on "wget" => :build
# Provides the CLI utility `realpath`
depends_on "aardvark_shell_utils" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "fribidi"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "krb5"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb@2020"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb@2020"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb@2020"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb@2020"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb@2020"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make", "-j1", "hack_rust_ffi_bridge_targets"
system "make" # pickups up -jN from MAKEFLAGS from brew
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.04.21.tar.gz"
sha256 "53cd47af98d682a67c1d3496540f6b32f3720b68c46a775d96301992958c47c0"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
sha256 catalina: "f54354e18e38b7dc50d04d1a82b2053088a771772426a3fdf7e5594905a9bc92"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
Updated hhvm-nightly.rb recipe to 2021.04.22
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class HhvmNightly < Formula
desc "JIT compiler and runtime for the Hack language"
homepage "http://hhvm.com/"
head "https://github.com/facebook/hhvm.git"
url "https://dl.hhvm.com/source/nightlies/hhvm-nightly-2021.04.22.tar.gz"
sha256 "4d72f6a3bc4a3ba1275a86fbf2f6077ac8a22eec09bace63455ca67914f93866"
bottle do
root_url "https://dl.hhvm.com/homebrew-bottles"
end
option "with-debug", <<~EOS
Make an unoptimized build with assertions enabled. This will run PHP and
Hack code dramatically slower than a release build, and is suitable mostly
for debugging HHVM itself.
EOS
# Needs very recent xcode
depends_on :macos => :sierra
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "cmake" => :build
depends_on "dwarfutils" => :build
depends_on "gawk" => :build
depends_on "libelf" => :build
depends_on "libtool" => :build
depends_on "md5sha1sum" => :build
depends_on "pkg-config" => :build
depends_on "wget" => :build
# We statically link against icu4c as every non-bugfix release is not
# backwards compatible; needing to rebuild for every release is too
# brittle
depends_on "icu4c" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "freetype"
depends_on "gd"
depends_on "gettext"
depends_on "glog"
depends_on "gmp"
depends_on "imagemagick@6"
depends_on "jemalloc"
depends_on "jpeg"
depends_on "libevent"
depends_on "libmemcached"
depends_on "libsodium"
depends_on "libpng"
depends_on "libxml2"
depends_on "libzip"
depends_on "lz4"
depends_on "mcrypt"
depends_on "oniguruma"
depends_on "openssl@1.1"
depends_on "pcre" # Used for Hack but not HHVM build - see #116
depends_on "postgresql"
depends_on "sqlite"
depends_on "tbb"
depends_on "zstd"
def install
cmake_args = std_cmake_args + %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DDEFAULT_CONFIG_DIR=#{etc}/hhvm
]
# Force use of bundled PCRE to workaround #116
cmake_args += %W[
-DSYSTEM_PCRE_HAS_JIT=0
]
# Features which don't work on OS X yet since they haven't been ported yet.
cmake_args += %W[
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
-DENABLE_EXTENSION_IMAP=OFF
]
# Required to specify a socket path if you are using the bundled async SQL
# client (which is very strongly recommended).
cmake_args << "-DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock"
# LZ4 warning macros are currently incompatible with clang
cmake_args << "-DCMAKE_C_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1"
cmake_args << "-DCMAKE_CXX_FLAGS=-DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DU_USING_ICU_NAMESPACE=1"
# Debug builds. This switch is all that's needed, it sets all the right
# cflags and other config changes.
if build.with? "debug"
cmake_args << "-DCMAKE_BUILD_TYPE=Debug"
else
cmake_args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
end
# Statically link libICU
cmake_args += %W[
-DICU_INCLUDE_DIR=#{Formula["icu4c"].opt_include}
-DICU_I18N_LIBRARY=#{Formula["icu4c"].opt_lib}/libicui18n.a
-DICU_LIBRARY=#{Formula["icu4c"].opt_lib}/libicuuc.a
-DICU_DATA_LIBRARY=#{Formula["icu4c"].opt_lib}/libicudata.a
]
# TBB looks for itself in a different place than brew installs to.
ENV["TBB_ARCH_PLATFORM"] = "."
cmake_args += %W[
-DTBB_INCLUDE_DIR=#{Formula["tbb"].opt_include}
-DTBB_INSTALL_DIR=#{Formula["tbb"].opt_prefix}
-DTBB_LIBRARY=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbb.dylib
-DTBB_LIBRARY_DIR=#{Formula["tbb"].opt_lib}
-DTBB_MALLOC_LIBRARY=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
-DTBB_MALLOC_LIBRARY_DEBUG=#{Formula["tbb"].opt_lib}/libtbbmalloc.dylib
]
system "cmake", *cmake_args, '.'
system "make"
system "make", "install"
tp_notices = (share/"doc/third_party_notices.txt")
(share/"doc").install "third-party/third_party_notices.txt"
(share/"doc/third_party_notices.txt").append_lines <<EOF
-----
The following software may be included in this product: icu4c. This Software contains the following license and notice below:
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the
directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard
or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/,
http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and
http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement.
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT.
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
EOF
ini = etc/"hhvm"
(ini/"php.ini").write php_ini unless File.exist? (ini/"php.ini")
(ini/"server.ini").write server_ini unless File.exist? (ini/"server.ini")
end
test do
(testpath/"test.php").write <<~EOS
<?php
exit(is_integer(HHVM_VERSION_ID) ? 0 : 1);
EOS
system "#{bin}/hhvm", testpath/"test.php"
end
plist_options :manual => "hhvm -m daemon -c #{HOMEBREW_PREFIX}/etc/hhvm/php.ini -c #{HOMEBREW_PREFIX}/etc/hhvm/server.ini"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/hhvm</string>
<string>-m</string>
<string>server</string>
<string>-c</string>
<string>#{etc}/hhvm/php.ini</string>
<string>-c</string>
<string>#{etc}/hhvm/server.ini</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/php.ini
def php_ini
<<~EOS
; php options
session.save_handler = files
session.save_path = #{var}/lib/hhvm/sessions
session.gc_maxlifetime = 1440
; hhvm specific
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
EOS
end
# https://github.com/hhvm/packaging/blob/master/hhvm/deb/skeleton/etc/hhvm/server.ini
def server_ini
<<~EOS
; php options
pid = #{var}/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = #{var}/log/hhvm/error.log
hhvm.repo.central.path = #{var}/run/hhvm/hhvm.hhbc
EOS
end
end
|
class I386ElfGdb < Formula
desc "GNU debugger for i386-elf cross development"
homepage "https://www.gnu.org/software/gdb/"
url "https://ftp.gnu.org/gnu/gdb/gdb-9.1.tar.xz"
mirror "https://ftpmirror.gnu.org/gdb/gdb-9.1.tar.xz"
sha256 "699e0ec832fdd2f21c8266171ea5bf44024bd05164fdf064e4d10cc4cf0d1737"
head "https://sourceware.org/git/binutils-gdb.git"
bottle do
sha256 "8b58be6c0e44cf7b180e7729c47a726ea4e268115f1a77dc24adee9f6963e482" => :catalina
sha256 "92cdbf67b36efd307633153414220dd4dbdc732a26e87a19c05f8dbf72d30b3a" => :mojave
sha256 "5a173cea39b163dabfd97db3ea26446344ff82bdc3792b3111414d7f5c9ee6de" => :high_sierra
end
conflicts_with "gdb", :because => "both install include/gdb, share/gdb and share/info"
def install
mkdir "build" do
system "../configure", "--target=i386-elf",
"--prefix=#{prefix}",
"--disable-werror"
system "make"
# Don't install bfd or opcodes, as they are provided by binutils
system "make", "install-gdb"
end
end
test do
system "#{bin}/i386-elf-gdb", "#{bin}/i386-elf-gdb", "-configuration"
end
end
i386-elf-gdb: enable lzma support & add switch to python@3.8
And unify installation with gdb formula
Closes #50458.
Signed-off-by: Alexander Bayandin <673dbf9b1367181cd47bae83bf10b2ffe51be6ac@gmail.com>
class I386ElfGdb < Formula
desc "GNU debugger for i386-elf cross development"
homepage "https://www.gnu.org/software/gdb/"
url "https://ftp.gnu.org/gnu/gdb/gdb-9.1.tar.xz"
mirror "https://ftpmirror.gnu.org/gdb/gdb-9.1.tar.xz"
sha256 "699e0ec832fdd2f21c8266171ea5bf44024bd05164fdf064e4d10cc4cf0d1737"
head "https://sourceware.org/git/binutils-gdb.git"
bottle do
sha256 "8b58be6c0e44cf7b180e7729c47a726ea4e268115f1a77dc24adee9f6963e482" => :catalina
sha256 "92cdbf67b36efd307633153414220dd4dbdc732a26e87a19c05f8dbf72d30b3a" => :mojave
sha256 "5a173cea39b163dabfd97db3ea26446344ff82bdc3792b3111414d7f5c9ee6de" => :high_sierra
end
depends_on "python@3.8"
depends_on "xz" # required for lzma support
conflicts_with "gdb", :because => "both install include/gdb, share/gdb and share/info"
def install
args = %W[
--target=i386-elf
--prefix=#{prefix}
--disable-debug
--disable-dependency-tracking
--with-lzma
--with-python=#{Formula["python@3.8"].opt_bin}/python3
--disable-binutils
]
mkdir "build" do
system "../configure", *args
system "make"
# Don't install bfd or opcodes, as they are provided by binutils
system "make", "install-gdb"
end
end
test do
system "#{bin}/i386-elf-gdb", "#{bin}/i386-elf-gdb", "-configuration"
end
end
|
class I686ElfGcc < Formula
desc "The GNU compiler collection for i686-elf"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-10.2.0/gcc-10.2.0.tar.xz"
sha256 "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
license "GPL-2.0"
livecheck do
url :stable
end
bottle do
sha256 "8e258af70b398807c115631de8a1dc8c6ebdb3be870fe26410c14e91a7659a58" => :catalina
sha256 "4c14d4308435c164f92de628f8e1b97a63692fb0b3ff083c083a64fed1c72870" => :mojave
sha256 "c8d9a65d529d5c9219b451dfd724c7df0275df5f9c6138eb3db173b783c07372" => :high_sierra
end
depends_on "gmp"
depends_on "i686-elf-binutils"
depends_on "libmpc"
depends_on "mpfr"
def install
mkdir "i686-elf-gcc-build" do
system "../configure", "--target=i686-elf",
"--prefix=#{prefix}",
"--infodir=#{info}/i686-elf-gcc",
"--disable-nls",
"--without-isl",
"--without-headers",
"--with-as=#{Formula["i686-elf-binutils"].bin}/i686-elf-as",
"--with-ld=#{Formula["i686-elf-binutils"].bin}/i686-elf-ld",
"--enable-languages=c,c++",
"SED=/usr/bin/sed"
system "make", "all-gcc"
system "make", "install-gcc"
system "make", "all-target-libgcc"
system "make", "install-target-libgcc"
# FSF-related man pages may conflict with native gcc
(share/"man/man7").rmtree
end
end
test do
(testpath/"test-c.c").write <<~EOS
int main(void)
{
int i=0;
while(i<10) i++;
return i;
}
EOS
system "#{bin}/i686-elf-gcc", "-c", "-o", "test-c.o", "test-c.c"
assert_match "file format elf32-i386",
shell_output("#{Formula["i686-elf-binutils"].bin}/i686-elf-objdump -a test-c.o")
end
end
i686-elf-gcc: remove article from description
class I686ElfGcc < Formula
desc "GNU compiler collection for i686-elf"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-10.2.0/gcc-10.2.0.tar.xz"
sha256 "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
license "GPL-2.0"
livecheck do
url :stable
end
bottle do
sha256 "8e258af70b398807c115631de8a1dc8c6ebdb3be870fe26410c14e91a7659a58" => :catalina
sha256 "4c14d4308435c164f92de628f8e1b97a63692fb0b3ff083c083a64fed1c72870" => :mojave
sha256 "c8d9a65d529d5c9219b451dfd724c7df0275df5f9c6138eb3db173b783c07372" => :high_sierra
end
depends_on "gmp"
depends_on "i686-elf-binutils"
depends_on "libmpc"
depends_on "mpfr"
def install
mkdir "i686-elf-gcc-build" do
system "../configure", "--target=i686-elf",
"--prefix=#{prefix}",
"--infodir=#{info}/i686-elf-gcc",
"--disable-nls",
"--without-isl",
"--without-headers",
"--with-as=#{Formula["i686-elf-binutils"].bin}/i686-elf-as",
"--with-ld=#{Formula["i686-elf-binutils"].bin}/i686-elf-ld",
"--enable-languages=c,c++",
"SED=/usr/bin/sed"
system "make", "all-gcc"
system "make", "install-gcc"
system "make", "all-target-libgcc"
system "make", "install-target-libgcc"
# FSF-related man pages may conflict with native gcc
(share/"man/man7").rmtree
end
end
test do
(testpath/"test-c.c").write <<~EOS
int main(void)
{
int i=0;
while(i<10) i++;
return i;
}
EOS
system "#{bin}/i686-elf-gcc", "-c", "-o", "test-c.o", "test-c.c"
assert_match "file format elf32-i386",
shell_output("#{Formula["i686-elf-binutils"].bin}/i686-elf-objdump -a test-c.o")
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.