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

68 lines
2.1 KiB
Ruby

require 'package'
class Smplayer < Package
description 'SMPlayer is a free media player for Windows and Linux with built-in codecs that can play virtually all video and audio formats.'
homepage 'https://www.smplayer.info/'
version '24.5.0'
license 'GPL-2'
compatibility 'x86_64'
min_glibc '2.30'
source_url "https://github.com/smplayer-dev/smplayer/releases/download/v#{version}/SMPlayer-#{version}-x86_64.AppImage"
source_sha256 '85fb5a2322f48a298b7784fc3516e672525593c017ca504310bff05e1330457b'
no_compile_needed
depends_on 'gdk_base'
depends_on 'gtk3'
depends_on 'jack'
depends_on 'libthai'
depends_on 'sommelier'
def self.build
File.write 'smplayer', <<~EOF
#!/bin/bash
export LD_LIBRARY_PATH=#{CREW_PREFIX}/share/smplayer/lib:$LD_LIBRARY_PATH
cd #{CREW_PREFIX}/share/smplayer
bin/smplayer "$@"
EOF
end
def self.install
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/smplayer"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/applications"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/icons/hicolor/512x512/apps"
FileUtils.mv Dir['usr/*'], "#{CREW_DEST_PREFIX}/share/smplayer"
FileUtils.mv 'smplayer.desktop', "#{CREW_DEST_PREFIX}/share/applications"
FileUtils.mv 'smplayer.svg', "#{CREW_DEST_PREFIX}/share/icons/hicolor/512x512/apps"
FileUtils.install 'smplayer', "#{CREW_DEST_PREFIX}/bin/smplayer", mode: 0o755
end
def self.postinstall
ExitMessage.add <<~EOM
Type 'smplayer' to get started.
If you have trouble playing videos, try the steps below:
Select Options > Preferences
Click the 'Audio' tab
Uncheck 'Use software volume control'
Click OK
EOM
end
def self.postremove
config_dir = "#{CREW_PREFIX}/.config/smplayer"
if Dir.exist? config_dir
print "Would you like to remove the #{config_dir} directory? [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.".lightgreen
end
end
end
end