Skip to content

Commit e8b2b93

Browse files
committed
dynamic Windows builds
1 parent b18f85f commit e8b2b93

File tree

4 files changed

+88
-139
lines changed

4 files changed

+88
-139
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: |
3838
rm -rf libserum
3939
git clone https://github.com/PPUC/libserum.git libserum
40-
(cd libserum && git checkout f871ab8923460108776595170d0bef8f7a3bc8e4)
40+
(cd libserum && git checkout d2616536ea90fe6bf83bb48dc4655dc3fb3e25fd)
4141
4242
- if: matrix.platform == 'linux'
4343
name: Install dependencies (linux)
@@ -110,49 +110,18 @@ jobs:
110110
New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\\vcpkg" | Out-Null
111111
112112
- if: matrix.platform == 'win'
113-
name: Restore vcpkg cache (Windows installed)
113+
name: Restore vcpkg cache (Windows)
114114
uses: actions/cache/restore@v4
115115
with:
116-
path: vcpkg/installed
117-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
118-
restore-keys: |
119-
vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-dynamic-
120-
121-
- if: matrix.platform == 'win'
122-
name: Restore vcpkg cache (Windows downloads)
123-
uses: actions/cache/restore@v4
124-
with:
125-
path: vcpkg/downloads
126-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
127-
restore-keys: |
128-
vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-dynamic-
129-
130-
- if: matrix.platform == 'win'
131-
name: Restore vcpkg cache (Windows buildtrees)
132-
uses: actions/cache/restore@v4
133-
with:
134-
path: vcpkg/buildtrees
135-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
136-
restore-keys: |
137-
vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-dynamic-
138-
139-
- if: matrix.platform == 'win'
140-
name: Restore vcpkg cache (Windows packages)
141-
uses: actions/cache/restore@v4
142-
with:
143-
path: vcpkg/packages
144-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
145-
restore-keys: |
146-
vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-dynamic-
147-
148-
- if: matrix.platform == 'win'
149-
name: Restore vcpkg cache (Windows registry)
150-
uses: actions/cache/restore@v4
151-
with:
152-
path: vcpkg/registry
153-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
116+
path: |
117+
vcpkg/installed
118+
vcpkg/downloads
119+
vcpkg/buildtrees
120+
vcpkg/packages
121+
vcpkg/registry
122+
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
154123
restore-keys: |
155-
vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry-dynamic-
124+
vcpkg-${{ runner.os }}-${{ matrix.arch }}-dynamic-
156125
157126
- if: matrix.platform == 'win'
158127
name: Setup vcpkg (Windows)
@@ -169,7 +138,6 @@ jobs:
169138
}
170139
& "$root/bootstrap-vcpkg.bat"
171140
$triplet = if ("${{ matrix.arch }}" -eq "x86") { "x86-windows" } else { "x64-windows" }
172-
$staticTriplet = if ("${{ matrix.arch }}" -eq "x86") { "x86-windows-static" } else { "x64-windows-static" }
173141
"VCPKG_ROOT=$root" | Out-File -FilePath $env:GITHUB_ENV -Append
174142
"VCPKG_DEFAULT_TRIPLET=$triplet" | Out-File -FilePath $env:GITHUB_ENV -Append
175143
"VCPKG_DEFAULT_BINARY_CACHE=$binaryCache" | Out-File -FilePath $env:GITHUB_ENV -Append
@@ -179,7 +147,7 @@ jobs:
179147
uses: actions/cache/restore@v4
180148
with:
181149
path: vcpkg-binary-cache
182-
key: vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
150+
key: vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
183151
restore-keys: |
184152
vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-dynamic-
185153
@@ -193,39 +161,16 @@ jobs:
193161
& "$root/vcpkg.exe" install opencv qtbase --triplet $triplet
194162
195163
- if: matrix.platform == 'win'
196-
name: Save vcpkg cache (Windows installed)
164+
name: Save vcpkg cache (Windows)
197165
uses: actions/cache/save@v4
198166
with:
199-
path: vcpkg/installed
200-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
201-
202-
- if: matrix.platform == 'win'
203-
name: Save vcpkg cache (Windows downloads)
204-
uses: actions/cache/save@v4
205-
with:
206-
path: vcpkg/downloads
207-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
208-
209-
- if: matrix.platform == 'win'
210-
name: Save vcpkg cache (Windows buildtrees)
211-
uses: actions/cache/save@v4
212-
with:
213-
path: vcpkg/buildtrees
214-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
215-
216-
- if: matrix.platform == 'win'
217-
name: Save vcpkg cache (Windows packages)
218-
uses: actions/cache/save@v4
219-
with:
220-
path: vcpkg/packages
221-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
222-
223-
- if: matrix.platform == 'win'
224-
name: Save vcpkg cache (Windows registry)
225-
uses: actions/cache/save@v4
226-
with:
227-
path: vcpkg/registry
228-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
167+
path: |
168+
vcpkg/installed
169+
vcpkg/downloads
170+
vcpkg/buildtrees
171+
vcpkg/packages
172+
vcpkg/registry
173+
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
229174

230175
- if: matrix.platform == 'win'
231176
name: Save vcpkg binary cache (Windows)
@@ -234,57 +179,6 @@ jobs:
234179
path: vcpkg-binary-cache
235180
key: vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-dynamic-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
236181

237-
- if: matrix.platform == 'win'
238-
name: vcpkg install (Windows static)
239-
shell: pwsh
240-
run: |
241-
$root = Join-Path $env:GITHUB_WORKSPACE "vcpkg"
242-
$env:VCPKG_DEFAULT_BINARY_CACHE = Join-Path $env:GITHUB_WORKSPACE "vcpkg-binary-cache"
243-
$staticTriplet = if ("${{ matrix.arch }}" -eq "x86") { "x86-windows-static" } else { "x64-windows-static" }
244-
& "$root/vcpkg.exe" install opencv qtbase --triplet $staticTriplet
245-
246-
- if: matrix.platform == 'win'
247-
name: Save vcpkg cache (Windows installed, static)
248-
uses: actions/cache/save@v4
249-
with:
250-
path: vcpkg/installed
251-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-installed-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
252-
253-
- if: matrix.platform == 'win'
254-
name: Save vcpkg cache (Windows downloads, static)
255-
uses: actions/cache/save@v4
256-
with:
257-
path: vcpkg/downloads
258-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-downloads-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
259-
260-
- if: matrix.platform == 'win'
261-
name: Save vcpkg cache (Windows buildtrees, static)
262-
uses: actions/cache/save@v4
263-
with:
264-
path: vcpkg/buildtrees
265-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-buildtrees-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
266-
267-
- if: matrix.platform == 'win'
268-
name: Save vcpkg cache (Windows packages, static)
269-
uses: actions/cache/save@v4
270-
with:
271-
path: vcpkg/packages
272-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-packages-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
273-
274-
- if: matrix.platform == 'win'
275-
name: Save vcpkg cache (Windows registry, static)
276-
uses: actions/cache/save@v4
277-
with:
278-
path: vcpkg/registry
279-
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-registry-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
280-
281-
- if: matrix.platform == 'win'
282-
name: Save vcpkg binary cache (Windows static)
283-
uses: actions/cache/save@v4
284-
with:
285-
path: vcpkg-binary-cache
286-
key: vcpkg-bin-${{ runner.os }}-${{ matrix.arch }}-static-${{ hashFiles('.github/workflows/ci.yml', 'platforms/config.sh') }}
287-
288182
- if: matrix.platform == 'win'
289183
name: Add msbuild (Windows)
290184
uses: microsoft/setup-msbuild@v2
@@ -295,9 +189,43 @@ jobs:
295189
run: |
296190
find platforms \( -name "build.sh" -o -name "external.sh" \) -exec chmod +x {} \;
297191
./platforms/${{ matrix.platform }}/${{ matrix.arch }}/build.sh
298-
if [ "${{ matrix.platform }}" = "win" ]; then
299-
STATIC_LINKING=1 ./platforms/${{ matrix.platform }}/${{ matrix.arch }}/build.sh
300-
fi
192+
193+
- if: matrix.platform == 'win'
194+
name: Package Windows dynamic runtime
195+
shell: pwsh
196+
run: |
197+
$arch = "${{ matrix.arch }}"
198+
$triplet = if ($arch -eq "x86") { "x86-windows" } else { "x64-windows" }
199+
$root = Join-Path $env:GITHUB_WORKSPACE "vcpkg"
200+
$artifact = Join-Path $env:GITHUB_WORKSPACE "artifacts\win-$arch"
201+
$exe = Join-Path $artifact "PPUC-Serum-Colorizer.exe"
202+
if (-not (Test-Path $exe)) {
203+
throw "Missing executable: $exe"
204+
}
205+
$windeployqt = Join-Path $root "installed\$triplet\tools\qt6\bin\windeployqt.exe"
206+
if (-not (Test-Path $windeployqt)) {
207+
throw "Missing windeployqt: $windeployqt"
208+
}
209+
& $windeployqt --release --dir $artifact $exe
210+
$opencvBin = Join-Path $root "installed\$triplet\bin"
211+
Get-ChildItem -Path $opencvBin -Filter "opencv_*.dll" | Copy-Item -Destination $artifact -Force
212+
$licenses = Join-Path $artifact "licenses"
213+
New-Item -ItemType Directory -Force -Path $licenses | Out-Null
214+
Copy-Item (Join-Path $env:GITHUB_WORKSPACE "LICENSE") -Destination $licenses -Force
215+
$qtShare = Join-Path $root "installed\$triplet\share\qt6"
216+
if (Test-Path $qtShare) {
217+
Get-ChildItem -Path $qtShare -File -Include "LICENSE*", "COPYING*", "LGPL*", "GPL*" |
218+
Copy-Item -Destination $licenses -Force
219+
}
220+
$opencvShare = Join-Path $root "installed\$triplet\share\opencv4"
221+
if (Test-Path $opencvShare) {
222+
Get-ChildItem -Path $opencvShare -File -Include "LICENSE*", "COPYING*" |
223+
Copy-Item -Destination $licenses -Force
224+
}
225+
$libserumLicense = Join-Path $env:GITHUB_WORKSPACE "libserum\LICENSE"
226+
if (Test-Path $libserumLicense) {
227+
Copy-Item $libserumLicense -Destination $licenses -Force
228+
}
301229
302230
- if: matrix.platform != 'win'
303231
name: Upload artifacts
@@ -312,10 +240,3 @@ jobs:
312240
with:
313241
name: PPUC-Serum-Colorizer-${{ matrix.platform }}-${{ matrix.arch }}
314242
path: artifacts/${{ matrix.platform }}-${{ matrix.arch }}
315-
316-
- if: matrix.platform == 'win'
317-
name: Upload artifacts (Windows static)
318-
uses: actions/upload-artifact@v4
319-
with:
320-
name: PPUC-Serum-Colorizer-${{ matrix.platform }}-${{ matrix.arch }}-static
321-
path: artifacts/${{ matrix.platform }}-${{ matrix.arch }}-static

app/MainWindow.cpp

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,9 +2543,11 @@ MainWindow::MainWindow(QWidget* parent)
25432543
viewMenu->addAction(previewDock->toggleViewAction());
25442544

25452545
auto* handbookAction = new QAction("&Handbook", this);
2546+
auto* licensesAction = new QAction("&Dependencies && Licenses", this);
25462547
auto* copyLogAction = new QAction("&Copy Log", this);
25472548
auto* aboutAction = new QAction("&About", this);
25482549
helpMenu->addAction(handbookAction);
2550+
helpMenu->addAction(licensesAction);
25492551
helpMenu->addAction(copyLogAction);
25502552
helpMenu->addAction(aboutAction);
25512553
connect(handbookAction, &QAction::triggered, this, [this]() {
@@ -2579,6 +2581,32 @@ MainWindow::MainWindow(QWidget* parent)
25792581
QGuiApplication::clipboard()->setText(QString::fromUtf8(file.readAll()));
25802582
logLine("Log copied from Help menu");
25812583
});
2584+
connect(licensesAction, &QAction::triggered, this, [this]() {
2585+
const QString appName = QCoreApplication::applicationName().isEmpty()
2586+
? QString("PPUC-Serum-Colorizer")
2587+
: QCoreApplication::applicationName();
2588+
auto* dialog = new QDialog(this);
2589+
dialog->setAttribute(Qt::WA_DeleteOnClose);
2590+
dialog->setWindowTitle("Dependencies & Licenses");
2591+
dialog->resize(720, 520);
2592+
auto* layout = new QVBoxLayout(dialog);
2593+
auto* viewer = new QTextBrowser(dialog);
2594+
viewer->setOpenExternalLinks(true);
2595+
const QString text = QStringLiteral(
2596+
"# Dependencies & Licenses\n"
2597+
"\n"
2598+
"This build of %1 includes the following third‑party components:\n"
2599+
"\n"
2600+
"- **Qt 6** (LGPL/GPL; dynamic linking)\n"
2601+
"- **OpenCV** (BSD‑3‑Clause)\n"
2602+
"- **libserum** (GPLv2+)\n"
2603+
"\n"
2604+
"License texts are shipped in the `licenses/` folder next to the application.\n");
2605+
viewer->setMarkdown(text.arg(appName));
2606+
layout->addWidget(viewer);
2607+
dialog->setLayout(layout);
2608+
dialog->show();
2609+
});
25822610
connect(aboutAction, &QAction::triggered, this, [this]() {
25832611
const QString appName = QCoreApplication::applicationName().isEmpty()
25842612
? QString("PPUC-Serum-Colorizer")
@@ -6058,8 +6086,7 @@ void MainWindow::advancePlaybackFrame()
60586086
}
60596087
m_playbackPos += 1;
60606088
if (m_playbackPos >= static_cast<int>(m_playbackFrames.size())) {
6061-
stopPlayback();
6062-
return;
6089+
m_playbackPos = 0;
60636090
}
60646091
renderPlaybackFrame();
60656092
}

handbook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This handbook captures editor behaviors and workflows that differ from the legac
2222
- Use the mask overlay toggle to show masks on the original preview frames.
2323
- Use the rotate toggle to preview color rotations in the preview row.
2424
- Use the refresh button to rebuild previews after bulk edits.
25-
- Use Play/Pause/Stop/Prev/Next/Rew/Fwd in the Playback tab to test-play the selected frames (or the whole ROM if none or only one frame is selected). A single selected frame becomes the start point.
25+
- Use Play/Pause/Stop/Prev/Next/Rew/Fwd in the Playback tab to test-play the selected frames (or the whole ROM if none or only one frame is selected). A single selected frame becomes the start point. Playback loops back to the first selected frame when it reaches the end.
2626
- Playback can override per-frame durations using the `Fixed` control (milliseconds) in the Playback tab.
2727

2828
## Canvas Controls
@@ -131,6 +131,7 @@ This handbook captures editor behaviors and workflows that differ from the legac
131131
- Logging can be enabled/disabled in Settings (enabled by default) and writes to `ppuc-serum-colorizer.log` in the app data folder.
132132
- If the app did not shut down cleanly, a startup prompt offers to copy the log for reporting.
133133
- The Help menu includes “Copy Log” and the log is truncated automatically to keep it manageable.
134+
- The Help menu includes “Dependencies & Licenses” with links to the bundled `licenses/` folder.
134135

135136
## Open/Save and Legacy Compatibility
136137

platforms/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ -z "${BUILD_TYPE}" ]; then
88
BUILD_TYPE="Release"
99
fi
1010

11-
LIBSERUM_SHA=f871ab8923460108776595170d0bef8f7a3bc8e4
11+
LIBSERUM_SHA=d2616536ea90fe6bf83bb48dc4655dc3fb3e25fd
1212

1313
if [ -z "${PLATFORM}" ]; then
1414
PLATFORM="unknown"

0 commit comments

Comments
 (0)