hamlib 0.1.27 → 0.2.0

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.
package/binding.gyp CHANGED
@@ -2,19 +2,20 @@
2
2
  "targets": [
3
3
  {
4
4
  "target_name": "hamlib",
5
- "sources": [
5
+ "sources": [
6
6
  "src/hamlib.cpp",
7
7
  "src/decoder.cpp",
8
8
  "src/addon.cpp"
9
9
  ],
10
10
  "include_dirs": [
11
11
  "include",
12
+ "src/shim",
12
13
  "<!@(node -p \"require('node-addon-api').include\")"
13
14
  ],
14
15
  "dependencies": [
15
16
  "<!(node -p \"require('node-addon-api').gyp\")"
16
17
  ],
17
- "defines": [
18
+ "defines": [
18
19
  "NAPI_DISABLE_CPP_EXCEPTIONS"
19
20
  ],
20
21
  "cflags!": [ "-fno-exceptions" ],
@@ -28,6 +29,7 @@
28
29
  "/usr/local/include"
29
30
  ],
30
31
  "libraries": [
32
+ "<(module_root_dir)/shim-build/libhamlib_shim.a",
31
33
  "<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log('-L' + process.env.HAMLIB_PREFIX + '/lib')\")",
32
34
  "-L/usr/lib",
33
35
  "-L/usr/local/lib",
@@ -49,6 +51,7 @@
49
51
  "/opt/homebrew/opt/libusb/include"
50
52
  ],
51
53
  "libraries": [
54
+ "<(module_root_dir)/shim-build/libhamlib_shim.a",
52
55
  "<!@(node -e \"if(process.env.HAMLIB_PREFIX) console.log('-L' + process.env.HAMLIB_PREFIX + '/lib')\")",
53
56
  "-L/usr/local/lib",
54
57
  "-L/usr/local/opt/hamlib/lib",
@@ -75,89 +78,19 @@
75
78
  ],
76
79
  "conditions": [
77
80
  ["target_arch==\"x64\"", {
78
- "conditions": [
79
- # Check if we're in MinGW environment (HAMLIB_ROOT is set to /mingw64)
80
- ["\"<!(node -e \"console.log(process.env.HAMLIB_ROOT || '')\")\"==\"/mingw64\"", {
81
- "include_dirs": [
82
- "/mingw64/include"
83
- ],
84
- "library_dirs": [
85
- "/mingw64/lib"
86
- ],
87
- "libraries": [
88
- "-lhamlib",
89
- "-lws2_32",
90
- "-lwinmm"
91
- ],
92
- "cflags": [
93
- "-I/mingw64/include"
94
- ],
95
- "ldflags": [
96
- "-L/mingw64/lib",
97
- "-static-libgcc",
98
- "-static-libstdc++"
99
- ]
100
- }, {
101
- # Traditional Windows build with Visual C++
102
- "include_dirs": [
103
- # Try environment variable in different formats
104
- "<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/include')\")",
105
- # Fallback paths
106
- "C:/hamlib/include",
107
- "C:/Program Files/Hamlib/include",
108
- "C:/Program Files (x86)/Hamlib/include"
109
- ],
110
- "library_dirs": [
111
- # Try environment variable paths
112
- "<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/bin')\")",
113
- "<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib')\")",
114
- "<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib/gcc')\")",
115
- "<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib/x64')\")",
116
- "<!(node -e \"console.log((process.env.HAMLIB_ROOT || 'C:/hamlib') + '/lib/msvc')\")",
117
- # Fallback paths
118
- "C:/hamlib/bin",
119
- "C:/hamlib/lib",
120
- "C:/hamlib/lib/gcc",
121
- "C:/hamlib/lib/x64",
122
- "C:/hamlib/lib/Release",
123
- "C:/Program Files/Hamlib/bin",
124
- "C:/Program Files/Hamlib/lib",
125
- "C:/Program Files/Hamlib/lib/gcc",
126
- "C:/Program Files (x86)/Hamlib/bin",
127
- "C:/Program Files (x86)/Hamlib/lib"
128
- ],
129
- "libraries": [
130
- # Link against the import library present in hamlib-w64 zip
131
- "libhamlib-4.lib",
132
- # Common Win32 system libs used by hamlib
133
- "Ws2_32.lib",
134
- "Winmm.lib"
135
- ],
136
- "conditions": [
137
- # Add pthread paths only if PTHREAD_ROOT is set
138
- ["\"<!(node -e \"console.log(process.env.PTHREAD_ROOT || '')\")\"!=\"\"", {
139
- "include_dirs": [
140
- # Headers are placed directly under PTHREAD_ROOT to match this include path
141
- "<!(node -e \"console.log((process.env.PTHREAD_ROOT || 'C:/pthread-win32'))\")"
142
- ],
143
- "library_dirs": [
144
- "<!(node -e \"console.log((process.env.PTHREAD_ROOT || 'C:/pthread-win32') + '/lib/x64')\")",
145
- "<!(node -e \"console.log((process.env.PTHREAD_ROOT || 'C:/pthread-win32') + '/lib')\")"
146
- ],
147
- "libraries": [
148
- # Only link the MSVC import library we download from Sourceware
149
- "pthreadVC2.lib"
150
- ]
151
- }]
152
- ],
153
- "msvs_settings": {
154
- "VCCLCompilerTool": {
155
- "ExceptionHandling": 1,
156
- "AdditionalOptions": ["/std:c++14"]
157
- }
158
- }
159
- }]
160
- ]
81
+ "library_dirs": [
82
+ "<(module_root_dir)/shim-build"
83
+ ],
84
+ "libraries": [
85
+ "hamlib_shim.lib",
86
+ "Ws2_32.lib"
87
+ ],
88
+ "msvs_settings": {
89
+ "VCCLCompilerTool": {
90
+ "ExceptionHandling": 1,
91
+ "AdditionalOptions": ["/std:c++14"]
92
+ }
93
+ }
161
94
  }]
162
95
  ]
163
96
  }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamlib",
3
- "version": "0.1.27",
3
+ "version": "0.2.0",
4
4
  "description": "Node.js wrapper for hamlib radio control library",
5
5
  "main": "index.js",
6
6
  "module": "lib/index.mjs",
Binary file
Binary file
Binary file
package/src/addon.cpp CHANGED
@@ -1,12 +1,12 @@
1
1
  #include <napi.h>
2
2
  #include "hamlib.h"
3
3
  #include "decoder.h"
4
- #include <hamlib/rig.h>
4
+ #include "shim/hamlib_shim.h"
5
5
 
6
6
  Napi::Object Init(Napi::Env env, Napi::Object exports) {
7
7
  // Set Hamlib debug level to NONE by default to prevent unwanted output
8
8
  // Users can change this using HamLib.setDebugLevel() if needed
9
- rig_set_debug(RIG_DEBUG_NONE);
9
+ shim_rig_set_debug(0); // 0 = RIG_DEBUG_NONE
10
10
 
11
11
  Napi::String name = Napi::String::New(env, "HamLib");
12
12
  exports.Set(name, NodeHamLib::GetClass(env));