xezat 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 971a71dc0eae6338466af60e22d6cce153514be903f36ce3b8466cbe8e197f8d
4
- data.tar.gz: 97ec5d3fd7386ae4022dc488e8fd1bb239629e91a54b606347fca99c3128378c
3
+ metadata.gz: 631c0baddcd33f64246b3f98a73a979d523c1c8115803baf3006a70346779b71
4
+ data.tar.gz: 930b2a86f48ddad910120670ebbc4b75c9e34acddff350dd99023d3c6838b003
5
5
  SHA512:
6
- metadata.gz: a092f71a8b3f282c2d48dc736df3fc6081d8c1ec23bbb5de81f05db9a8e58e45eca00f193819e67d6680ff7c2ec8dcb0bd59c2fdafb16be47a2562669d6e5856
7
- data.tar.gz: 7dda61ff0a0a7234486f085705b8bd2f0f2e19af108c8eb8c1696f224a66a33534069ffd159d76047dd4e31dd13dee32095d5795bdc054e9af744b05a9e4bb85
6
+ metadata.gz: e536d5924cb08642b47743742c314c595887a212e87927ca9d080f1aa52997d5c25dcbb930202e031fe2289f08a24fdfb39cfe71d2e4253d6d97933f75ad9108
7
+ data.tar.gz: 9aae07b58ecfc7e87dc4e274ceadf9772d8c0a06161448bd2e74173c72fcc4fef103e02d4ed83c3073c5b17db15aec86e290daad7b5719ddd01b49ad7f82be4f
data/exe/xezat CHANGED
@@ -5,7 +5,6 @@ Encoding.default_external = 'UTF-8'
5
5
 
6
6
  self_file =
7
7
  if File.symlink?(__FILE__)
8
- require 'pathname'
9
8
  Pathname.new(__FILE__).realpath
10
9
  else
11
10
  __FILE__
@@ -15,7 +15,7 @@ module Xezat
15
15
  File.dirname(file)
16
16
  end.sort.uniq.join(':')
17
17
  Xezat.logger.debug(" Additional PATH = #{additional_path.gsub(Regexp.new(variables[:D]), '')}")
18
- command = ['bash', File.expand_path(File.join(DATA_DIR, 'cygport_dep.sh')), cygport]
18
+ command = ['bash', File.expand_path(File.join(DATA_DIR, 'cygport.sh')), cygport, 'dep']
19
19
  result, error, status = Open3.capture3({ 'PATH' => "#{additional_path}:#{ENV.fetch('PATH')}" }, command.join(' '))
20
20
  Xezat.logger.warn(" Stderr = #{error}") unless error.empty?
21
21
  raise CygportProcessError, error unless status.success?
@@ -26,11 +26,11 @@ module Xezat
26
26
 
27
27
  def resolve_pseudo(pkg, pkgs)
28
28
  case pkg
29
- when 'python3'
30
- pkgs[:python39]
31
- when 'perl5_036'
29
+ when /^python3\s*/
30
+ pkgs[:python3]
31
+ when /^perl5_0\d{2}$/
32
32
  pkgs[:perl_base]
33
- when 'ruby_32'
33
+ when /^ruby_\d{2}$/
34
34
  pkgs[:ruby]
35
35
  else
36
36
  pkg
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+ require 'xezat'
5
+ require 'xezat/config'
6
+ require 'xezat/variables'
7
+
8
+ module Xezat
9
+ class NoDistDirectoryError < StandardError
10
+ end
11
+
12
+ module Command
13
+ class Dist
14
+ include Xezat
15
+
16
+ def initialize(options, cygport)
17
+ @options = options
18
+ @cygport = cygport
19
+ end
20
+
21
+ def execute
22
+ Xezat.logger.debug('Start distributing')
23
+ vars = variables(@cygport)
24
+
25
+ noop = @options[:noop]
26
+ verbose = @options[:noop] || @options[:verbose]
27
+
28
+ arch = vars[:ARCH]
29
+ release_dir = File.expand_path(File.join(get_dist_directory(@options), arch, 'release'))
30
+ pkg_dir = File.expand_path(File.join(release_dir, vars[:PN]))
31
+ dist_dir = File.expand_path(File.join(vars[:distdir], vars[:PN]))
32
+
33
+ if Dir.exist?(pkg_dir)
34
+ Xezat.logger.warn(" Package directory already exists : #{pkg_dir} (skip)")
35
+ else
36
+ Xezat.logger.debug(" Copy package to release directory : #{pkg_dir}")
37
+ FileUtils.cp_r(dist_dir, release_dir, noop:, verbose:)
38
+ end
39
+
40
+ Xezat.logger.debug('End distributing')
41
+ end
42
+
43
+ def get_dist_directory(options)
44
+ conf = config(options[:config])
45
+ dist_dir = conf['xezat']['distdir'] || options[:distdir]
46
+ raise NoDistDirectoryError if dist_dir.nil?
47
+
48
+ Xezat.logger.debug(" Dist directory: #{dist_dir}")
49
+ dist_dir
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+ require 'open3'
5
+ require 'xezat'
6
+ require 'xezat/variables'
7
+
8
+ module Xezat
9
+ module Command
10
+ class Prep
11
+ include Xezat
12
+
13
+ def initialize(options, cygport)
14
+ @options = options
15
+ @cygport = cygport
16
+ end
17
+
18
+ def execute
19
+ Xezat.logger.debug('Start prep')
20
+ invoke_cygport_command('fetch')
21
+ invoke_cygport_command('prep')
22
+ copy_readme_if_exists
23
+ Xezat.logger.debug('End prep')
24
+ end
25
+
26
+ private
27
+
28
+ def invoke_cygport_command(command)
29
+ Xezat.logger.debug(" Execute cygport #{command}")
30
+ script = File.expand_path(File.join(DATA_DIR, 'cygport.sh'))
31
+ output = +''
32
+ Open3.popen2e("bash #{script} #{@cygport} #{command}") do |_stdin, stdout_err, wait_thr|
33
+ stdout_err.each_line do |line|
34
+ $stdout.print(line)
35
+ $stdout.flush
36
+ output << line
37
+ end
38
+ raise CygportProcessError, output unless wait_thr.value.success?
39
+ end
40
+ end
41
+
42
+ def copy_readme_if_exists
43
+ vars = variables(@cygport)
44
+ cygport_dir = File.dirname(File.expand_path(@cygport))
45
+ readme_source = File.expand_path('README', cygport_dir)
46
+ readme_dest = File.expand_path('README', vars[:C])
47
+
48
+ return unless File.exist?(readme_source)
49
+
50
+ Xezat.logger.debug(" Copy README from #{readme_source} to #{readme_dest}")
51
+ FileUtils.cp(readme_source, readme_dest)
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'xezat'
4
+
5
+ module Xezat
6
+ module Command
7
+ class Validate
8
+ def validate_appstream_path(variables)
9
+ legacy_dir = File.join(variables[:D], '/usr/share/appdata')
10
+ Dir.glob('*', base: legacy_dir).each do |file|
11
+ Xezat.logger.error(" #{file} is in the legacy AppStream path /usr/share/appdata, move it to /usr/share/metainfo")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -30,10 +30,23 @@ module Xezat
30
30
  end
31
31
  end
32
32
 
33
+ EXECUTABLE_TIMEOUT = 5
34
+
33
35
  private
34
36
 
35
37
  def executable?(config)
36
- Open3.capture3(config.to_s)
38
+ Open3.popen3(config.to_s) do |stdin, stdout, stderr, wait_thr|
39
+ stdin.close
40
+ out_reader = Thread.new { stdout.read }
41
+ err_reader = Thread.new { stderr.read }
42
+ unless wait_thr.join(EXECUTABLE_TIMEOUT)
43
+ Process.kill(:KILL, wait_thr.pid)
44
+ wait_thr.join
45
+ raise "#{config} timed out after #{EXECUTABLE_TIMEOUT}s"
46
+ end
47
+ out_reader.join
48
+ err_reader.join
49
+ end
37
50
  rescue StandardError => e
38
51
  Xezat.logger.warn(" #{config} not executable: #{e}")
39
52
  raise e
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'net/http'
4
4
  require 'uri'
5
+ require 'xezat/command/validate/appstream'
5
6
  require 'xezat/command/validate/config'
6
7
  require 'xezat/command/validate/license'
7
8
  require 'xezat/command/validate/pkgconfig'
@@ -47,6 +48,9 @@ module Xezat
47
48
  Xezat.logger.debug(' Validate *-config')
48
49
  validate_config(vars, gcc_version)
49
50
 
51
+ Xezat.logger.debug(' Validate AppStream path')
52
+ validate_appstream_path(vars)
53
+
50
54
  Xezat.logger.debug('End validating')
51
55
  end
52
56
 
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xezat
4
+ module Detector
5
+ class GnomeCommon
6
+ def detect?(variables)
7
+ variables.key?(:_gnome2_CYGCLASS_)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -4,7 +4,7 @@ require 'find'
4
4
 
5
5
  module Xezat
6
6
  module Detector
7
- class Python39Docutils
7
+ class Python3Docutils
8
8
  def detect?(variables)
9
9
  Find.find(variables[:S]) do |file|
10
10
  next unless file.end_with?("#{File::SEPARATOR}configure.ac", "#{File::SEPARATOR}configure.in")
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'find'
4
+
5
+ module Xezat
6
+ module Detector
7
+ class Python3
8
+ def detect?(variables)
9
+ return true if Dir.glob(File.join(variables[:D], 'usr', 'lib', 'python3.*')).any? { |dir| File.directory?(dir) }
10
+
11
+ Find.find(variables[:D]) do |file|
12
+ next unless file.end_with?('.py')
13
+
14
+ first_line = File.readlines(file).first
15
+ return true if %r{^#!\s*/usr/bin/env\s*python(3(\.\d+)?)?\s*$}.match?(first_line)
16
+ return true if %r{^#!\s*/usr/bin/python(3(\.\d+)?)?\s*$}.match?(first_line)
17
+ end
18
+ false
19
+ end
20
+ end
21
+ end
22
+ end
@@ -27,9 +27,9 @@ module Xezat
27
27
  Xezat.logger.debug(" #{name} ... no")
28
28
  end
29
29
  end
30
- if tools.include?(:python27) && (tools.include?(:python36) || tools.include?(:python37))
31
- Xezat.logger.debug(' Remove python27 because of detecting python3x')
32
- tools.delete(:python27)
30
+ if tools.include?(:libtool) && tools.include?(:cmake)
31
+ Xezat.logger.debug(' Remove libtool because of detecting cmake')
32
+ tools.delete(:libtool)
33
33
  end
34
34
  tools
35
35
  end
data/lib/xezat/main.rb CHANGED
@@ -62,6 +62,15 @@ module Xezat
62
62
  Command::Port.new(options, cygport).execute
63
63
  end
64
64
 
65
+ desc 'dist cygport', 'Copy dist directory to release directory'
66
+ option :noop, type: :boolean, aliases: '-n', desc: 'dry run'
67
+ option :distdir, type: :string, aliases: '-d', desc: 'specify dist directory'
68
+
69
+ def dist(cygport)
70
+ require 'xezat/command/dist'
71
+ Command::Dist.new(options, cygport).execute
72
+ end
73
+
65
74
  desc 'validate cygport', 'Validate files'
66
75
  option :ignore, type: :boolean, aliases: '-i', desc: 'ignore error'
67
76
 
@@ -76,5 +85,12 @@ module Xezat
76
85
  require 'xezat/command/announce'
77
86
  Command::Announce.new(nil, cygport).execute
78
87
  end
88
+
89
+ desc 'prep cygport', 'Fetch and prepare sources'
90
+
91
+ def prep(cygport)
92
+ require 'xezat/command/prep'
93
+ Command::Prep.new(options, cygport).execute
94
+ end
79
95
  end
80
96
  end
data/lib/xezat/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Xezat
4
- VERSION = '0.4.0'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -4,14 +4,12 @@
4
4
  - archive
5
5
  - audio
6
6
  - base
7
- - benchmark
8
7
  - comm
9
8
  - database
10
9
  - debug
11
10
  - devel
12
11
  - doc
13
12
  - editors
14
- - emulators
15
13
  - games
16
14
  - gnome
17
15
  - graphics
@@ -22,8 +22,8 @@ Fortran Free Form:
22
22
  - gcc-core
23
23
  Lex:
24
24
  package: flex
25
- Lua:
26
- package: lua
25
+ #Lua:
26
+ # package: lua
27
27
  #Objective-C:
28
28
  # package: gcc-objc
29
29
  # dependencies:
@@ -34,11 +34,11 @@ Lua:
34
34
  # dependencies:
35
35
  # - binutils
36
36
  # - gcc-core
37
- Protocol Buffer:
38
- package: libprotobuf-devel
39
- Ragel:
40
- package: ragel
41
- Vala:
42
- package: vala
37
+ #Protocol Buffer:
38
+ # package: libprotobuf-devel
39
+ #Ragel:
40
+ # package: ragel
41
+ #Vala:
42
+ # package: vala
43
43
  Yacc:
44
44
  package: bison
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ export LANG=C
4
+
5
+ source ${CYGPORT:-/usr/bin/cygport} $*
data/xezat.gemspec CHANGED
@@ -40,12 +40,13 @@ Gem::Specification.new do |spec|
40
40
  spec.bindir = 'exe'
41
41
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
42
42
  spec.require_paths = ['lib']
43
- spec.required_ruby_version = '>= 3.2.2'
43
+ spec.required_ruby_version = '>= 4.0.5'
44
44
 
45
45
  spec.add_dependency 'bashvar', '>= 0.1.1'
46
46
  spec.add_dependency 'colorize', '>= 1.1.0'
47
47
  spec.add_dependency 'facets', '>= 3.1.0'
48
48
  spec.add_dependency 'github-linguist', '>= 9.1.0'
49
+ spec.add_dependency 'logger', '>= 1.6.0'
49
50
  spec.add_dependency 'pkg-config', '>= 1.6.1'
50
51
  spec.add_dependency 'spdx', '>= 4.1.5'
51
52
  spec.add_dependency 'thor', '>= 1.2.2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xezat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Fujimura (fd0)
@@ -65,6 +65,20 @@ dependencies:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: 9.1.0
68
+ - !ruby/object:Gem::Dependency
69
+ name: logger
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.6.0
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 1.6.0
68
82
  - !ruby/object:Gem::Dependency
69
83
  name: pkg-config
70
84
  requirement: !ruby/object:Gem::Requirement
@@ -244,11 +258,14 @@ files:
244
258
  - lib/xezat/command/bump/src_uri.rb
245
259
  - lib/xezat/command/bump/tool.rb
246
260
  - lib/xezat/command/debug.rb
261
+ - lib/xezat/command/dist.rb
247
262
  - lib/xezat/command/doctor.rb
248
263
  - lib/xezat/command/generate.rb
249
264
  - lib/xezat/command/init.rb
250
265
  - lib/xezat/command/port.rb
266
+ - lib/xezat/command/prep.rb
251
267
  - lib/xezat/command/validate.rb
268
+ - lib/xezat/command/validate/appstream.rb
252
269
  - lib/xezat/command/validate/config.rb
253
270
  - lib/xezat/command/validate/license.rb
254
271
  - lib/xezat/command/validate/pkgconfig.rb
@@ -268,6 +285,7 @@ files:
268
285
  - lib/xezat/detector/font-util.rb
269
286
  - lib/xezat/detector/gengetopt.rb
270
287
  - lib/xezat/detector/gettext-devel.rb
288
+ - lib/xezat/detector/gnome-common.rb
271
289
  - lib/xezat/detector/gnulib.rb
272
290
  - lib/xezat/detector/gobject-introspection.rb
273
291
  - lib/xezat/detector/halibut.rb
@@ -277,12 +295,8 @@ files:
277
295
  - lib/xezat/detector/meson.rb
278
296
  - lib/xezat/detector/nasm.rb
279
297
  - lib/xezat/detector/ninja.rb
280
- - lib/xezat/detector/python27.rb
281
- - lib/xezat/detector/python36.rb
282
- - lib/xezat/detector/python37.rb
283
- - lib/xezat/detector/python38.rb
284
- - lib/xezat/detector/python39-docutils.rb
285
- - lib/xezat/detector/python39.rb
298
+ - lib/xezat/detector/python3-docutils.rb
299
+ - lib/xezat/detector/python3.rb
286
300
  - lib/xezat/detector/roundup.rb
287
301
  - lib/xezat/detector/waf.rb
288
302
  - lib/xezat/detector/xorg-util-macros.rb
@@ -300,7 +314,7 @@ files:
300
314
  - share/xezat/bashvar.sh
301
315
  - share/xezat/categories.yaml
302
316
  - share/xezat/compilers.yaml
303
- - share/xezat/cygport_dep.sh
317
+ - share/xezat/cygport.sh
304
318
  - share/xezat/languages.yaml
305
319
  - share/xezat/repository/bitbucket.yaml
306
320
  - share/xezat/repository/github.yaml
@@ -327,14 +341,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
327
341
  requirements:
328
342
  - - ">="
329
343
  - !ruby/object:Gem::Version
330
- version: 3.2.2
344
+ version: 4.0.5
331
345
  required_rubygems_version: !ruby/object:Gem::Requirement
332
346
  requirements:
333
347
  - - ">="
334
348
  - !ruby/object:Gem::Version
335
349
  version: '0'
336
350
  requirements: []
337
- rubygems_version: 3.6.9
351
+ rubygems_version: 4.0.10
338
352
  specification_version: 4
339
353
  summary: xezat helps you win at cygport.
340
354
  test_files: []
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'find'
4
-
5
- module Xezat
6
- module Detector
7
- class Python27
8
- def detect?(variables)
9
- return true if File.directory?(File.join(variables[:D], 'usr', 'lib', 'python2.7'))
10
-
11
- Find.find(variables[:D]) do |file|
12
- next unless file.end_with?('.py')
13
-
14
- first_line = File.readlines(file).first
15
- return true if %r{^#!\s*/usr/bin/env\s*python2\s*$}.match?(first_line)
16
- return true if %r{^#!\s*/usr/bin/env\s*python2.7\s*$}.match?(first_line)
17
- return true if %r{^#!\s*/usr/bin/python2\s*$}.match?(first_line)
18
- return true if %r{^#!\s*/usr/bin/python2.7\s*$}.match?(first_line)
19
- end
20
- false
21
- end
22
- end
23
- end
24
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'find'
4
-
5
- module Xezat
6
- module Detector
7
- class Python36
8
- def detect?(variables)
9
- return true if File.directory?(File.join(variables[:D], 'usr', 'lib', 'python3.6'))
10
-
11
- Find.find(variables[:D]) do |file|
12
- next unless file.end_with?('.py')
13
-
14
- first_line = File.readlines(file).first
15
- return true if %r{^#!\s*/usr/bin/env\s*python3.6\s*$}.match?(first_line)
16
- return true if %r{^#!\s*/usr/bin/python3.6\s*$}.match?(first_line)
17
- end
18
- false
19
- end
20
- end
21
- end
22
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'find'
4
-
5
- module Xezat
6
- module Detector
7
- class Python37
8
- def detect?(variables)
9
- return true if File.directory?(File.join(variables[:D], 'usr', 'lib', 'python3.7'))
10
-
11
- Find.find(variables[:D]) do |file|
12
- next unless file.end_with?('.py')
13
-
14
- first_line = File.readlines(file).first
15
- return true if %r{^#!\s*/usr/bin/env\s*python3.7\s*$}.match?(first_line)
16
- return true if %r{^#!\s*/usr/bin/python3.7\s*$}.match?(first_line)
17
- end
18
- false
19
- end
20
- end
21
- end
22
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'find'
4
-
5
- module Xezat
6
- module Detector
7
- class Python38
8
- def detect?(variables)
9
- return true if File.directory?(File.join(variables[:D], 'usr', 'lib', 'python3.8'))
10
-
11
- Find.find(variables[:D]) do |file|
12
- next unless file.end_with?('.py')
13
-
14
- first_line = File.readlines(file).first
15
- return true if %r{^#!\s*/usr/bin/env\s*python3.8\s*$}.match?(first_line)
16
- return true if %r{^#!\s*/usr/bin/python3.8\s*$}.match?(first_line)
17
- end
18
- false
19
- end
20
- end
21
- end
22
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'find'
4
-
5
- module Xezat
6
- module Detector
7
- class Python39
8
- def detect?(variables)
9
- return true if File.directory?(File.join(variables[:D], 'usr', 'lib', 'python3.9'))
10
-
11
- Find.find(variables[:D]) do |file|
12
- next unless file.end_with?('.py')
13
-
14
- first_line = File.readlines(file).first
15
- return true if %r{^#!\s*/usr/bin/env\s*python\s*$}.match?(first_line)
16
- return true if %r{^#!\s*/usr/bin/env\s*python3\s*$}.match?(first_line)
17
- return true if %r{^#!\s*/usr/bin/env\s*python3.9\s*$}.match?(first_line)
18
- return true if %r{^#!\s*/usr/bin/python\s*$}.match?(first_line)
19
- return true if %r{^#!\s*/usr/bin/python3\s*$}.match?(first_line)
20
- return true if %r{^#!\s*/usr/bin/python3.9\s*$}.match?(first_line)
21
- end
22
- false
23
- end
24
- end
25
- end
26
- end
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
-
3
- export LANG=C
4
-
5
- source ${CYGPORT:-/usr/bin/cygport} $* dep