libsodium-prebuilt
libsodium prebuilt as a shared library and NAN module
Last updated 3 years ago by emilbayes .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install libsodium-prebuilt 
SYNC missed versions from official npm registry.

libsodium-prebuilt

build status Build status

libsodium prebuilt as a shared library and NAN module.

npm install libsodium-prebuilts

Versions

This module will track libsodium versions, but may also increment versions if there are changes to the build process the downstream modules depend on.

libsodium-prebuilt libsodium
1.0.0 1.0.16 / 24.0.1

Usage

require('libsodium-prebuild') // will load symbols
// Load your native module which depends on libsodium-prebuilt

Get platform resolved base path to compiled dependencies:

node -p 'require("libsodium-prebuilt/paths").prefix'

Get path to include directory, eg. for including headers:

node -p 'require("libsodium-prebuilt/paths").include'

Get path to lib directory, eg. for linking to .dylib or .so files:

node -p 'require("libsodium-prebuilt/paths").lib'

Get path to the .lib file for linking on Windows:

node -p 'require("libsodium-prebuilt/paths").win32lib'

Get path to the versioned .dll file for linking on Windows:

node -p 'require("libsodium-prebuilt/paths").win32dll'

Example GYP file

{
    'variables': {
        'target_arch%': '<!(node -p "os.arch()")>'
    },
    'targets': [{
        'target_name': 'project_name',
        'include_dirs': [
          '<!(node -e "require(\'nan\')")',
          '<!(node -p "require(\'libsodium-prebuilt/paths\').include")'
        ],
        'sources': [
            # Source files (.c, .cc, .cpp, etc.)
        ],
        'xcode_settings': {
            'OTHER_CFLAGS': ['-g', '-O3']
        },
        'cflags': ['-g', '-O3'],
        'conditions': [
            ['OS == "win"', {
                'link_settings': {
                    'libraries': [
                        '<!(node -p "require(\'libsodium-prebuilt/paths\').win32lib")',
                    ]
                },
                'msvs_settings': {
                    'VCLinkerTool': {
                        'DelayLoadDLLs': ['<!(node -p "require(\'libsodium-prebuilt/paths\').win32dll")']
                    }
                },
            }],
            ['OS == "mac"', {
              'link_settings': {
                  'libraries': [
                      '-L<!(node -p "require(\'libsodium-prebuilt/paths\').lib")',
                      '-lazy-lsodium',
                  ]
              }
            }],
            ['OS == "linux"', {
                'link_settings': {
                    'libraries': [
                        '-L<!(node -p \'require("libsodium-prebuilt/paths").lib\')',
                        '-z lazy',
                        '-lsodium',
                    ]
                }
            }]
        ],
    }]
}

Contributing

git clone --recursive git://github.com/emilbayes/libsodium-prebuilt.git

License

ISC

Current Tags

  • 1.0.1-0                                ...           latest (3 years ago)

2 Versions

  • 1.0.1-0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (5)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |