xezat 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -19
  3. data/bin/xezat +6 -6
  4. data/lib/xezat/command/create.rb +4 -4
  5. data/lib/xezat/command/generate.rb +76 -5
  6. data/lib/xezat/commands.rb +1 -1
  7. data/lib/xezat/cygchangelog.rb +1 -1
  8. data/lib/xezat/detector/autoconf.rb +1 -0
  9. data/lib/xezat/detector/automake.rb +1 -0
  10. data/lib/xezat/detector/boost.m4.rb +1 -0
  11. data/lib/xezat/detector/cmake.rb +1 -0
  12. data/lib/xezat/detector/gengetopt.rb +1 -0
  13. data/lib/xezat/detector/gobject-introspection.rb +21 -0
  14. data/lib/xezat/detector/libQt5Core-devel.rb +20 -0
  15. data/lib/xezat/detector/libtool.rb +1 -0
  16. data/lib/xezat/detector/make.rb +1 -0
  17. data/lib/xezat/detector/python-docutils.rb +1 -0
  18. data/lib/xezat/refine/linguist/file_blob.rb +1 -1
  19. data/lib/xezat/validator/m4.rb +1 -0
  20. data/lib/xezat/validator/pkgconfig.rb +2 -1
  21. data/lib/xezat/version.rb +1 -1
  22. data/share/xezat/compilers.json +40 -40
  23. data/share/xezat/repository/bitbucket.json +3 -3
  24. data/share/xezat/repository/github.json +3 -3
  25. data/share/xezat/repository/google.json +5 -5
  26. data/share/xezat/repository/savannah.json +4 -0
  27. data/share/xezat/repository/sourceforge.json +4 -4
  28. data/share/xezat/show_cygport_variable.sh +3 -2
  29. data/share/xezat/template/Makefile.am +3 -0
  30. data/share/xezat/template/cygport.erb +17 -3
  31. data/share/xezat/template/pkgconfig.cmake +8 -0
  32. data/share/xezat/template/pkgconfig.erb +1 -1
  33. data/test/xezat/command/test_bump.rb +1 -0
  34. data/test/xezat/command/test_create.rb +5 -4
  35. data/test/xezat/command/test_doctor.rb +2 -1
  36. data/test/xezat/detector/fixture/gobject-introspection/no/configure.ac +1 -0
  37. data/test/xezat/detector/fixture/gobject-introspection/yes/configure.ac +1 -0
  38. data/test/xezat/detector/fixture/libQt5Core-devel/no/foo.cygport +1 -0
  39. data/test/xezat/detector/fixture/libQt5Core-devel/yes_cygport/foo.cygport +1 -0
  40. data/test/xezat/detector/fixture/libQt5Core-devel/yes_dir/foo.cygport +1 -0
  41. data/test/xezat/detector/fixture/libQt5Core-devel/yes_dir/foo.pro +1 -0
  42. data/test/xezat/detector/test_autoconf.rb +1 -0
  43. data/test/xezat/detector/test_automake.rb +1 -0
  44. data/test/xezat/detector/test_boost.m4.rb +1 -0
  45. data/test/xezat/detector/test_cmake.rb +1 -0
  46. data/test/xezat/detector/test_gengetopt.rb +1 -0
  47. data/test/xezat/detector/test_gobject-introspection.rb +20 -0
  48. data/test/xezat/detector/test_libQt5Core-devel.rb +30 -0
  49. data/test/xezat/detector/test_python-docutils.rb +1 -0
  50. data/test/xezat/test_cygchangelog.rb +1 -0
  51. data/test/xezat/test_cygclasses.rb +1 -0
  52. data/test/xezat/test_cygversion.rb +3 -2
  53. data/test/xezat/test_variables.rb +1 -0
  54. data/test/xezat/validator/test_m4.rb +1 -0
  55. data/test/xezat/validator/test_pkgconfig.rb +1 -0
  56. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed2c44e72ce46695edf8b725d890d0b56670c023
4
- data.tar.gz: 21e444b65fde66b0538a85c7c6628baf1fe0466f
3
+ metadata.gz: 7de08390192ad439d253b0e258cc6806abe83216
4
+ data.tar.gz: d31409ca3dcf5ac73cc2c7219a07571f7899890b
5
5
  SHA512:
6
- metadata.gz: 317b2be1714e348aa9b656a9a45cc5aeea09d9f8b20aac7874a877eb129d8a2b970e52f703bc3a5d2bc3f02e192c4b24d880e5dd0b3e671b555ec31d55f9877b
7
- data.tar.gz: f3c859dcf772f2da6b90ef7e14a11665657eaef4ef78bd2814bdfbf722ea49279ec0ca1d2040bc60c84c8089fa5f1dbbab544d50acf2f5c170199dee81c78131
6
+ metadata.gz: 751491bedd995a89a7d4c1d0ee9042f2068a5533bbaa92f4b7ed74ea8d5bb0b908f4653b85a01c291579d04def51fb9f2a32341a93087953f967fb4bed2430e8
7
+ data.tar.gz: 48c13d941d5f12231c2edca2eddded3f972d0b977cf16417bf5e8676737c01390af98551db7f43c92245fab9e997c4af3a8d7d556521fbe05dca0c82b8db434c
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- xezat 0.0.2 -- Xezat is the complement of cygport
23
+ xezat 0.0.3 -- Xezat is the complement of cygport
24
24
 
25
25
  Usage:
26
26
 
@@ -63,8 +63,8 @@ Or install it yourself as:
63
63
 
64
64
  Example.1
65
65
 
66
- % xezat create xezat-0.0.2-1bl1.cygport
67
- % cat xezat-0.0.2-1bl1.cygport
66
+ % xezat create xezat-0.0.3-1bl1.cygport
67
+ % cat xezat-0.0.3-1bl1.cygport
68
68
 
69
69
  ```bash
70
70
  HOMEPAGE=""
@@ -79,12 +79,26 @@ PKG_NAMES="
79
79
  lib${PN}0
80
80
  lib${PN}-devel
81
81
  "
82
+ xezat_CONTENTS="
83
+ usr/bin/*.exe
84
+ usr/share
85
+ "
86
+ libxezat0_CONTENTS="
87
+ usr/bin/*.dll
88
+ "
89
+ libxezat_devel_CONTENTS="
90
+ usr/include
91
+ usr/lib
92
+ "
93
+ xezat_SUMMARY="${SUMMARY} (licensing & readmes)"
94
+ libxezat0_SUMMARY="${SUMMARY} (runtime)"
95
+ libxezat_devel_SUMMARY="${SUMMARY} (development)"
82
96
  ```
83
97
 
84
98
  Example.2
85
99
 
86
- % xezat create -a -c Libs -i git --repository=github -s 'Complement of Cygport' -o xezat-0.0.2-1bl1.cygport
87
- % cat xezat-0.0.2-1bl1.cygport
100
+ % xezat create -a -c Libs -i git --repository=github -s 'Complement of Cygport' -o xezat-0.0.3-1bl1.cygport
101
+ % cat xezat-0.0.3-1bl1.cygport
88
102
 
89
103
  ```bash
90
104
  HOMEPAGE="https://github.com/fd00/${PN}"
@@ -95,10 +109,6 @@ SUMMARY="Complement of Cygport"
95
109
  DESCRIPTION=""
96
110
 
97
111
  inherit git
98
-
99
- PKG_NAMES="
100
- ${PN}
101
- "
102
112
  ```
103
113
 
104
114
  ### debug
@@ -116,13 +126,13 @@ PKG_NAMES="
116
126
 
117
127
  Example.1
118
128
 
119
- % xezat debug xezat-0.0.2-1bl1.cygport
129
+ % xezat debug xezat-0.0.3-1bl1.cygport
120
130
  #<Xezat::VariableManager:0x000006011ba808
121
131
  @variables=
122
132
  {:AR=>"ar",
123
133
  :ARCH=>"x86_64",
124
134
  :ARCH_x86_64=>"1",
125
- :B=>"/usr/src/xezat-0.0.2-1bl1.x86_64/build",
135
+ :B=>"/usr/src/xezat-0.0.3-1bl1.x86_64/build",
126
136
  :BASH=>"/usr/bin/bash",
127
137
  (snip)
128
138
  :mirror_apache=>"http://www.apache.org/dist",
@@ -131,10 +141,10 @@ Example.1
131
141
  :mirror_cran=>"http://cran.r-project.org",
132
142
  :mirror_ctan=>"http://mirror.ctan.org/",
133
143
  (snip)
134
- :src_patchfile=>"xezat-0.0.2-1bl1.src.patch",
135
- :srcdir=>"/usr/src/xezat-0.0.2-1bl1.x86_64/src",
144
+ :src_patchfile=>"xezat-0.0.3-1bl1.src.patch",
145
+ :srcdir=>"/usr/src/xezat-0.0.3-1bl1.x86_64/src",
136
146
  :top=>"/usr/src",
137
- :workdir=>"/usr/src/xezat-0.0.2-1bl1.x86_64"}>
147
+ :workdir=>"/usr/src/xezat-0.0.3-1bl1.x86_64"}>
138
148
  %
139
149
 
140
150
  ### doctor
@@ -175,7 +185,6 @@ Example.1
175
185
  xezat generate [options] cygport
176
186
 
177
187
  Options:
178
- -c, --cmake generate *.cmake
179
188
  -o, --overwrite overwrite file
180
189
  -p, --pkg-config generate *.pc
181
190
  -h, --help Show this message
@@ -184,8 +193,8 @@ Example.1
184
193
 
185
194
  Example.1
186
195
 
187
- % xezat generate xezat-0.0.2-1bl1.cygport -p
188
- % cat xezat-0.0.2-1bl1.x86_64/src/xezat-0.0.2/xezat.pc
196
+ % xezat generate xezat-0.0.3-1bl1.cygport -p
197
+ % cat xezat-0.0.3-1bl1.x86_64/src/xezat-0.0.3/xezat.pc
189
198
  prefix=@prefix@
190
199
  exec_prefix=@exec_prefix@
191
200
  libdir=@libdir@
@@ -247,6 +256,6 @@ Example.1
247
256
  [xezat]
248
257
  distdir = /cygdrive/e/dist
249
258
  portdir = /cygdrive/e/yacp
250
- % xezat port xezat-0.0.2-1bl1.cygport
259
+ % xezat port xezat-0.0.3-1bl1.cygport
251
260
  % ls /cygdrive/e/yacp/xezat
252
- README xezat-0.0.2-1bl1.cygport xezat-0.0.2-1bl1.src.patch
261
+ README xezat-0.0.3-1bl1.cygport xezat-0.0.3-1bl1.src.patch
data/bin/xezat CHANGED
@@ -3,12 +3,12 @@
3
3
  Encoding::default_external = 'UTF-8'
4
4
 
5
5
  self_file =
6
- if File.symlink?(__FILE__)
7
- require 'pathname'
8
- Pathname.new(__FILE__).realpath
9
- else
10
- __FILE__
11
- end
6
+ if File.symlink?(__FILE__)
7
+ require 'pathname'
8
+ Pathname.new(__FILE__).realpath
9
+ else
10
+ __FILE__
11
+ end
12
12
  $:.unshift File.expand_path(File.join(File.dirname(self_file), '..', 'lib'))
13
13
 
14
14
  require 'xezat/main'
@@ -70,8 +70,8 @@ module Xezat
70
70
  end
71
71
  else
72
72
  {
73
- :HOMEPAGE => '',
74
- :SRC_URI => ''
73
+ :HOMEPAGE => '',
74
+ :SRC_URI => ''
75
75
  }
76
76
  end
77
77
  end
@@ -90,8 +90,8 @@ module Xezat
90
90
  vcs_prefix = vcs_class.to_s.upcase if vcs_class
91
91
  vcs_uri = "#{vcs_prefix}_URI".intern
92
92
  {
93
- :HOMEPAGE => original_template_variables[:HOMEPAGE],
94
- vcs_uri => original_template_variables[vcs_uri]
93
+ :HOMEPAGE => original_template_variables[:HOMEPAGE],
94
+ vcs_uri => original_template_variables[vcs_uri]
95
95
  }
96
96
  end
97
97
 
@@ -1,3 +1,5 @@
1
+ require 'facets/file/atomic_open'
2
+ require 'facets/file/atomic_write'
1
3
  require 'xezat/commands'
2
4
  require 'xezat/variables'
3
5
 
@@ -6,6 +8,10 @@ module Xezat
6
8
  class UnregeneratableConfigurationError < StandardError
7
9
  end
8
10
 
11
+ # configure.(ac|in) が存在しない場合に投げられる例外
12
+ class ConfigureNotFoundError < StandardError
13
+ end
14
+
9
15
  module Command
10
16
  # 追加のファイルを生成する
11
17
  class Generate
@@ -13,7 +19,6 @@ module Xezat
13
19
  program.command(:generate) do |c|
14
20
  c.syntax 'generate [options] cygport'
15
21
  c.description 'generate additional files'
16
- c.option 'cmake', '-c', '--cmake', 'generate *.cmake'
17
22
  c.option 'overwrite', '-o', '--overwrite', 'overwrite file'
18
23
  c.option 'pc', '-p', '--pkg-config', 'generate *.pc'
19
24
  c.action do |args, options|
@@ -32,12 +37,78 @@ module Xezat
32
37
  variables = VariableManager::get_default_variables(cygport)
33
38
 
34
39
  if options['pc']
35
- pc = File::expand_path(File::join(variables[:S], "#{variables[:PN]}.pc.in"))
36
- raise UnregeneratableConfigurationError, "#{variables[:PN]}.pc.in already exists" if File::exist?(pc) && !options['overwrite']
37
- File::atomic_write(pc) do |f|
38
- f.write(get_package_config(variables))
40
+ generate_pkg_config(variables, options)
41
+ end
42
+
43
+ if variables[:_cmake_CYGCLASS_]
44
+ result, detail = append_commands_to_cmakelists(variables)
45
+ else
46
+ result, detail = append_commands_to_configure(variables)
47
+ end
48
+ c.logger.info detail if result
49
+ end
50
+
51
+ # *.pc を生成する
52
+ def generate_pkg_config(variables, options)
53
+ srcdir = variables[:CYGCMAKE_SOURCE] || variables[:S]
54
+ pc = File::expand_path(File::join(srcdir, "#{variables[:PN]}.pc.in"))
55
+ raise UnregeneratableConfigurationError, "#{variables[:PN]}.pc.in already exists" if File::exist?(pc) && !options['overwrite']
56
+ File::atomic_write(pc) do |f|
57
+ f.write(get_package_config(variables))
58
+ end
59
+ end
60
+
61
+ # CMakeLists.txt の末尾に *.pc を生成する命令を追記する
62
+ def append_commands_to_cmakelists(variables)
63
+ srcdir = variables[:CYGCMAKE_SOURCE] || variables[:S]
64
+ cmakelists = File::expand_path(File::join(srcdir, "CMakeLists.txt"))
65
+ puts cmakelists
66
+ original = File::read(cmakelists)
67
+ commands = File::read(File::expand_path(File::join(TEMPLATE_DIR, 'pkgconfig.cmake')))
68
+
69
+ unless original.match(/DESTINATION \$\{CMAKE_INSTALL_PREFIX\}\/lib\/pkgconfig/)
70
+ File::atomic_open(cmakelists, 'a') do |f|
71
+ f.write(commands)
39
72
  end
73
+ return [true, "append #{variables[:PN]}.pc installation commands to #{cmakelists}"]
40
74
  end
75
+ return [false, '']
76
+ end
77
+
78
+ # configure.ac と Makefile.am の末尾に *.pc を生成する命令を追加する
79
+ def append_commands_to_configure(variables)
80
+ result = false
81
+ detail = []
82
+
83
+ srcdir = variables[:CYGCONF_SOURCE] || variables[:S]
84
+ configure_ac = File::expand_path(File::join(srcdir, 'configure.ac'))
85
+ configure_ac = File::expand_path(File::join(srcdir, 'configure.in')) unless File::exist?(configure_ac)
86
+ raise ConfigureNotFoundError unless File::exist?(configure_ac)
87
+ original_ac = File::read(configure_ac)
88
+
89
+ unless original_ac.match(/#{variables[:PN]}.pc/)
90
+ original_ac.gsub!(/(AC_CONFIG_FILES\(\[)/, '\1' + "#{variables[:PN]}.pc ")
91
+ File::atomic_write(configure_ac) do |fa|
92
+ fa.write(original_ac)
93
+ end
94
+ result = true
95
+ detail << "append #{variables[:PN]}.pc installation commands to #{configure_ac}"
96
+ end
97
+
98
+ makefile_am = File::expand_path(File::join(srcdir, 'Makefile.am'))
99
+ raise MakefileNotFoundError unless File::exist?(makefile_am)
100
+ original_am = File::read(makefile_am)
101
+
102
+ unless original_am.match(/pkgconfig_DATA/)
103
+ commands_am = File::read(File::expand_path(File::join(TEMPLATE_DIR, 'Makefile.am')))
104
+ File::atomic_open(makefile_am, 'a') do |fm|
105
+ fm.write(commands_am)
106
+ end
107
+ result = true
108
+ detail << "append #{variables[:PN]}.pc installation commands to #{makefile_am}"
109
+ end
110
+
111
+ [result, detail.join(',')]
41
112
  end
42
113
 
43
114
  # シェル変数群を埋め込まれたテンプレート文字列を返す
@@ -23,7 +23,7 @@ module Xezat
23
23
  def self.program=(program)
24
24
  @@program = program
25
25
  end
26
-
26
+
27
27
  def self.[](name)
28
28
  @@commands[name]
29
29
  end
@@ -43,7 +43,7 @@ module Xezat
43
43
 
44
44
  def each(&block)
45
45
  @changelogs.sort do |a, b|
46
- - (Cygversion.new(a[0].to_s) <=> Cygversion.new(b[0].to_s))
46
+ -(Cygversion.new(a[0].to_s) <=> Cygversion.new(b[0].to_s))
47
47
  end.each do |k, v|
48
48
  block.call(k, v)
49
49
  end
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class Autoconf
7
7
  DetectorManager::register(:autoconf, self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:S]) do |file|
10
11
  return true if file.end_with?(File::SEPARATOR + 'configure.ac') || file.end_with?(File::SEPARATOR + 'configure.in')
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class Automake
7
7
  DetectorManager::register(:automake, self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:S]) do |file|
10
11
  return true if file.end_with?(File::SEPARATOR + 'Makefile.am')
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class BoostM4
7
7
  DetectorManager::register(:'boost.m4', self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:S]) do |file|
10
11
  if file.end_with?(File::SEPARATOR + 'configure.ac') || file.end_with?(File::SEPARATOR + 'configure.in')
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class Cmake
7
7
  DetectorManager::register(:cmake, self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:S]) do |file|
10
11
  return true if file.end_with?(File::SEPARATOR + 'CMakeLists.txt')
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class Gengetopt
7
7
  DetectorManager::register(:gengetopt, self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:S]) do |file|
10
11
  return true if file.end_with?('.ggo')
@@ -0,0 +1,21 @@
1
+ require 'find'
2
+ require 'xezat/detectors'
3
+
4
+ module Xezat
5
+ module Detector
6
+ class GobjectIntrospection
7
+ DetectorManager::register(:'gobject-introspection', self)
8
+
9
+ def detect(variables)
10
+ Find::find(variables[:S]) do |file|
11
+ if file.end_with?(File::SEPARATOR + 'configure.ac') || file.end_with?(File::SEPARATOR + 'configure.in')
12
+ File::foreach(file) do |line|
13
+ return true if line.lstrip.start_with?('GOBJECT_INTROSPECTION_CHECK')
14
+ end
15
+ end
16
+ end
17
+ false
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ require 'find'
2
+ require 'xezat/detectors'
3
+
4
+ module Xezat
5
+ module Detector
6
+ class LibQt5CoreDevel
7
+ DetectorManager::register(:'libQt5Core-devel', self)
8
+
9
+ def detect(variables)
10
+ File::foreach(File::join(variables[:top], variables[:cygportfile])) do |line|
11
+ return true if line.index('qt5-qmake')
12
+ end
13
+ Find::find(variables[:S]) do |file|
14
+ return true if file.end_with?(File::SEPARATOR + variables[:PN] + '.pro')
15
+ end
16
+ false
17
+ end
18
+ end
19
+ end
20
+ end
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class Libtool
7
7
  DetectorManager::register(:libtool, self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:S]) do |file|
10
11
  return true if file.end_with?(File::SEPARATOR + 'ltmain.sh')
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class Make
7
7
  DetectorManager::register(:make, self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:B]) do |file|
10
11
  return true if file.end_with?(File::SEPARATOR + 'Makefile')
@@ -5,6 +5,7 @@ module Xezat
5
5
  module Detector
6
6
  class PythonDocutils
7
7
  DetectorManager::register(:'python-docutils', self)
8
+
8
9
  def detect(variables)
9
10
  Find::find(variables[:S]) do |file|
10
11
  if file.end_with?(File::SEPARATOR + 'configure.ac') || file.end_with?(File::SEPARATOR + 'configure.in')
@@ -6,7 +6,7 @@ module Xezat
6
6
  module Linguist
7
7
  class FileBlob < ::Linguist::FileBlob
8
8
  def data
9
- super.scrub
9
+ super.scrub rescue ''
10
10
  end
11
11
  end
12
12
  end
@@ -7,6 +7,7 @@ module Xezat
7
7
  # /usr/share/aclocal/*.m4 を検証する
8
8
  class M4
9
9
  ValidatorManager::register(:m4, self)
10
+
10
11
  def validate(variables)
11
12
  acdir = File::join(variables[:D], 'usr', 'share', 'aclocal')
12
13
  detail = nil
@@ -3,7 +3,8 @@ require 'xezat/validators'
3
3
  module Xezat
4
4
  module Validator
5
5
  class Pkgconfig
6
- ValidatorManager::register(:pkgconfig ,self)
6
+ ValidatorManager::register(:pkgconfig, self)
7
+
7
8
  def validate(variables)
8
9
  pcdir = File::join(variables[:D], 'usr', 'lib', 'pkgconfig')
9
10
  result = true
@@ -1,3 +1,3 @@
1
1
  module Xezat
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -1,42 +1,42 @@
1
1
  {
2
- "Bison": {
3
- "package": "bison"
4
- },
5
- "C": {
6
- "package": "gcc-core",
7
- "dependencies": [
8
- "binutils"
9
- ]
10
- },
11
- "C++": {
12
- "package": "gcc-g++",
13
- "dependencies": [
14
- "binutils",
15
- "gcc-core"
16
- ]
17
- },
18
- "FORTRAN": {
19
- "package": "gcc-fortran",
20
- "dependencies": [
21
- "binutils",
22
- "gcc-core"
23
- ]
24
- },
25
- "Objective-C": {
26
- "package": "gcc-objc",
27
- "dependencies": [
28
- "binutils",
29
- "gcc-core"
30
- ]
31
- },
32
- "Objective-C++": {
33
- "package": "gcc-objc++",
34
- "dependencies": [
35
- "binutils",
36
- "gcc-core"
37
- ]
38
- },
39
- "Ruby": {
40
- "package": "ruby"
41
- }
2
+ "Bison": {
3
+ "package": "bison"
4
+ },
5
+ "C": {
6
+ "package": "gcc-core",
7
+ "dependencies": [
8
+ "binutils"
9
+ ]
10
+ },
11
+ "C++": {
12
+ "package": "gcc-g++",
13
+ "dependencies": [
14
+ "binutils",
15
+ "gcc-core"
16
+ ]
17
+ },
18
+ "FORTRAN": {
19
+ "package": "gcc-fortran",
20
+ "dependencies": [
21
+ "binutils",
22
+ "gcc-core"
23
+ ]
24
+ },
25
+ "Objective-C": {
26
+ "package": "gcc-objc",
27
+ "dependencies": [
28
+ "binutils",
29
+ "gcc-core"
30
+ ]
31
+ },
32
+ "Objective-C++": {
33
+ "package": "gcc-objc++",
34
+ "dependencies": [
35
+ "binutils",
36
+ "gcc-core"
37
+ ]
38
+ },
39
+ "Ruby": {
40
+ "package": "ruby"
41
+ }
42
42
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "HOMEPAGE": "https://bitbucket.org/fd00/${PN}",
3
- "SRC_URI": "https://bitbucket.org/fd00/${PN}/downloads/${P}.tar.gz",
4
- "HG_URI": "https://bitbucket.org/fd00/${PN}"
2
+ "HOMEPAGE": "https://bitbucket.org/fd00/${PN}",
3
+ "SRC_URI": "https://bitbucket.org/fd00/${PN}/downloads/${P}.tar.gz",
4
+ "HG_URI": "https://bitbucket.org/fd00/${PN}"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "HOMEPAGE": "https://github.com/fd00/${PN}",
3
- "SRC_URI": "https://github.com/fd00/${PN}/archive/v${PV}.tar.gz",
4
- "GIT_URI": "https://github.com/fd00/${PN}.git"
2
+ "HOMEPAGE": "https://github.com/fd00/${PN}",
3
+ "SRC_URI": "https://github.com/fd00/${PN}/archive/v${PV}.tar.gz",
4
+ "GIT_URI": "https://github.com/fd00/${PN}.git"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "HOMEPAGE": "https://code.google.com/p/${PN}/",
3
- "SRC_URI": "https://${PN}.googlecode.com/files/${P}.tar.gz",
4
- "SVN_URI": "http://${PN}.googlecode.com/svn/trunk/",
5
- "GIT_URI": "https://code.google.com/p/${PN}/",
6
- "HG_URI": "https://code.google.com/p/${PN}/"
2
+ "HOMEPAGE": "https://code.google.com/p/${PN}/",
3
+ "SRC_URI": "https://${PN}.googlecode.com/files/${P}.tar.gz",
4
+ "SVN_URI": "http://${PN}.googlecode.com/svn/trunk/",
5
+ "GIT_URI": "https://code.google.com/p/${PN}/",
6
+ "HG_URI": "https://code.google.com/p/${PN}/"
7
7
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "HOMEPAGE": "http://www.nongnu.org/${PN}/",
3
+ "SRC_URI": "mirror://savannah/${PN}/${P}.tar.gz"
4
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
- "HOMEPAGE": "http://${PN}.sf.net/",
3
- "SRC_URI": "mirror://sourceforge/${PN}/${P}.tar.gz",
4
- "SVN_URI": "svn://svn.code.sf.net/p/${PN}/code",
5
- "GIT_URI": "git://git.code.sf.net/p/${PN}/code"
2
+ "HOMEPAGE": "http://${PN}.sf.net/",
3
+ "SRC_URI": "mirror://sourceforge/${PN}/${P}.tar.gz",
4
+ "SVN_URI": "svn://svn.code.sf.net/p/${PN}/code",
5
+ "GIT_URI": "git://git.code.sf.net/p/${PN}/code"
6
6
  }
@@ -7,9 +7,10 @@ show_cygport_variables()
7
7
  [ $var = 'BASH_COMMAND' ] && continue
8
8
  [ $var = 'COMP_WORDBREAKS' ] && continue
9
9
  [ $var = 'HOMEPATH' ] && continue
10
+ [ $var = 'PERL_MB_OPT' ] && continue
10
11
  [[ ${!var} =~ ^[A-Za-z]:.* ]] && continue
11
12
 
12
- echo -n "!ruby/sym" $var:
13
+ echo -n :$var:
13
14
  if [[ `declare -p $var` =~ "declare -a" ]]
14
15
  then
15
16
  echo
@@ -19,7 +20,7 @@ show_cygport_variables()
19
20
  do
20
21
  x=`printf '${%s[%s]}' $var $key`
21
22
  eval "value=$x"
22
- echo " -" $value
23
+ echo " -" '"'$value'"'
23
24
  done
24
25
  else
25
26
  echo ' "'`echo "${!var}" | sed -e "s/\\n/ /g"`'"'
@@ -0,0 +1,3 @@
1
+
2
+ pkgconfigdir = $(libdir)/pkgconfig
3
+ pkgconfig_DATA = $(PACKAGE).pc
@@ -9,11 +9,25 @@ DESCRIPTION="<%= description %>"
9
9
  <% cygclasses.each do |cygclass| -%>
10
10
  inherit <%= cygclass %>
11
11
  <% end -%>
12
-
12
+ <% pkg_name = cygport.gsub(/-[0-9].*$/, '').gsub(/[+-\.]/, '_') -%>
13
+ <% unless apponly then -%>
13
14
  PKG_NAMES="
14
15
  ${PN}
15
- <% unless apponly then -%>
16
16
  lib${PN}0
17
17
  lib${PN}-devel
18
- <% end -%>
19
18
  "
19
+ <%= pkg_name %>_CONTENTS="
20
+ usr/bin/*.exe
21
+ usr/share
22
+ "
23
+ lib<%= pkg_name %>0_CONTENTS="
24
+ usr/bin/*.dll
25
+ "
26
+ lib<%= pkg_name %>_devel_CONTENTS="
27
+ usr/include
28
+ usr/lib
29
+ "
30
+ <%= pkg_name %>_SUMMARY="${SUMMARY} (licensing & readmes)"
31
+ lib<%= pkg_name %>0_SUMMARY="${SUMMARY} (runtime)"
32
+ lib<%= pkg_name %>_devel_SUMMARY="${SUMMARY} (development)"
33
+ <% end -%>
@@ -0,0 +1,8 @@
1
+
2
+ SET(prefix ${CMAKE_INSTALL_PREFIX})
3
+ SET(exec_prefix ${CMAKE_INSTALL_PREFIX})
4
+ SET(libdir ${CMAKE_INSTALL_PREFIX}/lib)
5
+ SET(includedir ${CMAKE_INSTALL_PREFIX}/include)
6
+ SET(VERSION "0")
7
+ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY)
8
+ INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
@@ -6,5 +6,5 @@ includedir=@includedir@
6
6
  Name: <%= variables[:PN] %>
7
7
  Description: <%= variables[:SUMMARY] %>
8
8
  Version: @VERSION@
9
- Libs: -L${libdir}
9
+ Libs: -L${libdir} -l<%= variables[:PN] %>
10
10
  Cflags: -I${includedir}
@@ -4,6 +4,7 @@ module Xezat::Test::Command
4
4
  class BumpTest < Test::Unit::TestCase
5
5
  include Xezat::Command
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @command = CommandManager[:bump]
9
10
  @cygclass_manager = CygclassManager.new(File.join(File.dirname(__FILE__), '..', '..', 'cygport', 'cygclass'))
@@ -4,12 +4,13 @@ module Xezat::Test::Command
4
4
  class CreateTest < Test::Unit::TestCase
5
5
  include Xezat::Command
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @command = CommandManager[:create]
9
10
  @cygclass_manager = CygclassManager.new(File.join(File.dirname(__FILE__), '..', '..', 'cygport', 'cygclass'))
10
11
  @repository_variables = {
11
- :HOMEPAGE => 'homepage',
12
- :SRC_URI => 'src_uri'
12
+ :HOMEPAGE => 'homepage',
13
+ :SRC_URI => 'src_uri'
13
14
  }
14
15
  end
15
16
 
@@ -23,8 +24,8 @@ module Xezat::Test::Command
23
24
  # cygclass ありの template のシェル変数群に変換する
24
25
  def test_get_template_variables_inherit
25
26
  expected = {
26
- :HOMEPAGE => 'homepage',
27
- :GIT_URI => nil
27
+ :HOMEPAGE => 'homepage',
28
+ :GIT_URI => nil
28
29
  }
29
30
  template_variables = @command.get_template_variables(@repository_variables, @cygclass_manager, [:git])
30
31
  assert_equal(expected, template_variables)
@@ -5,12 +5,13 @@ module Xezat::Test::Command
5
5
  class DoctorTest < Test::Unit::TestCase
6
6
  include Xezat::Command
7
7
  include Xezat
8
+
8
9
  def setup
9
10
  @command = CommandManager[:doctor]
10
11
  end
11
12
 
12
13
  def test_get_contents_uniqueness
13
- assert_equal({:"usr/bin/aaa"=>[:a], :"usr/bin/bbb"=>[:b1, :b2], :"usr/bin/ccc"=>[:b2]}, @command.get_contents_uniqueness(File::join(File.dirname(__FILE__), 'fixture', 'doctor')))
14
+ assert_equal({:"usr/bin/aaa" => [:a], :"usr/bin/bbb" => [:b1, :b2], :"usr/bin/ccc" => [:b2]}, @command.get_contents_uniqueness(File::join(File.dirname(__FILE__), 'fixture', 'doctor')))
14
15
  end
15
16
  end
16
17
  end
@@ -0,0 +1 @@
1
+ GOBJECT_INTROSPECTION_CHECK
@@ -4,6 +4,7 @@ module Xezat::Test::Detector
4
4
  class AutoconfTest < Test::Unit::TestCase
5
5
  include Xezat::Detector
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @detector = DetectorManager[:autoconf]
9
10
  end
@@ -4,6 +4,7 @@ module Xezat::Test::Detector
4
4
  class AutomakeTest < Test::Unit::TestCase
5
5
  include Xezat::Detector
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @detector = DetectorManager[:automake]
9
10
  end
@@ -4,6 +4,7 @@ module Xezat::Test::Detector
4
4
  class BoostM4Test < Test::Unit::TestCase
5
5
  include Xezat::Detector
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @detector = DetectorManager[:'boost.m4']
9
10
  end
@@ -4,6 +4,7 @@ module Xezat::Test::Detector
4
4
  class CmakeTest < Test::Unit::TestCase
5
5
  include Xezat::Detector
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @detector = DetectorManager[:cmake]
9
10
  end
@@ -4,6 +4,7 @@ module Xezat::Test::Detector
4
4
  class GengetoptTest < Test::Unit::TestCase
5
5
  include Xezat::Detector
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @detector = DetectorManager[:gengetopt]
9
10
  end
@@ -0,0 +1,20 @@
1
+ require 'xezat/detectors'
2
+
3
+ module Xezat::Test::Detector
4
+ class GObjectIntrospectiontest < Test::Unit::TestCase
5
+ include Xezat::Detector
6
+ include Xezat
7
+
8
+ def setup
9
+ @detector = DetectorManager[:'gobject-introspection']
10
+ end
11
+
12
+ def test_yes
13
+ assert_true(@detector.detect({S: File::join(File::dirname(__FILE__), 'fixture', 'gobject-introspection', 'yes')}))
14
+ end
15
+
16
+ def test_no
17
+ assert_false(@detector.detect({S: File::join(File::dirname(__FILE__), 'fixture', 'gobject-introspection', 'no')}))
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,30 @@
1
+ require 'xezat/detectors'
2
+
3
+ module Xezat::Test::Detector
4
+ class LibQt5CoreDevel < Test::Unit::TestCase
5
+ include Xezat::Detector
6
+ include Xezat
7
+
8
+ def setup
9
+ @detector = DetectorManager[:'libQt5Core-devel']
10
+ end
11
+
12
+ def test_yes_cygport
13
+ top = File::join(File::dirname(__FILE__), 'fixture', 'libQt5Core-devel', 'yes_cygport')
14
+ cygport = 'foo.cygport'
15
+ assert_true(@detector.detect({top: top, cygportfile: cygport, S: top, PN: 'foo'}))
16
+ end
17
+
18
+ def test_yes_dir
19
+ top = File::join(File::dirname(__FILE__), 'fixture', 'libQt5Core-devel', 'yes_dir')
20
+ cygport = 'foo.cygport'
21
+ assert_true(@detector.detect({top: top, cygportfile: cygport, S: top, PN: 'foo'}))
22
+ end
23
+
24
+ def test_no
25
+ top = File::join(File::dirname(__FILE__), 'fixture', 'libQt5Core-devel', 'no')
26
+ cygport = 'foo.cygport'
27
+ assert_false(@detector.detect({top: top, cygportfile: cygport, S: top, PN: 'foo'}))
28
+ end
29
+ end
30
+ end
@@ -4,6 +4,7 @@ module Xezat::Test::Detector
4
4
  class PythonDocutilsTest < Test::Unit::TestCase
5
5
  include Xezat::Detector
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @detector = DetectorManager[:'python-docutils']
9
10
  end
@@ -3,6 +3,7 @@ require 'xezat/cygchangelog'
3
3
  module Xezat::Test
4
4
  class CygchangelogTest < Test::Unit::TestCase
5
5
  include Xezat
6
+
6
7
  def test_initialize
7
8
  changelog = Cygchangelog.new(<<EOF
8
9
  Port Notes:
@@ -3,6 +3,7 @@ require 'xezat/cygclasses'
3
3
  module Xezat::Test
4
4
  class CygclassesTest < Test::Unit::TestCase
5
5
  include Xezat
6
+
6
7
  def setup
7
8
  @cygclass_manager = CygclassManager.new(File.join(File.dirname(__FILE__), '..', 'cygport', 'cygclass'))
8
9
  end
@@ -3,14 +3,15 @@ require 'xezat/cygversion'
3
3
  module Xezat::Test
4
4
  class CygversionTest < Test::Unit::TestCase
5
5
  include Xezat
6
+
6
7
  def test_initialize
7
8
  cygversion = Cygversion.new('1.0.0-1bl1')
8
- assert_equal(['1.0.0', 19700101, '1bl1'] ,cygversion.to_a)
9
+ assert_equal(['1.0.0', 19700101, '1bl1'], cygversion.to_a)
9
10
  end
10
11
 
11
12
  def test_initialize_vcs
12
13
  cygversion = Cygversion.new('1.0.0+git20150101-1bl1')
13
- assert_equal(['1.0.0', 20150101, '1bl1'] ,cygversion.to_a)
14
+ assert_equal(['1.0.0', 20150101, '1bl1'], cygversion.to_a)
14
15
  end
15
16
 
16
17
  def test_compare
@@ -3,6 +3,7 @@ require 'xezat/variables'
3
3
  module Xezat::Test
4
4
  class VariableManagerTest < Test::Unit::TestCase
5
5
  include Xezat
6
+
6
7
  def test_variable
7
8
  variables = VariableManager.new(<<EOF
8
9
  !ruby/sym HOMEPAGE: "https://github.com/fd00/xezat"
@@ -4,6 +4,7 @@ module Xezat::Test::Validator
4
4
  class M4Test < Test::Unit::TestCase
5
5
  include Xezat::Validator
6
6
  include Xezat
7
+
7
8
  def setup
8
9
  @validator = ValidatorManager[:m4]
9
10
  end
@@ -3,6 +3,7 @@ require 'xezat/validator/pkgconfig'
3
3
  module Xezat::Test::Validator
4
4
  class PkgconfigTest < Test::Unit::TestCase
5
5
  include Xezat
6
+
6
7
  def setup
7
8
  @validator = ValidatorManager[:pkgconfig]
8
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xezat
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
  - fd0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-18 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facets
@@ -154,6 +154,8 @@ files:
154
154
  - lib/xezat/detector/boost.m4.rb
155
155
  - lib/xezat/detector/cmake.rb
156
156
  - lib/xezat/detector/gengetopt.rb
157
+ - lib/xezat/detector/gobject-introspection.rb
158
+ - lib/xezat/detector/libQt5Core-devel.rb
157
159
  - lib/xezat/detector/libtool.rb
158
160
  - lib/xezat/detector/make.rb
159
161
  - lib/xezat/detector/python-docutils.rb
@@ -171,11 +173,14 @@ files:
171
173
  - share/xezat/repository/bitbucket.json
172
174
  - share/xezat/repository/github.json
173
175
  - share/xezat/repository/google.json
176
+ - share/xezat/repository/savannah.json
174
177
  - share/xezat/repository/sourceforge.json
175
178
  - share/xezat/show_cygport_description.sh
176
179
  - share/xezat/show_cygport_variable.sh
180
+ - share/xezat/template/Makefile.am
177
181
  - share/xezat/template/README.erb
178
182
  - share/xezat/template/cygport.erb
183
+ - share/xezat/template/pkgconfig.cmake
179
184
  - share/xezat/template/pkgconfig.erb
180
185
  - share/xezat/template/setup.erb
181
186
  - test/test.rb
@@ -199,6 +204,12 @@ files:
199
204
  - test/xezat/detector/fixture/gengetopt/no/xezat.log
200
205
  - test/xezat/detector/fixture/gengetopt/yes_root/xezat.ggo
201
206
  - test/xezat/detector/fixture/gengetopt/yes_subdir/subdir/xezat.ggo
207
+ - test/xezat/detector/fixture/gobject-introspection/no/configure.ac
208
+ - test/xezat/detector/fixture/gobject-introspection/yes/configure.ac
209
+ - test/xezat/detector/fixture/libQt5Core-devel/no/foo.cygport
210
+ - test/xezat/detector/fixture/libQt5Core-devel/yes_cygport/foo.cygport
211
+ - test/xezat/detector/fixture/libQt5Core-devel/yes_dir/foo.cygport
212
+ - test/xezat/detector/fixture/libQt5Core-devel/yes_dir/foo.pro
202
213
  - test/xezat/detector/fixture/python-docutils/no/configure.ac
203
214
  - test/xezat/detector/fixture/python-docutils/yes/configure.ac
204
215
  - test/xezat/detector/test_autoconf.rb
@@ -206,6 +217,8 @@ files:
206
217
  - test/xezat/detector/test_boost.m4.rb
207
218
  - test/xezat/detector/test_cmake.rb
208
219
  - test/xezat/detector/test_gengetopt.rb
220
+ - test/xezat/detector/test_gobject-introspection.rb
221
+ - test/xezat/detector/test_libQt5Core-devel.rb
209
222
  - test/xezat/detector/test_python-docutils.rb
210
223
  - test/xezat/test_cygchangelog.rb
211
224
  - test/xezat/test_cygclasses.rb
@@ -266,6 +279,12 @@ test_files:
266
279
  - test/xezat/detector/fixture/gengetopt/no/xezat.log
267
280
  - test/xezat/detector/fixture/gengetopt/yes_root/xezat.ggo
268
281
  - test/xezat/detector/fixture/gengetopt/yes_subdir/subdir/xezat.ggo
282
+ - test/xezat/detector/fixture/gobject-introspection/no/configure.ac
283
+ - test/xezat/detector/fixture/gobject-introspection/yes/configure.ac
284
+ - test/xezat/detector/fixture/libQt5Core-devel/no/foo.cygport
285
+ - test/xezat/detector/fixture/libQt5Core-devel/yes_cygport/foo.cygport
286
+ - test/xezat/detector/fixture/libQt5Core-devel/yes_dir/foo.cygport
287
+ - test/xezat/detector/fixture/libQt5Core-devel/yes_dir/foo.pro
269
288
  - test/xezat/detector/fixture/python-docutils/no/configure.ac
270
289
  - test/xezat/detector/fixture/python-docutils/yes/configure.ac
271
290
  - test/xezat/detector/test_autoconf.rb
@@ -273,6 +292,8 @@ test_files:
273
292
  - test/xezat/detector/test_boost.m4.rb
274
293
  - test/xezat/detector/test_cmake.rb
275
294
  - test/xezat/detector/test_gengetopt.rb
295
+ - test/xezat/detector/test_gobject-introspection.rb
296
+ - test/xezat/detector/test_libQt5Core-devel.rb
276
297
  - test/xezat/detector/test_python-docutils.rb
277
298
  - test/xezat/test_cygchangelog.rb
278
299
  - test/xezat/test_cygclasses.rb