#!/bin/bash set -e export MACOSX_DEPLOYMENT_TARGET=10.14 INSTALLDIR="$HOME/deps" NPROCS="$(getconf _NPROCESSORS_ONLN)" SDL=SDL2-2.28.1 PNG=1.6.37 JPG=9e SOUNDTOUCH=soundtouch-2.3.1 FFMPEG=6.0 QT=6.4.3 # Currently stuck on Qt 6.4 due to 6.5 requiring macOS 11.0. mkdir deps-build cd deps-build export PKG_CONFIG_PATH="$INSTALLDIR/lib/pkgconfig:$PKG_CONFIG_PATH" export LDFLAGS="-L$INSTALLDIR/lib -dead_strip $LDFLAGS" export CFLAGS="-I$INSTALLDIR/include -Os $CFLAGS" export CXXFLAGS="-I$INSTALLDIR/include -Os $CXXFLAGS" cat > SHASUMS <acceptMode() == QFileDialogOptions::AcceptSave) - || [self panel:m_panel shouldEnableURL:url]; m_panel.directoryURL = [NSURL fileURLWithPath:m_currentDirectory]; - m_panel.nameFieldStringValue = selectable ? info.fileName().toNSString() : @""; + m_panel.nameFieldStringValue = info.fileName().toNSString(); @@ -203,61 +201,2 @@ return hidden; -} - -- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url -{ - Q_UNUSED(sender); - - NSString *filename = url.path; - if (!filename.length) - return NO; - - // Always accept directories regardless of their names (unless it is a bundle): - NSFileManager *fm = NSFileManager.defaultManager; - NSDictionary *fileAttrs = [fm attributesOfItemAtPath:filename error:nil]; - if (!fileAttrs) - return NO; // Error accessing the file means 'no'. - NSString *fileType = fileAttrs.fileType; - bool isDir = [fileType isEqualToString:NSFileTypeDirectory]; - if (isDir) { - if (!m_panel.treatsFilePackagesAsDirectories) { - if ([NSWorkspace.sharedWorkspace isFilePackageAtPath:filename] == NO) - return YES; - } - } - - // Treat symbolic links and aliases to directories like directories - QFileInfo fileInfo(QString::fromNSString(filename)); - if (fileInfo.isSymLink() && QFileInfo(fileInfo.symLinkTarget()).isDir()) - return YES; - - QString qtFileName = fileInfo.fileName(); - // No filter means accept everything - bool nameMatches = m_selectedNameFilter->isEmpty(); - // Check if the current file name filter accepts the file: - for (int i = 0; !nameMatches && i < m_selectedNameFilter->size(); ++i) { - if (QDir::match(m_selectedNameFilter->at(i), qtFileName)) - nameMatches = true; - } - if (!nameMatches) - return NO; - - QDir::Filters filter = m_options->filter(); - if ((!(filter & (QDir::Dirs | QDir::AllDirs)) && isDir) - || (!(filter & QDir::Files) && [fileType isEqualToString:NSFileTypeRegular]) - || ((filter & QDir::NoSymLinks) && [fileType isEqualToString:NSFileTypeSymbolicLink])) - return NO; - - bool filterPermissions = ((filter & QDir::PermissionMask) - && (filter & QDir::PermissionMask) != QDir::PermissionMask); - if (filterPermissions) { - if ((!(filter & QDir::Readable) && [fm isReadableFileAtPath:filename]) - || (!(filter & QDir::Writable) && [fm isWritableFileAtPath:filename]) - || (!(filter & QDir::Executable) && [fm isExecutableFileAtPath:filename])) - return NO; - } - if (!(filter & QDir::Hidden) - && (qtFileName.startsWith(u'.') || [self isHiddenFileAtURL:url])) - return NO; - - return YES; } @@ -406,5 +345,2 @@ { - if (m_options->acceptMode() != QFileDialogOptions::AcceptSave) - return nil; // panel:shouldEnableURL: does the file filtering for NSOpenPanel - QStringList fileTypes; EOF cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_optimize_size=ON -DFEATURE_dbus=OFF -DFEATURE_framework=OFF -DFEATURE_icu=OFF -DFEATURE_opengl=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF -DFEATURE_gssapi=OFF make -C build "-j$NPROCS" make -C build install cd .. echo "Installing Qt SVG..." tar xf "qtsvg-everywhere-src-$QT.tar.xz" cd "qtsvg-everywhere-src-$QT" cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel make -C build "-j$NPROCS" make -C build install cd .. echo "Installing Qt Image Formats..." tar xf "qtimageformats-everywhere-src-$QT.tar.xz" cd "qtimageformats-everywhere-src-$QT" cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel make -C build "-j$NPROCS" make -C build install cd .. echo "Installing Qt Tools..." tar xf "qttools-everywhere-src-$QT.tar.xz" cd "qttools-everywhere-src-$QT" # Linguist relies on a library in the Designer target, which takes 5-7 minutes to build on the CI # Avoid it by not building Linguist, since we only need the tools that come with it patch -u src/linguist/CMakeLists.txt <