Skip to content

Commit 01b3759

Browse files
authored
Merge pull request #3 from Totto16/improvements
Improvements
2 parents 0c0baa4 + f001645 commit 01b3759

File tree

11 files changed

+7194
-6791
lines changed

11 files changed

+7194
-6791
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ jobs:
7575
echo "CXX_LD=lld" >> "$GITHUB_ENV"
7676
echo "OBJC_LD=lld" >> "$GITHUB_ENV"
7777
78+
- name: Unbreak Python in GHA (MacOS 13 image)
79+
if: matrix.config.os == 'macos' && matrix.config.os-version == 13
80+
run: |
81+
# TODO: remove this, after it works again
82+
# A workaround for "The `brew link` step did not complete successfully" error.
83+
# See e.g. https://github.com/Homebrew/homebrew-core/issues/165793#issuecomment-1991817938
84+
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
85+
sudo rm -rf /Library/Frameworks/Python.framework/
86+
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
87+
7888
- name: Setup meson (MacOS)
7989
if: matrix.config.os == 'macos'
8090
run: |
@@ -104,7 +114,7 @@ jobs:
104114
- name: Build and Install OOPetris
105115
run: |
106116
cd oopetris
107-
meson setup build -Dbuildtype=release -Ddefault_library=shared -Dclang_libcpp=${{ matrix.config.os == 'macos' && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }}
117+
meson setup build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ matrix.config.os == 'macos' && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=static_from_buildtype' || '' }}
108118
${{ matrix.config.os == 'ubuntu' && 'sudo' || '' }} meson install -C build
109119
${{ matrix.config.os == 'ubuntu' && 'sudo ldconfig' || '' }}
110120

binding.gyp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# type: ignore
22
{
3+
"variables": {
4+
"oopetris_compiler": "<!(pkg-config oopetris-recordings --variable=compiler)",
5+
},
36
"targets": [
47
{
58
"target_name": "oopetris",
@@ -40,6 +43,15 @@
4043
}
4144
},
4245
],
46+
[
47+
'OS == "linux" and oopetris_compiler == "gcc"',
48+
{
49+
"cflags_cc": [
50+
"-static-libgcc", # to build with a static libgcc (libgcc_s)
51+
"-static-libstdc++", # to build with a static libstdc++
52+
]
53+
},
54+
],
4355
[
4456
'OS != "win"',
4557
{
@@ -58,28 +70,30 @@
5870
],
5971
],
6072
"defines": ["V8_DEPRECATION_WARNINGS=1"],
61-
"sources": ["src/cpp/wrapper.cpp"],
73+
"sources": ["src/cpp/wrapper.cpp", "src/cpp/convert.cpp"],
6274
"include_dirs": [
6375
"<!@(node -e \"require('nan')\")",
6476
"<!@(pkg-config oopetris-recordings --cflags-only-I | sed s/-I//g)",
6577
],
6678
"library_dirs": [
6779
"<!@(pkg-config oopetris-recordings --libs-only-L | sed s/-L//g)",
6880
],
69-
"msvs_settings": { ## settinsg cflags_cc doesn't really work onw windows, so using this
81+
"msvs_settings": { # setting cflags_cc doesn't really work onw windows, so using this
7082
"VCCLCompilerTool": {
7183
"AdditionalOptions": [
7284
"/std:c++latest",
7385
"/W4",
7486
"/EHsc",
7587
"/O2",
88+
"/utf-8", # since fmt.h has some warnings without that
7689
"/wd4100", # since nan.h -> node.h has some warnings regarding that
7790
"<!@(pkg-config oopetris-recordings --cflags)",
7891
]
7992
},
8093
"VCLinkerTool": {
8194
"AdditionalDependencies": [
82-
"<!@(pkg-config oopetris-recordings --libs-only-l | sed s/-l/lib/g |sed 's/\\s/.a /g')", # adjust to the default setting, namely lib<name>.a via some sed magic
95+
# adjust to the default setting, namely lib<name>.a via some sed magic
96+
'<!@(pkg-config oopetris-recordings --libs-only-l | sed s/-l/lib/g | sed "s/\\s/.a /g")',
8397
],
8498
},
8599
},

package-lock.json

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oopetris",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Node js wrapper for oopetris",
55
"gypfile": true,
66
"main": "./dist/index.js",
@@ -17,8 +17,8 @@
1717
"scripts": {
1818
"install": "node-gyp-build",
1919
"build": "npm run build:gyp && npm run compile",
20-
"build:gyp": "prebuildify -t 18.20.4 -t 20.17.0 -t 21.7.3 -t 22.9.0 --strip",
21-
"build:debug": "prebuildify -t 18.20.4 -t 20.17.0 -t 21.7.3 -t 22.9.0 --debug",
20+
"build:gyp": "prebuildify -t 18.20.4 -t 20.18.0 -t 21.7.3 -t 22.9.0 --strip",
21+
"build:debug": "prebuildify -t 18.20.4 -t 20.18.0 -t 21.7.3 -t 22.9.0 --debug",
2222
"compile": "npm run build:tsc",
2323
"build:tsc": "tsc",
2424
"test": "npx jest",
@@ -53,10 +53,10 @@
5353
"devDependencies": {
5454
"@types/jest": "^29.5.13",
5555
"jest": "^29.7.0",
56-
"nan": "^2.20.0",
56+
"nan": "^2.22.0",
5757
"prebuildify": "^6.0.2",
5858
"ts-jest": "^29.2.5",
5959
"ts-node": "^10.9.2",
60-
"typescript": "^5.6.2"
60+
"typescript": "^5.6.3"
6161
}
6262
}

0 commit comments

Comments
 (0)