mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-02-18 13:03:12 +00:00
chore: chores
This commit is contained in:
parent
ed837760c8
commit
a09f632836
@ -5,18 +5,17 @@ The Nix configuration builds nim-sds by calling nimble tasks directly (no Makefi
|
|||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
```
|
```
|
||||||
flake.nix — Entry point, defines packages and dev shell
|
flake.nix — Entry point, defines packages, dev shell, and utility apps
|
||||||
├── nix/default.nix — Build derivation: configures env, runs nim <task> sds.nims
|
├── nix/default.nix — Build derivation: configures env, runs nim <task> sds.nims
|
||||||
├── nix/shell.nix — Dev shell: sets up NIMBLE_DIR, nimble-links, NIM_LIB_DIR
|
├── nix/shell.nix — Dev shell: sets up NIMBLE_DIR, nimble-links, NIM_LIB_DIR
|
||||||
└── nix/tools.nix — Helper: extracts version from sds.nimble
|
└── nix/tools.nix — Helper: extracts version from sds.nimble
|
||||||
```
|
```
|
||||||
|
|
||||||
The `nimbusBuildSystem` flake input is used **only** for its pinned Nim compiler.
|
The Nim compiler comes from nixpkgs (pinned to 24.11, Nim 2.2.4).
|
||||||
All build logic lives in `sds.nimble` (nimble tasks).
|
All build logic lives in `sds.nimble` (nimble tasks).
|
||||||
|
|
||||||
## Shell
|
## Shell
|
||||||
|
|
||||||
A development shell can be started using:
|
|
||||||
```sh
|
```sh
|
||||||
nix develop '.?submodules=1'
|
nix develop '.?submodules=1'
|
||||||
```
|
```
|
||||||
@ -34,15 +33,10 @@ nix build '.?submodules=1#libsds-android-arm64'
|
|||||||
```
|
```
|
||||||
|
|
||||||
The `?submodules=1` part is required because vendored dependencies are git submodules.
|
The `?submodules=1` part is required because vendored dependencies are git submodules.
|
||||||
For more details see: https://github.com/NixOS/nix/issues/4423
|
|
||||||
|
|
||||||
## Testing
|
## Utility apps
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
nix flake check '.?submodules=1'
|
nix run '.#setup' # Initialize git submodules (run once after clone)
|
||||||
```
|
nix run '.#clean' # Garbage-collect the Nix store
|
||||||
|
|
||||||
Or inside the dev shell:
|
|
||||||
```sh
|
|
||||||
nimble test
|
|
||||||
```
|
```
|
||||||
|
|||||||
@ -1,42 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "- - - - - - - - - - Windows Setup Script - - - - - - - - - -"
|
|
||||||
|
|
||||||
success_count=0
|
|
||||||
failure_count=0
|
|
||||||
|
|
||||||
# Function to execute a command and check its status
|
|
||||||
execute_command() {
|
|
||||||
echo "Executing: $1"
|
|
||||||
if eval "$1"; then
|
|
||||||
echo -e "✓ Command succeeded \n"
|
|
||||||
((success_count++))
|
|
||||||
else
|
|
||||||
echo -e "✗ Command failed \n"
|
|
||||||
((failure_count++))
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "1. -.-.-.-- Set PATH -.-.-.-"
|
|
||||||
export PATH="/c/msys64/usr/bin:/c/msys64/mingw64/bin:/c/msys64/usr/lib:/c/msys64/mingw64/lib:$PATH"
|
|
||||||
|
|
||||||
echo "2. -.-.-.- Verify dependencies -.-.-.-"
|
|
||||||
execute_command "which gcc g++ make cmake cargo upx rustc python"
|
|
||||||
|
|
||||||
echo "3. -.-.-.- Updating submodules -.-.-.-"
|
|
||||||
execute_command "git submodule update --init --recursive"
|
|
||||||
|
|
||||||
echo "4. -.-.-.- Creating tmp directory -.-.-.-"
|
|
||||||
execute_command "mkdir -p tmp"
|
|
||||||
|
|
||||||
echo "5. -.-.-.- Building Nim -.-.-.-"
|
|
||||||
cd vendor/nimbus-build-system/vendor/Nim
|
|
||||||
execute_command "./build_all.bat"
|
|
||||||
cd ../../../..
|
|
||||||
|
|
||||||
echo "6. -.-.-.- Building libsds -.-.-.- "
|
|
||||||
execute_command "make libsds STATIC=0 V=3 -j8"
|
|
||||||
|
|
||||||
echo "Windows setup completed successfully!"
|
|
||||||
echo "✓ Successful commands: $success_count"
|
|
||||||
echo "✗ Failed commands: $failure_count"
|
|
||||||
@ -1,8 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# This script creates nimble-link files for all vendored Nim submodules.
|
# This script creates nimble-link files for all vendored Nim submodules,
|
||||||
# It replaces the dependency on nimbus-build-system's create_nimble_link.sh
|
# allowing Nim's import resolver to find them.
|
||||||
# by inlining the same logic.
|
|
||||||
#
|
#
|
||||||
# Required env vars:
|
# Required env vars:
|
||||||
# NIMBLE_DIR — directory where nimble-link packages are created
|
# NIMBLE_DIR — directory where nimble-link packages are created
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user