Files
chromebrew/packages/udeler.rb
Maximilian Downey Twiss de24923ee8 Add Rubocop CI (#7083)
* Rename IgnoredPatterns to AllowedPatterns.

* Exclude docopt.rb (not our code) from Rubocop

* Disable Style/RedundantReturn

* Disable Style/MutableConstant

* Disable Style/NumericLiterals

* Set Layout/IndentationStyle to spaces

* Temporarily disable various cops.

* Add Rubocop CI via Octocop

* Lint tree with rubocop -A -c .rubocop.yml

Co-authored-by: Satadru Pramanik <satadru@gmail.com>
2022-08-22 13:31:25 -04:00

44 lines
1.3 KiB
Ruby

require 'package'
class Udeler < Package
description 'A desktop application for downloading Udemy courses'
homepage 'https://github.com/FaisalUmair/udemy-downloader-gui'
version '1.8.2'
license 'MIT'
compatibility 'x86_64'
source_url 'https://github.com/FaisalUmair/udemy-downloader-gui/releases/download/v1.8.2/Udeler-1.8.2-linux-x86_x64.AppImage'
source_sha256 'b6c1001d25f12661e4c20c84274d7987ce7c6b5b78bdef5ca72aa0f6f82c4c44'
no_compile_needed
depends_on 'gtk3'
depends_on 'sommelier'
def self.patch
system "sed -i 's,AppRun,udeler,' udeler.desktop"
end
def self.build
udeler = <<~EOF
#!/bin/bash
cd #{CREW_PREFIX}/share/udeler
GDK_BACKEND=x11 ./AppRun "$@"
EOF
File.write('udeler.sh', udeler)
end
def self.install
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.cp_r 'usr/share', CREW_DEST_PREFIX
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/udeler"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/applications"
FileUtils.mv 'udeler.desktop', "#{CREW_DEST_PREFIX}/share/applications"
FileUtils.install 'udeler.sh', "#{CREW_DEST_PREFIX}/bin/udeler", mode: 0o755
FileUtils.mv Dir['*'], "#{CREW_DEST_PREFIX}/share/udeler"
end
def self.postinstall
puts "\nType 'udeler' to get started.\n".lightblue
end
end