Some Fixes

This commit is contained in:
TheBrokenRail 2025-02-27 08:33:56 -05:00
parent 955c2b9b3d
commit 723d5160c8
5 changed files with 88 additions and 77 deletions

View File

@ -38,81 +38,20 @@ target_compile_definitions(launcher PRIVATE _FILE_OFFSET_BITS=64)
install(TARGETS launcher DESTINATION "${MCPI_INSTALL_DIR}")
install_symlink("../${MCPI_INSTALL_DIR}/launcher" "bin/${MCPI_APP_NAME}")
# Install Desktop Entry
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop"
"[Desktop Entry]\n"
"Name=${MCPI_APP_TITLE}\n"
"Comment=Fun with Blocks\n"
"Icon=${MCPI_APP_ID}\n"
"Exec=${MCPI_APP_NAME}\n"
"Type=Application\n"
"Categories=Game;\n"
"Terminal=false\n"
"StartupNotify=false\n"
"StartupWMClass=${MCPI_APP_ID}\n"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/launcher.desktop"
DESTINATION "${MCPI_SHARE_DIR}/applications"
RENAME "${MCPI_APP_ID}.desktop"
)
# Install AppStream Metadata
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<component type=\"desktop\">\n"
" <id>${MCPI_APP_ID}</id>\n"
" <name>${MCPI_APP_TITLE}</name>\n"
" <metadata_license>CC0-1.0</metadata_license>\n"
" <summary>Fun with Blocks</summary>\n"
" <description>\n"
" <p>Minecraft: Pi Edition Modding Project.</p>\n"
" <p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p>\n"
" </description>\n"
" <url type=\"homepage\">${MCPI_REPO}</url>\n"
" <launchable type=\"desktop-id\">${MCPI_APP_ID}.desktop</launchable>\n"
" <provides>\n"
" <id>${MCPI_APP_ID}.desktop</id>\n"
" </provides>\n"
" <project_license>LicenseRef-proprietary</project_license>\n"
" <developer_name>${MCPI_AUTHOR} &amp; Mojang AB</developer_name>\n"
" <content_rating type=\"oars-1.0\">\n"
" <content_attribute id=\"violence-cartoon\">moderate</content_attribute>\n"
" <content_attribute id=\"violence-fantasy\">none</content_attribute>\n"
" <content_attribute id=\"violence-realistic\">none</content_attribute>\n"
" <content_attribute id=\"violence-bloodshed\">none</content_attribute>\n"
" <content_attribute id=\"violence-sexual\">none</content_attribute>\n"
" <content_attribute id=\"drugs-alcohol\">none</content_attribute>\n"
" <content_attribute id=\"drugs-narcotics\">none</content_attribute>\n"
" <content_attribute id=\"drugs-tobacco\">none</content_attribute>\n"
" <content_attribute id=\"sex-nudity\">none</content_attribute>\n"
" <content_attribute id=\"sex-themes\">none</content_attribute>\n"
" <content_attribute id=\"language-profanity\">none</content_attribute>\n"
" <content_attribute id=\"language-humor\">none</content_attribute>\n"
" <content_attribute id=\"language-discrimination\">none</content_attribute>\n"
" <content_attribute id=\"social-chat\">intense</content_attribute>\n"
" <content_attribute id=\"social-info\">none</content_attribute>\n"
" <content_attribute id=\"social-audio\">none</content_attribute>\n"
" <content_attribute id=\"social-location\">none</content_attribute>\n"
" <content_attribute id=\"social-contacts\">none</content_attribute>\n"
" <content_attribute id=\"money-purchasing\">none</content_attribute>\n"
" <content_attribute id=\"money-gambling\">none</content_attribute>\n"
" </content_rating>\n"
" <releases>\n"
" <release version=\"${MCPI_VERSION}\" date=\"${MCPI_VERSION_DATE}\"></release>\n"
" </releases>\n"
" <screenshots>\n"
" <screenshot type=\"default\">\n"
" <image>${MCPI_REPO}/raw/branch/master/images/start.png</image>\n"
" </screenshot>\n"
" </screenshots>\n"
"</component>\n"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
DESTINATION "${MCPI_SHARE_DIR}/metainfo"
RENAME "${MCPI_APP_ID}.appdata.xml"
)
# Data
set(DATA_DIR "data")
set_and_mkdir(CONFIGURED_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/${DATA_DIR}")
function(configure_and_install_data input_name output_path output_name)
set(configured_path "${CONFIGURED_DATA_DIR}/${input_name}")
configure_file("${DATA_DIR}/${input_name}" "${configured_path}" ESCAPE_QUOTES)
install(
FILES "${configured_path}"
DESTINATION "${MCPI_SHARE_DIR}/${output_path}"
RENAME "${output_name}"
)
endfunction()
configure_and_install_data(launcher.desktop applications "${MCPI_APP_ID}.desktop")
configure_and_install_data(appstream.xml metainfo "${MCPI_APP_ID}.appdata.xml")
# AppImage
if(MCPI_IS_APPIMAGE_BUILD)

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>${MCPI_APP_ID}</id>
<name>${MCPI_APP_TITLE}</name>
<metadata_license>CC0-1.0</metadata_license>
<summary>Fun with Blocks</summary>
<description>
<p>Minecraft: Pi Edition Modding Project.</p>
<p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p>
</description>
<url type="homepage">${MCPI_REPO}</url>
<launchable type="desktop-id">${MCPI_APP_ID}.desktop</launchable>
<provides>
<id>${MCPI_APP_ID}.desktop</id>
</provides>
<project_license>LicenseRef-proprietary</project_license>
<developer_name>${MCPI_AUTHOR} &amp; Mojang AB</developer_name>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">moderate</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">none</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="language-profanity">none</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">none</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">none</content_attribute>
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
<releases>
<release version="${MCPI_VERSION}" date="${MCPI_VERSION_DATE}" />
</releases>
<screenshots>
<screenshot type="default">
<image>${MCPI_REPO}/raw/branch/master/images/start.png</image>
</screenshot>
</screenshots>
</component>

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=${MCPI_APP_TITLE}
Comment=Fun with Blocks
Icon=${MCPI_APP_ID}
Exec=${MCPI_APP_NAME}
Type=Application
Categories=Game;
Terminal=false
StartupNotify=false
StartupWMClass=${MCPI_APP_ID}

View File

@ -1,7 +1,7 @@
#!/usr/bin/env node
import * as path from 'node:path';
import * as fs from 'node:fs';
import { err, run, makeExecutable, getDebianVersion, getScriptsDir, info } from './lib/util.mjs';
import { err, run, makeExecutable, getDebianVersion, getScriptsDir, info, doesPackageExist } from './lib/util.mjs';
import { parseOptions, Enum, Architectures } from './lib/options.mjs';
// Check System
@ -125,11 +125,16 @@ handlers.set(Modes.Build, function () {
// Testing Dependencies
handlers.set(Modes.Test, function () {
let glib = 'libglib2.0-0';
const newerGlib = glib + 't64';
if (doesPackageExist(newerGlib)) {
glib = newerGlib;
}
addPackageForHost(
'libc6',
'libstdc++6',
'libopenal1',
'libglib2.0-0'
glib
);
});

View File

@ -25,6 +25,15 @@ export function run(command) {
err(e);
}
}
export function doesPackageExist(name) {
try {
info('Checking If Package Exists: ' + name);
child_process.execFileSync('apt-cache', ['show', name], {stdio: 'ignore'});
return true;
} catch (e) {
return false;
}
}
// Create Directory
export function createDir(dir, clean) {