Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected]: fix build without python 2 #67350

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,22 @@ def install
serf_prefix = libexec/"serf"

resource("serf").stage do
# SConstruct merges in gssapi linkflags using scons's MergeFlags,
# but that discards duplicate values - including the duplicate
# values we want, like multiple -arch values for a universal build.
# Passing 0 as the `unique` kwarg turns this behaviour off.
inreplace "SConstruct", "unique=1", "unique=0"
inreplace "SConstruct" do |s|
# SConstruct merges in gssapi linkflags using scons's MergeFlags,
# but that discards duplicate values - including the duplicate
# values we want, like multiple -arch values for a universal build.
# Passing 0 as the `unique` kwarg turns this behaviour off.
s.gsub! "unique=1", "unique=0"
# Fixes for running under Python 3
s.gsub! "print 'Warning: Used unknown variables:', ', '.join(unknown.keys())",
"print('Warning: Used unknown variables:', ', '.join(unknown.keys()))"
s.gsub! "match = re.search('SERF_MAJOR_VERSION ([0-9]+).*'",
"match = re.search(b'SERF_MAJOR_VERSION ([0-9]+).*'"
s.gsub! "'SERF_MINOR_VERSION ([0-9]+).*'",
"b'SERF_MINOR_VERSION ([0-9]+).*'"
s.gsub! "'SERF_PATCH_VERSION ([0-9]+)'",
"b'SERF_PATCH_VERSION ([0-9]+)'"
end

# scons ignores our compiler and flags unless explicitly passed
args = %W[PREFIX=#{serf_prefix} GSSAPI=/usr CC=#{ENV.cc}
Expand Down