Skip to content

Commit 9d91a32

Browse files
committed
Change gypfiles
1 parent 625f3b1 commit 9d91a32

File tree

7 files changed

+64
-45
lines changed

7 files changed

+64
-45
lines changed

.semaphore/semaphore.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ blocks:
9797
commands:
9898
- sem-version node 18.19.0
9999
- export NODE_ABI=108
100-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
100+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
101101
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
102102
- npx node-pre-gyp package
103103
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -106,7 +106,7 @@ blocks:
106106
commands:
107107
- sem-version node 20.10.0
108108
- export NODE_ABI=115
109-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
109+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
110110
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
111111
- npx node-pre-gyp package
112112
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -115,7 +115,7 @@ blocks:
115115
commands:
116116
- sem-version node 21.4.0
117117
- export NODE_ABI=120
118-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
118+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
119119
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
120120
- npx node-pre-gyp package
121121
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -141,7 +141,7 @@ blocks:
141141
commands:
142142
- sem-version node 18.19.0
143143
- export NODE_ABI=108
144-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
144+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
145145
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
146146
- npx node-pre-gyp package
147147
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -150,7 +150,7 @@ blocks:
150150
commands:
151151
- sem-version node 20.10.0
152152
- export NODE_ABI=115
153-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
153+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
154154
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
155155
- npx node-pre-gyp package
156156
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -159,7 +159,7 @@ blocks:
159159
commands:
160160
- sem-version node 21.4.0
161161
- export NODE_ABI=120
162-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
162+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
163163
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
164164
- npx node-pre-gyp package
165165
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -184,7 +184,7 @@ blocks:
184184
commands:
185185
- sem-version node 18.19.0
186186
- export NODE_ABI=108
187-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
187+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
188188
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
189189
- npx node-pre-gyp package
190190
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -193,7 +193,7 @@ blocks:
193193
commands:
194194
- sem-version node 20.10.0
195195
- export NODE_ABI=115
196-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
196+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
197197
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
198198
- npx node-pre-gyp package
199199
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
@@ -202,7 +202,7 @@ blocks:
202202
commands:
203203
- sem-version node 21.4.0
204204
- export NODE_ABI=120
205-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
205+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
206206
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
207207
- npx node-pre-gyp package
208208
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}

binding.gyp

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"targets": [
99
{
10-
"target_name": "node-librdkafka",
10+
"target_name": "confluent-kafka-js",
1111
'sources': [
1212
'src/binding.cc',
1313
'src/callbacks.cc',
@@ -86,17 +86,28 @@
8686
],
8787
'conditions': [
8888
[
89-
['OS=="linux"', 'CKJS_LINKING="dynamic"'],
89+
'CKJS_LINKING=="dynamic"',
9090
{
91-
"libraries": [
92-
"../build/deps/librdkafka.so",
93-
"../build/deps/librdkafka++.so",
94-
"-Wl,-rpath='$$ORIGIN/../deps'",
95-
],
96-
}
97-
],
98-
[
99-
['OS=="linux"', 'CKJS_LINKING!="dynamic"'],
91+
"conditions": [
92+
[
93+
'OS=="mac"',
94+
{
95+
"libraries": [
96+
"../build/deps/librdkafka.dylib",
97+
"../build/deps/librdkafka++.dylib",
98+
"-Wl,-rpath='$$ORIGIN/../deps'",
99+
],
100+
},
101+
{
102+
"libraries": [
103+
"../build/deps/librdkafka.so",
104+
"../build/deps/librdkafka++.so",
105+
"-Wl,-rpath='$$ORIGIN/../deps'",
106+
],
107+
},
108+
]
109+
]
110+
},
100111
{
101112
"libraries": [
102113
"../build/deps/librdkafka-static.a",
@@ -105,15 +116,6 @@
105116
],
106117
}
107118
],
108-
[
109-
'OS=="mac"',
110-
{
111-
"libraries": [
112-
"../build/deps/librdkafka.dylib",
113-
"../build/deps/librdkafka++.dylib",
114-
],
115-
}
116-
]
117119
],
118120
},
119121
# Else link against globally installed rdkafka and use

deps/librdkafka.gyp

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"variables": {
3+
"CKJS_LINKING%": "<!(node ../util/get-env.js CKJS_LINKING static)",
4+
},
25
'targets': [
36
{
47
"target_name": "librdkafka",
@@ -25,31 +28,45 @@
2528
"inputs": [
2629
"librdkafka/config.h",
2730
],
31+
"outputs": [
32+
"deps/librdkafka/src/librdkafka.so",
33+
],
2834
"action": [
2935
"make", "-C", "librdkafka", "libs", "install"
3036
],
3137
"conditions": [
3238
[
33-
'OS=="mac"',
39+
'CKJS_LINKING=="dynamic"',
3440
{
35-
'outputs': [
36-
'deps/librdkafka/src-cpp/librdkafka++.dylib',
37-
'deps/librdkafka/src-cpp/librdkafka++.1.dylib',
38-
'deps/librdkafka/src/librdkafka.dylib',
39-
'deps/librdkafka/src/librdkafka.1.dylib'
40-
],
41+
"conditions": [
42+
[
43+
'OS=="mac"',
44+
{
45+
'outputs': [
46+
'deps/librdkafka/src-cpp/librdkafka++.dylib',
47+
'deps/librdkafka/src-cpp/librdkafka++.1.dylib',
48+
'deps/librdkafka/src/librdkafka.dylib',
49+
'deps/librdkafka/src/librdkafka.1.dylib',
50+
]
51+
},
52+
{
53+
'outputs': [
54+
'deps/librdkafka/src-cpp/librdkafka++.so',
55+
'deps/librdkafka/src-cpp/librdkafka++.so.1',
56+
'deps/librdkafka/src/librdkafka.so',
57+
'deps/librdkafka/src/librdkafka.so.1',
58+
],
59+
},
60+
],
61+
]
4162
},
4263
{
4364
'outputs': [
44-
'deps/librdkafka/src-cpp/librdkafka++.so',
45-
'deps/librdkafka/src-cpp/librdkafka++.so.1',
46-
'deps/librdkafka/src/librdkafka.so',
47-
'deps/librdkafka/src/librdkafka.so.1',
4865
'deps/librdkafka/src-cpp/librdkafka++.a',
4966
'deps/librdkafka/src/librdkafka.a',
5067
],
5168
}
52-
]
69+
],
5370
],
5471
}
5572
]

librdkafka.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
* of the MIT license. See the LICENSE.txt file for details.
88
*/
99

10-
var kafka = require('bindings')('node-librdkafka');
10+
var kafka = require('bindings')('confluent-kafka-js');
1111

1212
module.exports = kafka;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test:types": "tsc -p ."
1515
},
1616
"binary": {
17-
"module_name": "node-librdkafka",
17+
"module_name": "confluent-kafka-js",
1818
"module_path": "./build/{configuration}/",
1919
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz",
2020
"host": "https://github.com/confluentinc/confluent-kafka-js/releases/download/",

test/binding.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* of the MIT license. See the LICENSE.txt file for details.
88
*/
99

10-
var addon = require('bindings')('node-librdkafka');
10+
var addon = require('bindings')('confluent-kafka-js');
1111
var t = require('assert');
1212

1313
var consumerConfig = {

test/consumer.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* of the MIT license. See the LICENSE.txt file for details.
88
*/
99

10-
var addon = require('bindings')('node-librdkafka');
10+
var addon = require('bindings')('confluent-kafka-js');
1111
var t = require('assert');
1212

1313
var client;

0 commit comments

Comments
 (0)