Skip to content

Commit

Permalink
Fix index exports
Browse files Browse the repository at this point in the history
  • Loading branch information
raub committed Oct 24, 2023
1 parent d9b7dcf commit 92c9608
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 62 deletions.
117 changes: 57 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ binaries through **NPM** for **Node.js** addons.
* Library: Qt.
* Linking: dynamic dll-type.


## Usage

### Windows

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

```javascript
'variables': {
'bin' : '<!(node -p "require(\'addon-tools-raub\').bin")',
'qt_core_bin' : '<!(node -p "require(\'deps-qt-core-raub\').bin")',
'qt_gui_bin' : '<!(node -p "require(\'deps-qt-gui-raub\').bin")',
'qt_qml_bin' : '<!(node -e "require(\'deps-qt-qml-raub\').bin")',
},
...
'targets': [
{
'target_name': '...',
'conditions': [
['OS=="linux"', {
'libraries': [
"-Wl,-rpath,'$$ORIGIN'",
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-core-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-gui-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-qml-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-core-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-gui-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-qml-raub/<(bin)'",
'<(qt_core_bin)/libicui18n.so.56',
'<(qt_core_bin)/libicuuc.so.56',
'<(qt_core_bin)/libicudata.so.56',
'<(qt_core_bin)/libicuio.so.56',
'<(qt_core_bin)/libicule.so.56',
'<(qt_core_bin)/libicutu.so.56',
'<(qt_core_bin)/libQt5Core.so.5',
'<(qt_core_bin)/libQt5Network.so.5',
'<(qt_core_bin)/libQt5DBus.so.5',
'<(qt_gui_bin)/libQt5Gui.so.5',
'<(qt_gui_bin)/libQt5OpenGL.so.5',
'<(qt_gui_bin)/libQt5Widgets.so.5',
'<(qt_gui_bin)/libQt5XcbQpa.so.5',
'<(qt_qml_bin)/libQt5Qml.so.5',
'<(qt_qml_bin)/libQt5Quick.so.5',
'<(qt_qml_bin)/libQt5QuickControls2.so.5',
'<(qt_qml_bin)/libQt5QuickTemplates2.so.5',
'<(qt_qml_bin)/libQt5QuickWidgets.so.5',
],
}],
['OS=="mac"', {
'libraries': [
'-Wl,-rpath,@loader_path',
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-core-raub/<(bin)',
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-gui-raub/<(bin)',
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-qml-raub/<(bin)',
'-Wl,-rpath,@loader_path/../../deps-qt-core-raub/<(bin)',
'-Wl,-rpath,@loader_path/../../deps-qt-gui-raub/<(bin)',
'-Wl,-rpath,@loader_path/../../deps-qt-qml-raub/<(bin)',
],
}],
],
},
'variables': {
'bin': '<!(node -p "require(\'addon-tools-raub\').bin")',
'qt_core_bin': '<!(node -p "require(\'deps-qt-core-raub\').bin")',
'qt_gui_bin': '<!(node -p "require(\'deps-qt-gui-raub\').bin")',
'qt_qml_bin': '<!(node -e "require(\'deps-qt-qml-raub\').bin")',
},
...
'targets': [
{
'target_name': '...',
'conditions': [
['OS=="linux"', {
'libraries': [
"-Wl,-rpath,'$$ORIGIN'",
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-core-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-gui-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../node_modules/deps-qt-qml-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-core-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-gui-raub/<(bin)'",
"-Wl,-rpath,'$$ORIGIN/../../deps-qt-qml-raub/<(bin)'",
'<(qt_core_bin)/libicui18n.so.56',
'<(qt_core_bin)/libicuuc.so.56',
'<(qt_core_bin)/libicudata.so.56',
'<(qt_core_bin)/libicuio.so.56',
'<(qt_core_bin)/libicule.so.56',
'<(qt_core_bin)/libicutu.so.56',
'<(qt_core_bin)/libQt5Core.so.5',
'<(qt_core_bin)/libQt5Network.so.5',
'<(qt_core_bin)/libQt5DBus.so.5',
'<(qt_gui_bin)/libQt5Gui.so.5',
'<(qt_gui_bin)/libQt5OpenGL.so.5',
'<(qt_gui_bin)/libQt5Widgets.so.5',
'<(qt_gui_bin)/libQt5XcbQpa.so.5',
'<(qt_qml_bin)/libQt5Qml.so.5',
'<(qt_qml_bin)/libQt5Quick.so.5',
'<(qt_qml_bin)/libQt5QuickControls2.so.5',
'<(qt_qml_bin)/libQt5QuickTemplates2.so.5',
'<(qt_qml_bin)/libQt5QuickWidgets.so.5',
],
}],
['OS=="mac"', {
'libraries': [
'-Wl,-rpath,@loader_path',
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-core-raub/<(bin)',
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-gui-raub/<(bin)',
'-Wl,-rpath,@loader_path/../node_modules/deps-qt-qml-raub/<(bin)',
'-Wl,-rpath,@loader_path/../../deps-qt-core-raub/<(bin)',
'-Wl,-rpath,@loader_path/../../deps-qt-gui-raub/<(bin)',
'-Wl,-rpath,@loader_path/../../deps-qt-qml-raub/<(bin)',
],
}],
],
},
```


Expand Down
20 changes: 19 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
declare module "deps-qt-core-raub" {
declare module "deps-qt-qml-raub" {
/**
* Exports of `deps-qt-core-raub`
*/
export const core: {
bin: string;
include: string;
};

/**
* Exports of `deps-qt-gui-raub`
*/
export const gui: {
bin: string;
include: string;
};

/**
* Path to binaries
*
* Platform binary directory absolute path
*/
export const bin: string;
/**
* Path to includes
*
* Include directory for this module
*/
export const include: string;
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ const gui = require('deps-qt-gui-raub');
module.exports = {
gui,
core : gui.core,
...tools.paths(__dirname),
...require('addon-tools-raub').getPaths(__dirname),
};

0 comments on commit 92c9608

Please sign in to comment.