tangled
alpha
login
or
join now
dunkirk.sh
/
shortwave
a mega cool windows xp app
0
fork
atom
overview
issues
pulls
pipelines
Compare changes
Choose any two refs to compare.
base:
main
v0.1.2
v0.1.1
v0.1.0
compare:
main
v0.1.2
v0.1.1
v0.1.0
go
+63
-114
7 changed files
expand all
collapse all
unified
split
.gitignore
CMakeLists.txt
flake.nix
icon.aseprite
installer.nsi
shortwave.ico
shortwave.rc
+1
.gitignore
···
5
5
.clangd
6
6
compile_commands.json
7
7
build/
8
8
+
ShortwaveRadioInstaller.exe
+8
-4
CMakeLists.txt
···
14
14
add_compile_options(-fno-threadsafe-statics)
15
15
add_compile_options(-D_GLIBCXX_HAS_GTHREADS=0)
16
16
17
17
-
add_executable(ShortwaveApp WIN32 main.cpp)
17
17
+
if(MINGW)
18
18
+
set(WIN32_ICON shortwave.rc)
19
19
+
endif()
20
20
+
21
21
+
add_executable(ShortwaveApp WIN32 main.cpp ${WIN32_ICON})
18
22
19
23
# Add BASS library from libs directory
20
24
target_include_directories(ShortwaveApp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
···
24
28
target_include_directories(ShortwaveApp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
25
29
26
30
# Minimal static linking and avoid threading dependencies
27
27
-
target_link_options(ShortwaveApp PRIVATE
28
28
-
-static-libgcc
31
31
+
target_link_options(ShortwaveApp PRIVATE
32
32
+
-static-libgcc
29
33
-static-libstdc++
30
34
-static
31
35
-Wl,--subsystem,windows:5.01
···
51
55
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}"
52
56
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}"
53
57
)
54
54
-
endif()
58
58
+
endif()
+40
-97
flake.nix
···
65
65
'';
66
66
};
67
67
68
68
-
installer = pkgs.stdenv.mkDerivation {
69
69
-
name = "shortwave-installer";
70
70
-
version = "1.0.0";
71
71
-
src = ./.;
72
72
-
73
73
-
nativeBuildInputs = with pkgs; [
74
74
-
nsis
75
75
-
];
76
76
-
77
77
-
buildInputs = [ self'.packages.shortwave ];
78
78
-
buildPhase = ''
79
79
-
# Create staging directory
80
80
-
mkdir -p staging
81
81
-
82
82
-
# Copy executable and DLLs
83
83
-
cp ${self'.packages.shortwave}/bin/Shortwave.exe staging/
84
84
-
85
85
-
cp libs/bass.dll staging/
86
86
-
87
87
-
cp shortwave.ico staging/
88
88
-
89
89
-
# Copy documentation
90
90
-
cp LICENSE.md staging/
91
91
-
cp README.md staging/
92
92
-
93
93
-
# Build installer
94
94
-
cd staging
95
95
-
makensis -NOCD ../installer.nsi
96
96
-
97
97
-
# Rename output to expected installer name
98
98
-
if [ -f ShortwaveRadioInstaller.exe ]; then
99
99
-
mv ShortwaveRadioInstaller.exe ../
100
100
-
else
101
101
-
echo "โ Installer was not created by makensis"
102
102
-
exit 1
103
103
-
fi
104
104
-
cd ..
105
105
-
ls
106
106
-
'';
107
107
-
108
108
-
installPhase = ''
109
109
-
mkdir -p $out/bin
110
110
-
cp ShortwaveRadioInstaller.exe $out/bin/
111
111
-
'';
112
112
-
};
113
113
-
114
68
deploy-to-xp = pkgs.writeShellScriptBin "deploy-to-xp" ''
115
69
echo "rebuilding program"
116
70
nix build
···
168
122
pkgsCross.mingw32.buildPackages.gcc
169
123
self'.packages.deploy-to-xp
170
124
self'.packages.build-installer
125
125
+
nsis
171
126
];
172
127
173
128
shellHook = ''
174
174
-
echo "Shortwave Radio development environment loaded"
175
175
-
echo "Available commands:"
176
176
-
echo " nix build - Build the Shortwave Radio application"
177
177
-
echo " nix build .#installer - Build Windows installer"
178
178
-
echo " build-installer - Build installer (shortcut)"
179
179
-
echo " deploy-to-xp - Deploy to XP VM folder"
180
180
-
echo ""
181
181
-
echo "Setting up development environment..."
129
129
+
# Get dynamic paths from nix packages
130
130
+
GCC_BASE="${pkgs.pkgsCross.mingw32.buildPackages.gcc}/i686-w64-mingw32"
131
131
+
SYS_INCLUDE="$GCC_BASE/sys-include"
132
132
+
MINGW_MAIN_INCLUDE="${pkgs.pkgsCross.mingw32.windows.mingw_w64.dev}/include"
133
133
+
CPP_INCLUDE="${pkgs.lib.getDev pkgs.pkgsCross.mingw32.buildPackages.gcc}/include/c++/10.3.0"
134
134
+
CPP_TARGET_INCLUDE="$CPP_INCLUDE/i686-w64-mingw32"
182
135
183
183
-
# Get dynamic paths from nix packages
184
184
-
GCC_BASE="${pkgs.pkgsCross.mingw32.buildPackages.gcc}/i686-w64-mingw32"
185
185
-
SYS_INCLUDE="$GCC_BASE/sys-include"
186
186
-
MINGW_MAIN_INCLUDE="${pkgs.pkgsCross.mingw32.windows.mingw_w64.dev}/include"
187
187
-
CPP_INCLUDE="${pkgs.lib.getDev pkgs.pkgsCross.mingw32.buildPackages.gcc}/include/c++/10.3.0"
188
188
-
CPP_TARGET_INCLUDE="$CPP_INCLUDE/i686-w64-mingw32"
189
189
-
190
190
-
# Auto-generate .clangd config with correct paths
191
191
-
cat > .clangd << EOF
192
192
-
CompileFlags:
193
193
-
Add:
194
194
-
- -target
195
195
-
- i686-w64-mingw32
196
196
-
- -DWINVER=0x0501
197
197
-
- -D_WIN32_WINNT=0x0501
198
198
-
- -DWIN32_LEAN_AND_MEAN
199
199
-
- -D_WIN32
200
200
-
- -DWIN32
201
201
-
- -std=c++17
202
202
-
- -fno-builtin
203
203
-
- -isystem
204
204
-
- $SYS_INCLUDE
205
205
-
- -isystem
206
206
-
- $MINGW_MAIN_INCLUDE
207
207
-
- -isystem
208
208
-
- $CPP_INCLUDE
209
209
-
- -isystem
210
210
-
- $CPP_TARGET_INCLUDE
211
211
-
Remove:
212
212
-
- -I*/gcc/*/include
213
213
-
EOF
214
214
-
215
215
-
cat > compile_commands.json << EOF
216
216
-
[
217
217
-
{
218
218
-
"directory": "$(pwd)",
219
219
-
"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",
220
220
-
"file": "main.cpp"
221
221
-
}
222
222
-
]
223
223
-
EOF
136
136
+
# Auto-generate .clangd config with correct paths
137
137
+
cat > .clangd <<EOF
138
138
+
CompileFlags:
139
139
+
Add:
140
140
+
- -target
141
141
+
- i686-w64-mingw32
142
142
+
- -DWINVER=0x0501
143
143
+
- -D_WIN32_WINNT=0x0501
144
144
+
- -DWIN32_LEAN_AND_MEAN
145
145
+
- -D_WIN32
146
146
+
- -DWIN32
147
147
+
- -std=c++17
148
148
+
- -fno-builtin
149
149
+
- -isystem
150
150
+
- $SYS_INCLUDE
151
151
+
- -isystem
152
152
+
- $MINGW_MAIN_INCLUDE
153
153
+
- -isystem
154
154
+
- $CPP_INCLUDE
155
155
+
- -isystem
156
156
+
- $CPP_TARGET_INCLUDE
157
157
+
Remove:
158
158
+
- -I*/gcc/*/include
159
159
+
EOF
224
160
225
225
-
echo "โ Generated .clangd config and compile_commands.json with include paths"
226
226
-
echo "โ Development environment ready for Shortwave Radio development"
161
161
+
cat > compile_commands.json <<EOF
162
162
+
[
163
163
+
{
164
164
+
"directory": "$(pwd)",
165
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",
166
166
+
"file": "main.cpp"
167
167
+
}
168
168
+
]
169
169
+
EOF
227
170
'';
228
171
};
229
172
};
icon.aseprite
This is a binary file and will not be displayed.
+13
-13
installer.nsi
···
44
44
45
45
section "install"
46
46
setOutPath $INSTDIR
47
47
-
47
47
+
48
48
; Main executable
49
49
-
file "Shortwave.exe"
50
50
-
49
49
+
file "result/bin/Shortwave.exe"
50
50
+
51
51
; BASS audio library
52
52
-
file "bass.dll"
53
53
-
52
52
+
file "libs/bass.dll"
53
53
+
54
54
; License and documentation
55
55
file "LICENSE.md"
56
56
file "README.md"
57
57
-
57
57
+
58
58
; Create uninstaller
59
59
writeUninstaller "$INSTDIR\uninstall.exe"
60
60
-
60
60
+
61
61
; Start menu shortcuts
62
62
createDirectory "$SMPROGRAMS\${APPNAME}"
63
63
createShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\Shortwave.exe"
64
64
createShortCut "$SMPROGRAMS\${APPNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
65
65
-
65
65
+
66
66
; Desktop shortcut
67
67
createShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\Shortwave.exe"
68
68
-
68
68
+
69
69
; Registry entries for Add/Remove Programs
70
70
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME} - ${DESCRIPTION}"
71
71
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
···
99
99
delete "$INSTDIR\LICENSE.md"
100
100
delete "$INSTDIR\README.md"
101
101
delete "$INSTDIR\uninstall.exe"
102
102
-
102
102
+
103
103
; Remove shortcuts
104
104
delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk"
105
105
delete "$SMPROGRAMS\${APPNAME}\Uninstall.lnk"
106
106
rmDir "$SMPROGRAMS\${APPNAME}"
107
107
delete "$DESKTOP\${APPNAME}.lnk"
108
108
-
108
108
+
109
109
; Remove registry entries
110
110
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
111
111
-
111
111
+
112
112
; Remove installation directory
113
113
rmDir "$INSTDIR"
114
114
-
sectionEnd
114
114
+
sectionEnd
shortwave.ico
This is a binary file and will not be displayed.
+1
shortwave.rc
···
1
1
+
IDI_ICON1 ICON DISCARDABLE "shortwave.ico"