gear 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97e26787777b28a03c1a1293077cc855cb998e56
4
- data.tar.gz: 4fd29a9e4c0948802cc6226dd29256a9dee0406f
3
+ metadata.gz: 445603b1e01a4640e1961abf51b9fee905cda6a3
4
+ data.tar.gz: bbdc3d2eecbf4a8d572646bf500c96b4d870ad0c
5
5
  SHA512:
6
- metadata.gz: 06646f36476fcf108f0bb4c8247d90e528b751aec5f4e1c2ee8a0139af3eddf94d38ff394c119c619c7508a92d8c8de46912c19c0ee1e5fbc127e0d9b468af89
7
- data.tar.gz: ac8b6b443779b00bfc4fac4d5935122dd1a029ef3ae20a6ad240a575ccb32173b9805b0449c10cb3aa0a07958789fae6c395c1b6847c7d613bb972ab15c298ef
6
+ metadata.gz: 2811ae13eafa601a8891ce094275b5d9c24582a86026ed8d5a50127b52864b84c7f00196048145bba8b4a075bca15dd4d2af8cb136ceb63dcea54a21c1ad3a71
7
+ data.tar.gz: 363bc374f3b826c76cd3c0ab416d6c1fc8e3c29e44a8927f76b4e6d0df1057d46b6ffcaaf393c642a6adf67a8d393d79314a439bf477bb825f77c5b6634975cd
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gear'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.license = 'GPL-3'
5
5
  s.summary = 'modular dependency build system for native extensions'
6
6
  s.description = 'gear provides a modular framework to encapsulate build tasks for native ' +
@@ -111,7 +111,7 @@ class Gear
111
111
  else
112
112
  @git = Git.clone(repository, build_path)
113
113
  end
114
- rescue e
114
+ rescue StandardError => e
115
115
  STDERR.puts "Could not obtain repository #{repository}.\n#{e}"
116
116
  @obtained = false
117
117
  return false
@@ -1,4 +1,7 @@
1
- require "gear"
1
+ require 'gear'
2
+
3
+ require 'gears/boost'
4
+ require 'gears/cmake'
2
5
 
3
6
  module Gears
4
7
  class APNGAsm < Gear
@@ -19,6 +22,12 @@ module Gears
19
22
  end
20
23
 
21
24
  def build()
25
+ # prerequisites
26
+ cm = Gears::CMake.new
27
+ cm.engage
28
+ boost = Gears::Boost.new
29
+ boost.engage
30
+
22
31
  Dir.chdir(@build_path)
23
32
  FileUtils.mkdir_p('build') # `mkdir build`
24
33
  Dir.chdir('build') # `cd build`
@@ -20,10 +20,10 @@ module Gears
20
20
 
21
21
  def build()
22
22
  Dir.chdir(@build_path)
23
- `sh bootstrap.sh --without-libraries=python --prefix=#{@@install_path}`
24
- `sh b2 headers`
25
- `sh b2`
26
- `sh b2 install --prefix=#{@@install_path}`
23
+ `./bootstrap.sh --without-libraries=python --prefix=#{@@install_path}`
24
+ `./b2 headers`
25
+ `./b2`
26
+ `./b2 install --prefix=#{@@install_path}`
27
27
  @built = true
28
28
  return true
29
29
  end
@@ -0,0 +1,51 @@
1
+ require 'gear'
2
+
3
+ require 'gears/libarchive'
4
+
5
+ module Gears
6
+ class CMake < Gear
7
+ @gear_name = "CMake"
8
+
9
+ def check()
10
+ gear_exec 'cmake --version'
11
+ if $?.exitstatus == 0
12
+ @checked = true
13
+ return true
14
+ end
15
+ @checked = false
16
+ return false
17
+ end
18
+
19
+ def obtain()
20
+ github_obtain('Kitware', 'CMake')
21
+ end
22
+
23
+ def build()
24
+ la = Gears::LibArchive.new
25
+ la.engage
26
+
27
+ Dir.chdir(@build_path)
28
+ `sh bootstrap --prefix=#{@@install_path}`
29
+ `make`
30
+ @built = true
31
+ return true
32
+ end
33
+
34
+ def install()
35
+ std_make_install
36
+ end
37
+
38
+ def uninstall()
39
+ FileUtils.rm_f("#{@@install_path}/bin/ccmake")
40
+ FileUtils.rm_f("#{@@install_path}/bin/cmake")
41
+ FileUtils.rm_f("#{@@install_path}/bin/cmakexbuild")
42
+ FileUtils.rm_f("#{@@install_path}/bin/cpack")
43
+ FileUtils.rm_f("#{@@install_path}/bin/ctest")
44
+ FileUtils.rm_rf(Dir.glob("#{@@install_path}/doc/cmake-*"))
45
+ FileUtils.rm_rf("#{@@install_path}/share/aclocal")
46
+ FileUtils.rm_rf(Dir.glob("#{@@install_path}/share/cmake-*"))
47
+ @installed = false
48
+ return true
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require "gear"
2
+
3
+ module Gears
4
+ class LibArchive < Gear
5
+ @gear_name = "libarchive"
6
+
7
+ def check()
8
+ gear_exec 'ldconfig -p | grep libarchive'
9
+ if $?.exitstatus == 0
10
+ @checked = true
11
+ return true
12
+ end
13
+ @checked = false
14
+ return false
15
+ end
16
+
17
+ def obtain()
18
+ github_obtain('libarchive', 'libarchive')
19
+ end
20
+
21
+ def build()
22
+ Dir.chdir(@build_path)
23
+ `sh build/autogen.sh`
24
+ `./configure --prefix=#{@@install_path}`
25
+ `make`
26
+ @built = true
27
+ return true
28
+ end
29
+
30
+ def install()
31
+ std_make_install
32
+ end
33
+
34
+ def uninstall()
35
+ FileUtils.rm_f("#{@@install_path}/bin/bsdcat")
36
+ FileUtils.rm_f("#{@@install_path}/bin/bsdcpio")
37
+ FileUtils.rm_f("#{@@install_path}/bin/bsdtar")
38
+ FileUtils.rm_f("#{@@install_path}/include/archive_entry.h")
39
+ FileUtils.rm_f("#{@@install_path}/include/archive.h")
40
+ FileUtils.rm_f(Dir.glob("#{@@install_path}/lib/libarchive.*"))
41
+ FileUtils.rm_rf("#{@@install_path}/lib/pkgconfig")
42
+ FileUtils.rm_f("#{@@install_path}/share/man/man1/bsdcat.1")
43
+ FileUtils.rm_f("#{@@install_path}/share/man/man1/bsdcpio.1")
44
+ FileUtils.rm_f("#{@@install_path}/share/man/man1/bsdtar.1")
45
+ FileUtils.rm_rf("#{@@install_path}/share/man/man3")
46
+ FileUtils.rm_rf("#{@@install_path}/share/man/man5")
47
+ @installed = false
48
+ return true
49
+ end
50
+ end
51
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gear
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei Kagetsuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-18 00:00:00.000000000 Z
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -35,6 +35,8 @@ files:
35
35
  - lib/gear.rb
36
36
  - lib/gears/apngasm.rb
37
37
  - lib/gears/boost.rb
38
+ - lib/gears/cmake.rb
39
+ - lib/gears/libarchive.rb
38
40
  - lib/gears/swig.rb
39
41
  homepage: https://github.com/Kagetsuki/gear
40
42
  licenses: