Skip to content

Commit f370792

Browse files
committed
build: added the json and gyp dependency files
1 parent 8daa9ee commit f370792

File tree

4 files changed

+296
-0
lines changed

4 files changed

+296
-0
lines changed
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# @license Apache-2.0
2+
#
3+
# Copyright (c) 2025 The Stdlib Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# A `.gyp` file for building a Node.js native add-on.
18+
#
19+
# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
20+
# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
21+
{
22+
# List of files to include in this file:
23+
"includes": [
24+
"./include.gypi",
25+
],
26+
# Define variables to be used throughout the configuration for all targets:
27+
"variables": {
28+
# Target name should match the add-on export name:
29+
"addon_target_name%": "addon",
30+
# Set variables based on the host OS:
31+
"conditions": [
32+
[
33+
'OS=="win"',
34+
{
35+
# Define the object file suffix:
36+
"obj": "obj",
37+
},
38+
{
39+
# Define the object file suffix:
40+
"obj": "o",
41+
},
42+
], # end condition (OS=="win")
43+
], # end conditions
44+
}, # end variables
45+
# Define compile targets:
46+
"targets": [
47+
# Target to generate an add-on:
48+
{
49+
# The target name should match the add-on export name:
50+
"target_name": "<(addon_target_name)",
51+
# Define dependencies:
52+
"dependencies": [],
53+
# Define directories which contain relevant include headers:
54+
"include_dirs": [
55+
# Local include directory:
56+
"<@(include_dirs)",
57+
],
58+
# List of source files:
59+
"sources": [
60+
"<@(src_files)",
61+
"src/addon.c",
62+
],
63+
# Settings which should be applied when a target's object files are used as linker input:
64+
"link_settings": {
65+
# Define libraries:
66+
"libraries": [
67+
"<@(libraries)",
68+
],
69+
# Define library directories:
70+
"library_dirs": [
71+
"<@(library_dirs)",
72+
],
73+
},
74+
# C/C++ compiler flags:
75+
"cflags": [
76+
# Enable commonly used warning options:
77+
"-Wall",
78+
# Aggressive optimization:
79+
"-O3",
80+
],
81+
# C specific compiler flags:
82+
"cflags_c": [
83+
# Specify the C standard to which a program is expected to conform:
84+
"-std=c99",
85+
],
86+
# C++ specific compiler flags:
87+
"cflags_cpp": [
88+
# Specify the C++ standard to which a program is expected to conform:
89+
"-std=c++11",
90+
],
91+
# Linker flags:
92+
"ldflags": [],
93+
# Apply conditions based on the host OS:
94+
"conditions": [
95+
[
96+
'OS=="mac"',
97+
{
98+
# Linker flags:
99+
"ldflags": [
100+
"-undefined dynamic_lookup",
101+
"-Wl,-no-pie",
102+
"-Wl,-search_paths_first",
103+
],
104+
},
105+
], # end condition (OS=="mac")
106+
[
107+
'OS!="win"',
108+
{
109+
# C/C++ flags:
110+
"cflags": [
111+
# Generate platform-independent code:
112+
"-fPIC",
113+
],
114+
},
115+
], # end condition (OS!="win")
116+
], # end conditions
117+
}, # end target <(addon_target_name)
118+
# Target to copy a generated add-on to a standard location:
119+
{
120+
"target_name": "copy_addon",
121+
# Declare that the output of this target is not linked:
122+
"type": "none",
123+
# Define dependencies:
124+
"dependencies": [
125+
# Require that the add-on be generated before building this target:
126+
"<(addon_target_name)",
127+
],
128+
# Define a list of actions:
129+
"actions": [
130+
{
131+
"action_name": "copy_addon",
132+
"message": "Copying addon...",
133+
# Explicitly list the inputs in the command-line invocation below:
134+
"inputs": [],
135+
# Declare the expected outputs:
136+
"outputs": [
137+
"<(addon_output_dir)/<(addon_target_name).node",
138+
],
139+
# Define the command-line invocation:
140+
"action": [
141+
"cp",
142+
"<(PRODUCT_DIR)/<(addon_target_name).node",
143+
"<(addon_output_dir)/<(addon_target_name).node",
144+
],
145+
},
146+
], # end actions
147+
}, # end target copy_addon
148+
], # end targets
149+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# @license Apache-2.0
2+
#
3+
# Copyright (c) 2025 The Stdlib Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# A GYP include file for building a Node.js native add-on.
18+
#
19+
# Main documentation:
20+
#
21+
# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
22+
# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
23+
{
24+
# Define variables to be used throughout the configuration for all targets:
25+
"variables": {
26+
# Source directory:
27+
"src_dir": "./src",
28+
# Include directories:
29+
"include_dirs": [
30+
"<!@(node -e \"var arr = require('@stdlib/utils/library-manifest')('./manifest.json',{},{'basedir':process.cwd(),'paths':'posix'}).include; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }\")",
31+
],
32+
# Add-on destination directory:
33+
"addon_output_dir": "./src",
34+
# Source files:
35+
"src_files": [
36+
"<(src_dir)/addon.c",
37+
"<!@(node -e \"var arr = require('@stdlib/utils/library-manifest')('./manifest.json',{},{'basedir':process.cwd(),'paths':'posix'}).src; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }\")",
38+
],
39+
# Library dependencies:
40+
"libraries": [
41+
"<!@(node -e \"var arr = require('@stdlib/utils/library-manifest')('./manifest.json',{},{'basedir':process.cwd(),'paths':'posix'}).libraries; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }\")",
42+
],
43+
# Library directories:
44+
"library_dirs": [
45+
"<!@(node -e \"var arr = require('@stdlib/utils/library-manifest')('./manifest.json',{},{'basedir':process.cwd(),'paths':'posix'}).libpath; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }\")",
46+
],
47+
}, # end variables
48+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"options": {
3+
"task": "build",
4+
"wasm": false
5+
},
6+
"fields": [
7+
{
8+
"field": "src",
9+
"resolve": true,
10+
"relative": true
11+
},
12+
{
13+
"field": "include",
14+
"resolve": true,
15+
"relative": true
16+
},
17+
{
18+
"field": "libraries",
19+
"resolve": false,
20+
"relative": false
21+
},
22+
{
23+
"field": "libpath",
24+
"resolve": true,
25+
"relative": false
26+
}
27+
],
28+
"confs": [
29+
{
30+
"task": "build",
31+
"wasm": false,
32+
"src": [
33+
"./src/main.c"
34+
],
35+
"include": [
36+
"./include"
37+
],
38+
"libraries": [],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/math/base/napi/quaternary",
42+
"@stdlib/math/base/assert/is-nonnegative-integer",
43+
"@stdlib/constants/float64/pinf",
44+
"@stdlib/math/base/assert/is-nan",
45+
"@stdlib/math/base/special/exp",
46+
"@stdlib/math/base/special/factorialln",
47+
"@stdlib/math/base/special/max",
48+
"@stdlib/math/base/special/min"
49+
]
50+
},
51+
{
52+
"task": "benchmark",
53+
"wasm": false,
54+
"src": [
55+
"./src/main.c"
56+
],
57+
"include": [
58+
"./include"
59+
],
60+
"libraries": [],
61+
"libpath": [],
62+
"dependencies": [
63+
"@stdlib/math/base/assert/is-nonnegative-integer",
64+
"@stdlib/constants/float64/pinf",
65+
"@stdlib/math/base/assert/is-nan",
66+
"@stdlib/math/base/special/exp",
67+
"@stdlib/math/base/special/factorialln",
68+
"@stdlib/math/base/special/max",
69+
"@stdlib/math/base/special/min",
70+
"@stdlib/math/base/special/round"
71+
]
72+
},
73+
{
74+
"task": "examples",
75+
"wasm": false,
76+
"src": [
77+
"./src/main.c"
78+
],
79+
"include": [
80+
"./include"
81+
],
82+
"libraries": [],
83+
"libpath": [],
84+
"dependencies": [
85+
"@stdlib/math/base/assert/is-nonnegative-integer",
86+
"@stdlib/constants/float64/pinf",
87+
"@stdlib/math/base/assert/is-nan",
88+
"@stdlib/math/base/special/exp",
89+
"@stdlib/math/base/special/factorialln",
90+
"@stdlib/math/base/special/max",
91+
"@stdlib/math/base/special/min",
92+
"@stdlib/math/base/special/round"
93+
]
94+
}
95+
]
96+
}

lib/node_modules/@stdlib/stats/base/dists/hypergeometric/pmf/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
}
1515
],
1616
"main": "./lib",
17+
"gypfile": true,
1718
"directories": {
1819
"benchmark": "./benchmark",
1920
"doc": "./docs",
2021
"example": "./examples",
22+
"include": "./include",
2123
"lib": "./lib",
24+
"src": "./src",
2225
"test": "./test"
2326
},
2427
"types": "./docs/types",

0 commit comments

Comments
 (0)