-
Notifications
You must be signed in to change notification settings - Fork 727
/
patch-ext_P4_extconf.rb
52 lines (47 loc) · 1.82 KB
/
patch-ext_P4_extconf.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- ext/P4/extconf.rb.orig 2024-01-21 10:40:57 UTC
+++ ext/P4/extconf.rb
@@ -384,23 +384,8 @@ def resolve_p4api_dir
# When running rake compile, use this instead of other options, I'm not sure how
# gem/bundler options are passed through via rake
- if ENV.has_key?('p4api_dir')
- p4api_dir = ENV['p4api_dir']
- dir_config('p4api', "#{p4api_dir}/include", "#{p4api_dir}/lib")
- end
-
- if !p4api_dir && !with_config('p4api-dir') && enable_config('p4api-download', true)
- download_api_via_https
- unzip_file
- p4api_dir = downloaded_p4api_dir
- dir_config('p4api', "#{p4api_dir}/include", "#{p4api_dir}/lib")
- elsif with_config('p4api_dir')
- p4api_dir = with_config('p4api-dir')
- dir_config('p4api', "#{p4api_dir}/include", "#{p4api_dir}/lib")
- elsif !p4api_dir
- raise '--with-p4api-dir option has not been specified, and --disable-p4api-download is in effect'
- end
-
+ p4api_dir = with_config('p4api-dir')
+ dir_config('supp', "#{p4api_dir}/include/perforce", "#{p4api_dir}/lib/perforce")
p4api_dir
end
@@ -455,12 +440,12 @@ def p4_platform_label
raise 'Automatic fetching of p4api from perforce FTP is not supported on Windows'
when /darwin19|darwin[2-9][0-9]/
"macosx1015#{p4_cpu(:darwin)}"
- when /darwin/
+ when /darwin/
"darwin90#{p4_cpu(:darwin)}"
when /solaris/
"solaris10#{p4_cpu(:solaris)}"
when /linux/
- "linux26#{p4_cpu(:linux)}"
+ "linux26#{p4_cpu(:linux)}"
end
end
@@ -586,7 +571,7 @@ puts "$libs #{$libs}"
puts "$libs #{$libs}"
# Parse the Version file into a ruby structure
-version_info = P4ApiVersion.load(p4api_dir)
+version_info = P4ApiVersion.load("#{p4api_dir}/share/examples/p4api")
create_p4rubyconf_header(version_info, $libs)
# This will generate a standard extconf.h based on what we discover locally.