-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed relative path issue, bumped version number, added activesupport…
… dependency, added prerequisite check that will tell user what packages to install and install gtk and sourceview
- Loading branch information
Showing
6 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
require_relative 'prerequisites' | ||
|
||
require 'gtk2' | ||
require 'gtksourceview2' | ||
require 'yaml' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Gtk | ||
class Image | ||
def file= path | ||
set_file File.app_relative(path) | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ layout: | |
|
||
options: | ||
default_position: 0, 0 | ||
default_size: 150, 100 | ||
default_size: 1000, 700 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
class LibNotFoundError < StandardError; end | ||
|
||
def check_packages | ||
selections = `dpkg --get-selections` | ||
libs = %w(libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk2.0-dev libgtksourceview2.0-dev) | ||
libs.each do |lib| | ||
raise LibNotFoundError unless selections =~ Regexp.new(lib) | ||
end | ||
rescue LibNotFoundError => e | ||
puts 'Some packages needed for installation are missing' | ||
puts 'To install the rquired packages please run:' | ||
puts ' sudo apt-get install libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk2.0-dev libgtksourceview2.0-dev' | ||
puts | ||
exit | ||
end | ||
|
||
def install_ruby_gnome2 | ||
trap("INT") { puts "\rAborted."; exit } | ||
|
||
puts "Some ruby libraries need to be compiled and installed to run merrol (gtk2 and gtksourceview2)" | ||
puts "Press ENTER to install or CTRL+C to abort" | ||
gets | ||
|
||
logfile = '/tmp/ruby-gnome2-install.log' | ||
|
||
package = 'ruby-gnome2-all-0.90.4' | ||
system "gem install pkg-config > #{logfile}" | ||
puts 'pkg-config installed' | ||
|
||
puts 'Downloading sources...' | ||
system "cd /tmp && wget http://downloads.sourceforge.net/ruby-gnome2/#{package}.tar.gz >> #{logfile}" | ||
|
||
puts 'Extracting sources...' | ||
system "cd /tmp && tar xf #{package}.tar.gz" | ||
|
||
puts 'Configuring ...' | ||
system "cd /tmp/#{package} && ruby extconf.rb >> #{logfile}" | ||
|
||
puts 'Building ...' | ||
system "cd /tmp/#{package} && sudo make >> #{logfile}" | ||
|
||
puts 'Installing ...' | ||
system "cd /tmp/#{package} && sudo make install >> #{logfile}" | ||
|
||
puts 'Done.' | ||
end | ||
|
||
begin | ||
check_packages | ||
require 'gtksourceview2' | ||
rescue LoadError | ||
install_ruby_gnome2 | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters