neutron 0.2.0 → 0.2.1
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/lib/neutron/pkgconf.rb +1 -36
- data/lib/neutron/valac.rb +1 -35
- data/lib/neutron/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9961f6fc0623cab64450dab624133c82fe06058
|
4
|
+
data.tar.gz: 2ae97e7c9d188d5a87e6c6c1a7ab36ee5ef95a9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 120e2f4aad0fba30f4f18cbc9b336a96cafd5e2b6415685c221084fd8b205a14c93008dcb9ace655ced7b208a1e4340b05faa073f717aa62861d9c74d466bc2c
|
7
|
+
data.tar.gz: 974ffdad414188af06c16000246a76a26a2c4d9babdb990f7f08ebaf5ff801ba8425b07642911c7eb6ba6ea5ebc82da562ac163144fb60d69594247bc30f73aa
|
data/lib/neutron/pkgconf.rb
CHANGED
@@ -47,39 +47,4 @@ class Neutron::PkgConf
|
|
47
47
|
raise InvalidPkgConfError if tainted?
|
48
48
|
@packages.map{|p|"--pkg #{p}"}.join(' ')
|
49
49
|
end
|
50
|
-
|
51
|
-
def self.gen_pc(filename, **opts)
|
52
|
-
prefix = if ENV['PREFIX'] then ENV['PREFIX'] else '/usr' end
|
53
|
-
filename = File.expand_path(filename)
|
54
|
-
|
55
|
-
content = ''
|
56
|
-
|
57
|
-
content << "prefix=#{prefix}\n"
|
58
|
-
content << "exec_prefix=${prefix}\n"
|
59
|
-
content << "includedir=${prefix}/include\n"
|
60
|
-
content << "libdir=${exec_prefix}/lib\n"
|
61
|
-
content << "\n"
|
62
|
-
|
63
|
-
reqs = if opts[:requires] then opts[:requires].packages.join(' ') else '' end
|
64
|
-
preqs = if opts[:prequires] then opts[:prequires].packages.join(' ') else '' end
|
65
|
-
|
66
|
-
lname = opts[:name]
|
67
|
-
if m = /lib(.+)/.match(lname.downcase)
|
68
|
-
lname = m[1]
|
69
|
-
end
|
70
|
-
|
71
|
-
content << "Name: #{opts[:name] or 'Unnamed'}\n"
|
72
|
-
content << "Description: #{opts[:description] or 'No description'}\n"
|
73
|
-
content << "Version: #{opts[:version] or '0.1.0'}\n"
|
74
|
-
content << "Requires: #{reqs}\n"
|
75
|
-
content << "Requires.private: #{preqs}\n"
|
76
|
-
content << "Cflags: #{opts[:cflags] or "-I${includedir}/#{opts[:name].downcase or 'undefined'}"}\n"
|
77
|
-
content << "Libs: -L${libdir} -l#{lname or 'undefined'}\n"
|
78
|
-
content << "Libs.private: #{opts[:plibs] or ''}\n"
|
79
|
-
|
80
|
-
File.delete(filename) if File.exist?(filename)
|
81
|
-
File.write(filename, content)
|
82
|
-
|
83
|
-
puts "] Done generating pkg-config #{filename}"
|
84
|
-
end
|
85
|
-
end
|
50
|
+
end
|
data/lib/neutron/valac.rb
CHANGED
@@ -6,8 +6,6 @@ module Neutron::Valac
|
|
6
6
|
prog: 'valac',
|
7
7
|
debug: false,
|
8
8
|
type: :object,
|
9
|
-
gen_vapi: false,
|
10
|
-
gen_header: false,
|
11
9
|
args: ''
|
12
10
|
}.merge(opts)
|
13
11
|
|
@@ -20,46 +18,14 @@ module Neutron::Valac
|
|
20
18
|
case o[:type]
|
21
19
|
when :object
|
22
20
|
specific << ' -c'
|
23
|
-
when :ccode
|
24
|
-
specific << ' -C'
|
25
21
|
else
|
26
22
|
raise TypeError, "Invalid output type: #{o[:type]}!"
|
27
23
|
end
|
28
24
|
|
29
25
|
files.each do |file|
|
30
26
|
file = File.expand_path(file)
|
31
|
-
|
32
|
-
iter_specific = ''
|
33
27
|
|
34
|
-
|
35
|
-
puts "Warning: this part of Neutron::Valac module is not finished. Use it at own risk!"
|
36
|
-
iter_specific << " --vapi #{Neutron.file_to_ext(file, '.vapi')}"
|
37
|
-
end
|
38
|
-
|
39
|
-
if o[:gen_header]
|
40
|
-
iter_specific << " --header #{Neutron.file_to_ext(file, '.h')}"
|
41
|
-
end
|
42
|
-
|
43
|
-
Neutron.execute("#{o[:prog]} #{file} #{specific} #{iter_specific} -b ./ --thread #{o[:args]}", must_success: true)
|
28
|
+
Neutron.execute("#{o[:prog]} #{file} #{specific} -b ./ --thread #{o[:args]}", must_success: true)
|
44
29
|
end
|
45
30
|
end
|
46
|
-
|
47
|
-
def self.to_c(*files, **opts)
|
48
|
-
o = {
|
49
|
-
proc: 'valac',
|
50
|
-
args: ''
|
51
|
-
}
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.vapi_header(header)
|
55
|
-
"[CCode (cheader_filename = \"#{header}\")]\n\n"
|
56
|
-
end
|
57
31
|
end
|
58
|
-
|
59
|
-
=begin
|
60
|
-
valac --vapi library.vapi --header library.h library.vala -C # Compiles library into C code and header to access it
|
61
|
-
cat *.vapi > libname.vapi # Concatenates all VAPIs into single file. Worked for me
|
62
|
-
gcc -c library.c -fpic `pkg-config --libs --cflags glib-2.0` # Compiles generated C code
|
63
|
-
gcc library.vala -o libname.so -shared -fpic `pkg-config --libs --cflags glib-2.0` # Compiles shared library
|
64
|
-
valac test.vala libname.vapi -X library.so -X -Wl,-rpath=./ # Compiles project using library
|
65
|
-
=end
|
data/lib/neutron/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neutron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nickolay Ilyushin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.6.
|
85
|
+
rubygems_version: 2.6.11
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Build-Tool toolkit for Ruby
|