Skip to content

Instantly share code, notes, and snippets.

@supechicken
Created October 20, 2022 14:06
Show Gist options
  • Save supechicken/71dd6b79101a0808ed4f32a3441e7849 to your computer and use it in GitHub Desktop.
Save supechicken/71dd6b79101a0808ed4f32a3441e7849 to your computer and use it in GitHub Desktop.
require 'fileutils'
loop do
print 'Commit: '
commit = $stdin.gets
system 'git', 'checkout', commit, chdir: 'platform2'
FileUtils.rm_rf %w[a b]
FileUtils.cp_r 'platform2/vm_tools/sommelier', 'a'
FileUtils.cp_r 'platform2/vm_tools/sommelier', 'b'
system 'patch', '-p1', '-i', 'patch.patch' if File.exist?('patch.patch')
print 'Press enter to continue...'
$stdin.getc
puts 'Try build...'
FileUtils.rm_rf 'build'
FileUtils.cp_r 'b', 'build'
Dir.chdir 'build' do
begin
system 'meson -Dprefix=/usr/local -Dxwayland_path=/usr/local/bin/Xwayland -Dxwayland_gl_driver_path=/usr/local/lib/dri -Dxwayland_shm_driver=noop -Dshm_driver=noop -Dvirtwl_device=/dev/null builddir', exception: true
rescue
system 'meson -Dprefix=/usr/local -Dxwayland_path=/usr/local/bin/Xwayland -Dxwayland_gl_driver_path=/usr/local/lib/dri builddir'
end
system 'samu -C install'
end
system {'PS1' => '\[\033[01;34m\]\w\[\033[00m\]\>> '}, 'bash', '--norc'
print 'Works?: '
$stdin.getc
system 'diff', '--git', '--recursive', 'a', 'b', out: 'patch.patch'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment