Skip to content

Commit 78f8d29

Browse files
author
Metacraft Labs
committed
Fix the non-nix-build on macOS
1 parent 56d92b8 commit 78f8d29

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

non-nix-build/build_with_nim.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
# depends on env `$ROOT_DIR` and `$DIST_DIR`
44
# and nim 1.6 installed
55
# and valid env `$LIBSQLITE3_PATH` at least for nixos
6+
# Set NIM1 env var to override nim command (defaults to nim1 from nix)
67

78
set -e
89

10+
NIM1=${NIM1:-nim1}
11+
912
export GIT_ROOT=$(git rev-parse --show-toplevel)
1013

1114
brew install libzip
@@ -20,7 +23,7 @@ echo "==========="
2023
# run-time decisions.
2124

2225
# codetracer
23-
nim1 -d:release \
26+
$NIM1 -d:release \
2427
-d:asyncBackend=asyncdispatch \
2528
--passL:"-headerpad_max_install_names" \
2629
--gc:refc --hints:on --warnings:off \
@@ -45,7 +48,7 @@ install_name_tool -add_rpath "@loader_path" "${DIST_DIR}/bin/ct"
4548

4649
codesign -s - --force --deep "${DIST_DIR}/bin/ct"
4750

48-
nim1 -d:release \
51+
$NIM1 -d:release \
4952
-d:asyncBackend=asyncdispatch \
5053
--passL:"-headerpad_max_install_names" \
5154
--gc:refc --hints:on --warnings:off \
@@ -74,15 +77,15 @@ codesign -s - --force --deep "${DIST_DIR}/bin/db-backend-record"
7477

7578

7679
# index.js
77-
nim1 \
80+
$NIM1 \
7881
--hints:on --warnings:off --sourcemap:on \
7982
-d:ctIndex -d:chronicles_sinks=json \
8083
-d:ctmacos \
8184
-d:nodejs --out:"$DIST_DIR/index.js" js src/frontend/index.nim
8285
cp "$DIST_DIR/index.js" "$DIST_DIR/src/index.js"
8386

8487
# ui.js
85-
nim1 \
88+
$NIM1 \
8689
--hints:off --warnings:off \
8790
-d:chronicles_enabled=off \
8891
-d:ctRenderer \
@@ -91,7 +94,7 @@ nim1 \
9194
cp "$DIST_DIR/ui.js" "$DIST_DIR/src/ui.js"
9295

9396
# subwindow.js
94-
nim1 \
97+
$NIM1 \
9598
--hints:off --warnings:off \
9699
-d:chronicles_enabled=off \
97100
-d:ctRenderer \

0 commit comments

Comments
 (0)