fastqr 1.0.9 → 1.0.10
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/CMakeLists.txt +1 -1
- data/VERSION +1 -1
- data/bindings/nodejs/index.js +5 -5
- data/bindings/nodejs/package.json +1 -1
- data/bindings/ruby/lib/fastqr/version.rb +1 -1
- data/bindings/ruby/lib/fastqr.rb +21 -32
- data/bindings/ruby/prebuilt/macos-arm64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/macos-arm64.tar.gz +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64/bin/fastqr +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64.tar.gz +0 -0
- data/scripts/build-binaries.sh +8 -27
- data/scripts/test-npm-real.sh +3 -3
- data/src/fastqr.cpp +1 -1
- metadata +1 -17
- data/bindings/ruby/prebuilt/macos-arm64/lib/libfastqr.dylib +0 -0
- data/bindings/ruby/prebuilt/macos-x86_64/lib/libfastqr.dylib +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c8da6700425b86beecd6243cae158af79644a0dcda10be631ee7edfbe7b4e82
|
|
4
|
+
data.tar.gz: c1d1e682923888db3ebe3486afb88e2f1b5e1b98531d5f85024a5faa63a565a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25a814734cc21e75ffa16c883d82d5800eb0bc0e43267b35bd19da2121b5a8e0cf82fdeb3db0219355765a6e5476529f98b884b481b75a0e9a176ff6421d9b9e
|
|
7
|
+
data.tar.gz: 7c68d84521eff5ee6eb234a9d29153924978935a53b8bf27f3fe2adc50cc6140870c1de46e788797cbdc2d9ec8dad3bd690b7dd8db5c43b5e8c3c1e57129406b
|
data/CMakeLists.txt
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.10
|
data/bindings/nodejs/index.js
CHANGED
|
@@ -13,7 +13,7 @@ let fastqr;
|
|
|
13
13
|
// Use pre-built CLI binary (no FFI needed!)
|
|
14
14
|
if (platform.isPrebuiltAvailable()) {
|
|
15
15
|
const cliPath = path.join(__dirname, 'prebuilt', platform.getPlatformString(), 'bin', 'fastqr');
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
if (!fs.existsSync(cliPath)) {
|
|
18
18
|
throw new Error(
|
|
19
19
|
'FastQR CLI binary not found. Expected at: ' + cliPath + '\n' +
|
|
@@ -25,11 +25,11 @@ if (platform.isPrebuiltAvailable()) {
|
|
|
25
25
|
fastqr = {
|
|
26
26
|
generate: function(data, outputPath, options = {}) {
|
|
27
27
|
const args = [data, outputPath];
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
// Support both new 'size' and legacy 'width'/'height'
|
|
30
30
|
const size = options.size || options.width || options.height || 300;
|
|
31
31
|
args.push('-s', size.toString());
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
if (options.optimizeSize) args.push('-o');
|
|
34
34
|
if (options.foreground) args.push('-f', options.foreground.join(','));
|
|
35
35
|
if (options.background) args.push('-b', options.background.join(','));
|
|
@@ -37,7 +37,7 @@ if (platform.isPrebuiltAvailable()) {
|
|
|
37
37
|
if (options.logo) args.push('-l', options.logo);
|
|
38
38
|
if (options.logoSize) args.push('-p', options.logoSize.toString());
|
|
39
39
|
if (options.quality) args.push('-q', options.quality.toString());
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
try {
|
|
42
42
|
execFileSync(cliPath, args, { stdio: 'pipe' });
|
|
43
43
|
return true;
|
|
@@ -55,7 +55,7 @@ if (platform.isPrebuiltAvailable()) {
|
|
|
55
55
|
},
|
|
56
56
|
VERSION: null // Will be set below
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
fastqr.VERSION = fastqr.version();
|
|
60
60
|
} else {
|
|
61
61
|
throw new Error(
|
data/bindings/ruby/lib/fastqr.rb
CHANGED
|
@@ -3,33 +3,6 @@
|
|
|
3
3
|
require_relative "fastqr/version"
|
|
4
4
|
require_relative "fastqr/platform"
|
|
5
5
|
|
|
6
|
-
# Load pre-built binary if available, otherwise try to load compiled extension
|
|
7
|
-
begin
|
|
8
|
-
if FastQR::Platform.prebuilt_available?
|
|
9
|
-
# Load from pre-built binary
|
|
10
|
-
require 'ffi'
|
|
11
|
-
|
|
12
|
-
module FastQR
|
|
13
|
-
module Native
|
|
14
|
-
extend FFI::Library
|
|
15
|
-
|
|
16
|
-
lib_path = Platform.lib_path
|
|
17
|
-
ffi_lib lib_path
|
|
18
|
-
|
|
19
|
-
# Define C functions
|
|
20
|
-
attach_function :fastqr_generate_c, :fastqr_generate, [:string, :string, :pointer], :int
|
|
21
|
-
attach_function :fastqr_version, [], :string
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
else
|
|
25
|
-
# Fall back to compiled extension
|
|
26
|
-
require_relative "fastqr/fastqr"
|
|
27
|
-
end
|
|
28
|
-
rescue LoadError => e
|
|
29
|
-
warn "Warning: Could not load FastQR native extension: #{e.message}"
|
|
30
|
-
warn "Please run: gem install fastqr -- --with-system-libraries"
|
|
31
|
-
end
|
|
32
|
-
|
|
33
6
|
module FastQR
|
|
34
7
|
class Error < StandardError; end
|
|
35
8
|
|
|
@@ -37,7 +10,11 @@ module FastQR
|
|
|
37
10
|
#
|
|
38
11
|
# @return [String] Version string
|
|
39
12
|
def self.version
|
|
40
|
-
|
|
13
|
+
cli_path = Platform.find_binary
|
|
14
|
+
output = `#{cli_path} -v 2>&1`.strip
|
|
15
|
+
output.sub('FastQR v', '')
|
|
16
|
+
rescue => e
|
|
17
|
+
VERSION
|
|
41
18
|
end
|
|
42
19
|
|
|
43
20
|
# Generate QR code with options
|
|
@@ -77,10 +54,22 @@ module FastQR
|
|
|
77
54
|
raise Error, "Data cannot be empty" if data.nil? || data.empty?
|
|
78
55
|
raise Error, "Output path cannot be empty" if output_path.nil? || output_path.empty?
|
|
79
56
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
cli_path = Platform.find_binary
|
|
58
|
+
args = [data, output_path]
|
|
59
|
+
|
|
60
|
+
# Build command arguments from options
|
|
61
|
+
args += ['-s', options[:size].to_s] if options[:size]
|
|
62
|
+
args += ['-o'] if options[:optimize_size]
|
|
63
|
+
args += ['-f', options[:foreground].join(',')] if options[:foreground]
|
|
64
|
+
args += ['-b', options[:background].join(',')] if options[:background]
|
|
65
|
+
args += ['-e', options[:error_level]] if options[:error_level]
|
|
66
|
+
args += ['-l', options[:logo]] if options[:logo]
|
|
67
|
+
args += ['-p', options[:logo_size].to_s] if options[:logo_size]
|
|
68
|
+
args += ['-q', options[:quality].to_s] if options[:quality]
|
|
69
|
+
|
|
70
|
+
# Execute CLI binary
|
|
71
|
+
result = system(cli_path, *args, out: File::NULL, err: File::NULL)
|
|
72
|
+
raise Error, "Failed to generate QR code" unless result
|
|
84
73
|
|
|
85
74
|
true
|
|
86
75
|
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/scripts/build-binaries.sh
CHANGED
|
@@ -37,10 +37,11 @@ rm -rf build
|
|
|
37
37
|
mkdir build
|
|
38
38
|
cd build
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
echo "🔧 Building standalone CLI with static linking..."
|
|
41
|
+
# Configure for standalone CLI (all dependencies static)
|
|
41
42
|
cmake .. \
|
|
42
43
|
-DCMAKE_BUILD_TYPE=Release \
|
|
43
|
-
-DBUILD_SHARED_LIBS=
|
|
44
|
+
-DBUILD_SHARED_LIBS=OFF \
|
|
44
45
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
|
45
46
|
-DFASTQR_BUILD_EXAMPLES=OFF
|
|
46
47
|
|
|
@@ -51,34 +52,14 @@ else
|
|
|
51
52
|
make -j$(nproc)
|
|
52
53
|
fi
|
|
53
54
|
|
|
54
|
-
# Install to temporary location
|
|
55
|
-
make install DESTDIR="$PWD/staging"
|
|
56
|
-
|
|
57
55
|
cd ..
|
|
58
56
|
|
|
59
|
-
# Copy
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
cp build/libfastqr.*.dylib "$OUTPUT_DIR/lib/libfastqr.dylib" 2>/dev/null || \
|
|
63
|
-
cp build/libfastqr.dylib "$OUTPUT_DIR/lib/libfastqr.dylib"
|
|
57
|
+
# Copy standalone CLI binary (no dylib needed!)
|
|
58
|
+
cp build/fastqr "$OUTPUT_DIR/bin/fastqr"
|
|
59
|
+
echo "✅ Built standalone CLI (all static - no dependencies!)"
|
|
64
60
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
else
|
|
68
|
-
# Copy all .so files to lib directory
|
|
69
|
-
if [ -f build/staging/usr/local/lib/libfastqr.so ]; then
|
|
70
|
-
cp build/staging/usr/local/lib/libfastqr.so* "$OUTPUT_DIR/lib/"
|
|
71
|
-
else
|
|
72
|
-
cp build/libfastqr.so* "$OUTPUT_DIR/lib/"
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
# Copy binary
|
|
76
|
-
if [ -f build/staging/usr/local/bin/fastqr ]; then
|
|
77
|
-
cp build/staging/usr/local/bin/fastqr "$OUTPUT_DIR/bin/fastqr"
|
|
78
|
-
else
|
|
79
|
-
cp build/fastqr "$OUTPUT_DIR/bin/fastqr"
|
|
80
|
-
fi
|
|
81
|
-
fi
|
|
61
|
+
# No shared library needed - CLI is standalone!
|
|
62
|
+
# (Ruby and Node.js use CLI binary directly)
|
|
82
63
|
|
|
83
64
|
# Copy headers
|
|
84
65
|
cp -r include "$OUTPUT_DIR/"
|
data/scripts/test-npm-real.sh
CHANGED
|
@@ -57,9 +57,9 @@ console.log('✅ Result:', result2);
|
|
|
57
57
|
// Test 3: With options
|
|
58
58
|
console.log('');
|
|
59
59
|
console.log('Test 3: QR with optimize...');
|
|
60
|
-
const result3 = fastqr.generate('Test Optimize', 'test_node_opt.png', {
|
|
61
|
-
size: 500,
|
|
62
|
-
optimizeSize: true
|
|
60
|
+
const result3 = fastqr.generate('Test Optimize', 'test_node_opt.png', {
|
|
61
|
+
size: 500,
|
|
62
|
+
optimizeSize: true
|
|
63
63
|
});
|
|
64
64
|
console.log('✅ Result:', result3);
|
|
65
65
|
|
data/src/fastqr.cpp
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastqr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- FastQR Project
|
|
@@ -10,20 +10,6 @@ bindir: bin
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2025-10-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: ffi
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.15'
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.15'
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: rake
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -104,13 +90,11 @@ files:
|
|
|
104
90
|
- bindings/ruby/prebuilt/macos-arm64/include/fastqr.h
|
|
105
91
|
- bindings/ruby/prebuilt/macos-arm64/include/stb_image.h
|
|
106
92
|
- bindings/ruby/prebuilt/macos-arm64/include/stb_image_write.h
|
|
107
|
-
- bindings/ruby/prebuilt/macos-arm64/lib/libfastqr.dylib
|
|
108
93
|
- bindings/ruby/prebuilt/macos-x86_64.tar.gz
|
|
109
94
|
- bindings/ruby/prebuilt/macos-x86_64/bin/fastqr
|
|
110
95
|
- bindings/ruby/prebuilt/macos-x86_64/include/fastqr.h
|
|
111
96
|
- bindings/ruby/prebuilt/macos-x86_64/include/stb_image.h
|
|
112
97
|
- bindings/ruby/prebuilt/macos-x86_64/include/stb_image_write.h
|
|
113
|
-
- bindings/ruby/prebuilt/macos-x86_64/lib/libfastqr.dylib
|
|
114
98
|
- build.sh
|
|
115
99
|
- cmake/fastqrConfig.cmake.in
|
|
116
100
|
- composer.json
|
|
Binary file
|
|
Binary file
|