From e806903d7e611d44c13118eb998140277a7e4ee1 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:32:55 +0100 Subject: Support OpenBSD without patches --- launcher/tools/MCEditTool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/tools/MCEditTool.cpp b/launcher/tools/MCEditTool.cpp index 21e1a3b0..2c1ec613 100644 --- a/launcher/tools/MCEditTool.cpp +++ b/launcher/tools/MCEditTool.cpp @@ -52,7 +52,7 @@ QString MCEditTool::getProgramPath() #else const QString mceditPath = path(); QDir mceditDir(mceditPath); -#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) +#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) if (mceditDir.exists("mcedit.sh")) { return mceditDir.absoluteFilePath("mcedit.sh"); -- cgit From dba9199e58aa08faa22682705b3137684c385fcf Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:35:48 +0100 Subject: Support OpenBSD in UpdateController.cpp --- launcher/UpdateController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/UpdateController.cpp b/launcher/UpdateController.cpp index f9b7d349..c02cd1e7 100644 --- a/launcher/UpdateController.cpp +++ b/launcher/UpdateController.cpp @@ -93,7 +93,7 @@ void UpdateController::installUpdates() qDebug() << "Installing updates."; #ifdef Q_OS_WIN QString finishCmd = QApplication::applicationFilePath(); -#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) +#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined (Q_OS_OPENBSD) QString finishCmd = FS::PathCombine(m_root, BuildConfig.LAUNCHER_NAME); #elif defined Q_OS_MAC QString finishCmd = QApplication::applicationFilePath(); -- cgit From ca1a2bbe2cda64859b45e256576f01ce98043e92 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:38:26 +0100 Subject: Add OpenBSD instructions --- BUILD.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 9872e9e7..e66dc7e1 100644 --- a/BUILD.md +++ b/BUILD.md @@ -20,7 +20,7 @@ git submodule update The rest of the documentation assumes you have already cloned the repository. -# Linux +# Linux and FreeBSD Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution. @@ -273,3 +273,43 @@ Remember to replace `/path/to/Qt/` with the actual path. For newer Qt installati **Note:** The final app bundle may not run due to code signing issues, which need to be fixed with `codesign -fs -`. + +# OpenBSD + +Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution. + +## Build dependencies +- A C++ compiler capable of building C++11 code. +- Qt Development tools 5.6 or newer (`qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5` on Debian-based system) +- cmake 3.1 or newer (`cmake` on Debian-based system) +- zlib (`zlib1g-dev` on Debian-based system) +- Java JDK (`openjdk-17-jdk`on Debian-based system) +- GL headers (`libgl1-mesa-dev` on Debian-based system) + +You can use IDEs like KDevelop or QtCreator to open the CMake project if you want to work on the code. + +### Building a portable binary + +```sh +mkdir install +# configure the project +cmake -S . -B build \ + -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake +# build +cd build +make -j$(nproc) install +``` + +### Building & Installing to the System + +This is the preferred method for installation, and is suitable for packages. + +```sh +# configure everything +cmake -S . -B build \ +  -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="/usr" \ # Use "/usr" for packages, otherwise, leave it at the default "/usr/local". + -DLauncher_LAYOUT=lin-system -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake +cd build +make -j$(nproc) install # Optionally specify DESTDIR for packages (i.e. DESTDIR=${pkgdir}) +``` -- cgit From f31d5372e7c5f53261df502d58472e7a76e08eed Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:39:14 +0100 Subject: Update BUILD.md --- BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index e66dc7e1..a11b3c65 100644 --- a/BUILD.md +++ b/BUILD.md @@ -276,7 +276,7 @@ need to be fixed with `codesign -fs -`. # OpenBSD -Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution. +Tested on OpenBSD 7.0-alpha i386, on older should work too ## Build dependencies - A C++ compiler capable of building C++11 code. -- cgit From 305350fdc8b21d7ac335f29d64708ff255dce1c9 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:41:13 +0100 Subject: Update BUILD.md --- BUILD.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index a11b3c65..068872e1 100644 --- a/BUILD.md +++ b/BUILD.md @@ -22,7 +22,7 @@ The rest of the documentation assumes you have already cloned the repository. # Linux and FreeBSD -Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution. +Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution. If you're using FreeBSD you should use 13.0-RELEASE or newer. ## Build dependencies - A C++ compiler capable of building C++11 code. @@ -31,6 +31,7 @@ Getting the project to build and run on Linux is easy if you use any modern and - zlib (`zlib1g-dev` on Debian-based system) - Java JDK (`openjdk-17-jdk`on Debian-based system) - GL headers (`libgl1-mesa-dev` on Debian-based system) +- games/lwjgl port if using FreeBSD You can use IDEs like KDevelop or QtCreator to open the CMake project if you want to work on the code. -- cgit From dd8946b15a833e72b5b6f0c8160ddf1f2b3867a6 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:03:17 +0100 Subject: Update BUILD.md --- BUILD.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/BUILD.md b/BUILD.md index 068872e1..2f4f34fb 100644 --- a/BUILD.md +++ b/BUILD.md @@ -280,12 +280,13 @@ need to be fixed with `codesign -fs -`. Tested on OpenBSD 7.0-alpha i386, on older should work too ## Build dependencies -- A C++ compiler capable of building C++11 code. -- Qt Development tools 5.6 or newer (`qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5` on Debian-based system) -- cmake 3.1 or newer (`cmake` on Debian-based system) -- zlib (`zlib1g-dev` on Debian-based system) -- Java JDK (`openjdk-17-jdk`on Debian-based system) -- GL headers (`libgl1-mesa-dev` on Debian-based system) +- A C++ compiler capable of building C++11 code (included in base system) +- Qt Development tools 5.6 or newer ([meta/qt5](https://openports.se/meta/qt5)) +- cmake 3.1 or newer ([devel/cmake](https://openports.se/devel/cmake)) +- zlib (included in base system) +- Java JDK ([devel/jdk-1.8](https://openports.se/devel/jdk/1.8)) +- GL headers (included in base system) +- lwjgl ([games/lwjgl](https://openports.se/games/lwjgl) and [games/lwjgl3](https://openports.se/games/lwjgl3)) You can use IDEs like KDevelop or QtCreator to open the CMake project if you want to work on the code. -- cgit From f25152e068e301b31dc35cf38c4a72d96a5c7698 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:06:08 +0100 Subject: Update BUILD.md --- BUILD.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BUILD.md b/BUILD.md index 2f4f34fb..f21b6e7a 100644 --- a/BUILD.md +++ b/BUILD.md @@ -55,7 +55,7 @@ This is the preferred method for installation, and is suitable for packages. # configure everything cmake -S . -B build \   -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="/usr" \ # Use "/usr" for packages, otherwise, leave it at the default "/usr/local". + -DCMAKE_INSTALL_PREFIX="/usr" \ # Replace /usr with /usr/local when building on FreeBSD -DLauncher_LAYOUT=lin-system cd build make -j$(nproc) install # Optionally specify DESTDIR for packages (i.e. DESTDIR=${pkgdir}) @@ -73,7 +73,7 @@ makedeb -s The deb will be located in the directory the repo was cloned in. -### Building a .rpm +### Building an .rpm 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. @@ -310,8 +310,8 @@ This is the preferred method for installation, and is suitable for packages. # configure everything cmake -S . -B build \   -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="/usr" \ # Use "/usr" for packages, otherwise, leave it at the default "/usr/local". - -DLauncher_LAYOUT=lin-system -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake + -DCMAKE_INSTALL_PREFIX="/usr/local" \ # /usr/local is default in OpenBSD and FreeBSD + -DLauncher_LAYOUT=lin-system -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake # use linux layout and point to qt5 libs cd build make -j$(nproc) install # Optionally specify DESTDIR for packages (i.e. DESTDIR=${pkgdir}) ``` -- cgit From d35cbfd9c4e3917f24dad94e00f787bbf6c1fcf9 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:11:20 +0100 Subject: Add Slackware instructions --- BUILD.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BUILD.md b/BUILD.md index f21b6e7a..5b1fb20d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -95,6 +95,15 @@ rpmbuild -bb polymc.spec The path to the rpm packages will be printed when the build is complete. +### Building a Slackware package + +To build a Slackware package, first install [qt5 SlackBuild](http://slackbuilds.org/repository/14.2/libraries/qt5/) (on 15.0 and newer installed by defualt), then set up a [JDK](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/adoptium-jdk8.tar.gz). Next, download the [SlackBuild](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/polymc.tar.gz), unpack it and type in extracted directory: + +``` +sudo ./polymc.SlackBuild # script will do everything, just sit up and wait +sudo /sbin/installpkg /tmp/polymc-version-arch-1_SBo.tgz # install the created package +``` + ### Building a flatpak You don't need to clone the entire PolyMC repo for this; the flatpak file handles that. -- cgit From b646fc5a13d1c564fe2317811ae23d23b9cd6ff9 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:18:39 +0100 Subject: Update build instructions for Slackware 14.2 --- BUILD.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 5b1fb20d..c6b7b809 100644 --- a/BUILD.md +++ b/BUILD.md @@ -97,7 +97,22 @@ The path to the rpm packages will be printed when the build is complete. ### Building a Slackware package -To build a Slackware package, first install [qt5 SlackBuild](http://slackbuilds.org/repository/14.2/libraries/qt5/) (on 15.0 and newer installed by defualt), then set up a [JDK](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/adoptium-jdk8.tar.gz). Next, download the [SlackBuild](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/polymc.tar.gz), unpack it and type in extracted directory: +To build a Slackware package, first install [qt5 SlackBuild](http://slackbuilds.org/repository/14.2/libraries/qt5/) (on 15.0 and newer installed by defualt), then set up a [JDK](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/adoptium-jdk8.tar.gz). + +If you're using Slackware 14.2, update cmake with these commands: + +``` +mkdir -p /tmp/SBo +cd /tmp/SBo +wget -c https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2.tar.gz +tar xzvf cmake-3.22.2.tar.gz +cd cmake-3.22.2 +./configure --prefix=/usr +make +sudo make install +``` + +Next, download the [SlackBuild](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/polymc.tar.gz), unpack it and type in extracted directory: ``` sudo ./polymc.SlackBuild # script will do everything, just sit up and wait -- cgit From b2b4ab3f0ce0efdd2ee5524c3e0e754a815f4a48 Mon Sep 17 00:00:00 2001 From: glowiak <52356948+glowiak@users.noreply.github.com> Date: Mon, 7 Feb 2022 10:11:36 +0100 Subject: Update BUILD.md --- BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index c6b7b809..3b6e6446 100644 --- a/BUILD.md +++ b/BUILD.md @@ -55,7 +55,7 @@ This is the preferred method for installation, and is suitable for packages. # configure everything cmake -S . -B build \   -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="/usr" \ # Replace /usr with /usr/local when building on FreeBSD + -DCMAKE_INSTALL_PREFIX="/usr" \ # Use "/usr" when building Linux packages. If building on FreeBSD or not for package, use "/usr/local" -DLauncher_LAYOUT=lin-system cd build make -j$(nproc) install # Optionally specify DESTDIR for packages (i.e. DESTDIR=${pkgdir}) -- cgit