Files
chromebrew/packages/opera.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

63 lines
2.0 KiB
Ruby

require 'package'
class Opera < Package
description 'Opera is a multi-platform web browser based on Chromium and developed by Opera Software.'
homepage 'https://www.opera.com/'
version '112.0.5197.53'
license 'OPERA-2018'
compatibility 'x86_64'
min_glibc '2.29'
# faster apt mirror, but only works when downloading latest version of opera
# source_url "https://deb.opera.com/opera/pool/non-free/o/opera-stable/opera-stable_#{version}_amd64.deb"
source_url "https://deb.opera.com/opera-stable/pool/non-free/o/opera-stable/opera-stable_#{version}_amd64.deb"
source_sha256 'cb3173f2837a04ccddf2ef22958e6d34f0912eb94778fef1385399b720369e4c'
depends_on 'gtk3'
depends_on 'gsettings_desktop_schemas'
depends_on 'harfbuzz'
depends_on 'graphite'
depends_on 'cras'
depends_on 'libcom_err'
no_compile_needed
no_shrink
def self.install
# Since opera puts the executable in a location that is not in the path,
# we need to link it to bin directory.
FileUtils.ln_sf "#{CREW_PREFIX}/share/x86_64-linux-gnu/opera/opera", 'bin/opera'
# Move lib subfolder to the share directory.
FileUtils.mv 'lib/x86_64-linux-gnu/', 'share/'
FileUtils.rm_rf 'lib/'
FileUtils.mkdir_p CREW_DEST_PREFIX
FileUtils.mv Dir['*'], CREW_DEST_PREFIX
end
def self.postinstall
puts
print 'Set Opera as your default browser? [Y/n]: '
case $stdin.gets.chomp.downcase
when '', 'y', 'yes'
Dir.chdir("#{CREW_PREFIX}/bin") do
FileUtils.ln_sf "#{CREW_LIB_PREFIX}/opera/opera", 'x-www-browser'
end
puts 'Opera is now your default browser.'.lightgreen
else
puts 'No change has been made.'.orange
end
ExitMessage.add "\nType 'opera' to get started.\n"
end
def self.postremove
Dir.chdir("#{CREW_PREFIX}/bin") do
if File.exist?('x-www-browser') && File.symlink?('x-www-browser') && \
(File.realpath('x-www-browser') == "#{CREW_PREFIX}/share/x86_64-linux-gnu/opera/opera")
FileUtils.rm 'x-www-browser'
end
end
end
end