Files
chromebrew/packages/balena_etcher.rb
2021-12-26 21:15:58 -05:00

57 lines
1.7 KiB
Ruby

require 'package'
class Balena_etcher < Package
description 'Flash OS images to SD cards & USB drives, safely and easily.'
homepage 'https://www.balena.io/etcher/'
@_ver = '1.7.2'
version @_ver
license 'Apache-2.0'
compatibility 'x86_64, i686'
case ARCH
when 'x86_64'
source_url "https://github.com/balena-io/etcher/releases/download/v#{@_ver}/balenaEtcher-#{@_ver}-x64.AppImage"
source_sha256 '1ab261f16e50f191eac8e6b6f8007e8587ccc423e5601909144caf8690cdfb71'
when 'i686'
source_url "https://github.com/balena-io/etcher/releases/download/v#{@_ver}/balenaEtcher-#{@_ver}-ia32.AppImage"
source_sha256 '7864fe758150467dd5d642f5ff261963c1dceaeb1026dc4c79414e0ba849a9d7'
end
depends_on 'gtk2'
depends_on 'freetype'
depends_on 'cairo'
depends_on 'xzutils'
depends_on 'libnotify'
depends_on 'nspr'
depends_on 'libgconf'
depends_on 'libxss'
depends_on 'libcom_err'
depends_on 'gsettings_desktop_schemas'
depends_on 'xhost'
depends_on 'sommelier'
def self.build
etcher = <<~EOF
#!/bin/bash
xhost si:localuser:root
cd #{CREW_PREFIX}/share/balena-etcher
sudo -E LD_LIBRARY_PATH=#{CREW_LIB_PREFIX} ./AppRun "$@"
EOF
IO.write('etcher.sh', etcher)
end
def self.install
ENV['CREW_NOT_STRIP'] = '1'
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/balena-etcher"
FileUtils.install 'etcher.sh', "#{CREW_DEST_PREFIX}/bin/etcher", mode: 0755
FileUtils.mv Dir['*'], "#{CREW_DEST_PREFIX}/share/balena-etcher"
end
def self.postinstall
system "glib-compile-schemas #{CREW_PREFIX}/share/glib-2.0/schemas"
puts
puts "To get started, type 'etcher'.".lightblue
puts
end
end