···
68
-
installer = pkgs.stdenv.mkDerivation {
69
-
name = "shortwave-installer";
73
-
nativeBuildInputs = with pkgs; [
77
-
buildInputs = [ self'.packages.shortwave ];
79
-
# Create staging directory
82
-
# Copy executable and DLLs
83
-
cp ${self'.packages.shortwave}/bin/Shortwave.exe staging/
85
-
cp libs/bass.dll staging/
87
-
cp shortwave.ico staging/
89
-
# Copy documentation
90
-
cp LICENSE.md staging/
91
-
cp README.md staging/
95
-
makensis -NOCD ../installer.nsi
97
-
# Rename output to expected installer name
98
-
if [ -f ShortwaveRadioInstaller.exe ]; then
99
-
mv ShortwaveRadioInstaller.exe ../
101
-
echo "✗ Installer was not created by makensis"
110
-
cp ShortwaveRadioInstaller.exe $out/bin/
deploy-to-xp = pkgs.writeShellScriptBin "deploy-to-xp" ''
echo "rebuilding program"
···
175
-
echo "Shortwave Radio development environment loaded"
176
-
echo "Available commands:"
177
-
echo " nix build - Build the Shortwave Radio application"
178
-
echo " nix build .#installer - Build Windows installer"
179
-
echo " build-installer - Build installer (shortcut)"
180
-
echo " deploy-to-xp - Deploy to XP VM folder"
182
-
echo "Setting up development environment..."
184
-
# Get dynamic paths from nix packages
185
-
GCC_BASE="${pkgs.pkgsCross.mingw32.buildPackages.gcc}/i686-w64-mingw32"
186
-
SYS_INCLUDE="$GCC_BASE/sys-include"
187
-
MINGW_MAIN_INCLUDE="${pkgs.pkgsCross.mingw32.windows.mingw_w64.dev}/include"
188
-
CPP_INCLUDE="${pkgs.lib.getDev pkgs.pkgsCross.mingw32.buildPackages.gcc}/include/c++/10.3.0"
189
-
CPP_TARGET_INCLUDE="$CPP_INCLUDE/i686-w64-mingw32"
191
-
# Auto-generate .clangd config with correct paths
192
-
cat > .clangd << EOF
198
-
- -D_WIN32_WINNT=0x0501
199
-
- -DWIN32_LEAN_AND_MEAN
207
-
- $MINGW_MAIN_INCLUDE
211
-
- $CPP_TARGET_INCLUDE
213
-
- -I*/gcc/*/include
129
+
# Get dynamic paths from nix packages
130
+
GCC_BASE="${pkgs.pkgsCross.mingw32.buildPackages.gcc}/i686-w64-mingw32"
131
+
SYS_INCLUDE="$GCC_BASE/sys-include"
132
+
MINGW_MAIN_INCLUDE="${pkgs.pkgsCross.mingw32.windows.mingw_w64.dev}/include"
133
+
CPP_INCLUDE="${pkgs.lib.getDev pkgs.pkgsCross.mingw32.buildPackages.gcc}/include/c++/10.3.0"
134
+
CPP_TARGET_INCLUDE="$CPP_INCLUDE/i686-w64-mingw32"
216
-
cat > compile_commands.json << EOF
219
-
"directory": "$(pwd)",
220
-
"command": "i686-w64-mingw32-g++ -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -std=c++17 -isystem \"$SYS_INCLUDE\" -isystem \"$MINGW_MAIN_INCLUDE\" -isystem \"$CPP_INCLUDE\" -isystem \"$CPP_TARGET_INCLUDE\" -c main.cpp",
136
+
# Auto-generate .clangd config with correct paths
137
+
cat > .clangd <<EOF
143
+
- -D_WIN32_WINNT=0x0501
144
+
- -DWIN32_LEAN_AND_MEAN
152
+
- $MINGW_MAIN_INCLUDE
156
+
- $CPP_TARGET_INCLUDE
158
+
- -I*/gcc/*/include
226
-
echo "✓ Generated .clangd config and compile_commands.json with include paths"
227
-
echo "✓ Development environment ready for Shortwave Radio development"
161
+
cat > compile_commands.json <<EOF
164
+
"directory": "$(pwd)",
165
+
"command": "i686-w64-mingw32-g++ -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -std=c++17 -isystem \"$SYS_INCLUDE\" -isystem \"$MINGW_MAIN_INCLUDE\" -isystem \"$CPP_INCLUDE\" -isystem \"$CPP_TARGET_INCLUDE\" -c main.cpp",