psp-toolchain 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,48 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ psp-toolchain (0.0.1)
5
+ activesupport (~> 3.2)
6
+ cocaine (~> 0.5)
7
+ slop (~> 3.4)
8
+ version (~> 1.0)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ activesupport (3.2.12)
14
+ i18n (~> 0.6)
15
+ multi_json (~> 1.0)
16
+ climate_control (0.0.3)
17
+ activesupport (>= 3.0)
18
+ cocaine (0.5.1)
19
+ climate_control (>= 0.0.3, < 1.0)
20
+ diff-lcs (1.2.1)
21
+ fuubar (1.1.0)
22
+ rspec (~> 2.0)
23
+ rspec-instafail (~> 0.2.0)
24
+ ruby-progressbar (~> 1.0.0)
25
+ i18n (0.6.4)
26
+ multi_json (1.6.1)
27
+ rake (10.0.3)
28
+ rspec (2.13.0)
29
+ rspec-core (~> 2.13.0)
30
+ rspec-expectations (~> 2.13.0)
31
+ rspec-mocks (~> 2.13.0)
32
+ rspec-core (2.13.1)
33
+ rspec-expectations (2.13.0)
34
+ diff-lcs (>= 1.1.3, < 2.0)
35
+ rspec-instafail (0.2.4)
36
+ rspec-mocks (2.13.0)
37
+ ruby-progressbar (1.0.2)
38
+ slop (3.4.4)
39
+ version (1.0.0)
40
+
41
+ PLATFORMS
42
+ ruby
43
+
44
+ DEPENDENCIES
45
+ fuubar (~> 1.1)
46
+ psp-toolchain!
47
+ rake (~> 10.0)
48
+ rspec (~> 2.13)
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Ryan Scott Lewis <ryan@rynet.us>.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,60 @@
1
+ # PSP::Toolchain
2
+
3
+ An open-source toolchain for PSP homebrew development built in Ruby.
4
+
5
+ ## Install
6
+
7
+ ### RubyGems: `gem install psp-toolchain`
8
+
9
+ ## Dependencies
10
+
11
+ The following dependencies must be installed (preferably via `apt-get`, `yum`, `port`, `brew`, or similar package manager):
12
+
13
+ * autoconf
14
+ * automake
15
+ * bison
16
+ * flex
17
+ * g++/gcc-c++
18
+ * gcc
19
+ * git
20
+ * gmp
21
+ * libelf
22
+ * libusb-dev
23
+ * make
24
+ * mpc
25
+ * mpfr
26
+ * ncurses
27
+ * patch
28
+ * readline
29
+ * subversion
30
+ * texinfo
31
+ * wget
32
+
33
+ ## Usage
34
+
35
+ Simply run `gem install psp-toolchain` and if all dependencies are installed, the toolchain will be compiled.
36
+
37
+ If the dependencies are not met, you can run the `psp-toolchain` executable to manually compile the toolchain.
38
+
39
+ ## CLI
40
+
41
+ The CLI interface is used to install the PSP toolchain to a specific location.
42
+
43
+ `--prefix`/`-p`
44
+
45
+ The output directory for the toolchain.
46
+ A `bin` directory will be created in this directory which should be added to your PATH.
47
+
48
+ `--force`/`-f`
49
+
50
+ The toolchain will not be installed if it is already installed in the `--prefix` directory unless this option is passed.
51
+
52
+ `--verbose`/`-v`
53
+
54
+ Show the commands that are being run.
55
+
56
+ ## Copyright
57
+
58
+ Copyright © 2013 Ryan Scott Lewis <ryan@rynet.us>.
59
+
60
+ The MIT License (MIT) - See LICENSE for further details.
@@ -0,0 +1,19 @@
1
+ require 'pathname'
2
+ require 'rubygems/specification'
3
+ require 'rubygems/package_task'
4
+
5
+ $project_path = Pathname.new(__FILE__).dirname.expand_path
6
+ $spec = Gem::Specification.load( Pathname.glob( $project_path.join('*.gemspec') ).first.to_s )
7
+
8
+ Rake::TaskManager.record_task_metadata = true
9
+
10
+ Gem::PackageTask.new($spec) do |t|
11
+ t.need_zip = false
12
+ t.need_tar = false
13
+ end
14
+
15
+ task :default do
16
+ Rake::application.options.show_tasks = :tasks # this solves sidewaysmilk problem
17
+ Rake::application.options.show_task_pattern = //
18
+ Rake::application.display_tasks_and_comments
19
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ require 'psp/toolchain/start'
@@ -0,0 +1,18 @@
1
+ require 'active_support/core_ext/module/delegation'
2
+ require 'version'
3
+ require 'psp/toolchain/application'
4
+
5
+ module PSP
6
+
7
+ # An open-source toolchain for PSP homebrew development built in Ruby.
8
+ module Toolchain
9
+
10
+ is_versioned
11
+
12
+ class << self
13
+ delegate :start, to: Application
14
+ end
15
+
16
+ end
17
+
18
+ end
@@ -0,0 +1,56 @@
1
+ require 'singleton'
2
+ require 'logger'
3
+ require 'slop'
4
+ require 'psp/toolchain'
5
+ require 'psp/toolchain/error'
6
+ require 'psp/toolchain/errors/invalid_prefix'
7
+
8
+ module PSP
9
+
10
+ module Toolchain
11
+
12
+ class Application
13
+
14
+ include Singleton
15
+
16
+ class << self
17
+ delegate :start, to: :instance
18
+ end
19
+
20
+ attr_reader :logger, :options
21
+
22
+ def initialize
23
+ @logger = Logger.new(STDOUT)
24
+
25
+ parse_options
26
+ end
27
+
28
+ def start
29
+
30
+ end
31
+
32
+ protected
33
+
34
+ def parse_options
35
+ options = Slop.parse strict: true, help: true, ignore_case: true do
36
+ banner 'Usage: psp-toolchain [options]'
37
+
38
+ on :p, :prefix=, 'The output directory for the toolchain', required: true
39
+ on :f, :force, 'Force the installation of the toolchain into the -p directory'
40
+ on :v, :verbose, 'Enable verbosity'
41
+ end
42
+
43
+ prefix = Errors::InvalidPrefix.check(options)
44
+
45
+ @options = options.to_hash.merge(prefix: prefix)
46
+ rescue Error, Slop::Error => error
47
+ logger.error(error.to_s)
48
+
49
+ exit
50
+ end
51
+
52
+ end
53
+
54
+ end
55
+
56
+ end
@@ -0,0 +1,12 @@
1
+ require 'psp/toolchain'
2
+
3
+ module PSP
4
+ module Toolchain
5
+
6
+ # The base class for errors.
7
+ class Error < StandardError
8
+
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,26 @@
1
+ require 'psp/toolchain/error'
2
+
3
+ module PSP
4
+ module Toolchain
5
+ module Errors
6
+
7
+ # Raised when the directory given for the :prefix option does not exist.
8
+ class InvalidPrefix < Error
9
+
10
+ # @params [#[]] options The options containing :prefix.
11
+ # @option options [String] :prefix The prefix directory.
12
+ # @return [Pathname] The prefix value converted into a Pathname.
13
+ def self.check(options)
14
+ Pathname.new( options[:prefix] ).expand_path.tap { |prefix| raise self unless prefix.exist? }
15
+ end
16
+
17
+ # @return [String] The error message.
18
+ def to_s
19
+ 'prefix directory does not exist'
20
+ end
21
+
22
+ end
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ require 'psp/toolchain'
2
+
3
+ PSP::Toolchain.start
@@ -0,0 +1,35 @@
1
+ require 'pathname'
2
+
3
+ Gem::Specification.new do |s|
4
+
5
+ # Variables
6
+ s.name = Pathname.new(__FILE__).basename('.gemspec').to_s
7
+ s.author = 'Ryan Scott Lewis'
8
+ s.email = 'ryan@rynet.us'
9
+ s.summary = 'An open-source toolchain for PSP homebrew development built in Ruby.'
10
+ s.description = s.summary
11
+ s.license = 'MIT'
12
+
13
+ # Dependencies
14
+ s.add_dependency 'version', '~> 1.0'
15
+ s.add_dependency 'cocaine', '~> 0.5'
16
+ s.add_dependency 'slop', '~> 3.4'
17
+ s.add_dependency 'activesupport', '~> 3.2'
18
+ s.add_development_dependency 'rake', '~> 10.0'
19
+ s.add_development_dependency 'rspec', '~> 2.13'
20
+ s.add_development_dependency 'fuubar', '~> 1.1'
21
+
22
+ # Pragmatically set variables
23
+ s.homepage = "http://github.com/RyanScottLewis/#{s.name}"
24
+ s.version = Pathname.glob('VERSION*').first.read rescue '0.0.0'
25
+ s.require_paths = ['lib']
26
+ s.files = %w(Gemfile Gemfile.lock LICENSE VERSION Rakefile README.md)
27
+
28
+ s.files << "#{s.name}.gemspec"
29
+ s.files += Dir.glob('bin/*')
30
+ s.files += Dir.glob('lib/**/*.rb')
31
+ s.files += Dir.glob('spec/**/*')
32
+
33
+ s.extensions << 'lib/psp/toolchain/start.rb'
34
+
35
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe PSP::Toolchain do
4
+
5
+ it 'should have specs' do
6
+ pending
7
+ end
8
+
9
+ end
@@ -0,0 +1,7 @@
1
+ require 'bundler/setup'
2
+ require 'psp/toolchain'
3
+
4
+ RSpec.configure do |config|
5
+ config.treat_symbols_as_metadata_keys_with_true_values = true
6
+ config.order = 'random'
7
+ end
metadata ADDED
@@ -0,0 +1,179 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: psp-toolchain
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ryan Scott Lewis
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-03-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: version
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: cocaine
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '0.5'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0.5'
46
+ - !ruby/object:Gem::Dependency
47
+ name: slop
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '3.4'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.4'
62
+ - !ruby/object:Gem::Dependency
63
+ name: activesupport
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '3.2'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '3.2'
78
+ - !ruby/object:Gem::Dependency
79
+ name: rake
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '10.0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '10.0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: rspec
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: '2.13'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '2.13'
110
+ - !ruby/object:Gem::Dependency
111
+ name: fuubar
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '1.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: '1.1'
126
+ description: An open-source toolchain for PSP homebrew development built in Ruby.
127
+ email: ryan@rynet.us
128
+ executables: []
129
+ extensions:
130
+ - lib/psp/toolchain/start.rb
131
+ extra_rdoc_files: []
132
+ files:
133
+ - Gemfile
134
+ - Gemfile.lock
135
+ - LICENSE
136
+ - VERSION
137
+ - Rakefile
138
+ - README.md
139
+ - psp-toolchain.gemspec
140
+ - bin/psp-toolkit
141
+ - lib/psp/toolchain/application.rb
142
+ - lib/psp/toolchain/error.rb
143
+ - lib/psp/toolchain/errors/invalid_prefix.rb
144
+ - lib/psp/toolchain/start.rb
145
+ - lib/psp/toolchain.rb
146
+ - spec/psp/toolchain/toolchain_spec.rb
147
+ - spec/spec_helper.rb
148
+ homepage: http://github.com/RyanScottLewis/psp-toolchain
149
+ licenses:
150
+ - MIT
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ required_ruby_version: !ruby/object:Gem::Requirement
156
+ none: false
157
+ requirements:
158
+ - - ! '>='
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ segments:
162
+ - 0
163
+ hash: 1668355172905340546
164
+ required_rubygems_version: !ruby/object:Gem::Requirement
165
+ none: false
166
+ requirements:
167
+ - - ! '>='
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ segments:
171
+ - 0
172
+ hash: 1668355172905340546
173
+ requirements: []
174
+ rubyforge_project:
175
+ rubygems_version: 1.8.25
176
+ signing_key:
177
+ specification_version: 3
178
+ summary: An open-source toolchain for PSP homebrew development built in Ruby.
179
+ test_files: []