libui 0.1.3.pre-x86_64-darwin → 0.2.0.pre-x86_64-darwin
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/LICENSE.txt +1 -1
- data/README.md +27 -3
- data/lib/libui/error.rb +10 -0
- data/lib/libui/ffi.rb +15 -4
- data/lib/libui/version.rb +1 -1
- data/lib/libui.rb +12 -2
- data/vendor/libui.x86_64.dylib +0 -0
- metadata +25 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f93f77a77f68890634f59988823870d3f80baac5820856ac551dac128c47228
|
4
|
+
data.tar.gz: 0aa9e66cbf90e9a5c3cfb1d86f11e82200f82eac2c9e88d21b2aeb1ad60d3275
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abcecf91a66544d8d5365eb98c72b89b5fb8a638dbf7940f4a1fa5232c04b0d37c445ce49994bbec583926e63d6b008d9c519e4ca6f6ca5d390b8a24960bb972
|
7
|
+
data.tar.gz: 1b22d167e1a2b692f5634390856274a9171b129ea1b8509cf381ea5f75ce06ecc3ade77808135bd78fb13637f7a327a3d2a8d386e1b85171313f0c09569f568e
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -4,21 +4,32 @@
|
|
4
4
|
[](https://badge.fury.io/rb/libui)
|
5
5
|
<a href="https://github.com/AndyObtiva/glimmer-dsl-libui"><img alt="glimmer-dsl-libui" src="https://github.com/AndyObtiva/glimmer/blob/master/images/glimmer-logo-hi-res.svg" width="50" height="50" align="right"></a>
|
6
6
|
[](https://github.com/kojix2/libui-ng/actions/workflows/pre-build.yml)
|
7
|
+
[](https://tokei.kojix2.net/github/kojix2/LibUI)
|
7
8
|
|
8
|
-
LibUI is a Ruby wrapper for libui
|
9
|
+
LibUI is a Ruby wrapper for libui family.
|
9
10
|
|
10
11
|
:rocket: [libui-ng](https://github.com/libui-ng/libui-ng) - A cross-platform portable GUI library
|
11
12
|
|
13
|
+
:wrench: [libui-dev](https://github.com/petabyt/libui-dev) - Native UI library for C - with some extras
|
14
|
+
|
12
15
|
:radio_button: [libui](https://github.com/andlabs/libui) - Original version by andlabs.
|
13
16
|
|
14
17
|
## Installation
|
15
18
|
|
19
|
+
It is recommended to use libui-ng, via the --pre commandline flag:
|
20
|
+
|
21
|
+
```sh
|
22
|
+
gem install libui --pre # libui-ng; this will fetch libui-0.1.3.pre-x86_64-linux.gem
|
23
|
+
```
|
24
|
+
|
25
|
+
If for some reason you would like to install the slightly older libui-0.1.2.gem release, issue:
|
26
|
+
|
16
27
|
```sh
|
17
28
|
gem install libui
|
18
29
|
```
|
19
30
|
|
20
|
-
- The gem package includes the
|
21
|
-
- Namely `libui.dll`, `libui.dylib`,
|
31
|
+
- The gem package includes the libui-ng shared library for Windows, Mac, and Linux.
|
32
|
+
- Namely `libui.dll`, `libui.dylib`, or `libui.so`.
|
22
33
|
- No dependencies required.
|
23
34
|
- The libui gem uses the standard Ruby library [Fiddle](https://github.com/ruby/fiddle) to call C functions.
|
24
35
|
|
@@ -204,6 +215,19 @@ Another simple approach is to replace the shared libraries in the gem vendor dir
|
|
204
215
|
|
205
216
|
### Publishing gems
|
206
217
|
|
218
|
+
#### Automated Publishing
|
219
|
+
|
220
|
+
Push a version tag to automatically publish platform-specific gems:
|
221
|
+
|
222
|
+
```sh
|
223
|
+
git tag v0.1.3
|
224
|
+
git push origin v0.1.3
|
225
|
+
```
|
226
|
+
|
227
|
+
Requires `RUBYGEMS_API_KEY` repository secret with scoped API key.
|
228
|
+
|
229
|
+
#### Manual Publishing
|
230
|
+
|
207
231
|
```sh
|
208
232
|
ls vendor # check the vendor directory
|
209
233
|
rm -rf pkg # remove previously built gems
|
data/lib/libui/error.rb
ADDED
data/lib/libui/ffi.rb
CHANGED
@@ -1,15 +1,24 @@
|
|
1
1
|
require 'fiddle/import'
|
2
2
|
require_relative 'fiddle_patch'
|
3
|
+
require_relative 'error'
|
3
4
|
|
4
5
|
module LibUI
|
6
|
+
class Error < StandardError; end
|
7
|
+
|
5
8
|
module FFI
|
6
9
|
extend Fiddle::Importer
|
7
10
|
extend FiddlePatch
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
raise
|
12
|
+
if LibUI.ffi_lib.nil?
|
13
|
+
raise LibraryNotFoundError, 'Could not find libui shared library. LibUI.ffi_lib is nil.'
|
14
|
+
elsif !File.exist?(LibUI.ffi_lib)
|
15
|
+
raise LibraryNotFoundError, "Could not find libui shared library: #{LibUI.ffi_lib}"
|
16
|
+
else
|
17
|
+
begin
|
18
|
+
dlload LibUI.ffi_lib
|
19
|
+
rescue LoadError
|
20
|
+
raise LibraryLoadError, "Could not load libui shared library: #{LibUI.ffi_lib}"
|
21
|
+
end
|
13
22
|
end
|
14
23
|
|
15
24
|
class << self
|
@@ -18,6 +27,8 @@ module LibUI
|
|
18
27
|
def try_extern(signature, *opts)
|
19
28
|
extern(signature, *opts)
|
20
29
|
rescue StandardError => e
|
30
|
+
# Do not raise error when the function is not found
|
31
|
+
# because some functions may not be available on older versions of libui.
|
21
32
|
warn "#{e.class.name}: #{e.message}"
|
22
33
|
end
|
23
34
|
|
data/lib/libui/version.rb
CHANGED
data/lib/libui.rb
CHANGED
@@ -1,16 +1,26 @@
|
|
1
1
|
require_relative 'libui/version'
|
2
2
|
require_relative 'libui/utils'
|
3
|
+
require_relative 'libui/error'
|
3
4
|
require 'rbconfig'
|
4
5
|
|
5
6
|
module LibUI
|
6
|
-
class Error < StandardError; end
|
7
|
-
|
8
7
|
class << self
|
9
8
|
attr_accessor :ffi_lib
|
10
9
|
end
|
11
10
|
|
11
|
+
host_cpu = case RbConfig::CONFIG['host_cpu']
|
12
|
+
when /i\d86/
|
13
|
+
'x86'
|
14
|
+
else
|
15
|
+
RbConfig::CONFIG['host_cpu']
|
16
|
+
end
|
17
|
+
|
12
18
|
lib_name = [
|
19
|
+
# For libui-ng shared libraries compiled with (rake vendor:build)
|
13
20
|
"libui.#{RbConfig::CONFIG['host_cpu']}.#{RbConfig::CONFIG['SOEXT']}",
|
21
|
+
# For libui-ng shared library downloaded from RubyGems.org
|
22
|
+
"libui.#{host_cpu}.#{RbConfig::CONFIG['SOEXT']}",
|
23
|
+
# For backward compatibility or manual compilation of libui-ng
|
14
24
|
"libui.#{RbConfig::CONFIG['SOEXT']}"
|
15
25
|
]
|
16
26
|
|
data/vendor/libui.x86_64.dylib
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,16 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0.pre
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
11
|
+
date: 2025-08-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fiddle
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description:
|
14
28
|
email:
|
15
29
|
- 2xijok@gmail.com
|
16
30
|
executables: []
|
@@ -20,6 +34,7 @@ files:
|
|
20
34
|
- LICENSE.txt
|
21
35
|
- README.md
|
22
36
|
- lib/libui.rb
|
37
|
+
- lib/libui/error.rb
|
23
38
|
- lib/libui/ffi.rb
|
24
39
|
- lib/libui/fiddle_patch.rb
|
25
40
|
- lib/libui/libui_base.rb
|
@@ -32,7 +47,7 @@ homepage: https://github.com/kojix2/libui
|
|
32
47
|
licenses:
|
33
48
|
- MIT
|
34
49
|
metadata: {}
|
35
|
-
post_install_message:
|
50
|
+
post_install_message:
|
36
51
|
rdoc_options: []
|
37
52
|
require_paths:
|
38
53
|
- lib
|
@@ -43,12 +58,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
58
|
version: '2.6'
|
44
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
60
|
requirements:
|
46
|
-
- - "
|
61
|
+
- - ">="
|
47
62
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
63
|
+
version: '0'
|
49
64
|
requirements: []
|
50
|
-
rubygems_version: 3.
|
51
|
-
signing_key:
|
65
|
+
rubygems_version: 3.5.22
|
66
|
+
signing_key:
|
52
67
|
specification_version: 4
|
53
68
|
summary: Ruby bindings to libui
|
54
69
|
test_files: []
|