Add ExifTool back to Windows builds
This commit is contained in:
+16
-3
@@ -625,10 +625,19 @@ Window::launch_exiftool(const QUrl &url)
|
||||
process->setStandardOutputFile(report_path, QIODeviceBase::Truncate);
|
||||
QStringList arguments = exiftool_command();
|
||||
process->setProgram(arguments.takeFirst());
|
||||
arguments.append({QStringLiteral("-groupNames"),
|
||||
QStringLiteral("-duplicates"), QStringLiteral("-extractEmbedded"),
|
||||
QStringLiteral("--binary"), QStringLiteral("-quiet")});
|
||||
#ifdef Q_OS_WIN
|
||||
// Perl only receives the command line in the ANSI code page, so the path
|
||||
// goes through a UTF-8 argfile on standard input. Being absolute,
|
||||
// it can't have the leading '-', '#', or white space that would matter.
|
||||
arguments.append(
|
||||
{QStringLiteral("-groupNames"), QStringLiteral("-duplicates"),
|
||||
QStringLiteral("-extractEmbedded"), QStringLiteral("--binary"),
|
||||
QStringLiteral("-quiet"), QStringLiteral("--"), path});
|
||||
{QStringLiteral("-charset"), QStringLiteral("filename=utf8"),
|
||||
QStringLiteral("-@"), QStringLiteral("-")});
|
||||
#else
|
||||
arguments.append({QStringLiteral("--"), path});
|
||||
#endif
|
||||
process->setArguments(arguments);
|
||||
|
||||
auto finished = make_shared<bool>(false);
|
||||
@@ -672,6 +681,10 @@ Window::launch_exiftool(const QUrl &url)
|
||||
process->deleteLater();
|
||||
});
|
||||
process->start();
|
||||
#ifdef Q_OS_WIN
|
||||
process->write(path.toUtf8() + '\n');
|
||||
process->closeWriteChannel();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+12
-8
@@ -103,12 +103,17 @@ extract() {
|
||||
done
|
||||
rm -rf tmp
|
||||
|
||||
# ExifTool
|
||||
# ExifTool is quite massive (mainly in file count), not sure what to do
|
||||
#bsdtar -xf exiftool.tar.gz
|
||||
#mv Image-ExifTool-*/exiftool bin
|
||||
#mv Image-ExifTool-*/lib/* lib/perl5/site_perl
|
||||
#rm -rf Image-ExifTool-*
|
||||
# ExifTool is still quite massive, even after this pruning.
|
||||
bsdtar -xf exiftool.tar.gz \
|
||||
--exclude 'Image-ExifTool-*/lib/*.pod' \
|
||||
--exclude 'Image-ExifTool-*/lib/Image/ExifTool/BuildTagLookup.pm' \
|
||||
-s '|^Image-ExifTool-[^/]*/exiftool$|bin/exiftool|' \
|
||||
-s '|^Image-ExifTool-[^/]*/lib/|lib/perl5/site_perl/|' \
|
||||
'Image-ExifTool-*/exiftool' 'Image-ExifTool-*/lib'
|
||||
(cd lib/perl5/core_perl && rm -rf CORE App CPAN CPAN.pm Devel/PPPort.pm \
|
||||
ExtUtils Module Pod TAP Test Test.pm Test2 perl5db.pl \
|
||||
Unicode/Collate Unicode/Collate.pm auto/Unicode/Collate Encode/*.e2x &&
|
||||
find unicore -mindepth 1 ! -name 'Name.p[lm]' -delete)
|
||||
}
|
||||
|
||||
# TODO(p): Try to push this bullshit directly to MSYS2.
|
||||
@@ -180,8 +185,7 @@ dbsync
|
||||
fetch $pkg-qt6-base $pkg-vulkan-loader $pkg-vulkan-headers $pkg-libwebp \
|
||||
$pkg-libjpeg-turbo $pkg-libheif $pkg-libjxl $pkg-openjpeg2 $pkg-libraw \
|
||||
$pkg-jxrlib $pkg-libwmf $pkg-zlib $pkg-shared-mime-info $pkg-gcc-libs \
|
||||
$pkg-gettext-runtime \
|
||||
#$pkg-perl $pkg-perl-win32-api
|
||||
$pkg-gettext-runtime $pkg-perl $pkg-perl-win32-api
|
||||
verify
|
||||
extract
|
||||
resvg
|
||||
|
||||
+11
-4
@@ -31,9 +31,16 @@ txt2rtf() {
|
||||
# msitools have this filename hardcoded in UI files, and it's required.
|
||||
txt2rtf "$(dirname "$0")/LICENSE" > License.rtf
|
||||
|
||||
find "$destdir" -type f \
|
||||
| wixl-heat --prefix "$destdir/" --directory-ref INSTALLDIR \
|
||||
--component-group CG.dn --var var.SourceDir > package-files.wxs
|
||||
heat() {
|
||||
wixl-heat --prefix "$destdir/" --directory-ref INSTALLDIR \
|
||||
--component-group "$1" --var var.SourceDir
|
||||
}
|
||||
|
||||
exiftool="^$destdir/(wperl\.exe|perl[0-9]+\.dll|exiftool|lib/perl5/.*)$"
|
||||
find "$destdir" -type f | grep -Ev "$exiftool" | heat CG.dn \
|
||||
> package-files.wxs
|
||||
find "$destdir" -type f | grep -E "$exiftool" | heat CG.exiftool \
|
||||
> exiftool-files.wxs
|
||||
|
||||
# Only register extensions in Explorer's "Open with" list, never claim
|
||||
# HKCR\.ext itself: Windows 8+ silently ignores default-app changes anyway,
|
||||
@@ -94,4 +101,4 @@ fi)
|
||||
XML
|
||||
|
||||
wixl --verbose --arch "$arch" -D SourceDir="$destdir" --ext ui \
|
||||
--output "$msi" "$wxs" package-files.wxs associations.wxs
|
||||
--output "$msi" "$wxs" package-files.wxs exiftool-files.wxs associations.wxs
|
||||
|
||||
@@ -73,10 +73,15 @@
|
||||
|
||||
<!-- FileAssociations is defined in the generated associations.wxs:
|
||||
it needs dn's actual "list supported media types" output. -->
|
||||
<Feature Id='Complete' Level='1'>
|
||||
<Feature Id='Complete' Level='1' Absent='disallow'>
|
||||
<ComponentGroupRef Id='CG.dn' />
|
||||
<ComponentRef Id='ProgramMenuDir' />
|
||||
<ComponentRef Id='FileAssociations' />
|
||||
|
||||
<!-- Though WixUI_Minimal won't let the user choose. -->
|
||||
<Feature Id='ExifTool' Level='1'>
|
||||
<ComponentGroupRef Id='CG.exiftool' />
|
||||
</Feature>
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
||||
|
||||
Reference in New Issue
Block a user