Skip to content

Commit 92c9608

Browse files
committed
Fix index exports
1 parent d9b7dcf commit 92c9608

File tree

3 files changed

+77
-62
lines changed

3 files changed

+77
-62
lines changed

README.md

Lines changed: 57 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ binaries through **NPM** for **Node.js** addons.
1717
* Library: Qt.
1818
* Linking: dynamic dll-type.
1919

20-
21-
## Usage
22-
2320
### Windows
2421

2522
Before any import of Qt-dependent module, there should be `require('deps-qt-qml-raub')`.
@@ -34,63 +31,63 @@ to such directories have to be compiled into the node-addon with `rpath` option.
3431
Adjust `binding.gyp`:
3532

3633
```javascript
37-
'variables': {
38-
'bin' : '<!(node -p "require(\'addon-tools-raub\').bin")',
39-
'qt_core_bin' : '<!(node -p "require(\'deps-qt-core-raub\').bin")',
40-
'qt_gui_bin' : '<!(node -p "require(\'deps-qt-gui-raub\').bin")',
41-
'qt_qml_bin' : '<!(node -e "require(\'deps-qt-qml-raub\').bin")',
42-
},
43-
...
44-
'targets': [
45-
{
46-
'target_name': '...',
47-
48-
'conditions': [
49-
50-
['OS=="linux"', {
51-
'libraries': [
52-
"-Wl,-rpath,'$$ORIGIN'",
53-
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-core-raub/<(bin)'",
54-
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-gui-raub/<(bin)'",
55-
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-qml-raub/<(bin)'",
56-
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-core-raub/<(bin)'",
57-
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-gui-raub/<(bin)'",
58-
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-qml-raub/<(bin)'",
59-
'<(qt_core_bin)/libicui18n.so.56',
60-
'<(qt_core_bin)/libicuuc.so.56',
61-
'<(qt_core_bin)/libicudata.so.56',
62-
'<(qt_core_bin)/libicuio.so.56',
63-
'<(qt_core_bin)/libicule.so.56',
64-
'<(qt_core_bin)/libicutu.so.56',
65-
'<(qt_core_bin)/libQt5Core.so.5',
66-
'<(qt_core_bin)/libQt5Network.so.5',
67-
'<(qt_core_bin)/libQt5DBus.so.5',
68-
'<(qt_gui_bin)/libQt5Gui.so.5',
69-
'<(qt_gui_bin)/libQt5OpenGL.so.5',
70-
'<(qt_gui_bin)/libQt5Widgets.so.5',
71-
'<(qt_gui_bin)/libQt5XcbQpa.so.5',
72-
'<(qt_qml_bin)/libQt5Qml.so.5',
73-
'<(qt_qml_bin)/libQt5Quick.so.5',
74-
'<(qt_qml_bin)/libQt5QuickControls2.so.5',
75-
'<(qt_qml_bin)/libQt5QuickTemplates2.so.5',
76-
'<(qt_qml_bin)/libQt5QuickWidgets.so.5',
77-
],
78-
}],
79-
80-
['OS=="mac"', {
81-
'libraries': [
82-
'-Wl,-rpath,@loader_path',
83-
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-core-raub/<(bin)',
84-
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-gui-raub/<(bin)',
85-
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-qml-raub/<(bin)',
86-
'-Wl,-rpath,@loader_path/../../deps-qt-core-raub/<(bin)',
87-
'-Wl,-rpath,@loader_path/../../deps-qt-gui-raub/<(bin)',
88-
'-Wl,-rpath,@loader_path/../../deps-qt-qml-raub/<(bin)',
89-
],
90-
}],
91-
92-
],
93-
},
34+
'variables': {
35+
'bin': '<!(node -p "require(\'addon-tools-raub\').bin")',
36+
'qt_core_bin': '<!(node -p "require(\'deps-qt-core-raub\').bin")',
37+
'qt_gui_bin': '<!(node -p "require(\'deps-qt-gui-raub\').bin")',
38+
'qt_qml_bin': '<!(node -e "require(\'deps-qt-qml-raub\').bin")',
39+
},
40+
...
41+
'targets': [
42+
{
43+
'target_name': '...',
44+
45+
'conditions': [
46+
47+
['OS=="linux"', {
48+
'libraries': [
49+
"-Wl,-rpath,'$$ORIGIN'",
50+
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-core-raub/<(bin)'",
51+
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-gui-raub/<(bin)'",
52+
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-qml-raub/<(bin)'",
53+
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-core-raub/<(bin)'",
54+
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-gui-raub/<(bin)'",
55+
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-qml-raub/<(bin)'",
56+
'<(qt_core_bin)/libicui18n.so.56',
57+
'<(qt_core_bin)/libicuuc.so.56',
58+
'<(qt_core_bin)/libicudata.so.56',
59+
'<(qt_core_bin)/libicuio.so.56',
60+
'<(qt_core_bin)/libicule.so.56',
61+
'<(qt_core_bin)/libicutu.so.56',
62+
'<(qt_core_bin)/libQt5Core.so.5',
63+
'<(qt_core_bin)/libQt5Network.so.5',
64+
'<(qt_core_bin)/libQt5DBus.so.5',
65+
'<(qt_gui_bin)/libQt5Gui.so.5',
66+
'<(qt_gui_bin)/libQt5OpenGL.so.5',
67+
'<(qt_gui_bin)/libQt5Widgets.so.5',
68+
'<(qt_gui_bin)/libQt5XcbQpa.so.5',
69+
'<(qt_qml_bin)/libQt5Qml.so.5',
70+
'<(qt_qml_bin)/libQt5Quick.so.5',
71+
'<(qt_qml_bin)/libQt5QuickControls2.so.5',
72+
'<(qt_qml_bin)/libQt5QuickTemplates2.so.5',
73+
'<(qt_qml_bin)/libQt5QuickWidgets.so.5',
74+
],
75+
}],
76+
77+
['OS=="mac"', {
78+
'libraries': [
79+
'-Wl,-rpath,@loader_path',
80+
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-core-raub/<(bin)',
81+
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-gui-raub/<(bin)',
82+
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-qml-raub/<(bin)',
83+
'-Wl,-rpath,@loader_path/../../deps-qt-core-raub/<(bin)',
84+
'-Wl,-rpath,@loader_path/../../deps-qt-gui-raub/<(bin)',
85+
'-Wl,-rpath,@loader_path/../../deps-qt-qml-raub/<(bin)',
86+
],
87+
}],
88+
89+
],
90+
},
9491
```
9592

9693

index.d.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1-
declare module "deps-qt-core-raub" {
1+
declare module "deps-qt-qml-raub" {
2+
/**
3+
* Exports of `deps-qt-core-raub`
4+
*/
5+
export const core: {
6+
bin: string;
7+
include: string;
8+
};
9+
10+
/**
11+
* Exports of `deps-qt-gui-raub`
12+
*/
13+
export const gui: {
14+
bin: string;
15+
include: string;
16+
};
17+
218
/**
319
* Path to binaries
20+
*
421
* Platform binary directory absolute path
522
*/
623
export const bin: string;
724
/**
825
* Path to includes
26+
*
927
* Include directory for this module
1028
*/
1129
export const include: string;

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ const gui = require('deps-qt-gui-raub');
88
module.exports = {
99
gui,
1010
core : gui.core,
11-
...tools.paths(__dirname),
11+
...require('addon-tools-raub').getPaths(__dirname),
1212
};

0 commit comments

Comments
 (0)