Files
chromebrew/packages/vulkansdk.rb
Satadru Pramanik, DO, MPH, MEng 5621163c84 Refactor ruby gems in packages, crew cleanup of debugging, install.sh refactor for gems (#10294)
* Some ruby gem updates and cleanup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* bump version

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* move gem installs to core install

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add webkitgtk_6 binaries for x86_64, add librsvg binaries

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add rebuilt librsvg binary for x86_64.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* rename gem function internals to make more sense

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* adjust webkitgtk_6 deps

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update ruby gem packages, add a ruby gem package update script to tools

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* suggested changes

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* rebuild parted

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add parted binaries

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* suggested changes

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* refactor ruby buildsystem

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add libsdl2, freerdp binaries

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* sync crew function to lib/fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* shellcheck fix

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add const for CREW_UPDATE_CHECK_INTERVAL

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Move time_difference into function for neatness.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* suggested changes from @uberhacker

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* @Zopolis4 suggested change: Use git last update time

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add .blank? usage to downloader to avoid undefined method `empty?' for nil (NoMethodError)

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
2024-08-13 11:25:39 -05:00

78 lines
2.4 KiB
Ruby

require 'package'
class Vulkansdk < Package
description 'Vulkan SDK'
homepage 'https://vulkan.lunarg.com/'
version '1.3.283.0'
license 'https://vulkan.lunarg.com/license/#/license'
compatibility 'x86_64'
min_glibc '2.31'
source_url "https://sdk.lunarg.com/sdk/download/#{version}/linux/vulkansdk-linux-x86_64-#{version}.tar.xz"
source_sha256 '8005e2cf3e89c80cbe1c0d0a259c88248de3257b4fc6fdefb47409edb3e43ecb'
depends_on 'libglvnd'
depends_on 'libxcomposite'
depends_on 'libxkbcommon'
depends_on 'vulkan_headers'
depends_on 'vulkan_icd_loader'
depends_on 'vulkan_tools'
depends_on 'xcb_util_image'
depends_on 'xcb_util_keysyms'
depends_on 'xcb_util_renderutil'
depends_on 'xcb_util_wm'
depends_on 'xdg_base'
no_shrink
no_compile_needed
print_source_bashrc
def self.install
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/env.d"
File.write "#{CREW_DEST_PREFIX}/etc/env.d/10-vulkansdk", <<~EOF
# Vulkan SDK environment
VK_LAYER_PATH=#{CREW_PREFIX}/share/vulkan/explicit_layer.d
EOF
Dir.chdir 'x86_64' do
# Remove conflicts with vulkan_icd_loader
FileUtils.rm Dir['lib/cmake/VulkanLoader/*.cmake']
FileUtils.rm Dir['lib/libvulkan.so*']
# Remove conflicts with vulkan_headers
FileUtils.rm Dir['include/vk_video/*']
FileUtils.rm Dir['share/cmake/VulkanHeaders/*']
FileUtils.rm_rf Dir['share/vulkan/registry/*']
# Remove conflicts with vulkan_tools
Dir.chdir 'bin' do
%w[vkcube vkcubepp vkcube-wayland vulkaninfo].each do |bin|
FileUtils.rm bin
end
end
# Rename for LD_LIBRARY_PATH on x86_64
FileUtils.mv 'lib', 'lib64'
FileUtils.mv Dir['include/vulkan/*'], 'include'
FileUtils.rm_rf 'include/vulkan'
%w[bin include lib64 share].each do |dir|
FileUtils.mv dir, CREW_DEST_PREFIX
end
end
end
def self.postinstall
ExitMessage.add "\nSee https://github.com/KhronosGroup/Vulkan-Guide.".lightblue
end
def self.postremove
config_dirs = ["#{HOME}/.local/share/vulkan", "#{HOME}/VulkanSDK"]
config_dirs.each do |config_dir|
next unless Dir.exist? config_dir
print "\nWould you like to remove #{config_dir}? [y/N] "
case $stdin.gets.chomp.downcase
when 'y', 'yes'
FileUtils.rm_rf config_dir
puts "#{config_dir} removed.".lightgreen
else
puts "#{config_dir} saved.".lightblue
end
end
end
end