Skip to content

Fix linux build and QT Deprecations #3305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,5 @@ etc/synthdefs/designs/overtone/sonic-pi/native

# Visual Studio settings folder.
.vs
app/.cache/clangd/index
sonic-pi.desktop
4 changes: 3 additions & 1 deletion BUILD-LINUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ and to run
In order to build Sonic Pi's various components, we need to install a
few dependencies:

* Build Tools (c++ compiler, cmake, git.)
* Build Tools (c++ compiler , cmake, git.)
* Qt + Dev tools (5.15+)
* Jack (and pulse-audio-module-jack if you are running Raspberry Pi OS)
* Ruby + Dev tools (2.5+)
* Elixir + Dev tools (12.0+)
* SuperCollider + SC3 plugins

Note: please make sure that you have gcc12 installed. Compiling vcpkg dependencies does not work with gcc13 currently


### 1.1 Debian
The following is a rough list of Debian packages that are needed that can serve as a starting position:
Expand Down
2 changes: 0 additions & 2 deletions app/gui/qt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ int main(int argc, char *argv[])

#if defined(Q_OS_LINUX)
//linux code goes here
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#elif defined(Q_OS_WIN)
// windows code goes here

Expand Down
3 changes: 2 additions & 1 deletion app/gui/qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ MainWindow::MainWindow(QApplication& app, QSplashScreen* splash)

toggleOSCServer(1);

app.setActiveWindow(editorTabWidget->currentWidget());
editorTabWidget->currentWidget()->activateWindow();


showWelcomeScreen();

Expand Down
14 changes: 8 additions & 6 deletions app/gui/qt/utils/sonicpi_i18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ bool SonicPii18n::loadTranslations(QString lang) {
std::cout << "[GUI] [i18n] - Loading translations for " << language.toUtf8().constData() << std::endl;

i18n = translator.load("sonic-pi_" + language, ":/lang/") || language == "en_GB" || language == "en" || language == "C";
if (!i18n) {
std::cout << "[GUI] [i18n] - Error: Failed to load language translation for " << language.toUtf8().constData() << std::endl;
language = "en_GB";
}
app->installTranslator(&translator);
i18n = translator.load("sonic-pi_" + language, ":/lang/") || language == "en_GB" || language == "en" || language == "C";
bool translator_succes_qt = qtTranslator.load("qt_" + language, QLibraryInfo::path(QLibraryInfo::TranslationsPath));
if (!i18n || !translator_succes_qt)
{
std::cout << "[GUI] [i18n] - Error: Failed to load language translation for " << language.toUtf8().constData() << std::endl;
language = "en_GB";
}
app->installTranslator(&translator);

qtTranslator.load("qt_" + language, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app->installTranslator(&qtTranslator);

this->currently_loaded_language = language;
Expand Down
2 changes: 2 additions & 0 deletions app/linux-prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ cd "${SCRIPT_DIR}"

if [ ! "$system_libs" == true ]; then
"${SCRIPT_DIR}"/linux-pre-vcpkg.sh "${args[@]}"
export CC=gcc-12 CXX=g++-12 # Use gcc-12 as the default compiler, since gcc-13 fails to build vcpkg
"${SCRIPT_DIR}"/linux-pre-vcpkg.sh "${args[@]}"
fi

echo "Compiling native ruby extensions..."
Expand Down