Class: Vcdeps::Installed
- Inherits:
-
Object
- Object
- Vcdeps::Installed
- Defined in:
- lib/vcdeps/installed.rb
Overview
An immutable snapshot of one completed out-of-tree install. All paths are absolute Strings with backslash separators (display-normalized like Vcvars::Locator#win). Runtime DLLs are enumerated from the authoritative vcpkg\info*.list files — NEVER guessed from port names (R§8.2) — and the debug/ tree is never exposed (R§8.4).
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#manifest_dir ⇒ Object
readonly
Returns the value of attribute manifest_dir.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#tool ⇒ Object
readonly
Returns the value of attribute tool.
-
#triplet ⇒ Object
readonly
Returns the value of attribute triplet.
Instance Method Summary collapse
- #bin_dir ⇒ Object
-
#copyright_files ⇒ Object
Hash{ "zlib" => "
\share\zlib\copyright", ... } for EXISTING files. -
#dlls ⇒ Object
Array
absolute paths of RELEASE runtime DLLs. - #include_dir ⇒ Object
-
#info_dir ⇒ Object
The vcpkg metadata dir holding info*.list (and status).
-
#initialize(root:, triplet:, manifest_dir:, key:, tool:, prefix: nil) ⇒ Installed
constructor
toolis nil for a --with-vcdeps-dir bypass install. -
#lib_dir ⇒ Object
The RELEASE lib dir — never debug\lib (R§8.4).
-
#pkgconfig_dir ⇒ Object
Accessor only; vcdeps never runs pkg-config (§5.14).
-
#ports ⇒ Object
Array
parsed from \vcpkg\info<name>_ _ .list filenames. -
#prefix ⇒ Object
<triplet> (or the bypass prefix override).
Constructor Details
#initialize(root:, triplet:, manifest_dir:, key:, tool:, prefix: nil) ⇒ Installed
tool is nil for a --with-vcdeps-dir bypass install. prefix: overrides
the computed
17 18 19 20 21 22 23 24 |
# File 'lib/vcdeps/installed.rb', line 17 def initialize(root:, triplet:, manifest_dir:, key:, tool:, prefix: nil) @root = win(root) @triplet = triplet @manifest_dir = win(manifest_dir) @key = key @tool = tool @prefix_override = prefix ? win(prefix) : nil end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
13 14 15 |
# File 'lib/vcdeps/installed.rb', line 13 def key @key end |
#manifest_dir ⇒ Object (readonly)
Returns the value of attribute manifest_dir.
13 14 15 |
# File 'lib/vcdeps/installed.rb', line 13 def manifest_dir @manifest_dir end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
13 14 15 |
# File 'lib/vcdeps/installed.rb', line 13 def root @root end |
#tool ⇒ Object (readonly)
Returns the value of attribute tool.
13 14 15 |
# File 'lib/vcdeps/installed.rb', line 13 def tool @tool end |
#triplet ⇒ Object (readonly)
Returns the value of attribute triplet.
13 14 15 |
# File 'lib/vcdeps/installed.rb', line 13 def triplet @triplet end |
Instance Method Details
#bin_dir ⇒ Object
42 43 44 |
# File 'lib/vcdeps/installed.rb', line 42 def bin_dir File.join(prefix, "bin").tr("/", "\\") end |
#copyright_files ⇒ Object
Hash{ "zlib" => "
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/vcdeps/installed.rb', line 84 def copyright_files result = {} ports.each do |port| cand = File.join(prefix, "share", port.name, "copyright") result[port.name] = win(cand) if File.exist?(cand) end # Bypass mode has no ports; scan share\*\copyright directly. if bypass? share = File.join(prefix, "share").tr("\\", "/") Dir[File.join(share, "*", "copyright")].each do |cp| name = File.basename(File.dirname(cp)) result[name] ||= win(cp) end end result end |
#dlls ⇒ Object
Array
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/vcdeps/installed.rb', line 66 def dlls if bypass? Dir[File.join(bin_dir.tr("\\", "/"), "*.dll")].sort.map { |p| win(p) } else out = [] list_files.each do |list| read_list_entries(list).each do |entry| next unless entry =~ /\.dll\z/i next if entry =~ %r{(?:\A|/)debug/}i out << win(File.join(@root, entry)) end end out.uniq.sort end end |
#include_dir ⇒ Object
33 34 35 |
# File 'lib/vcdeps/installed.rb', line 33 def include_dir File.join(prefix, "include").tr("/", "\\") end |
#info_dir ⇒ Object
The vcpkg metadata dir holding info*.list (and status).
52 53 54 |
# File 'lib/vcdeps/installed.rb', line 52 def info_dir File.join(@root, "vcpkg", "info").tr("/", "\\") end |
#lib_dir ⇒ Object
The RELEASE lib dir — never debug\lib (R§8.4).
38 39 40 |
# File 'lib/vcdeps/installed.rb', line 38 def lib_dir File.join(prefix, "lib").tr("/", "\\") end |
#pkgconfig_dir ⇒ Object
Accessor only; vcdeps never runs pkg-config (§5.14).
47 48 49 |
# File 'lib/vcdeps/installed.rb', line 47 def pkgconfig_dir File.join(prefix, "lib", "pkgconfig").tr("/", "\\") end |
#ports ⇒ Object
Array
58 59 60 |
# File 'lib/vcdeps/installed.rb', line 58 def ports list_files.filter_map { |path| parse_port(File.basename(path, ".list")) } end |
#prefix ⇒ Object
27 28 29 30 31 |
# File 'lib/vcdeps/installed.rb', line 27 def prefix return @prefix_override if @prefix_override File.join(@root, @triplet).tr("/", "\\") end |