fastqr 1.0.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.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/BUILD.md +482 -0
  3. data/CHANGELOG.md +51 -0
  4. data/CMakeLists.txt +126 -0
  5. data/CONTRIBUTING.md +63 -0
  6. data/DISTRIBUTION.md +730 -0
  7. data/INSTALL.md +171 -0
  8. data/LICENSE +39 -0
  9. data/PREBUILT.md +171 -0
  10. data/README.md +312 -0
  11. data/VERSION +1 -0
  12. data/bindings/nodejs/binding.gyp +38 -0
  13. data/bindings/nodejs/fastqr_node.cpp +125 -0
  14. data/bindings/nodejs/index.d.ts +80 -0
  15. data/bindings/nodejs/index.js +187 -0
  16. data/bindings/nodejs/lib/platform.js +72 -0
  17. data/bindings/nodejs/package.json +45 -0
  18. data/bindings/nodejs/test/test.js +45 -0
  19. data/bindings/php/fastqr_php.cpp +85 -0
  20. data/bindings/php/src/FastQR.php +316 -0
  21. data/bindings/php/tests/FastQRTest.php +97 -0
  22. data/bindings/ruby/extconf.rb +29 -0
  23. data/bindings/ruby/fastqr_ruby.cpp +122 -0
  24. data/bindings/ruby/lib/fastqr/platform.rb +70 -0
  25. data/bindings/ruby/lib/fastqr/version.rb +6 -0
  26. data/bindings/ruby/lib/fastqr.rb +129 -0
  27. data/bindings/ruby/prebuilt/macos-arm64.tar.gz +1 -0
  28. data/bindings/ruby/prebuilt/macos-x86_64.tar.gz +1 -0
  29. data/build.sh +109 -0
  30. data/cmake/fastqrConfig.cmake.in +6 -0
  31. data/composer.json +36 -0
  32. data/docs/CLI_USAGE.md +478 -0
  33. data/docs/NODEJS_USAGE.md +694 -0
  34. data/docs/PHP_USAGE.md +815 -0
  35. data/docs/README.md +191 -0
  36. data/docs/RUBY_USAGE.md +537 -0
  37. data/examples/CMakeLists.txt +7 -0
  38. data/examples/basic.cpp +58 -0
  39. data/include/fastqr.h +97 -0
  40. data/include/stb_image.h +7988 -0
  41. data/include/stb_image_write.h +1724 -0
  42. data/phpunit.xml +18 -0
  43. data/prebuilt/README.md +131 -0
  44. data/scripts/README.md +248 -0
  45. data/scripts/build-binaries.sh +98 -0
  46. data/scripts/build-local.sh +18 -0
  47. data/scripts/install.sh +87 -0
  48. data/scripts/release.sh +78 -0
  49. data/scripts/update-version.sh +58 -0
  50. data/src/cli.cpp +316 -0
  51. data/src/fastqr.cpp +665 -0
  52. data/test.sh +86 -0
  53. metadata +155 -0
data/DISTRIBUTION.md ADDED
@@ -0,0 +1,730 @@
1
+ # FastQR Distribution Guide
2
+
3
+ Detailed guide for distributing FastQR to various package managers.
4
+
5
+ ## 📋 Table of Contents
6
+
7
+ - [Homebrew (macOS)](#homebrew-macos)
8
+ - [APT/DEB (Ubuntu/Debian)](#aptdeb-ubuntudebian)
9
+ - [RubyGems (Ruby)](#rubygems-ruby)
10
+ - [npm (Node.js)](#npm-nodejs)
11
+ - [Packagist (PHP/Composer)](#packagist-phpcomposer)
12
+ - [GitHub Releases](#github-releases)
13
+
14
+ ---
15
+
16
+ ## 🍺 Homebrew (macOS)
17
+
18
+ ### Step 1: Create Homebrew Tap
19
+
20
+ ```bash
21
+ # Create tap repository on GitHub
22
+ # Repository name must follow format: homebrew-<tapname>
23
+ # Example: homebrew-fastqr
24
+
25
+ # Clone repository
26
+ git clone https://github.com/tranhuucanh/homebrew-fastqr.git
27
+ cd homebrew-fastqr
28
+ ```
29
+
30
+ ### Step 2: Create Formula
31
+
32
+ Create file `fastqr.rb`:
33
+
34
+ ```ruby
35
+ class Fastqr < Formula
36
+ desc "Fast QR code generator with UTF-8 support"
37
+ homepage "https://github.com/tranhuucanh/fastqr"
38
+ url "https://github.com/tranhuucanh/fastqr/archive/v1.0.0.tar.gz"
39
+ sha256 "SHA256_OF_TARBALL"
40
+ license "LGPL-2.1"
41
+
42
+ depends_on "cmake" => :build
43
+ depends_on "qrencode"
44
+ depends_on "vips"
45
+
46
+ def install
47
+ system "cmake", "-S", ".", "-B", "build", *std_cmake_args
48
+ system "cmake", "--build", "build"
49
+ system "cmake", "--install", "build"
50
+ end
51
+
52
+ test do
53
+ system "#{bin}/fastqr", "--version"
54
+ system "#{bin}/fastqr", "Test", "test.png"
55
+ assert_predicate testpath/"test.png", :exist?
56
+ end
57
+ end
58
+ ```
59
+
60
+ ### Step 3: Calculate SHA256
61
+
62
+ ```bash
63
+ # Download source tarball
64
+ wget https://github.com/tranhuucanh/fastqr/archive/v1.0.0.tar.gz
65
+
66
+ # Calculate SHA256
67
+ shasum -a 256 v1.0.0.tar.gz
68
+
69
+ # Update SHA256 in formula
70
+ ```
71
+
72
+ ### Step 4: Test Formula
73
+
74
+ ```bash
75
+ # Test installation
76
+ brew install --build-from-source fastqr.rb
77
+
78
+ # Test uninstall
79
+ brew uninstall fastqr
80
+
81
+ # Audit formula
82
+ brew audit --strict fastqr.rb
83
+ ```
84
+
85
+ ### Step 5: Publish
86
+
87
+ ```bash
88
+ git add fastqr.rb
89
+ git commit -m "Add fastqr formula v1.0.0"
90
+ git push origin main
91
+ ```
92
+
93
+ ### Step 6: User Installation Instructions
94
+
95
+ ```bash
96
+ brew tap tranhuucanh/fastqr
97
+ brew install fastqr
98
+ ```
99
+
100
+ **Note**: Homebrew automatically installs dependencies (qrencode and vips), so users don't need to install them manually.
101
+
102
+ ---
103
+
104
+ ## 📦 APT/DEB (Ubuntu/Debian)
105
+
106
+ ### Step 1: Prepare Build Environment
107
+
108
+ ```bash
109
+ sudo apt-get install build-essential devscripts debhelper
110
+ ```
111
+
112
+ ### Step 2: Create DEB Package Structure
113
+
114
+ ```bash
115
+ cd fastqr
116
+ mkdir -p debian
117
+
118
+ # Create required files
119
+ ```
120
+
121
+ **debian/control:**
122
+
123
+ ```
124
+ Source: fastqr
125
+ Section: utils
126
+ Priority: optional
127
+ Maintainer: Your Name <your.email@example.com>
128
+ Build-Depends: debhelper (>= 10), cmake, libqrencode-dev, libvips-dev
129
+ Standards-Version: 4.1.3
130
+ Homepage: https://github.com/tranhuucanh/fastqr
131
+
132
+ Package: fastqr
133
+ Architecture: any
134
+ Depends: ${shlibs:Depends}, ${misc:Depends}, libqrencode4, libvips42
135
+ Description: Fast QR code generator with UTF-8 support
136
+ FastQR is a fast QR code generator with full UTF-8 support,
137
+ custom colors, logo embedding, and precise size control.
138
+ ```
139
+
140
+ **debian/changelog:**
141
+
142
+ ```
143
+ fastqr (1.0.0-1) unstable; urgency=medium
144
+
145
+ * Initial release
146
+
147
+ -- Your Name <your.email@example.com> Sat, 18 Oct 2025 10:00:00 +0000
148
+ ```
149
+
150
+ **debian/rules:**
151
+
152
+ ```makefile
153
+ #!/usr/bin/make -f
154
+ %:
155
+ dh $@
156
+
157
+ override_dh_auto_configure:
158
+ dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release
159
+ ```
160
+
161
+ **debian/compat:**
162
+
163
+ ```
164
+ 10
165
+ ```
166
+
167
+ ### Step 3: Build Package
168
+
169
+ ```bash
170
+ # Build binary package
171
+ dpkg-buildpackage -us -uc -b
172
+
173
+ # Package will be created in parent directory
174
+ cd ..
175
+ ls fastqr_1.0.0-1_amd64.deb
176
+ ```
177
+
178
+ ### Step 4: Test Package
179
+
180
+ ```bash
181
+ # Install
182
+ sudo dpkg -i fastqr_1.0.0-1_amd64.deb
183
+
184
+ # Test
185
+ fastqr --version
186
+
187
+ # Uninstall
188
+ sudo apt-get remove fastqr
189
+ ```
190
+
191
+ ### Step 5: Upload to GitHub Releases
192
+
193
+ ```bash
194
+ # Upload .deb file to GitHub Releases
195
+ # Users can download and install:
196
+ wget https://github.com/tranhuucanh/fastqr/releases/download/v1.0.0/fastqr_1.0.0-1_amd64.deb
197
+ sudo dpkg -i fastqr_1.0.0-1_amd64.deb
198
+ ```
199
+
200
+ ---
201
+
202
+ ## 💎 RubyGems (Ruby)
203
+
204
+ ### Step 1: Prepare Gemspec
205
+
206
+ File `fastqr.gemspec` is already prepared. Review it:
207
+
208
+ ```ruby
209
+ # fastqr.gemspec
210
+ Gem::Specification.new do |spec|
211
+ spec.name = "fastqr"
212
+ spec.version = "1.0.0"
213
+ # ... other fields
214
+ end
215
+ ```
216
+
217
+ ### Step 2: Build Gem with Pre-built Binaries
218
+
219
+ ```bash
220
+ # First, build binaries for all platforms using GitHub Actions
221
+ # or build locally using scripts/build-binaries.sh
222
+
223
+ # Build gem (includes pre-built binaries)
224
+ gem build fastqr.gemspec
225
+
226
+ # Test install locally
227
+ gem install fastqr-1.0.0.gem
228
+
229
+ # Test
230
+ ruby -r fastqr -e "puts FastQR.version"
231
+
232
+ # Uninstall
233
+ gem uninstall fastqr
234
+ ```
235
+
236
+ **Important**: The gem now includes pre-built binaries, so users don't need to install libqrencode or libvips separately!
237
+
238
+ ### Step 3: Create RubyGems Account
239
+
240
+ ```bash
241
+ # Register account at: https://rubygems.org/sign_up
242
+
243
+ # Setup credentials
244
+ gem push # First time will ask for login
245
+ ```
246
+
247
+ ### Step 4: Publish to RubyGems
248
+
249
+ ```bash
250
+ # Push gem
251
+ gem push fastqr-1.0.0.gem
252
+
253
+ # Gem will be available at: https://rubygems.org/gems/fastqr
254
+ ```
255
+
256
+ ### Step 5: Verify
257
+
258
+ ```bash
259
+ # Users can now install with just:
260
+ gem install fastqr
261
+
262
+ # No need to install qrencode or vips!
263
+
264
+ # Or via Gemfile:
265
+ # gem 'fastqr', '~> 1.0'
266
+ ```
267
+
268
+ ### Update Version
269
+
270
+ ```bash
271
+ # 1. Update version in files:
272
+ # - fastqr.gemspec
273
+ # - bindings/ruby/lib/fastqr/version.rb
274
+
275
+ # 2. Rebuild binaries using GitHub Actions
276
+
277
+ # 3. Rebuild and push gem
278
+ gem build fastqr.gemspec
279
+ gem push fastqr-1.0.1.gem
280
+ ```
281
+
282
+ ---
283
+
284
+ ## 📦 npm (Node.js)
285
+
286
+ ### Step 1: Prepare Package
287
+
288
+ File `bindings/nodejs/package.json` is already prepared. Review it:
289
+
290
+ ```json
291
+ {
292
+ "name": "fastqr",
293
+ "version": "1.0.0",
294
+ "description": "Fast QR code generator...",
295
+ "main": "index.js"
296
+ }
297
+ ```
298
+
299
+ ### Step 2: Test Package Locally
300
+
301
+ ```bash
302
+ cd bindings/nodejs
303
+
304
+ # Install dependencies
305
+ npm install
306
+
307
+ # Test (will use pre-built binaries if available)
308
+ node test/test.js
309
+
310
+ # Test installation from tarball
311
+ npm pack
312
+ npm install fastqr-1.0.0.tgz
313
+ ```
314
+
315
+ **Important**: The npm package now includes pre-built binaries, so users don't need to install libqrencode or libvips separately!
316
+
317
+ ### Step 3: Create npm Account
318
+
319
+ ```bash
320
+ # Register at: https://www.npmjs.com/signup
321
+
322
+ # Login
323
+ npm login
324
+ ```
325
+
326
+ ### Step 4: Publish to npm
327
+
328
+ ```bash
329
+ cd bindings/nodejs
330
+
331
+ # Ensure pre-built binaries are included
332
+ # (GitHub Actions should have built them)
333
+
334
+ # Publish
335
+ npm publish
336
+
337
+ # Package will be available at: https://www.npmjs.com/package/fastqr
338
+ ```
339
+
340
+ ### Step 5: Verify
341
+
342
+ ```bash
343
+ # Users can now install with just:
344
+ npm install fastqr
345
+
346
+ # No need to install qrencode or vips!
347
+
348
+ # Or via package.json:
349
+ # "dependencies": {
350
+ # "fastqr": "^1.0.0"
351
+ # }
352
+ ```
353
+
354
+ ### Update Version
355
+
356
+ ```bash
357
+ # 1. Update version
358
+ cd bindings/nodejs
359
+ npm version patch # or minor, or major
360
+
361
+ # 2. Rebuild binaries using GitHub Actions
362
+
363
+ # 3. Publish
364
+ npm publish
365
+
366
+ # 4. Push git tag
367
+ git push --tags
368
+ ```
369
+
370
+ ### npm Scripts Useful
371
+
372
+ ```bash
373
+ # Unpublish (within 72 hours)
374
+ npm unpublish fastqr@1.0.0
375
+
376
+ # Deprecate old version
377
+ npm deprecate fastqr@1.0.0 "Please upgrade to 1.0.1"
378
+
379
+ # View package info
380
+ npm info fastqr
381
+ ```
382
+
383
+ ---
384
+
385
+ ## 📦 Packagist (PHP/Composer)
386
+
387
+ ### Step 1: Prepare composer.json
388
+
389
+ File `composer.json` is already prepared at root. Review it:
390
+
391
+ ```json
392
+ {
393
+ "name": "fastqr/fastqr",
394
+ "type": "library",
395
+ "license": "LGPL-2.1"
396
+ }
397
+ ```
398
+
399
+ ### Step 2: Create Packagist Account
400
+
401
+ 1. Visit: https://packagist.org/
402
+ 2. Register account
403
+ 3. Link with GitHub account
404
+
405
+ ### Step 3: Submit Package
406
+
407
+ 1. Visit: https://packagist.org/packages/submit
408
+ 2. Enter GitHub repository URL: `https://github.com/tranhuucanh/fastqr`
409
+ 3. Click "Check"
410
+ 4. If valid, click "Submit"
411
+
412
+ **Important**: The composer package now includes pre-built binaries in the repository (via GitHub Actions), so users don't need to install libqrencode or libvips separately!
413
+
414
+ ### Step 4: Setup Auto-Update (Recommended)
415
+
416
+ **Option 1: GitHub Service Hook (Recommended)**
417
+
418
+ 1. Go to Packagist package page
419
+ 2. Copy API Token
420
+ 3. Go to GitHub repo → Settings → Webhooks → Add webhook
421
+ 4. Payload URL: `https://packagist.org/api/github?username=PACKAGIST_USERNAME`
422
+ 5. Content type: `application/json`
423
+ 6. Secret: Paste API token
424
+ 7. Events: "Just the push event"
425
+
426
+ **Option 2: Manual Update**
427
+
428
+ ```bash
429
+ # Update package manually on Packagist
430
+ # Visit: https://packagist.org/packages/fastqr/fastqr
431
+ # Click "Update"
432
+ ```
433
+
434
+ ### Step 5: Tag Release
435
+
436
+ ```bash
437
+ # Create and push tag
438
+ git tag -a v1.0.0 -m "Release version 1.0.0"
439
+ git push origin v1.0.0
440
+
441
+ # Packagist will auto-detect new tag (if webhook is configured)
442
+ ```
443
+
444
+ ### Step 6: Verify
445
+
446
+ ```bash
447
+ # Users can now install with just:
448
+ composer require fastqr/fastqr
449
+
450
+ # No need to install qrencode or vips!
451
+
452
+ # Or via composer.json:
453
+ # "require": {
454
+ # "fastqr/fastqr": "^1.0"
455
+ # }
456
+ ```
457
+
458
+ ### Update Version
459
+
460
+ ```bash
461
+ # 1. Update version in composer.json (optional, Packagist uses git tags)
462
+ # 2. Commit changes
463
+ git commit -am "Update to v1.0.1"
464
+
465
+ # 3. Rebuild binaries using GitHub Actions
466
+
467
+ # 4. Create new tag
468
+ git tag -a v1.0.1 -m "Release version 1.0.1"
469
+ git push origin v1.0.1
470
+
471
+ # Packagist will auto-update if webhook is configured
472
+ ```
473
+
474
+ ---
475
+
476
+ ## 🚀 GitHub Releases
477
+
478
+ ### Step 1: Create Tag
479
+
480
+ ```bash
481
+ # Create tag
482
+ git tag -a v1.0.0 -m "Release version 1.0.0"
483
+ git push origin v1.0.0
484
+ ```
485
+
486
+ ### Step 2: Create Release on GitHub
487
+
488
+ 1. Go to: `https://github.com/tranhuucanh/fastqr/releases/new`
489
+ 2. Choose tag: `v1.0.0`
490
+ 3. Release title: `FastQR v1.0.0`
491
+ 4. Description: Release notes
492
+ 5. Upload assets:
493
+ - Source code (auto)
494
+ - `fastqr-1.0.0-linux-x64.deb`
495
+ - `fastqr-1.0.0-macos-arm64.tar.gz`
496
+ - `fastqr-1.0.0.gem`
497
+ - `fastqr-1.0.0.tgz` (npm)
498
+ - `fastqr-binaries-all.tar.gz` (all pre-built binaries)
499
+ 6. Click "Publish release"
500
+
501
+ ### Step 3: Build and Upload Assets
502
+
503
+ GitHub Actions workflow will automatically build and upload assets when you push a tag.
504
+
505
+ Alternatively, build manually:
506
+
507
+ ```bash
508
+ # Build DEB package
509
+ dpkg-buildpackage -us -uc -b
510
+ mv ../fastqr_1.0.0-1_amd64.deb ./fastqr-1.0.0-linux-x64.deb
511
+
512
+ # Build binaries for all platforms
513
+ ./scripts/build-binaries.sh
514
+
515
+ # Build Ruby gem (with binaries)
516
+ gem build fastqr.gemspec
517
+
518
+ # Build npm package (with binaries)
519
+ cd bindings/nodejs
520
+ npm pack
521
+ cd ../..
522
+
523
+ # Upload via GitHub UI or use GitHub CLI:
524
+ gh release upload v1.0.0 \
525
+ fastqr-1.0.0-linux-x64.deb \
526
+ fastqr-1.0.0-macos-arm64.tar.gz \
527
+ fastqr-1.0.0.gem \
528
+ bindings/nodejs/fastqr-1.0.0.tgz
529
+ ```
530
+
531
+ ---
532
+
533
+ ## 📝 Release Checklist
534
+
535
+ Before releasing a new version:
536
+
537
+ - [ ] Update version in all files:
538
+ - [ ] `CMakeLists.txt` (project VERSION)
539
+ - [ ] `include/fastqr.h` (FASTQR_VERSION)
540
+ - [ ] `src/fastqr.cpp` (FASTQR_VERSION)
541
+ - [ ] `fastqr.gemspec` (spec.version)
542
+ - [ ] `bindings/ruby/lib/fastqr/version.rb`
543
+ - [ ] `bindings/nodejs/package.json` (version)
544
+ - [ ] `composer.json` (version in description)
545
+
546
+ - [ ] Update CHANGELOG.md with new changes
547
+
548
+ - [ ] Run tests:
549
+ ```bash
550
+ cd build
551
+ make test
552
+ cd ../bindings/ruby && rake test
553
+ cd ../nodejs && npm test
554
+ cd ../php && vendor/bin/phpunit
555
+ ```
556
+
557
+ - [ ] Build pre-compiled binaries for all platforms:
558
+ ```bash
559
+ # Push tag to trigger GitHub Actions
560
+ git tag -a v1.0.1 -m "Release version 1.0.1"
561
+ git push origin v1.0.1
562
+ # GitHub Actions will build binaries automatically
563
+ ```
564
+
565
+ - [ ] Test on all platforms:
566
+ - [ ] macOS (Intel + ARM)
567
+ - [ ] Ubuntu 20.04, 22.04
568
+ - [ ] Debian 11, 12
569
+
570
+ - [ ] Commit changes:
571
+ ```bash
572
+ git commit -am "Bump version to 1.0.1"
573
+ ```
574
+
575
+ - [ ] Publish to package managers:
576
+ - [ ] Homebrew (update formula)
577
+ - [ ] RubyGems: `gem push fastqr-1.0.1.gem`
578
+ - [ ] npm: `npm publish`
579
+ - [ ] Packagist (auto via webhook)
580
+
581
+ - [ ] Create GitHub Release with assets
582
+
583
+ - [ ] Announce on:
584
+ - [ ] GitHub Discussions
585
+ - [ ] Twitter/X
586
+ - [ ] Reddit (r/ruby, r/node, r/PHP)
587
+
588
+ ---
589
+
590
+ ## 🆘 Troubleshooting
591
+
592
+ ### Homebrew
593
+
594
+ **Problem**: Formula fails audit
595
+
596
+ ```bash
597
+ # Fix common issues:
598
+ brew audit --strict --online fastqr.rb
599
+
600
+ # Check style:
601
+ brew style fastqr.rb
602
+ ```
603
+
604
+ **Problem**: Wrong SHA256
605
+
606
+ ```bash
607
+ # Recalculate:
608
+ shasum -a 256 v1.0.0.tar.gz
609
+ ```
610
+
611
+ ### RubyGems
612
+
613
+ **Problem**: Gem build fails
614
+
615
+ ```bash
616
+ # Check gemspec:
617
+ gem spec fastqr.gemspec
618
+
619
+ # Validate:
620
+ gem build --verbose fastqr.gemspec
621
+ ```
622
+
623
+ **Problem**: Pre-built binary not loading
624
+
625
+ ```bash
626
+ # Check if binaries are included:
627
+ gem unpack fastqr-1.0.0.gem
628
+ ls fastqr-1.0.0/bindings/ruby/prebuilt/
629
+
630
+ # Check platform detection:
631
+ ruby -r fastqr/platform -e "puts FastQR::Platform.platform"
632
+ ```
633
+
634
+ ### npm
635
+
636
+ **Problem**: Native addon fails to build
637
+
638
+ ```bash
639
+ # Should use pre-built binary instead
640
+ # Check if binaries are included:
641
+ npm pack --dry-run | grep prebuilt
642
+
643
+ # Check platform detection:
644
+ node -e "const p = require('./lib/platform'); console.log(p.detectPlatform())"
645
+ ```
646
+
647
+ **Problem**: Module not found
648
+
649
+ ```bash
650
+ # Check package structure:
651
+ npm pack --dry-run
652
+ ```
653
+
654
+ ### PHP/Composer
655
+
656
+ **Problem**: Packagist not updating
657
+
658
+ ```bash
659
+ # Check webhook:
660
+ # GitHub → Settings → Webhooks → Recent Deliveries
661
+
662
+ # Manual update:
663
+ # Visit: https://packagist.org/packages/fastqr/fastqr
664
+ # Click "Update"
665
+ ```
666
+
667
+ **Problem**: FFI library not found
668
+
669
+ ```bash
670
+ # Check if binaries are in composer package:
671
+ composer show -i fastqr/fastqr
672
+ ls vendor/fastqr/fastqr/bindings/php/prebuilt/
673
+
674
+ # Check platform detection:
675
+ php -r "echo PHP_OS_FAMILY;"
676
+ ```
677
+
678
+ **Problem**: FFI extension not available
679
+
680
+ ```bash
681
+ # Check PHP FFI extension:
682
+ php -m | grep ffi
683
+
684
+ # Install if missing:
685
+ # Ubuntu: sudo apt-get install php-ffi
686
+ # macOS: brew install php (includes FFI)
687
+ ```
688
+
689
+ ---
690
+
691
+ ## 📚 Resources
692
+
693
+ - [Homebrew Formula Cookbook](https://docs.brew.sh/Formula-Cookbook)
694
+ - [Debian Packaging Tutorial](https://www.debian.org/doc/manuals/maint-guide/)
695
+ - [RubyGems Guides](https://guides.rubygems.org/)
696
+ - [npm Publishing Guide](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry)
697
+ - [Packagist Documentation](https://packagist.org/about)
698
+ - [GitHub Actions Documentation](https://docs.github.com/en/actions)
699
+
700
+ ---
701
+
702
+ ## 🎯 Pre-built Binaries
703
+
704
+ Starting from v1.0.0, FastQR includes pre-built binaries for:
705
+
706
+ - **macOS**: arm64 (Apple Silicon), x86_64 (Intel)
707
+ - **Linux**: x86_64, arm64
708
+
709
+ These binaries are automatically bundled in:
710
+ - Ruby gems
711
+ - npm packages
712
+ - Composer packages (committed to repository)
713
+
714
+ **This means users can install with just:**
715
+ - `gem install fastqr` - no system dependencies needed!
716
+ - `npm install fastqr` - no system dependencies needed!
717
+ - `composer require fastqr/fastqr` - no system dependencies needed!
718
+
719
+ The binaries are built automatically by GitHub Actions on every tagged release.
720
+
721
+ ---
722
+
723
+ **Important Note**: For LGPL license compliance, when distributing binary packages:
724
+
725
+ 1. Include LICENSE file
726
+ 2. Include link to source code
727
+ 3. Include BUILD.md with build instructions
728
+ 4. State that the package uses libqrencode and libvips
729
+
730
+ This ensures LGPL requirements are met for static linking.