diff options
22 files changed, 140 insertions, 215 deletions
@@ -47,16 +47,25 @@ If everything works correctly, the .deb will be next to the build script, in `Po ### Building a .rpm -You don't need to install the build dependencies, as the script will use `dnf` to install them for you. +Build dependencies are automatically installed using `dnf`, but you do need the `rpmdevtools` package (on Fedora) +in order to fetch sources and setup your tree. ``` +cd ~ +# setup your ~/rpmbuild directory, required for rpmbuild to work. +rpmdev-setuptree +# note: submodules are not needed here, as the spec file will download the tarball instead git clone https://github.com/PolyMC/PolyMC.git -cd packages/rpm -sudo dnf builddep ./polymec.spec -rpmbuild -bb ./polymec.spec +cd PolyMC/packages/rpm +# install build dependencies +sudo dnf builddep polymc.spec +# download build sources +spectool -g -R polymc.spec +# now build! +rpmbuild -bb polymc.spec ``` -The path to the rpm packages will be printed at the end of building +The path to the rpm packages will be printed when the build is complete. ### Building from command line You need a source folder, a build folder and an install folder. diff --git a/CMakeLists.txt b/CMakeLists.txt index b7fb557a..6a9511b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,10 +63,7 @@ set(Launcher_UPDATER_BASE "" CACHE STRING "Base URL for the updater.") set(Launcher_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.") # The metadata server -set(Launcher_META_URL "https://meta.multimc.org/v1/" CACHE STRING "URL to fetch Launcher's meta files from.") - -# paste.ee API key -set(Launcher_PASTE_EE_API_KEY "utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ" CACHE STRING "API key you can get from paste.ee when you register an account") +set(Launcher_META_URL "https://meta.polymc.org/v1/" CACHE STRING "URL to fetch Launcher's meta files from.") # Imgur API Client ID set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application") diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index af8845dc..2595f78b 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -42,7 +42,6 @@ Config::Config() VERSION_STR = "@Launcher_VERSION_STRING@"; NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@"; - PASTE_EE_KEY = "@Launcher_PASTE_EE_API_KEY@"; IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@"; MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@"; META_URL = "@Launcher_META_URL@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 009fb2bc..d09d5288 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -68,11 +68,6 @@ public: QString NEWS_RSS_URL; /** - * API key you can get from paste.ee when you register an account - */ - QString PASTE_EE_KEY; - - /** * Client ID you can get from Imgur when you register an application */ QString IMGUR_CLIENT_ID; diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 8d1c4d62..b605e54b 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -14,7 +14,7 @@ #include "ui/pages/global/ProxyPage.h" #include "ui/pages/global/ExternalToolsPage.h" #include "ui/pages/global/AccountListPage.h" -#include "ui/pages/global/PasteEEPage.h" +#include "ui/pages/global/PastePage.h" #include "ui/pages/global/CustomCommandsPage.h" #include "ui/themes/ITheme.h" @@ -714,8 +714,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_settings->registerSetting("UpdateDialogGeometry", ""); - // paste.ee API key - m_settings->registerSetting("PasteEEAPIKey", "multimc"); + // pastebin URL + m_settings->registerSetting("PastebinURL", "https://0x0.st"); // Init page provider { @@ -728,7 +728,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_globalSettingsProvider->addPage<ProxyPage>(); m_globalSettingsProvider->addPage<ExternalToolsPage>(); m_globalSettingsProvider->addPage<AccountListPage>(); - m_globalSettingsProvider->addPage<PasteEEPage>(); + m_globalSettingsProvider->addPage<PastePage>(); } qDebug() << "<> Settings loaded."; } diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index c5a2b835..0ef27f6b 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -698,8 +698,8 @@ SET(LAUNCHER_SOURCES ui/pages/global/LauncherPage.h ui/pages/global/ProxyPage.cpp ui/pages/global/ProxyPage.h - ui/pages/global/PasteEEPage.cpp - ui/pages/global/PasteEEPage.h + ui/pages/global/PastePage.cpp + ui/pages/global/PastePage.h # GUI - platform pages ui/pages/modplatform/VanillaPage.cpp @@ -833,7 +833,7 @@ qt5_wrap_ui(LAUNCHER_UI ui/pages/global/AccountListPage.ui ui/pages/global/JavaPage.ui ui/pages/global/LauncherPage.ui - ui/pages/global/PasteEEPage.ui + ui/pages/global/PastePage.ui ui/pages/global/ProxyPage.ui ui/pages/global/MinecraftPage.ui ui/pages/global/ExternalToolsPage.ui diff --git a/launcher/java/JavaChecker.cpp b/launcher/java/JavaChecker.cpp index 4557784b..35ddc35c 100644 --- a/launcher/java/JavaChecker.cpp +++ b/launcher/java/JavaChecker.cpp @@ -111,7 +111,7 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status) auto parts = line.split('=', QString::SkipEmptyParts); if(parts.size() != 2 || parts[0].isEmpty() || parts[1].isEmpty()) { - success = false; + continue; } else { diff --git a/launcher/minecraft/auth/AuthRequest.cpp b/launcher/minecraft/auth/AuthRequest.cpp index 459d2354..feface80 100644 --- a/launcher/minecraft/auth/AuthRequest.cpp +++ b/launcher/minecraft/auth/AuthRequest.cpp @@ -44,7 +44,7 @@ void AuthRequest::onRequestFinished() { if (reply_ != qobject_cast<QNetworkReply *>(sender())) { return; } - httpStatus_ = 200; + httpStatus_ = reply_->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); finish(); } diff --git a/launcher/minecraft/auth/Parsers.cpp b/launcher/minecraft/auth/Parsers.cpp index ed31e934..2dd36562 100644 --- a/launcher/minecraft/auth/Parsers.cpp +++ b/launcher/minecraft/auth/Parsers.cpp @@ -94,7 +94,7 @@ bool parseXTokenResponse(QByteArray & data, Katabasis::Token &output, QString na return false; } if(!getString(obj.value("Token"), output.token)) { - qWarning() << "User Token is not a timestamp"; + qWarning() << "User Token is not a string"; return false; } auto arrayVal = obj.value("DisplayClaims").toObject().value("xui"); diff --git a/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp b/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp index 9fef99b0..add91659 100644 --- a/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp +++ b/launcher/minecraft/auth/steps/MinecraftProfileStep.cpp @@ -56,6 +56,14 @@ void MinecraftProfileStep::onRequestDone( return; } if (error != QNetworkReply::NoError) { + qWarning() << "Error getting profile:"; + qWarning() << " HTTP Status: " << requestor->httpStatus_; + qWarning() << " Internal error no.: " << error; + qWarning() << " Error string: " << requestor->errorString_; + + qWarning() << " Response:"; + qWarning() << QString::fromUtf8(data); + emit finished( AccountTaskState::STATE_FAILED_SOFT, tr("Minecraft Java profile acquisition failed.") diff --git a/launcher/net/PasteUpload.cpp b/launcher/net/PasteUpload.cpp index 4b69b68a..52b82a0e 100644 --- a/launcher/net/PasteUpload.cpp +++ b/launcher/net/PasteUpload.cpp @@ -8,44 +8,34 @@ #include <QJsonDocument> #include <QFile> -PasteUpload::PasteUpload(QWidget *window, QString text, QString key) : m_window(window) +PasteUpload::PasteUpload(QWidget *window, QString text, QString url) : m_window(window), m_uploadUrl(url), m_text(text.toUtf8()) { - m_key = key; - QByteArray temp; - QJsonObject topLevelObj; - QJsonObject sectionObject; - sectionObject.insert("contents", text); - QJsonArray sectionArray; - sectionArray.append(sectionObject); - topLevelObj.insert("description", "Log Upload"); - topLevelObj.insert("sections", sectionArray); - QJsonDocument docOut; - docOut.setObject(topLevelObj); - m_jsonContent = docOut.toJson(); } PasteUpload::~PasteUpload() { } -bool PasteUpload::validateText() -{ - return m_jsonContent.size() <= maxSize(); -} - void PasteUpload::executeTask() { - QNetworkRequest request(QUrl("https://api.paste.ee/v1/pastes")); + QNetworkRequest request{QUrl(m_uploadUrl)}; request.setHeader(QNetworkRequest::UserAgentHeader, BuildConfig.USER_AGENT_UNCACHED); - request.setRawHeader("Content-Type", "application/json"); - request.setRawHeader("Content-Length", QByteArray::number(m_jsonContent.size())); - request.setRawHeader("X-Auth-Token", m_key.toStdString().c_str()); + QHttpMultiPart *multiPart = new QHttpMultiPart{QHttpMultiPart::FormDataType}; + + QHttpPart filePart; + filePart.setBody(m_text); + filePart.setHeader(QNetworkRequest::ContentTypeHeader, "text/plain"); + filePart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data; name=\"file\"; filename=\"log.txt\""); - QNetworkReply *rep = APPLICATION->network()->post(request, m_jsonContent); + multiPart->append(filePart); + + QNetworkReply *rep = APPLICATION->network()->post(request, multiPart); + multiPart->setParent(rep); m_reply = std::shared_ptr<QNetworkReply>(rep); - setStatus(tr("Uploading to paste.ee")); + setStatus(tr("Uploading to %1").arg(m_uploadUrl)); + connect(rep, &QNetworkReply::uploadProgress, this, &Task::setProgress); connect(rep, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError))); connect(rep, SIGNAL(finished()), this, SLOT(downloadFinished())); @@ -61,45 +51,23 @@ void PasteUpload::downloadError(QNetworkReply::NetworkError error) void PasteUpload::downloadFinished() { QByteArray data = m_reply->readAll(); - // if the download succeeded - if (m_reply->error() == QNetworkReply::NetworkError::NoError) + int statusCode = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + + if (m_reply->error() != QNetworkReply::NetworkError::NoError) { + emitFailed(tr("Network error: %1").arg(m_reply->errorString())); m_reply.reset(); - QJsonParseError jsonError; - QJsonDocument doc = QJsonDocument::fromJson(data, &jsonError); - if (jsonError.error != QJsonParseError::NoError) - { - emitFailed(jsonError.errorString()); - return; - } - if (!parseResult(doc)) - { - emitFailed(tr("paste.ee returned an error. Please consult the logs for more information")); - return; - } + return; } - // else the download failed - else + else if (statusCode != 200 && statusCode != 201) { - emitFailed(QString("Network error: %1").arg(m_reply->errorString())); + QString reasonPhrase = m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString(); + emitFailed(tr("Error: %1 returned unexpected status code %2 %3").arg(m_uploadUrl).arg(statusCode).arg(reasonPhrase)); + qCritical() << m_uploadUrl << " returned unexpected status code " << statusCode << " with body: " << data; m_reply.reset(); return; } - emitSucceeded(); -} -bool PasteUpload::parseResult(QJsonDocument doc) -{ - auto object = doc.object(); - auto status = object.value("success").toBool(); - if (!status) - { - qCritical() << "paste.ee reported error:" << QString(object.value("error").toString()); - return false; - } - m_pasteLink = object.value("link").toString(); - m_pasteID = object.value("id").toString(); - qDebug() << m_pasteLink; - return true; + m_pasteLink = QString::fromUtf8(data).trimmed(); + emitSucceeded(); } - diff --git a/launcher/net/PasteUpload.h b/launcher/net/PasteUpload.h index 5514e058..62b2dc36 100644 --- a/launcher/net/PasteUpload.h +++ b/launcher/net/PasteUpload.h @@ -8,37 +8,21 @@ class PasteUpload : public Task { Q_OBJECT public: - PasteUpload(QWidget *window, QString text, QString key = "public"); + PasteUpload(QWidget *window, QString text, QString url); virtual ~PasteUpload(); QString pasteLink() { return m_pasteLink; } - QString pasteID() - { - return m_pasteID; - } - int maxSize() - { - // 2MB for paste.ee - public - if(m_key == "public") - return 1024*1024*2; - // 12MB for paste.ee - with actual key - return 1024*1024*12; - } - bool validateText(); protected: virtual void executeTask(); private: - bool parseResult(QJsonDocument doc); - QString m_error; QWidget *m_window; - QString m_pasteID; QString m_pasteLink; - QString m_key; - QByteArray m_jsonContent; + QString m_uploadUrl; + QByteArray m_text; std::shared_ptr<QNetworkReply> m_reply; public slots: diff --git a/launcher/ui/GuiUtil.cpp b/launcher/ui/GuiUtil.cpp index efb1a4df..9eb658e2 100644 --- a/launcher/ui/GuiUtil.cpp +++ b/launcher/ui/GuiUtil.cpp @@ -16,21 +16,8 @@ QString GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget) { ProgressDialog dialog(parentWidget); - auto APIKeySetting = APPLICATION->settings()->get("PasteEEAPIKey").toString(); - if(APIKeySetting == "multimc") - { - APIKeySetting = BuildConfig.PASTE_EE_KEY; - } - std::unique_ptr<PasteUpload> paste(new PasteUpload(parentWidget, text, APIKeySetting)); - - if (!paste->validateText()) - { - CustomMessageBox::selectable( - parentWidget, QObject::tr("Upload failed"), - QObject::tr("The log file is too big. You'll have to upload it manually."), - QMessageBox::Warning)->exec(); - return QString(); - } + auto pasteUrlSetting = APPLICATION->settings()->get("PastebinURL").toString(); + std::unique_ptr<PasteUpload> paste(new PasteUpload(parentWidget, text, pasteUrlSetting)); dialog.execWithTask(paste.get()); if (!paste->wasSuccessful()) diff --git a/launcher/ui/pages/global/PasteEEPage.cpp b/launcher/ui/pages/global/PastePage.cpp index 4b375d9a..7c69e1a4 100644 --- a/launcher/ui/pages/global/PasteEEPage.cpp +++ b/launcher/ui/pages/global/PastePage.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2021 MultiMC Contributors +/* Copyright 2013-2021 MultiMC & PolyMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,69 +13,51 @@ * limitations under the License. */ -#include "PasteEEPage.h" -#include "ui_PasteEEPage.h" +#include "PastePage.h" +#include "ui_PastePage.h" #include <QMessageBox> #include <QFileDialog> #include <QStandardPaths> #include <QTabBar> +#include <QVariant> #include "settings/SettingsObject.h" #include "tools/BaseProfiler.h" #include "Application.h" -PasteEEPage::PasteEEPage(QWidget *parent) : +PastePage::PastePage(QWidget *parent) : QWidget(parent), - ui(new Ui::PasteEEPage) + ui(new Ui::PastePage) { + static QRegularExpression validUrlRegExp("https?://.+"); ui->setupUi(this); + ui->urlChoices->setValidator(new QRegularExpressionValidator(validUrlRegExp, ui->urlChoices)); ui->tabWidget->tabBar()->hide();\ - connect(ui->customAPIkeyEdit, &QLineEdit::textEdited, this, &PasteEEPage::textEdited); loadSettings(); } -PasteEEPage::~PasteEEPage() +PastePage::~PastePage() { delete ui; } -void PasteEEPage::loadSettings() +void PastePage::loadSettings() { auto s = APPLICATION->settings(); - QString keyToUse = s->get("PasteEEAPIKey").toString(); - if(keyToUse == "multimc") - { - ui->multimcButton->setChecked(true); - } - else - { - ui->customButton->setChecked(true); - ui->customAPIkeyEdit->setText(keyToUse); - } + QString pastebinURL = s->get("PastebinURL").toString(); + ui->urlChoices->setCurrentText(pastebinURL); } -void PasteEEPage::applySettings() +void PastePage::applySettings() { auto s = APPLICATION->settings(); - - QString pasteKeyToUse; - if (ui->customButton->isChecked()) - pasteKeyToUse = ui->customAPIkeyEdit->text(); - else - { - pasteKeyToUse = "multimc"; - } - s->set("PasteEEAPIKey", pasteKeyToUse); + QString pastebinURL = ui->urlChoices->currentText(); + s->set("PastebinURL", pastebinURL); } -bool PasteEEPage::apply() +bool PastePage::apply() { applySettings(); return true; } - -void PasteEEPage::textEdited(const QString& text) -{ - ui->customButton->setChecked(true); -} diff --git a/launcher/ui/pages/global/PasteEEPage.h b/launcher/ui/pages/global/PastePage.h index a1c7d434..d475dfd9 100644 --- a/launcher/ui/pages/global/PasteEEPage.h +++ b/launcher/ui/pages/global/PastePage.h @@ -21,16 +21,16 @@ #include <Application.h> namespace Ui { -class PasteEEPage; +class PastePage; } -class PasteEEPage : public QWidget, public BasePage +class PastePage : public QWidget, public BasePage { Q_OBJECT public: - explicit PasteEEPage(QWidget *parent = 0); - ~PasteEEPage(); + explicit PastePage(QWidget *parent = 0); + ~PastePage(); QString displayName() const override { @@ -54,9 +54,7 @@ private: void loadSettings(); void applySettings(); -private slots: - void textEdited(const QString &text); - private: - Ui::PasteEEPage *ui; + Ui::PastePage *ui; }; + diff --git a/launcher/ui/pages/global/PasteEEPage.ui b/launcher/ui/pages/global/PastePage.ui index 10883781..2d13a765 100644 --- a/launcher/ui/pages/global/PasteEEPage.ui +++ b/launcher/ui/pages/global/PastePage.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>PasteEEPage</class> - <widget class="QWidget" name="PasteEEPage"> + <class>PastePage</class> + <widget class="QWidget" name="PastePage"> <property name="geometry"> <rect> <x>0</x> @@ -36,50 +36,55 @@ <item> <widget class="QGroupBox" name="groupBox_2"> <property name="title"> - <string>paste.ee API key</string> + <string>Pastebin URL</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_10"> + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <widget class="QRadioButton" name="multimcButton"> - <property name="text"> - <string>MultiMC key - 12MB &upload limit</string> + <widget class="Line" name="line"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <attribute name="buttonGroup"> - <string notr="true">pasteButtonGroup</string> - </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="customButton"> - <property name="text"> - <string>&Your own key - 12MB upload limit:</string> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> </property> - <attribute name="buttonGroup"> - <string notr="true">pasteButtonGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QLineEdit" name="customAPIkeyEdit"> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> + <property name="text"> + <string><html><head/><body><p>Note: only input that starts with <span style=" font-weight:600;">http://</span> or <span style=" font-weight:600;">https://</span> will be accepted.</p></body></html></string> </property> - <property name="placeholderText"> - <string>Paste your API key here!</string> + <property name="scaledContents"> + <bool>false</bool> </property> </widget> </item> <item> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="QComboBox" name="urlChoices"> + <property name="editable"> + <bool>true</bool> + </property> + <property name="insertPolicy"> + <enum>QComboBox::NoInsert</enum> </property> + <item> + <property name="text"> + <string>https://0x0.st</string> + </property> + </item> + <item> + <property name="text"> + <string>https://paste.polymc.org</string> + </property> + </item> </widget> </item> <item> <widget class="QLabel" name="label"> <property name="text"> - <string><html><head/><body><p><a href="https://paste.ee">paste.ee</a> is used by MultiMC for log uploads. If you have a <a href="https://paste.ee">paste.ee</a> account, you can add your API key here and have your uploaded logs paired with your account.</p></body></html></string> + <string><html><head/><body><p>Here you can choose from a predefined list of paste services, or input the URL of a different paste service of your choice, provided it supports the same protocol as 0x0.st, that is POST a file parameter to the URL and return a link in the response body.</p></body></html></string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> @@ -116,13 +121,7 @@ </widget> <tabstops> <tabstop>tabWidget</tabstop> - <tabstop>multimcButton</tabstop> - <tabstop>customButton</tabstop> - <tabstop>customAPIkeyEdit</tabstop> </tabstops> <resources/> <connections/> - <buttongroups> - <buttongroup name="pasteButtonGroup"/> - </buttongroups> </ui> diff --git a/launcher/ui/pages/instance/LogPage.ui b/launcher/ui/pages/instance/LogPage.ui index ccfc1551..31bb368c 100644 --- a/launcher/ui/pages/instance/LogPage.ui +++ b/launcher/ui/pages/instance/LogPage.ui @@ -100,7 +100,7 @@ <item> <widget class="QPushButton" name="btnPaste"> <property name="toolTip"> - <string>Upload the log to paste.ee - it will stay online for a month</string> + <string>Upload the log to the paste service configured in preferences</string> </property> <property name="text"> <string>Upload</string> diff --git a/launcher/ui/pages/instance/OtherLogsPage.ui b/launcher/ui/pages/instance/OtherLogsPage.ui index 56ff3b62..77f3e647 100644 --- a/launcher/ui/pages/instance/OtherLogsPage.ui +++ b/launcher/ui/pages/instance/OtherLogsPage.ui @@ -84,7 +84,7 @@ <item row="3" column="2"> <widget class="QPushButton" name="btnPaste"> <property name="toolTip"> - <string>Upload the log to paste.ee - it will stay online for a month</string> + <string>Upload the log to the paste service configured in preferences.</string> </property> <property name="text"> <string>Upload</string> diff --git a/packages/nix/polymc/default.nix b/packages/nix/polymc/default.nix index 5da00ff8..b6bf6c5e 100644 --- a/packages/nix/polymc/default.nix +++ b/packages/nix/polymc/default.nix @@ -88,7 +88,7 @@ mkDerivation rec { postInstall = '' install -Dm644 ../launcher/resources/multimc/scalable/launcher.svg $out/share/pixmaps/polymc.svg - install -Dm644 ${desktopItem}/share/applications/polymc.desktop $out/share/applications/org.polymc.PolyMC.desktop + install -Dm644 ${desktopItem}/share/applications/polymc.desktop $out/share/applications/org.polymc.polymc.desktop # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 wrapProgram $out/bin/polymc \ diff --git a/packages/rpm/polymc.spec b/packages/rpm/polymc.spec index f5a6fe07..0b659ed5 100644 --- a/packages/rpm/polymc.spec +++ b/packages/rpm/polymc.spec @@ -6,7 +6,7 @@ Name: polymc Version: 1.0.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Minecraft launcher with ability to manage multiple instances # @@ -61,23 +61,18 @@ Source0: https://github.com/PolyMC/PolyMC/archive/%{version}/%{name}-%{ve Source1: https://github.com/MultiMC/libnbtplusplus/archive/%{libnbtplusplus_commit}/libnbtplusplus-%{libnbtplusplus_shortcommit}.tar.gz Source2: https://github.com/PolyMC/quazip/archive/%{quazip_commit}/quazip-%{quazip_shortcommit}.tar.gz -BuildRequires: cmake3 +BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: gcc-c++ -# Fix warning: Could not complete Guile gdb module initialization from: -# /usr/share/gdb/guile/gdb/boot.scm -BuildRequires: gdb-headless - BuildRequires: java-devel -BuildRequires: pkgconfig(gl) -BuildRequires: pkgconfig(Qt5) -BuildRequires: pkgconfig(zlib) +BuildRequires: %{?suse_version:lib}qt5-qtbase-devel +BuildRequires: zlib-devel -Requires: java-headless -Requires: pkgconfig(gl) -Requires: pkgconfig(Qt5) -Requires: pkgconfig(zlib) +# Minecraft < 1.17 +Recommends: java-1.8.0-openjdk-headless +# Minecraft >= 1.17 +Recommends: java-17-openjdk-headless %description PolyMC is a free, open source launcher for Minecraft. It allows you to have @@ -105,7 +100,6 @@ mv -f libraries/libnbtplusplus-%{libnbtplusplus_commit} libraries/libnbtplusplus %cmake_build - %install %cmake_install @@ -115,8 +109,11 @@ echo "%{_libdir}/%{name}" > "%{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_ %check +# skip tests on systems that aren't officially supported +%if ! 0%{?suse_version} %ctest -desktop-file-validate %{buildroot}%{_datadir}/applications/org.polymc.PolyMC.desktop +desktop-file-validate %{buildroot}%{_datadir}/applications/org.polymc.polymc.desktop +%endif %files @@ -127,11 +124,14 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.polymc.PolyMC.des %{_datadir}/%{name}/* %{_datadir}/metainfo/org.polymc.PolyMC.metainfo.xml %{_datadir}/icons/hicolor/scalable/apps/org.polymc.PolyMC.svg -%{_datadir}/applications/org.polymc.PolyMC.desktop +%{_datadir}/applications/org.polymc.polymc.desktop %config %{_sysconfdir}/ld.so.conf.d/* %changelog +* Mon Jan 24 2022 Jan Drögehoff <sentrycraft123@gmail.com> - 1.0.5-2 +- remove explicit dependencies, correct dependencies to work on OpenSuse + * Sun Jan 09 2022 Jan Drögehoff <sentrycraft123@gmail.com> - 1.0.5-1 - Update to 1.0.5 diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 77b971fc..26369fe5 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -1,19 +1,19 @@ set(Launcher_CommonName "PolyMC") set(Launcher_Copyright "PolyMC Contributors" PARENT_SCOPE) -set(Launcher_Domain "github.com/PolyMC" PARENT_SCOPE) +set(Launcher_Domain "polymc.org" PARENT_SCOPE) set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) set(Launcher_DisplayName "${Launcher_CommonName}" PARENT_SCOPE) set(Launcher_UserAgent "${Launcher_CommonName}/${Launcher_RELEASE_VERSION_NAME}" PARENT_SCOPE) set(Launcher_ConfigFile "polymc.cfg" PARENT_SCOPE) set(Launcher_Git "https://github.com/PolyMC/PolyMC" PARENT_SCOPE) -set(Launcher_Desktop "program_info/org.polymc.PolyMC.desktop" PARENT_SCOPE) +set(Launcher_Desktop "program_info/org.polymc.polymc.desktop" PARENT_SCOPE) set(Launcher_MetaInfo "program_info/org.polymc.PolyMC.metainfo.xml" PARENT_SCOPE) set(Launcher_SVG "program_info/org.polymc.PolyMC.svg" PARENT_SCOPE) set(Launcher_Branding_ICNS "program_info/polymc.icns" PARENT_SCOPE) set(Launcher_Branding_WindowsRC "program_info/polymc.rc" PARENT_SCOPE) set(Launcher_Branding_LogoQRC "program_info/polymc.qrc" PARENT_SCOPE) -configure_file(org.polymc.PolyMC.desktop.in org.polymc.PolyMC.desktop) +configure_file(org.polymc.polymc.desktop.in org.polymc.polymc.desktop) configure_file(org.polymc.PolyMC.metainfo.xml.in org.polymc.PolyMC.metainfo.xml) diff --git a/program_info/org.polymc.PolyMC.desktop.in b/program_info/org.polymc.polymc.desktop.in index 5d982b38..8bbdc505 100644 --- a/program_info/org.polymc.PolyMC.desktop.in +++ b/program_info/org.polymc.polymc.desktop.in @@ -10,4 +10,3 @@ Icon=org.polymc.PolyMC PrefersNonDefaultGPU=true Categories=Game; Keywords=game;minecraft;launcher; -StartupWMClass=PolyMC |