xezat 0.2.2 → 0.2.3
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 +4 -4
- data/.rubocop.yml +1 -1
- data/lib/xezat/command/bump/compiler.rb +2 -2
- data/lib/xezat/command/bump/cygport_dep.rb +2 -2
- data/lib/xezat/command/bump/development_package.rb +29 -4
- data/lib/xezat/command/bump/language.rb +2 -2
- data/lib/xezat/command/bump.rb +6 -7
- data/lib/xezat/command/generate.rb +2 -1
- data/lib/xezat/command/init.rb +2 -2
- data/lib/xezat/command/validate/config.rb +40 -0
- data/lib/xezat/command/validate/license.rb +30 -0
- data/lib/xezat/command/validate/pkgconfig.rb +37 -0
- data/lib/xezat/command/validate.rb +17 -23
- data/lib/xezat/cygversion.rb +2 -0
- data/lib/xezat/detector/cmake.rb +1 -4
- data/lib/xezat/detector/{python38-docutils.rb → python39-docutils.rb} +1 -1
- data/lib/xezat/generator/pkgconfig.rb +32 -10
- data/lib/xezat/variables.rb +18 -3
- data/lib/xezat/version.rb +1 -1
- data/share/xezat/compilers.yaml +44 -0
- data/share/xezat/{invoke_cygport_dep.sh → cygport_dep.sh} +0 -0
- data/share/xezat/languages.yaml +11 -0
- data/share/xezat/repository/bitbucket.yaml +4 -0
- data/share/xezat/repository/github.yaml +4 -0
- data/share/xezat/repository/gnu.yaml +3 -0
- data/share/xezat/repository/savannah.yaml +3 -0
- data/share/xezat/repository/sourceforge.yaml +5 -0
- data/share/xezat/template/cmake.erb +6 -8
- data/share/xezat/template/cygport.erb +4 -0
- data/share/xezat/{show_cygport_variable.sh → var2yaml.sh} +3 -2
- data/xezat.gemspec +6 -5
- metadata +40 -23
- data/share/xezat/compilers.json +0 -67
- data/share/xezat/languages.json +0 -12
- data/share/xezat/repository/bitbucket.json +0 -5
- data/share/xezat/repository/github.json +0 -5
- data/share/xezat/repository/gnu.json +0 -4
- data/share/xezat/repository/savannah.json +0 -4
- data/share/xezat/repository/sourceforge.json +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0053db8d2a6f202e9aa40b7454f00f8ced3fdacd2c174944bec6c02a2ae106c4
|
4
|
+
data.tar.gz: 5abd0d6bd506b6a44ca306675e7b37b81d8834ff12d1165f47ad2c100ec87fcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb736dd2128a11b7b249db02e58732b54578085808f3e8d4ad36cfa74741ae2583194e3337b810d82e2a048cf9f7a893e9df1941d589e8953de270abe1799196
|
7
|
+
data.tar.gz: f8a26d86744acd8391b21c89db39afe00a880bf26b2660de5fc51d04ccae070a0e2761f650dea28c32a38cfc4b757f739b7baf4cad74aad5a480a4585e89e2dd
|
data/.rubocop.yml
CHANGED
@@ -7,8 +7,8 @@ module Xezat
|
|
7
7
|
class Bump
|
8
8
|
def get_compilers(languages, _variables)
|
9
9
|
Xezat.logger.debug(' Collect compilers')
|
10
|
-
compiler_file = File.expand_path(File.join(DATA_DIR, 'compilers.
|
11
|
-
compiler_candidates =
|
10
|
+
compiler_file = File.expand_path(File.join(DATA_DIR, 'compilers.yaml'))
|
11
|
+
compiler_candidates = YAML.safe_load(File.open(compiler_file), [Symbol])
|
12
12
|
compilers = []
|
13
13
|
languages.uniq.each do |language|
|
14
14
|
next unless compiler_candidates.key?(language)
|
@@ -14,8 +14,8 @@ module Xezat
|
|
14
14
|
additional_path = candidate_files.map do |file|
|
15
15
|
File.dirname(file)
|
16
16
|
end.sort.uniq.join(':')
|
17
|
-
command = ['bash', File.expand_path(File.join(DATA_DIR, '
|
18
|
-
result, error, status = Open3.capture3({ 'PATH' => "#{ENV
|
17
|
+
command = ['bash', File.expand_path(File.join(DATA_DIR, 'cygport_dep.sh')), cygport]
|
18
|
+
result, error, status = Open3.capture3({ 'PATH' => "#{ENV.fetch('PATH')}:#{additional_path}" }, command.join(' '))
|
19
19
|
raise CygportProcessError, error unless status.success?
|
20
20
|
|
21
21
|
result
|
@@ -8,17 +8,42 @@ require 'xezat/command/bump/tool'
|
|
8
8
|
module Xezat
|
9
9
|
module Command
|
10
10
|
class Bump
|
11
|
-
def get_development_packages(variables, packages)
|
11
|
+
def get_development_packages(variables, packages, runtimes, pkg2files)
|
12
12
|
Xezat.logger.debug(' Collect development packages')
|
13
13
|
compilers = get_compilers(get_languages(variables[:S]), variables)
|
14
14
|
tools = get_tools(variables)
|
15
15
|
build_requires = variables[:BUILD_REQUIRES].nil? ? [] : variables[:BUILD_REQUIRES].split.map(&:to_sym)
|
16
|
-
development_packages = (compilers + tools + build_requires + [:cygport]).uniq
|
17
|
-
|
16
|
+
development_packages = (compilers + tools + build_requires + [:cygport]).uniq
|
17
|
+
|
18
|
+
resolve_development_package(development_packages)
|
19
|
+
|
20
|
+
# Check gcc-gfortran
|
21
|
+
if runtimes.grep(/^libgfortran/).empty?
|
22
|
+
delete_fortran = true
|
23
|
+
pkg2files.each_value do |files|
|
24
|
+
delete_fortran = false unless files.grep(/\.mod$/).empty?
|
25
|
+
end
|
26
|
+
development_packages.delete(:'gcc-fortran') if delete_fortran
|
27
|
+
end
|
28
|
+
|
29
|
+
development_packages.sort!
|
30
|
+
|
18
31
|
development_packages.map! do |package|
|
19
|
-
packages[package]
|
32
|
+
pkg = packages[package]
|
33
|
+
raise "Package #{package} is not installed in your system" if pkg.nil?
|
34
|
+
|
35
|
+
pkg
|
20
36
|
end
|
21
37
|
end
|
38
|
+
|
39
|
+
def resolve_development_package(development_packages)
|
40
|
+
# Check libssl duplication
|
41
|
+
development_packages.delete(:'libssl-devel') if development_packages.include?(:'libssl1.0-devel')
|
42
|
+
|
43
|
+
# Check lua duplication
|
44
|
+
development_packages.delete(:lua) if development_packages.include?(:'lua5.1-devel')
|
45
|
+
development_packages.delete(:lua) if development_packages.include?(:'luajit-devel')
|
46
|
+
end
|
22
47
|
end
|
23
48
|
end
|
24
49
|
end
|
@@ -8,8 +8,8 @@ module Xezat
|
|
8
8
|
class Bump
|
9
9
|
def get_languages(top_src_dir)
|
10
10
|
Xezat.logger.debug(' Collect languages')
|
11
|
-
languages_file = File.expand_path(File.join(DATA_DIR, 'languages.
|
12
|
-
languages_candidates =
|
11
|
+
languages_file = File.expand_path(File.join(DATA_DIR, 'languages.yaml'))
|
12
|
+
languages_candidates = YAML.safe_load(File.open(languages_file), [Symbol])
|
13
13
|
languages = []
|
14
14
|
Find.find(top_src_dir) do |path|
|
15
15
|
next if FileTest.directory?(path)
|
data/lib/xezat/command/bump.rb
CHANGED
@@ -30,13 +30,12 @@ module Xezat
|
|
30
30
|
vars = variables(@cygport)
|
31
31
|
readme_file = File.expand_path(File.join(vars[:C], 'README'))
|
32
32
|
|
33
|
-
info = {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
}
|
33
|
+
info = {}
|
34
|
+
info[:src_uri] = get_src_uri(vars)
|
35
|
+
info[:runtimes] = get_runtime_packages(vars, pkgs, @cygport)
|
36
|
+
info[:files] = get_files(vars)
|
37
|
+
info[:developments] = get_development_packages(vars, pkgs, info[:runtimes], info[:files])
|
38
|
+
info[:changelog] = get_changelog(vars, @options, readme_file)
|
40
39
|
|
41
40
|
Xezat.logger.debug(' Write ChangeLog atomically')
|
42
41
|
File.atomic_write(readme_file) do |f|
|
@@ -5,8 +5,9 @@ require 'thor'
|
|
5
5
|
module Xezat
|
6
6
|
module Command
|
7
7
|
class Generate < Thor
|
8
|
-
desc '
|
8
|
+
desc 'pkgconfig cygport', 'Generate *.pc'
|
9
9
|
option :overwrite, type: :boolean, aliases: '-o', desc: 'overwrite *.pc'
|
10
|
+
option :srcdir, type: :string, aliases: '-s', desc: 'relative path to Makefile.am / CMakeLists.txt'
|
10
11
|
|
11
12
|
def pkgconfig(cygport)
|
12
13
|
require 'xezat/generator/pkgconfig'
|
data/lib/xezat/command/init.rb
CHANGED
@@ -41,10 +41,10 @@ module Xezat
|
|
41
41
|
|
42
42
|
def get_repository_variables(repository)
|
43
43
|
if repository
|
44
|
-
repository_file = File.expand_path(File.join(REPOSITORY_DIR, "#{repository}.
|
44
|
+
repository_file = File.expand_path(File.join(REPOSITORY_DIR, "#{repository}.yaml"))
|
45
45
|
raise NoSuchRepositoryError, "No such repository: #{template}" unless FileTest.exist?(repository_file) || FileTest.readable?(repository_file)
|
46
46
|
|
47
|
-
|
47
|
+
YAML.safe_load(File.open(repository_file), symbolize_names: true)
|
48
48
|
else
|
49
49
|
{
|
50
50
|
HOMEPAGE: '',
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pkg-config'
|
4
|
+
require 'xezat'
|
5
|
+
|
6
|
+
module Xezat
|
7
|
+
module Command
|
8
|
+
class Validate
|
9
|
+
def validate_config(variables, gcc_version)
|
10
|
+
configs = Dir.glob(File.join(variables[:D], '/usr/bin/*-config'))
|
11
|
+
configs.each do |config|
|
12
|
+
basename = File.basename(config)
|
13
|
+
Xezat.logger.debug(" #{basename} found")
|
14
|
+
|
15
|
+
result, _, status = Open3.capture3("#{config} --cflags")
|
16
|
+
if status.success?
|
17
|
+
Xezat.logger.debug(" cflags = #{result.strip}")
|
18
|
+
else
|
19
|
+
Xezat.logger.warn(' cflags not supported')
|
20
|
+
end
|
21
|
+
|
22
|
+
result, _, status = Open3.capture3("#{config} --cxxflags")
|
23
|
+
if status.success?
|
24
|
+
Xezat.logger.debug(" cxxflags = #{result.strip}")
|
25
|
+
else
|
26
|
+
Xezat.logger.warn(' cxxflags not supported')
|
27
|
+
end
|
28
|
+
|
29
|
+
result, _, status = Open3.capture3("#{config} --libs")
|
30
|
+
if status.success?
|
31
|
+
Xezat.logger.debug(" libs = #{result.strip}")
|
32
|
+
validate_libs(variables, result.strip, gcc_version)
|
33
|
+
else
|
34
|
+
Xezat.logger.warn(' libs not supported')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spdx'
|
4
|
+
require 'xezat'
|
5
|
+
|
6
|
+
module Xezat
|
7
|
+
module Command
|
8
|
+
class Validate
|
9
|
+
def validate_license(vars)
|
10
|
+
license = vars[:LICENSE]
|
11
|
+
if license.nil? || license.empty?
|
12
|
+
Xezat.logger.warn(' LICENSE is not defined')
|
13
|
+
elsif Spdx.valid?(license)
|
14
|
+
Xezat.logger.debug(" LICENSE = #{license}")
|
15
|
+
else
|
16
|
+
Xezat.logger.error(" LICENSE = #{license} (invalid)")
|
17
|
+
end
|
18
|
+
|
19
|
+
license_uri = vars[:LICENSE_URI]
|
20
|
+
if license_uri.nil? || license_uri.empty?
|
21
|
+
Xezat.logger.warn(' LICENSE_URI is not defined')
|
22
|
+
elsif File.exist?(File.join(vars[:S], license_uri))
|
23
|
+
Xezat.logger.debug(" LICENSE_URI = #{license_uri}")
|
24
|
+
else
|
25
|
+
Xezat.logger.error(" LICENSE_URI = #{license_uri} (not found)")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pkg-config'
|
4
|
+
require 'xezat'
|
5
|
+
|
6
|
+
module Xezat
|
7
|
+
module Command
|
8
|
+
class Validate
|
9
|
+
def validate_pkgconfig(variables, gcc_version)
|
10
|
+
pkgconfig_path = File.join(variables[:D], 'usr', 'lib', 'pkgconfig')
|
11
|
+
PKGConfig.add_path(pkgconfig_path)
|
12
|
+
Dir.glob('*.pc', 0, base: pkgconfig_path).each do |pc|
|
13
|
+
Xezat.logger.debug(" #{pc} found")
|
14
|
+
basename = File.basename(pc, '.pc')
|
15
|
+
|
16
|
+
modversion = PKGConfig.modversion(basename)
|
17
|
+
Xezat.logger.debug(" modversion = #{modversion}")
|
18
|
+
pv = variables[:PV][0].gsub(/\+.+$/, '')
|
19
|
+
Xezat.logger.error(" modversion differs from $PN = #{pv}") unless modversion == pv
|
20
|
+
|
21
|
+
prefix = PKGConfig.variable(basename, 'prefix')
|
22
|
+
if prefix.nil? || prefix.empty? || prefix.eql?('/usr')
|
23
|
+
Xezat.logger.debug(" prefix = #{prefix}")
|
24
|
+
else
|
25
|
+
Xezat.logger.warn(" prefix = #{prefix} (not standard)")
|
26
|
+
end
|
27
|
+
|
28
|
+
Xezat.logger.debug(" cflags = #{PKGConfig.cflags(basename)}")
|
29
|
+
|
30
|
+
libs = PKGConfig.libs(basename)
|
31
|
+
Xezat.logger.debug(" libs = #{libs}")
|
32
|
+
validate_libs(variables, libs, gcc_version)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,8 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'net/http'
|
4
|
-
require 'pkg-config'
|
5
4
|
require 'uri'
|
5
|
+
require 'xezat/command/validate/config'
|
6
|
+
require 'xezat/command/validate/license'
|
7
|
+
require 'xezat/command/validate/pkgconfig'
|
8
|
+
require 'xezat/cygversion'
|
6
9
|
require 'xezat/packages'
|
7
10
|
require 'xezat/variables'
|
8
11
|
|
@@ -21,6 +24,8 @@ module Xezat
|
|
21
24
|
vars = variables(@cygport)
|
22
25
|
pkgs = packages
|
23
26
|
|
27
|
+
gcc_version = Cygversion.new(pkgs[:'gcc-core'].gsub(/^gcc-core-/, '')).version.split('.')[0]
|
28
|
+
|
24
29
|
Xezat.logger.debug(' Validate .cygport')
|
25
30
|
validate_cygport(@cygport)
|
26
31
|
|
@@ -30,11 +35,17 @@ module Xezat
|
|
30
35
|
Xezat.logger.debug(' Validate homepage')
|
31
36
|
validate_homepage(vars[:HOMEPAGE])
|
32
37
|
|
38
|
+
Xezat.logger.debug(' Validate licenses')
|
39
|
+
validate_license(vars)
|
40
|
+
|
33
41
|
Xezat.logger.debug(' Validate BUILD_REQUIRES')
|
34
42
|
validate_build_requires(vars[:BUILD_REQUIRES], pkgs)
|
35
43
|
|
36
44
|
Xezat.logger.debug(' Validate *.pc')
|
37
|
-
validate_pkgconfig(vars)
|
45
|
+
validate_pkgconfig(vars, gcc_version)
|
46
|
+
|
47
|
+
Xezat.logger.debug(' Validate *-config')
|
48
|
+
validate_config(vars, gcc_version)
|
38
49
|
|
39
50
|
Xezat.logger.debug('End validating')
|
40
51
|
end
|
@@ -54,9 +65,9 @@ module Xezat
|
|
54
65
|
response = Net::HTTP.get_response(URI.parse(homepage))
|
55
66
|
code = response.code
|
56
67
|
if code == '200'
|
57
|
-
Xezat.logger.debug(" code = #{
|
68
|
+
Xezat.logger.debug(" code = #{code}")
|
58
69
|
else
|
59
|
-
Xezat.logger.error(" code = #{
|
70
|
+
Xezat.logger.error(" code = #{code}")
|
60
71
|
end
|
61
72
|
rescue OpenSSL::SSL::SSLError => e
|
62
73
|
raise e unless @options[:ignore]
|
@@ -77,25 +88,8 @@ module Xezat
|
|
77
88
|
end
|
78
89
|
end
|
79
90
|
|
80
|
-
def
|
81
|
-
|
82
|
-
PKGConfig.add_path(pkgconfig_path)
|
83
|
-
Dir.glob('*.pc', 0, base: pkgconfig_path).each do |pc|
|
84
|
-
basename = File.basename(pc, '.pc')
|
85
|
-
Xezat.logger.debug(" #{basename}.pc found")
|
86
|
-
modversion = PKGConfig.modversion(basename)
|
87
|
-
Xezat.logger.debug(" modversion = #{modversion}")
|
88
|
-
pv = variables[:PV][0].gsub(/\+.+$/, '')
|
89
|
-
Xezat.logger.error(" modversion differs from $PN = #{pv}") unless modversion == pv
|
90
|
-
Xezat.logger.debug(" cflags = #{PKGConfig.cflags(basename)}")
|
91
|
-
libs = PKGConfig.libs(basename)
|
92
|
-
Xezat.logger.debug(" libs = #{libs}")
|
93
|
-
validate_libs(variables, libs)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def validate_libs(variables, libs)
|
98
|
-
lib_dirs = [File.join(variables[:D], '/usr/lib'), '/usr/lib', '/usr/lib/w32api', '/usr/lib/gcc/x86_64-pc-cygwin/11']
|
91
|
+
def validate_libs(variables, libs, gcc_version)
|
92
|
+
lib_dirs = [File.join(variables[:D], '/usr/lib'), '/usr/lib', '/usr/lib/w32api', "/usr/lib/gcc/x86_64-pc-cygwin/#{gcc_version}"]
|
99
93
|
libs.split do |option|
|
100
94
|
if option.start_with?('-l')
|
101
95
|
lib_name = option[2, 255] # Assume file length limit
|
data/lib/xezat/cygversion.rb
CHANGED
data/lib/xezat/detector/cmake.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'English'
|
3
4
|
require 'facets/file/atomic_open'
|
4
5
|
require 'facets/file/atomic_write'
|
5
6
|
require 'xezat/variables'
|
@@ -21,22 +22,29 @@ module Xezat
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def generate
|
25
|
+
Xezat.logger.debug('Start package config generation')
|
24
26
|
vars = variables(@cygport)
|
25
27
|
generate_pkg_config(vars, @options)
|
26
28
|
|
27
29
|
if vars[:_cmake_CYGCLASS_]
|
28
|
-
append_commands_to_cmakelists(vars)
|
30
|
+
append_commands_to_cmakelists(vars, @options)
|
29
31
|
else
|
30
|
-
append_commands_to_autotools(vars)
|
32
|
+
append_commands_to_autotools(vars, @options)
|
31
33
|
end
|
34
|
+
Xezat.logger.debug('End package config generation')
|
32
35
|
end
|
33
36
|
|
34
37
|
def generate_pkg_config(variables, options)
|
35
38
|
srcdir = variables[:CYGCONF_SOURCE] || variables[:CYGCMAKE_SOURCE] || variables[:S]
|
39
|
+
srcdir = File.expand_path(File.join(variables[:S], options['srcdir'])) if options['srcdir']
|
40
|
+
Xezat.logger.debug(" srcdir = #{srcdir}")
|
41
|
+
|
36
42
|
pn = variables[:PN]
|
37
43
|
pc = File.expand_path(File.join(srcdir, "#{pn}.pc.in"))
|
38
44
|
raise UnregeneratableConfigurationError, "#{pn}.pc.in already exists" if File.exist?(pc) && !options['overwrite']
|
39
45
|
|
46
|
+
Xezat.logger.debug(' Generate pc')
|
47
|
+
|
40
48
|
File.atomic_write(pc) do |f|
|
41
49
|
f.write(get_pkg_config(variables))
|
42
50
|
end
|
@@ -47,10 +55,16 @@ module Xezat
|
|
47
55
|
ERB.new(File.readlines(erb).join(nil), trim_mode: '%-').result(binding)
|
48
56
|
end
|
49
57
|
|
50
|
-
def append_commands_to_cmakelists(variables)
|
58
|
+
def append_commands_to_cmakelists(variables, options)
|
51
59
|
srcdir = variables[:CYGCMAKE_SOURCE] || variables[:S]
|
60
|
+
srcdir = File.expand_path(File.join(variables[:S], options['srcdir'])) if options['srcdir']
|
52
61
|
cmakelists = File.expand_path(File.join(srcdir, 'CMakeLists.txt'))
|
53
|
-
|
62
|
+
if %r!DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig!.match?(File.read(cmakelists))
|
63
|
+
Xezat.logger.debug(' Not rewrite CMakeLists.txt')
|
64
|
+
return
|
65
|
+
end
|
66
|
+
|
67
|
+
Xezat.logger.debug(' Rewrite CMakeLists.txt')
|
54
68
|
|
55
69
|
File.atomic_open(cmakelists, 'a') do |f|
|
56
70
|
f.write(get_cmakelists(variables))
|
@@ -62,8 +76,9 @@ module Xezat
|
|
62
76
|
ERB.new(File.readlines(erb).join(nil), trim_mode: '%-').result(binding)
|
63
77
|
end
|
64
78
|
|
65
|
-
def append_commands_to_autotools(variables)
|
79
|
+
def append_commands_to_autotools(variables, options)
|
66
80
|
srcdir = variables[:CYGCONF_SOURCE] || variables[:S]
|
81
|
+
srcdir = File.expand_path(File.join(variables[:S], options['srcdir'])) if options['srcdir']
|
67
82
|
pn = variables[:PN]
|
68
83
|
configure_ac = File.expand_path(File.join(srcdir, 'configure.ac'))
|
69
84
|
configure_ac = File.expand_path(File.join(srcdir, 'configure.in')) unless File.exist?(configure_ac)
|
@@ -71,16 +86,23 @@ module Xezat
|
|
71
86
|
|
72
87
|
original_ac = File.read(configure_ac)
|
73
88
|
|
74
|
-
|
89
|
+
if /#{pn}.pc/.match?(original_ac)
|
90
|
+
Xezat.logger.debug(" Not rewrite #{configure_ac}")
|
91
|
+
return
|
92
|
+
end
|
93
|
+
|
94
|
+
rewritten_ac = original_ac.gsub(/^AC_OUTPUT$/, "AC_CONFIG_FILES([#{pn}.pc])#{$INPUT_RECORD_SEPARATOR}AC_OUTPUT")
|
75
95
|
|
76
|
-
|
77
|
-
|
78
|
-
fa.write(original_ac)
|
96
|
+
File.atomic_open(configure_ac, 'w') do |fa|
|
97
|
+
fa.write(rewritten_ac)
|
79
98
|
|
80
99
|
makefile_am = File.expand_path(File.join(srcdir, 'Makefile.am'))
|
81
100
|
raise AutotoolsFileNotFoundError unless File.exist?(makefile_am)
|
82
101
|
|
83
|
-
|
102
|
+
if /pkgconfig_DATA/.match?(File.read(makefile_am))
|
103
|
+
Xezat.logger.debug(" Not rewrite #{makefile_am}")
|
104
|
+
break
|
105
|
+
end
|
84
106
|
|
85
107
|
commands_am = File.read(File.expand_path(File.join(TEMPLATE_DIR, 'Makefile.am')))
|
86
108
|
File.atomic_open(makefile_am, 'a') do |fm|
|
data/lib/xezat/variables.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'English'
|
3
4
|
require 'etc'
|
4
5
|
require 'facets/file/atomic_write'
|
5
6
|
require 'facets/string/word_wrap'
|
@@ -22,15 +23,21 @@ module Xezat
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
command = ['bash', File.expand_path(File.join(DATA_DIR, '
|
26
|
+
command = ['bash', File.expand_path(File.join(DATA_DIR, 'var2yaml.sh')), cygport]
|
26
27
|
result, error, status = Open3.capture3(command.join(' '))
|
27
28
|
raise CygportProcessError, error unless status.success?
|
28
29
|
|
29
30
|
result.gsub!(/^.*\*\*\*.*$/, '')
|
30
31
|
|
31
|
-
|
32
|
-
|
32
|
+
begin
|
33
|
+
variables = YAML.safe_load(result, [Symbol]).each_value do |v|
|
34
|
+
v.strip! if v.respond_to?(:strip)
|
35
|
+
end
|
36
|
+
rescue Psych::SyntaxError => e
|
37
|
+
print_yaml(result)
|
38
|
+
raise e
|
33
39
|
end
|
40
|
+
|
34
41
|
variables[:DESCRIPTION].word_wrap!(79)
|
35
42
|
|
36
43
|
File.atomic_write(cache_file) do |f|
|
@@ -40,4 +47,12 @@ module Xezat
|
|
40
47
|
|
41
48
|
variables
|
42
49
|
end
|
50
|
+
|
51
|
+
def print_yaml(result)
|
52
|
+
lineno = 1
|
53
|
+
result.split($INPUT_RECORD_SEPARATOR).each do |line|
|
54
|
+
printf '%<lineno>5d | %<line>s%<ls>s', lineno: lineno, line: line, ls: $INPUT_RECORD_SEPARATOR
|
55
|
+
lineno += 1
|
56
|
+
end
|
57
|
+
end
|
43
58
|
end
|
data/lib/xezat/version.rb
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
Bison:
|
3
|
+
package: bison
|
4
|
+
C:
|
5
|
+
package: gcc-core
|
6
|
+
dependencies:
|
7
|
+
- binutils
|
8
|
+
C++:
|
9
|
+
package: gcc-g++
|
10
|
+
dependencies:
|
11
|
+
- binutils
|
12
|
+
- gcc-core
|
13
|
+
Fortran:
|
14
|
+
package: gcc-fortran
|
15
|
+
dependencies:
|
16
|
+
- binutils
|
17
|
+
- gcc-core
|
18
|
+
Fortran Free Form:
|
19
|
+
package: gcc-fortran
|
20
|
+
dependencies:
|
21
|
+
- binutils
|
22
|
+
- gcc-core
|
23
|
+
Lex:
|
24
|
+
package: flex
|
25
|
+
Lua:
|
26
|
+
package: lua
|
27
|
+
#Objective-C:
|
28
|
+
# package: gcc-objc
|
29
|
+
# dependencies:
|
30
|
+
# - binutils
|
31
|
+
# - gcc-core
|
32
|
+
#Objective-C++:
|
33
|
+
# package: gcc-objc++
|
34
|
+
# dependencies:
|
35
|
+
# - binutils
|
36
|
+
# - gcc-core
|
37
|
+
Protocol Buffer:
|
38
|
+
package: libprotobuf-devel
|
39
|
+
Ragel:
|
40
|
+
package: ragel
|
41
|
+
Vala:
|
42
|
+
package: vala
|
43
|
+
Yacc:
|
44
|
+
package: bison
|
File without changes
|
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
install(FILES ${CMAKE_BINARY_DIR}/<%= variables[:PN] %>.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
|
8
|
-
endif()
|
1
|
+
set(prefix ${CMAKE_INSTALL_PREFIX})
|
2
|
+
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
3
|
+
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
|
4
|
+
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
|
5
|
+
configure_file(${CMAKE_SOURCE_DIR}/<%= variables[:PN] %>.pc.in ${CMAKE_BINARY_DIR}/<%= variables[:PN] %>.pc @ONLY)
|
6
|
+
install(FILES ${CMAKE_BINARY_DIR}/<%= variables[:PN] %>.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
|
3
|
+
var2yaml()
|
4
4
|
{
|
5
5
|
for var in `compgen -A variable`
|
6
6
|
do
|
@@ -8,6 +8,7 @@ show_cygport_variables()
|
|
8
8
|
[ $var = 'COMP_WORDBREAKS' ] && continue
|
9
9
|
[ $var = 'HOMEPATH' ] && continue
|
10
10
|
[ $var = 'PERL_MB_OPT' ] && continue
|
11
|
+
[ $var = 'PSModulePath' ] && continue
|
11
12
|
[[ ${!var} =~ ^[A-Za-z]:.* ]] && continue
|
12
13
|
|
13
14
|
echo -n :$var:
|
@@ -28,4 +29,4 @@ show_cygport_variables()
|
|
28
29
|
done
|
29
30
|
}
|
30
31
|
|
31
|
-
source ${CYGPORT:-/usr/bin/cygport} $*
|
32
|
+
source ${CYGPORT:-/usr/bin/cygport} $* var2yaml
|
data/xezat.gemspec
CHANGED
@@ -24,18 +24,19 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.required_ruby_version = '>= 2.6.4'
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'facets', '>= 3.1.0'
|
27
|
-
spec.add_runtime_dependency 'github-linguist', '>= 7.
|
28
|
-
spec.add_runtime_dependency 'pkg-config', '>= 1.4.
|
27
|
+
spec.add_runtime_dependency 'github-linguist', '>= 7.21.0'
|
28
|
+
spec.add_runtime_dependency 'pkg-config', '>= 1.4.7'
|
29
|
+
spec.add_runtime_dependency 'spdx', '>= 4.1.1'
|
29
30
|
spec.add_runtime_dependency 'thor', '>= 0.20.3'
|
30
31
|
spec.add_runtime_dependency 'thor-zsh_completion', '>= 0.1.9'
|
31
32
|
|
32
33
|
spec.add_development_dependency 'bundler', '>= 1.15.3'
|
33
|
-
spec.add_development_dependency 'fasterer', '>= 0.
|
34
|
+
spec.add_development_dependency 'fasterer', '>= 0.10.0'
|
34
35
|
spec.add_development_dependency 'rake', '>= 13.0'
|
35
36
|
spec.add_development_dependency 'rspec', '>= 3.9.0'
|
36
37
|
spec.add_development_dependency 'rspec_junit_formatter', '<= 0.4.1'
|
37
|
-
spec.add_development_dependency 'rubocop', '>= 1.
|
38
|
-
spec.add_development_dependency 'rubocop-performance', '>= 1.
|
38
|
+
spec.add_development_dependency 'rubocop', '>= 1.28.1'
|
39
|
+
spec.add_development_dependency 'rubocop-performance', '>= 1.13.3'
|
39
40
|
spec.add_development_dependency 'simplecov', '>= 0.21.2'
|
40
41
|
|
41
42
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daisuke Fujimura (fd0)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|
@@ -30,28 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 7.
|
33
|
+
version: 7.21.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 7.
|
40
|
+
version: 7.21.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pkg-config
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.4.
|
47
|
+
version: 1.4.7
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.4.
|
54
|
+
version: 1.4.7
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: spdx
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 4.1.1
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 4.1.1
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: thor
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +114,14 @@ dependencies:
|
|
100
114
|
requirements:
|
101
115
|
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
117
|
+
version: 0.10.0
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
124
|
+
version: 0.10.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rake
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,28 +170,28 @@ dependencies:
|
|
156
170
|
requirements:
|
157
171
|
- - ">="
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
173
|
+
version: 1.28.1
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - ">="
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
180
|
+
version: 1.28.1
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: rubocop-performance
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - ">="
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
187
|
+
version: 1.13.3
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - ">="
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
194
|
+
version: 1.13.3
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: simplecov
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,6 +246,9 @@ files:
|
|
232
246
|
- lib/xezat/command/init.rb
|
233
247
|
- lib/xezat/command/port.rb
|
234
248
|
- lib/xezat/command/validate.rb
|
249
|
+
- lib/xezat/command/validate/config.rb
|
250
|
+
- lib/xezat/command/validate/license.rb
|
251
|
+
- lib/xezat/command/validate/pkgconfig.rb
|
235
252
|
- lib/xezat/config.rb
|
236
253
|
- lib/xezat/cygchangelog.rb
|
237
254
|
- lib/xezat/cygclasses.rb
|
@@ -256,8 +273,8 @@ files:
|
|
256
273
|
- lib/xezat/detector/python27.rb
|
257
274
|
- lib/xezat/detector/python36.rb
|
258
275
|
- lib/xezat/detector/python37.rb
|
259
|
-
- lib/xezat/detector/python38-docutils.rb
|
260
276
|
- lib/xezat/detector/python38.rb
|
277
|
+
- lib/xezat/detector/python39-docutils.rb
|
261
278
|
- lib/xezat/detector/python39.rb
|
262
279
|
- lib/xezat/detector/roundup.rb
|
263
280
|
- lib/xezat/detector/waf.rb
|
@@ -270,21 +287,21 @@ files:
|
|
270
287
|
- lib/xezat/variables.rb
|
271
288
|
- lib/xezat/version.rb
|
272
289
|
- share/xezat/categories.yaml
|
273
|
-
- share/xezat/compilers.
|
274
|
-
- share/xezat/
|
275
|
-
- share/xezat/languages.
|
276
|
-
- share/xezat/repository/bitbucket.
|
277
|
-
- share/xezat/repository/github.
|
278
|
-
- share/xezat/repository/gnu.
|
279
|
-
- share/xezat/repository/savannah.
|
280
|
-
- share/xezat/repository/sourceforge.
|
281
|
-
- share/xezat/show_cygport_variable.sh
|
290
|
+
- share/xezat/compilers.yaml
|
291
|
+
- share/xezat/cygport_dep.sh
|
292
|
+
- share/xezat/languages.yaml
|
293
|
+
- share/xezat/repository/bitbucket.yaml
|
294
|
+
- share/xezat/repository/github.yaml
|
295
|
+
- share/xezat/repository/gnu.yaml
|
296
|
+
- share/xezat/repository/savannah.yaml
|
297
|
+
- share/xezat/repository/sourceforge.yaml
|
282
298
|
- share/xezat/template/Makefile.am
|
283
299
|
- share/xezat/template/README.erb
|
284
300
|
- share/xezat/template/announce.erb
|
285
301
|
- share/xezat/template/cmake.erb
|
286
302
|
- share/xezat/template/cygport.erb
|
287
303
|
- share/xezat/template/pkgconfig.erb
|
304
|
+
- share/xezat/var2yaml.sh
|
288
305
|
- xezat.gemspec
|
289
306
|
homepage: https://github.com/fd00/xezat
|
290
307
|
licenses:
|
@@ -306,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
306
323
|
- !ruby/object:Gem::Version
|
307
324
|
version: '0'
|
308
325
|
requirements: []
|
309
|
-
rubygems_version: 3.
|
326
|
+
rubygems_version: 3.3.11
|
310
327
|
signing_key:
|
311
328
|
specification_version: 4
|
312
329
|
summary: xezat helps you win at cygport.
|
data/share/xezat/compilers.json
DELETED
@@ -1,67 +0,0 @@
|
|
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
|
-
"Fortran Free Form": {
|
26
|
-
"package": "gcc-fortran",
|
27
|
-
"dependencies": [
|
28
|
-
"binutils",
|
29
|
-
"gcc-core"
|
30
|
-
]
|
31
|
-
},
|
32
|
-
"Lex": {
|
33
|
-
"package": "flex"
|
34
|
-
},
|
35
|
-
"Lua": {
|
36
|
-
"package": "lua"
|
37
|
-
},
|
38
|
-
"Objective-C": {
|
39
|
-
"package": "gcc-objc",
|
40
|
-
"dependencies": [
|
41
|
-
"binutils",
|
42
|
-
"gcc-core"
|
43
|
-
]
|
44
|
-
},
|
45
|
-
"Objective-C++": {
|
46
|
-
"package": "gcc-objc++",
|
47
|
-
"dependencies": [
|
48
|
-
"binutils",
|
49
|
-
"gcc-core"
|
50
|
-
]
|
51
|
-
},
|
52
|
-
"Protocol Buffer": {
|
53
|
-
"package": "libprotobuf-devel"
|
54
|
-
},
|
55
|
-
"Ragel": {
|
56
|
-
"package": "ragel"
|
57
|
-
},
|
58
|
-
"Ruby": {
|
59
|
-
"package": "ruby"
|
60
|
-
},
|
61
|
-
"Vala": {
|
62
|
-
"package": "vala"
|
63
|
-
},
|
64
|
-
"Yacc": {
|
65
|
-
"package": "bison"
|
66
|
-
}
|
67
|
-
}
|
data/share/xezat/languages.json
DELETED