View | Details | Raw Unified | Return to bug 224823
Collapse All | Expand All

(-)games/multimc/Makefile (+37 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	multimc
4
DISTVERSION=	0.6.0
5
CATEGORIES=	games java
6
7
MAINTAINER=	me@tsundoku.ne.jp
8
COMMENT=	Minecraft launcher with ability to manage multiple instances
9
10
LICENSE=	APACHE20
11
LICENSE_FILE=	${WRKSRC}/COPYING.md
12
13
RUN_DEPENDS=	${LWJGL_DIR}/liblwjgl64.so:games/lwjgl
14
15
USES=		cmake:outsource
16
USE_GITHUB=	yes
17
GH_ACCOUNT=	MultiMC
18
GH_PROJECT=	MultiMC5
19
GH_TUPLE=	MultiMC:libnbtplusplus:4b305bb:libnbtplusplus/libraries/libnbtplusplus \
20
		MultiMC:quazip:164acc3:quazip/libraries/quazip
21
USE_LDCONFIG=	yes
22
USE_JAVA=	1.8+
23
USE_QT5=	buildtools core concurrent gui network qmake testlib_build widgets xml
24
25
CMAKE_ARGS=	-DMultiMC_LAYOUT="lin-system"
26
CMAKE_OFF=	MultiMC_UPDATER
27
CXXFLAGS+=	-Wno-inconsistent-missing-override \
28
		-Wno-delete-non-virtual-dtor \
29
		-DLWJGL_DIR='\"${LWJGL_DIR}\"'
30
31
LWJGL_DIR=	${LOCALBASE}/lib/lwjgl2.9.3
32
33
post-patch:
34
	@${REINPLACE_CMD} 's,usr/local,${LOCALBASE:S@^/@@},g' \
35
		${WRKSRC}/application/CMakeLists.txt
36
37
.include <bsd.port.mk>
(-)games/multimc/distinfo (+7 lines)
Line 0 Link Here
1
TIMESTAMP = 1514826359
2
SHA256 (MultiMC-MultiMC5-0.6.0_GH0.tar.gz) = ac458be99250d2a369ee805bf9560e396d0e0f16a95cc84c36eb0ef1e94a6374
3
SIZE (MultiMC-MultiMC5-0.6.0_GH0.tar.gz) = 1844862
4
SHA256 (MultiMC-libnbtplusplus-4b305bb_GH0.tar.gz) = 576391fb7aac44e8d8e2012f38b1f0bbb08cb9d0cd9104f162cfdee4b83e5627
5
SIZE (MultiMC-libnbtplusplus-4b305bb_GH0.tar.gz) = 47080
6
SHA256 (MultiMC-quazip-164acc3_GH0.tar.gz) = fb289ba497f2e315a8e85881ca78218f859d7a72f11463251cfb83271c4381b7
7
SIZE (MultiMC-quazip-164acc3_GH0.tar.gz) = 103454
(-)games/multimc/files/patch-CMakeLists.txt (+11 lines)
Line 0 Link Here
1
--- CMakeLists.txt.orig	2017-12-18 00:19:43 UTC
2
+++ CMakeLists.txt
3
@@ -5,6 +5,8 @@ if(IS_IN_SOURCE_BUILD)
4
 	message(AUTHOR_WARNING "You are building MultiMC in-source. This is NOT recommended!")
5
 endif()
6
 
7
+set(CMAKE_INSTALL_PREFIX "/")
8
+
9
 if(WIN32)
10
 	# In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows
11
 	cmake_policy(SET CMP0020 OLD)
(-)games/multimc/files/patch-api_gui_DesktopServices.cpp (+56 lines)
Line 0 Link Here
1
--- api/gui/DesktopServices.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/gui/DesktopServices.cpp
3
@@ -7,7 +7,7 @@
4
 /**
5
  * This shouldn't exist, but until QTBUG-9328 and other unreported bugs are fixed, it needs to be a thing.
6
  */
7
-#if defined(Q_OS_LINUX)
8
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
9
 
10
 #include <unistd.h>
11
 #include <errno.h>
12
@@ -83,7 +83,7 @@ bool openDirectory(const QString &path, 
13
 	{
14
 		return QDesktopServices::openUrl(QUrl::fromLocalFile(dir.absolutePath()));
15
 	};
16
-#if defined(Q_OS_LINUX)
17
+#if defined(Q_OS_LINUX) || defined (Q_OS_FREEBSD)
18
 	return IndirectOpen(f);
19
 #else
20
 	return f();
21
@@ -97,7 +97,7 @@ bool openFile(const QString &path)
22
 	{
23
 		return QDesktopServices::openUrl(QUrl::fromLocalFile(path));
24
 	};
25
-#if defined(Q_OS_LINUX)
26
+#if defined(Q_OS_LINUX) || defined (Q_OS_FREEBSD)
27
 	return IndirectOpen(f);
28
 #else
29
 	return f();
30
@@ -107,7 +107,7 @@ bool openFile(const QString &path)
31
 bool openFile(const QString &application, const QString &path, const QString &workingDirectory, qint64 *pid)
32
 {
33
 	qDebug() << "Opening file" << path << "using" << application;
34
-#if defined(Q_OS_LINUX)
35
+#if defined(Q_OS_LINUX) || defined (Q_OS_FREEBSD)
36
 	// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
37
 	return IndirectOpen([&]()
38
 	{
39
@@ -121,7 +121,7 @@ bool openFile(const QString &application
40
 bool run(const QString &application, const QStringList &args, const QString &workingDirectory, qint64 *pid)
41
 {
42
 	qDebug() << "Running" << application << "with args" << args.join(' ');
43
-#if defined(Q_OS_LINUX)
44
+#if defined(Q_OS_LINUX) || defined (Q_OS_FREEBSD)
45
 	// FIXME: the pid here is fake. So if something depends on it, it will likely misbehave
46
 	return IndirectOpen([&]()
47
 	{
48
@@ -139,7 +139,7 @@ bool openUrl(const QUrl &url)
49
 	{
50
 		return QDesktopServices::openUrl(url);
51
 	};
52
-#if defined(Q_OS_LINUX)
53
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
54
 	return IndirectOpen(f);
55
 #else
56
 	return f();
(-)games/multimc/files/patch-api_logic_FileSystem.cpp (+11 lines)
Line 0 Link Here
1
--- api/logic/FileSystem.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/FileSystem.cpp
3
@@ -407,7 +407,7 @@ QString getDesktopDir()
4
 bool createShortCut(QString location, QString dest, QStringList args, QString name,
5
 						  QString icon)
6
 {
7
-#if defined Q_OS_LINUX
8
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
9
 	location = PathCombine(location, name + ".desktop");
10
 
11
 	QFile f(location);
(-)games/multimc/files/patch-api_logic_FileSystem__test.cpp (+20 lines)
Line 0 Link Here
1
--- api/logic/FileSystem_test.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/FileSystem_test.cpp
3
@@ -119,7 +119,7 @@ slots:
4
 
5
 // this is only valid on linux
6
 // FIXME: implement on windows, OSX, then test.
7
-#if defined(Q_OS_LINUX)
8
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
9
 	void test_createShortcut_data()
10
 	{
11
 		QTest::addColumn<QString>("location");
12
@@ -134,7 +134,7 @@ slots:
13
 							  << (QStringList() << "arg1" << "arg2")
14
 							  << "asdf"
15
 							  << QString()
16
-						 #if defined(Q_OS_LINUX)
17
+						 #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
18
 							  << MULTIMC_GET_TEST_FILE("data/FileSystem-test_createShortcut-unix")
19
 						 #elif defined(Q_OS_WIN)
20
 							  << QByteArray()
(-)games/multimc/files/patch-api_logic_java_JavaUtils.cpp (+29 lines)
Line 0 Link Here
1
--- api/logic/java/JavaUtils.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/java/JavaUtils.cpp
3
@@ -81,7 +81,7 @@ QProcessEnvironment CleanEnviroment()
4
 			qDebug() << "Env: ignoring" << key << value;
5
 			continue;
6
 		}
7
-#ifdef Q_OS_LINUX
8
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
9
 		// Do not pass LD_* variables to java. They were intended for MultiMC
10
 		if(key.startsWith("LD_"))
11
 		{
12
@@ -110,7 +110,7 @@ QProcessEnvironment CleanEnviroment()
13
 		qDebug() << "Env: " << key << value;
14
 		env.insert(key, value);
15
 	}
16
-#ifdef Q_OS_LINUX
17
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
18
 	// HACK: Workaround for QTBUG42500
19
 	if(!env.contains("LD_LIBRARY_PATH"))
20
 	{
21
@@ -291,7 +291,7 @@ QList<QString> JavaUtils::FindJavaPaths(
22
 	return javas;
23
 }
24
 
25
-#elif defined(Q_OS_LINUX)
26
+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
27
 QList<QString> JavaUtils::FindJavaPaths()
28
 {
29
 	qDebug() << "Linux Java detection incomplete - defaulting to \"java\"";
(-)games/multimc/files/patch-api_logic_minecraft_MinecraftInstance.cpp (+14 lines)
Line 0 Link Here
1
--- api/logic/minecraft/MinecraftInstance.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/minecraft/MinecraftInstance.cpp
3
@@ -163,7 +163,11 @@ QString MinecraftInstance::binRoot() con
4
 
5
 QString MinecraftInstance::getNativePath() const
6
 {
7
+#if defined(Q_OS_FREEBSD)
8
+	QDir natives_dir(LWJGL_DIR "/");
9
+#else
10
 	QDir natives_dir(FS::PathCombine(instanceRoot(), "natives/"));
11
+#endif
12
 	return natives_dir.absolutePath();
13
 }
14
 
(-)games/multimc/files/patch-api_logic_minecraft_OpSys.cpp (+27 lines)
Line 0 Link Here
1
--- api/logic/minecraft/OpSys.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/minecraft/OpSys.cpp
3
@@ -17,6 +17,8 @@
4
 
5
 OpSys OpSys_fromString(QString name)
6
 {
7
+	if (name == "freebsd")
8
+		return Os_FreeBSD;
9
 	if (name == "linux")
10
 		return Os_Linux;
11
 	if (name == "windows")
12
@@ -30,6 +32,8 @@ QString OpSys_toString(OpSys name)
13
 {
14
 	switch (name)
15
 	{
16
+	case Os_FreeBSD:
17
+		return "freebsd";
18
 	case Os_Linux:
19
 		return "linux";
20
 	case Os_OSX:
21
@@ -39,4 +43,4 @@ QString OpSys_toString(OpSys name)
22
 	default:
23
 		return "other";
24
 	}
25
-}
26
\ No newline at end of file
27
+}
(-)games/multimc/files/patch-api_logic_minecraft_OpSys.h (+25 lines)
Line 0 Link Here
1
--- api/logic/minecraft/OpSys.h.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/minecraft/OpSys.h
3
@@ -20,6 +20,7 @@ enum OpSys
4
 	Os_Windows,
5
 	Os_Linux,
6
 	Os_OSX,
7
+	Os_FreeBSD,
8
 	Os_Other
9
 };
10
 
11
@@ -28,10 +29,10 @@ QString OpSys_toString(OpSys);
12
 
13
 #ifdef Q_OS_WIN32
14
 #define currentSystem Os_Windows
15
-#else
16
-#ifdef Q_OS_MAC
17
+#elif defined Q_OS_MAC
18
 #define currentSystem Os_OSX
19
+#elif defined Q_OS_FREEBSD
20
+#define currentSystem Os_FreeBSD
21
 #else
22
 #define currentSystem Os_Linux
23
 #endif
24
-#endif
25
\ No newline at end of file
(-)games/multimc/files/patch-api_logic_minecraft_launch_ExtractNatives.cpp (+17 lines)
Line 0 Link Here
1
--- api/logic/minecraft/launch/ExtractNatives.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/minecraft/launch/ExtractNatives.cpp
3
@@ -23,6 +23,14 @@
4
 #include "FileSystem.h"
5
 #include <QDir>
6
 
7
+//C library defines interfere with Java version check
8
+#ifdef major
9
+    #undef major
10
+#endif
11
+#ifdef minor
12
+    #undef minor
13
+#endif
14
+
15
 static QString replaceSuffix (QString target, const QString &suffix, const QString &replacement)
16
 {
17
 	if (!target.endsWith(suffix))
(-)games/multimc/files/patch-api_logic_minecraft_launch_PrintInstanceInfo.cpp (+62 lines)
Line 0 Link Here
1
--- api/logic/minecraft/launch/PrintInstanceInfo.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ api/logic/minecraft/launch/PrintInstanceInfo.cpp
3
@@ -24,6 +24,10 @@ void PrintInstanceInfo::executeTask()
4
     auto instance = m_parent->instance();
5
     auto lines = instance->verboseDescription(m_session);
6
     
7
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
8
+
9
+	char buff[512];
10
+
11
 #ifdef Q_OS_LINUX
12
     std::ifstream cpuin("/proc/cpuinfo");
13
     for (std::string line; std::getline(cpuin, line);)
14
@@ -36,7 +40,6 @@ void PrintInstanceInfo::executeTask()
15
         }
16
     }
17
 
18
-    char buff[512];
19
     int gpuline = -1;
20
     int cline = 0;
21
     FILE *fp = popen("lspci -k", "r");
22
@@ -64,6 +67,40 @@ void PrintInstanceInfo::executeTask()
23
             cline++;
24
         }
25
     }
26
+#elif defined(Q_OS_FREEBSD)
27
+
28
+	std::string strcard;
29
+
30
+	FILE *fp3 = popen("sysctl hw.model", "r");
31
+	if (fp3 != NULL)
32
+	{
33
+		fgets(buff, 512, fp3);
34
+		std::string str(buff);
35
+		QStringList clines = (QStringList() << QString::fromStdString(str.substr(10, std::string::npos)));
36
+		logLines(clines, MessageLevel::MultiMC);
37
+	}
38
+
39
+	FILE *fp4 = popen("pciconf -lv -a vgapci0", "r");
40
+	if (fp4 != NULL)
41
+	{
42
+		while (fgets(buff, 512, fp4) != NULL)
43
+		{
44
+			if (strncmp(buff, "    vendor", 10) == 0)
45
+			{
46
+				std::string str(buff);
47
+				strcard.append(str.substr(str.find_first_of("'") + 1, str.find_last_not_of("'") - (str.find_first_of("'") + 2)));
48
+				strcard.append(" ");
49
+			}
50
+			else if (strncmp(buff, "    device", 10) == 0)
51
+			{
52
+				std::string str2(buff);
53
+				strcard.append(str2.substr(str2.find_first_of("'") + 1, str2.find_last_not_of("'") - (str2.find_first_of("'") + 2)));
54
+				QStringList glines = (QStringList() << QString::fromStdString(strcard));
55
+				logLines(glines, MessageLevel::MultiMC);
56
+			}
57
+		}
58
+	}
59
+#endif
60
     
61
     FILE *fp2 = popen("glxinfo", "r");
62
     if (fp2 != NULL)
(-)games/multimc/files/patch-application_CMakeLists.txt (+31 lines)
Line 0 Link Here
1
--- application/CMakeLists.txt.orig	2017-12-18 00:19:43 UTC
2
+++ application/CMakeLists.txt
3
@@ -27,11 +27,11 @@ set(MultiMC_PASTE_EE_API_KEY "" CACHE ST
4
 set(MultiMC_ANALYTICS_ID "" CACHE STRING "ID you can get from Google analytics")
5
 
6
 #### Check the current Git commit and branch
7
-include(GetGitRevisionDescription)
8
-get_git_head_revision(MultiMC_GIT_REFSPEC MultiMC_GIT_COMMIT)
9
+#include(GetGitRevisionDescription)
10
+#get_git_head_revision(MultiMC_GIT_REFSPEC MultiMC_GIT_COMMIT)
11
 
12
-message(STATUS "Git commit: ${MultiMC_GIT_COMMIT}")
13
-message(STATUS "Git refspec: ${MultiMC_GIT_REFSPEC}")
14
+#message(STATUS "Git commit: ${MultiMC_GIT_COMMIT}")
15
+#message(STATUS "Git refspec: ${MultiMC_GIT_REFSPEC}")
16
 
17
 set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_HOTFIX}")
18
 
19
@@ -390,9 +390,9 @@ elseif(MultiMC_LAYOUT_REAL STREQUAL "lin
20
 	install(PROGRAMS package/linux/MultiMC DESTINATION ${BUNDLE_DEST_DIR})
21
 
22
 elseif(MultiMC_LAYOUT_REAL STREQUAL "lin-system")
23
-	set(MultiMC_BINARY_DEST_DIR "usr/bin" CACHE STRING "Relative path from packaging root to the binary directory")
24
-	set(MultiMC_LIBRARY_DEST_DIR "usr/lib" CACHE STRING "Relative path from packaging root to the library directory")
25
-	set(MultiMC_SHARE_DEST_DIR "usr/share/multimc" CACHE STRING "Relative path from packaging root to the shared data directory")
26
+	set(MultiMC_BINARY_DEST_DIR "usr/local/bin" CACHE STRING "Relative path from packaging root to the binary directory")
27
+	set(MultiMC_LIBRARY_DEST_DIR "usr/local/lib" CACHE STRING "Relative path from packaging root to the library directory")
28
+	set(MultiMC_SHARE_DEST_DIR "usr/local/share/multimc" CACHE STRING "Relative path from packaging root to the shared data directory")
29
 	set(MultiMC_APP_BINARY_NAME "multimc" CACHE STRING "Name of the MultiMC binary for the purposes of linux packaging")
30
 	set(JARS_DEST_DIR "${MultiMC_SHARE_DEST_DIR}")
31
 
(-)games/multimc/files/patch-application_MultiMC.cpp (+11 lines)
Line 0 Link Here
1
--- application/MultiMC.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ application/MultiMC.cpp
3
@@ -322,7 +322,7 @@ MultiMC::MultiMC(int &argc, char **argv)
4
 	// Set up paths
5
 	{
6
 		// Root path is used for updates.
7
-#ifdef Q_OS_LINUX
8
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
9
 		QDir foo(FS::PathCombine(binPath, ".."));
10
 		m_rootPath = foo.absolutePath();
11
 #elif defined(Q_OS_WIN32)
(-)games/multimc/files/patch-application_UpdateController.cpp (+11 lines)
Line 0 Link Here
1
--- application/UpdateController.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ application/UpdateController.cpp
3
@@ -90,7 +90,7 @@ void UpdateController::installUpdates()
4
 	qDebug() << "Installing updates.";
5
 #ifdef Q_OS_WIN
6
 	QString finishCmd = QApplication::applicationFilePath();
7
-#elif defined Q_OS_LINUX
8
+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
9
 	QString finishCmd = FS::PathCombine(m_root, "MultiMC");
10
 #elif defined Q_OS_MAC
11
 	QString finishCmd = QApplication::applicationFilePath();
(-)games/multimc/files/patch-application_install__prereqs.cmake.in (+8 lines)
Line 0 Link Here
1
--- application/install_prereqs.cmake.in.orig	2017-12-18 00:19:43 UTC
2
+++ application/install_prereqs.cmake.in
3
@@ -23,5 +23,4 @@ set(gp_cmd_paths ${gp_cmd_paths}
4
 )
5
 
6
 include(BundleUtilities)
7
-fixup_bundle("@APPS@" "${QTPLUGINS}" "@DIRS@")
8
 
(-)games/multimc/files/patch-libraries_iconfix_internal_qiconloader.cpp (+11 lines)
Line 0 Link Here
1
--- libraries/iconfix/internal/qiconloader.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ libraries/iconfix/internal/qiconloader.cpp
3
@@ -320,7 +320,7 @@ Description: Make it so that the QIcon l
4
 			 icon theme specification.
5
 Bug: https://bugreports.qt.nokia.com/browse/QTBUG-12874
6
  *********************************************************************/
7
-#ifdef Q_OS_LINUX
8
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
9
 	/* Freedesktop standard says to look in /usr/share/pixmaps last */
10
 	if (entries.isEmpty())
11
 	{
(-)games/multimc/files/patch-libraries_systeminfo_src_sys__unix.cpp (+41 lines)
Line 0 Link Here
1
--- libraries/systeminfo/src/sys_unix.cpp.orig	2017-12-18 00:19:43 UTC
2
+++ libraries/systeminfo/src/sys_unix.cpp
3
@@ -16,6 +16,7 @@ Sys::KernelInfo Sys::getKernelInfo()
4
 uint64_t Sys::getSystemRam()
5
 {
6
 	std::string token;
7
+	#ifdef Q_OS_LINUX
8
 	std::ifstream file("/proc/meminfo");
9
 	while(file >> token)
10
 	{
11
@@ -34,6 +35,19 @@ uint64_t Sys::getSystemRam()
12
 		// ignore rest of the line
13
 		file.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
14
 	}
15
+	#elif defined Q_OS_FREEBSD
16
+	char buff[512];
17
+	FILE *fp = popen("sysctl hw.physmem", "r");
18
+	if (fp != NULL)
19
+	{
20
+		while(fgets(buff, 512, fp) != NULL)
21
+		{
22
+			std::string str(buff);
23
+			uint64_t mem = std::stoull(str.substr(12, std::string::npos));
24
+			return mem * 1024ull;
25
+		}
26
+	}
27
+	#endif
28
 	return 0; // nothing found
29
 }
30
 
31
@@ -43,7 +57,9 @@ bool Sys::isCPU64bit()
32
 }
33
 
34
 bool Sys::isSystem64bit()
35
-{
36
+{	
37
+	#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
38
 	// kernel build arch on linux
39
 	return QSysInfo::currentCpuArchitecture() == "x86_64";
40
+	#endif
41
 }
(-)games/multimc/pkg-descr (+3 lines)
Line 0 Link Here
1
MultiMC is a custom launcher for Minecraft that allows you to easily manage
2
multiple installations of Minecraft at once. It also allows you to easily
3
install and remove mods by simply dragging and dropping. 
(-)games/multimc/pkg-plist (+10 lines)
Line 0 Link Here
1
bin/multimc
2
lib/libMultiMC_gui.so
3
lib/libMultiMC_iconfix.so
4
lib/libMultiMC_logic.so
5
lib/libMultiMC_nbt++.so
6
lib/libMultiMC_quazip.so
7
lib/libMultiMC_rainbow.so
8
lib/libMultiMC_unpack200.so
9
%%DATADIR%%/jars/JavaCheck.jar
10
%%DATADIR%%/jars/NewLaunch.jar

Return to bug 224823