Updata AppStream Metadata (Close #126)
This commit is contained in:
parent
73772958fd
commit
3f63087a33
@ -189,6 +189,7 @@ if(BUILD_NATIVE_COMPONENTS)
|
|||||||
# Configure
|
# Configure
|
||||||
CMAKE_CACHE_ARGS ${ARM_OPTIONS}
|
CMAKE_CACHE_ARGS ${ARM_OPTIONS}
|
||||||
CMAKE_GENERATOR "Ninja Multi-Config"
|
CMAKE_GENERATOR "Ninja Multi-Config"
|
||||||
|
CONFIGURE_HANDLED_BY_BUILD TRUE
|
||||||
# Build
|
# Build
|
||||||
BUILD_COMMAND
|
BUILD_COMMAND
|
||||||
"${CMAKE_COMMAND}" "--build" "<BINARY_DIR>" "--config" "$<CONFIG>"
|
"${CMAKE_COMMAND}" "--build" "<BINARY_DIR>" "--config" "$<CONFIG>"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="Start Screen" src="images/start.png">
|
<img alt="Start Screen" src="images/screenshots/start.png">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
@ -1,28 +1,9 @@
|
|||||||
# Utility Functions
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/../util/util.cmake")
|
|
||||||
|
|
||||||
# Download AppImage Runtime
|
|
||||||
set(RUNTIME_ARCH "unknown")
|
|
||||||
if(CPACK_MCPI_ARCH STREQUAL "armhf")
|
|
||||||
set(RUNTIME_ARCH "armhf")
|
|
||||||
elseif(CPACK_MCPI_ARCH STREQUAL "arm64")
|
|
||||||
set(RUNTIME_ARCH "aarch64")
|
|
||||||
elseif(CPACK_MCPI_ARCH STREQUAL "amd64")
|
|
||||||
set(RUNTIME_ARCH "x86_64")
|
|
||||||
endif()
|
|
||||||
set(RUNTIME "${CPACK_TOPLEVEL_DIRECTORY}/runtime")
|
|
||||||
safe_download(
|
|
||||||
"AppImage Runtime"
|
|
||||||
"https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-${RUNTIME_ARCH}"
|
|
||||||
"${RUNTIME}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Package
|
# Package
|
||||||
set(APPIMAGE_ARCH "unknown")
|
set(APPIMAGE_ARCH "unknown")
|
||||||
if(CPACK_MCPI_ARCH STREQUAL "armhf")
|
if(CPACK_MCPI_ARCH STREQUAL "armhf")
|
||||||
set(APPIMAGE_ARCH "arm")
|
set(APPIMAGE_ARCH "arm")
|
||||||
elseif(CPACK_MCPI_ARCH STREQUAL "arm64")
|
elseif(CPACK_MCPI_ARCH STREQUAL "arm64")
|
||||||
set(APPIMAGE_ARCH "arm_aarch64")
|
set(APPIMAGE_ARCH "aarch64")
|
||||||
elseif(CPACK_MCPI_ARCH STREQUAL "amd64")
|
elseif(CPACK_MCPI_ARCH STREQUAL "amd64")
|
||||||
set(APPIMAGE_ARCH "x86_64")
|
set(APPIMAGE_ARCH "x86_64")
|
||||||
endif()
|
endif()
|
||||||
@ -33,8 +14,6 @@ execute_process(
|
|||||||
"VERSION=${CPACK_MCPI_VERSION}"
|
"VERSION=${CPACK_MCPI_VERSION}"
|
||||||
"appimagetool"
|
"appimagetool"
|
||||||
"--updateinformation" "zsync|${CPACK_MCPI_REPO}/releases/download/latest/${CPACK_PACKAGE_FILE_NAME_ZSYNC}${CPACK_MCPI_APPIMAGE_ZSYNC_EXT}"
|
"--updateinformation" "zsync|${CPACK_MCPI_REPO}/releases/download/latest/${CPACK_PACKAGE_FILE_NAME_ZSYNC}${CPACK_MCPI_APPIMAGE_ZSYNC_EXT}"
|
||||||
"--runtime-file" "${RUNTIME}"
|
|
||||||
"--comp" "zstd"
|
|
||||||
"${CPACK_TEMPORARY_DIRECTORY}"
|
"${CPACK_TEMPORARY_DIRECTORY}"
|
||||||
"${CPACK_PACKAGE_FILE_NAME}${CPACK_MCPI_APPIMAGE_EXT}"
|
"${CPACK_PACKAGE_FILE_NAME}${CPACK_MCPI_APPIMAGE_EXT}"
|
||||||
WORKING_DIRECTORY "${CPACK_PACKAGE_DIRECTORY}"
|
WORKING_DIRECTORY "${CPACK_PACKAGE_DIRECTORY}"
|
||||||
|
@ -29,9 +29,13 @@ else()
|
|||||||
set(BUILD_MEDIA_LAYER_CORE "${BUILD_ARM_COMPONENTS}")
|
set(BUILD_MEDIA_LAYER_CORE "${BUILD_ARM_COMPONENTS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Author
|
||||||
|
mcpi_option(AUTHOR "Author" STRING "TheBrokenRail")
|
||||||
|
mcpi_option(AUTHOR_ID "Author ID" STRING "com.thebrokenrail")
|
||||||
|
|
||||||
# App Information
|
# App Information
|
||||||
mcpi_option(APP_NAME "App Name" STRING "minecraft-pi-reborn")
|
mcpi_option(APP_NAME "App Name" STRING "minecraft-pi-reborn")
|
||||||
mcpi_option(APP_ID "App ID" STRING "com.thebrokenrail.MCPIReborn")
|
mcpi_option(APP_ID "App ID" STRING "${MCPI_AUTHOR_ID}.MCPIReborn")
|
||||||
mcpi_option(APP_TITLE "App Title" STRING "Minecraft: Pi Edition: Reborn")
|
mcpi_option(APP_TITLE "App Title" STRING "Minecraft: Pi Edition: Reborn")
|
||||||
|
|
||||||
# Skin Server
|
# Skin Server
|
||||||
@ -49,9 +53,6 @@ set_property(
|
|||||||
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../../VERSION" MCPI_VERSION)
|
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../../VERSION" MCPI_VERSION)
|
||||||
file(TIMESTAMP "${CMAKE_CURRENT_LIST_DIR}/../../VERSION" MCPI_VERSION_DATE "%Y-%m-%d" UTC)
|
file(TIMESTAMP "${CMAKE_CURRENT_LIST_DIR}/../../VERSION" MCPI_VERSION_DATE "%Y-%m-%d" UTC)
|
||||||
|
|
||||||
# Author
|
|
||||||
mcpi_option(AUTHOR "Author" STRING "TheBrokenRail")
|
|
||||||
|
|
||||||
# Homepage
|
# Homepage
|
||||||
mcpi_option(REPO_HOST "Repository Host" STRING "https://gitea.thebrokenrail.com")
|
mcpi_option(REPO_HOST "Repository Host" STRING "https://gitea.thebrokenrail.com")
|
||||||
mcpi_option(REPO_PATH "Repository Path" STRING "minecraft-pi-reborn/minecraft-pi-reborn")
|
mcpi_option(REPO_PATH "Repository Path" STRING "minecraft-pi-reborn/minecraft-pi-reborn")
|
||||||
|
BIN
images/screenshots/launcher.png
Normal file
BIN
images/screenshots/launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
BIN
images/screenshots/start.png
Normal file
BIN
images/screenshots/start.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 143 KiB |
BIN
images/start.png
BIN
images/start.png
Binary file not shown.
Before Width: | Height: | Size: 133 KiB |
@ -1,48 +1,65 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<component type="desktop">
|
<component type="desktop-application">
|
||||||
<id>${MCPI_APP_ID}</id>
|
<id>${MCPI_APP_ID}</id>
|
||||||
|
|
||||||
<name>${MCPI_APP_TITLE}</name>
|
<name>${MCPI_APP_TITLE}</name>
|
||||||
<metadata_license>CC0-1.0</metadata_license>
|
|
||||||
<summary>Fun with Blocks</summary>
|
<summary>Fun with Blocks</summary>
|
||||||
<description>
|
<description>
|
||||||
<p>Minecraft: Pi Edition Modding Project.</p>
|
<p>Minecraft: Pi Edition Modding Project.</p>
|
||||||
<p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p>
|
<p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p>
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
|
<categories>
|
||||||
|
<category>Game</category>
|
||||||
|
<category>Simulation</category>
|
||||||
|
</categories>
|
||||||
|
<keywords>
|
||||||
|
<keyword>sandbox</keyword>
|
||||||
|
<keyword>world</keyword>
|
||||||
|
<keyword>mining</keyword>
|
||||||
|
<keyword>crafting</keyword>
|
||||||
|
<keyword>blocks</keyword>
|
||||||
|
<keyword>multiplayer</keyword>
|
||||||
|
</keywords>
|
||||||
|
|
||||||
|
<metadata_license>CC0-1.0</metadata_license>
|
||||||
|
<project_license>LicenseRef-proprietary</project_license>
|
||||||
|
|
||||||
|
<developer id="${MCPI_AUTHOR_ID}">
|
||||||
|
<name>${MCPI_AUTHOR} & Mojang AB</name>
|
||||||
|
</developer>
|
||||||
|
|
||||||
<url type="homepage">${MCPI_REPO}</url>
|
<url type="homepage">${MCPI_REPO}</url>
|
||||||
|
<url type="help">${MCPI_DISCORD_INVITE}</url>
|
||||||
|
|
||||||
|
<screenshots>
|
||||||
|
<screenshot type="default">
|
||||||
|
<image>${MCPI_REPO}/raw/branch/master/images/screenshots/start.png</image>
|
||||||
|
<caption>Start Screen</caption>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<image>${MCPI_REPO}/raw/branch/master/images/screenshots/launcher.png</image>
|
||||||
|
<caption>Launcher</caption>
|
||||||
|
</screenshot>
|
||||||
|
</screenshots>
|
||||||
|
|
||||||
<launchable type="desktop-id">${MCPI_APP_ID}.desktop</launchable>
|
<launchable type="desktop-id">${MCPI_APP_ID}.desktop</launchable>
|
||||||
<provides>
|
<provides>
|
||||||
<id>${MCPI_APP_ID}.desktop</id>
|
<binary>${MCPI_APP_NAME}</binary>
|
||||||
</provides>
|
</provides>
|
||||||
<project_license>LicenseRef-proprietary</project_license>
|
|
||||||
<developer_name>${MCPI_AUTHOR} & Mojang AB</developer_name>
|
<recommends>
|
||||||
<content_rating type="oars-1.0">
|
<control>pointing</control>
|
||||||
|
<control>keyboard</control>
|
||||||
|
<display_length compare="ge">360</display_length>
|
||||||
|
</recommends>
|
||||||
|
|
||||||
|
<content_rating type="oars-1.1">
|
||||||
<content_attribute id="violence-cartoon">moderate</content_attribute>
|
<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-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>
|
</content_rating>
|
||||||
|
|
||||||
<releases>
|
<releases>
|
||||||
<release version="${MCPI_VERSION}" date="${MCPI_VERSION_DATE}" />
|
<release version="${MCPI_VERSION}" date="${MCPI_VERSION_DATE}" />
|
||||||
</releases>
|
</releases>
|
||||||
<screenshots>
|
|
||||||
<screenshot type="default">
|
|
||||||
<image>${MCPI_REPO}/raw/branch/master/images/start.png</image>
|
|
||||||
</screenshot>
|
|
||||||
</screenshots>
|
|
||||||
</component>
|
</component>
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import * as fs from 'node:fs';
|
import * as fs from 'node:fs';
|
||||||
import { info, err, run, createDir, getScriptsDir, getBuildToolsBin, getParallelFlag } from './lib/util.mjs';
|
import * as os from 'node:os';
|
||||||
|
import { info, err, run, createDir, getScriptsDir, getBuildToolsBin } from './lib/util.mjs';
|
||||||
import { parseOptions, Enum, Architectures } from './lib/options.mjs';
|
import { parseOptions, Enum, Architectures } from './lib/options.mjs';
|
||||||
|
|
||||||
// CMake Options
|
// CMake Options
|
||||||
@ -100,9 +101,9 @@ if (!options.install) {
|
|||||||
|
|
||||||
// Use Build Tools
|
// Use Build Tools
|
||||||
const buildTools = getBuildToolsBin();
|
const buildTools = getBuildToolsBin();
|
||||||
const makeTool = 'make';
|
const jobserver = 'jobserver_pool.py';
|
||||||
const hasBuildTools = fs.existsSync(path.join(buildTools, makeTool));
|
const supportsJobserver = fs.existsSync(path.join(buildTools, jobserver));
|
||||||
if (hasBuildTools) {
|
if (supportsJobserver) {
|
||||||
function prependEnv(env, value) {
|
function prependEnv(env, value) {
|
||||||
const old = process.env[env];
|
const old = process.env[env];
|
||||||
if (old) {
|
if (old) {
|
||||||
@ -123,12 +124,11 @@ run(configure);
|
|||||||
|
|
||||||
// Build
|
// Build
|
||||||
const configArg = ['--config', options.debug ? 'Debug' : 'Release'];
|
const configArg = ['--config', options.debug ? 'Debug' : 'Release'];
|
||||||
if (hasBuildTools) {
|
const buildCommand = ['cmake', '--build', build, ...configArg];
|
||||||
fs.writeFileSync(path.join(build, 'Makefile'), `.PHONY: all\nall:\n\t+@cmake --build . ${configArg.join(' ')}\n`);
|
if (supportsJobserver) {
|
||||||
run([makeTool, '-C', build, getParallelFlag(), '--jobserver-style=fifo']);
|
buildCommand.unshift(jobserver, '--fifo', path.join(os.tmpdir(), '.jobserver-' + process.pid));
|
||||||
} else {
|
|
||||||
run(['cmake', '--build', build, getParallelFlag(), ...configArg]);
|
|
||||||
}
|
}
|
||||||
|
run(buildCommand);
|
||||||
|
|
||||||
// Package
|
// Package
|
||||||
if (options.packageType !== PackageTypes.AppImage) {
|
if (options.packageType !== PackageTypes.AppImage) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import * as fs from 'node:fs';
|
import * as fs from 'node:fs';
|
||||||
import { err, run, getDebianVersion, info, doesPackageExist, getBuildToolsDir, createDir, getBuildToolsBin, getParallelFlag } from './lib/util.mjs';
|
import { err, run, getDebianVersion, info, doesPackageExist, getBuildToolsDir, createDir } from './lib/util.mjs';
|
||||||
import { parseOptions, Enum, Architectures } from './lib/options.mjs';
|
import { parseOptions, Enum, Architectures } from './lib/options.mjs';
|
||||||
|
|
||||||
// Check System
|
// Check System
|
||||||
@ -75,9 +75,17 @@ handlers.set(Modes.Build, function () {
|
|||||||
addPackageForBuild(
|
addPackageForBuild(
|
||||||
'git',
|
'git',
|
||||||
'cmake' + backportsSuffix,
|
'cmake' + backportsSuffix,
|
||||||
// For Build Tools
|
// For Building Ninja
|
||||||
'make',
|
'ninja-build',
|
||||||
're2c'
|
're2c',
|
||||||
|
// For Building AppStream
|
||||||
|
'libyaml-dev',
|
||||||
|
'libxmlb-dev',
|
||||||
|
'liblzma-dev',
|
||||||
|
'libcurl4-openssl-dev',
|
||||||
|
'libglib2.0-dev',
|
||||||
|
'meson',
|
||||||
|
'gperf'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Compiler
|
// Compiler
|
||||||
@ -112,10 +120,7 @@ handlers.set(Modes.Build, function () {
|
|||||||
addPackageForHost('libglib2.0-dev');
|
addPackageForHost('libglib2.0-dev');
|
||||||
|
|
||||||
// AppImage Dependencies
|
// AppImage Dependencies
|
||||||
addPackageForBuild(
|
addPackageForBuild('zsync');
|
||||||
'appstream',
|
|
||||||
'zsync'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Install Packages
|
// Install Packages
|
||||||
installPackages();
|
installPackages();
|
||||||
@ -126,11 +131,10 @@ handlers.set(Modes.Build, function () {
|
|||||||
createDir(buildDir, false);
|
createDir(buildDir, false);
|
||||||
run([
|
run([
|
||||||
'cmake',
|
'cmake',
|
||||||
'-DCMAKE_BUILD_TYPE=Release',
|
'-GNinja',
|
||||||
'-DCMAKE_INSTALL_PREFIX=' + getBuildToolsBin(),
|
|
||||||
'-S', buildToolsDir, '-B', buildDir
|
'-S', buildToolsDir, '-B', buildDir
|
||||||
]);
|
]);
|
||||||
run(['cmake', '--build', buildDir, getParallelFlag()]);
|
run(['cmake', '--build', buildDir]);
|
||||||
run(['cmake', '--install', buildDir]);
|
run(['cmake', '--install', buildDir]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ import * as child_process from 'node:child_process';
|
|||||||
import * as fs from 'node:fs';
|
import * as fs from 'node:fs';
|
||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import * as url from 'node:url';
|
import * as url from 'node:url';
|
||||||
import * as os from 'node:os';
|
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
const EXIT_FAILURE = 1;
|
const EXIT_FAILURE = 1;
|
||||||
@ -72,9 +71,4 @@ export function getBuildToolsBin() {
|
|||||||
const dir = path.join(getBuildToolsDir(), 'bin');
|
const dir = path.join(getBuildToolsDir(), 'bin');
|
||||||
createDir(dir, false);
|
createDir(dir, false);
|
||||||
return dir;
|
return dir;
|
||||||
}
|
|
||||||
|
|
||||||
// Get '-jX' Flag For Build Tools
|
|
||||||
export function getParallelFlag() {
|
|
||||||
return '-j' + os.cpus().length;
|
|
||||||
}
|
}
|
@ -5,9 +5,38 @@ set -e
|
|||||||
# Setup
|
# Setup
|
||||||
export XDG_SESSION_TYPE=x11
|
export XDG_SESSION_TYPE=x11
|
||||||
unset MCPI_GUI_SCALE
|
unset MCPI_GUI_SCALE
|
||||||
export PATH="$(pwd)/out/host/usr/bin:${PATH}"
|
unset MCPI_USERNAME
|
||||||
|
export PATH="$(pwd)/out/none/host/usr/bin:${PATH}"
|
||||||
|
|
||||||
# Setup Feature Flags
|
# Game Directory
|
||||||
|
export MCPI_PROFILE_DIRECTORY="$(pwd)/.testing-tmp"
|
||||||
|
rm -rf "${MCPI_PROFILE_DIRECTORY}"
|
||||||
|
mkdir "${MCPI_PROFILE_DIRECTORY}"
|
||||||
|
|
||||||
|
# Take Screenshot
|
||||||
|
screenshot() {
|
||||||
|
# Arguments
|
||||||
|
IMAGE="images/screenshots/$1.png"
|
||||||
|
TIMER="$2"
|
||||||
|
shift 2
|
||||||
|
|
||||||
|
# Run
|
||||||
|
minecraft-pi-reborn "$@" &
|
||||||
|
PID="$!"
|
||||||
|
|
||||||
|
# Screenshot
|
||||||
|
sleep "${TIMER}"
|
||||||
|
gnome-screenshot --window "--file=${IMAGE}"
|
||||||
|
|
||||||
|
# Kill
|
||||||
|
kill "${PID}"
|
||||||
|
wait "${PID}" || :
|
||||||
|
}
|
||||||
|
|
||||||
|
# Launcher
|
||||||
|
screenshot launcher 0.5
|
||||||
|
|
||||||
|
# Start Screen
|
||||||
export MCPI_FEATURE_FLAGS="$(
|
export MCPI_FEATURE_FLAGS="$(
|
||||||
# Get All Feature Flags
|
# Get All Feature Flags
|
||||||
minecraft-pi-reborn --print-available-feature-flags |
|
minecraft-pi-reborn --print-available-feature-flags |
|
||||||
@ -19,15 +48,4 @@ export MCPI_FEATURE_FLAGS="$(
|
|||||||
# Format
|
# Format
|
||||||
tr '\n' '|'
|
tr '\n' '|'
|
||||||
)"
|
)"
|
||||||
|
screenshot start 3 --default
|
||||||
# Run
|
|
||||||
minecraft-pi-reborn --default --no-cache &
|
|
||||||
PID="$!"
|
|
||||||
|
|
||||||
# Screenshot
|
|
||||||
sleep 3
|
|
||||||
gnome-screenshot --window --file=images/start.png
|
|
||||||
|
|
||||||
# Kill
|
|
||||||
kill "${PID}"
|
|
||||||
wait "${PID}"
|
|
@ -19,7 +19,7 @@ fi
|
|||||||
# Make Test Directory
|
# Make Test Directory
|
||||||
TEST_WORKING_DIR="$(pwd)/.testing-tmp"
|
TEST_WORKING_DIR="$(pwd)/.testing-tmp"
|
||||||
rm -rf "${TEST_WORKING_DIR}"
|
rm -rf "${TEST_WORKING_DIR}"
|
||||||
mkdir -p "${TEST_WORKING_DIR}"
|
mkdir "${TEST_WORKING_DIR}"
|
||||||
ROOT="$(pwd)"
|
ROOT="$(pwd)"
|
||||||
cd "${TEST_WORKING_DIR}"
|
cd "${TEST_WORKING_DIR}"
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ if [ "${MODE}" = "server" ]; then
|
|||||||
./tmp.AppImage --appimage-extract-and-run --server --only-generate
|
./tmp.AppImage --appimage-extract-and-run --server --only-generate
|
||||||
else
|
else
|
||||||
# Client Test
|
# Client Test
|
||||||
export HOME="${TEST_WORKING_DIR}"
|
export MCPI_PROFILE_DIRECTORY="${TEST_WORKING_DIR}"
|
||||||
./tmp.AppImage --appimage-extract-and-run --default --no-cache --benchmark --force-headless
|
./tmp.AppImage --appimage-extract-and-run --default --no-cache --benchmark --force-headless
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,40 +1,32 @@
|
|||||||
cmake_minimum_required(VERSION 3.25.0)
|
cmake_minimum_required(VERSION 3.25.0)
|
||||||
project(tools)
|
|
||||||
|
|
||||||
# Utility Functions
|
# Utility Functions
|
||||||
include(../cmake/util/util.cmake)
|
include(../cmake/util/util.cmake)
|
||||||
|
|
||||||
|
# Force Build Type
|
||||||
|
force_set(CMAKE_BUILD_TYPE "Release" STRING)
|
||||||
|
|
||||||
|
# Project
|
||||||
|
project(tools)
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
force_set(BUILD_TESTING FALSE BOOL)
|
force_set(BUILD_TESTING FALSE BOOL)
|
||||||
force_set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/bin" FILEPATH)
|
force_set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/bin" FILEPATH)
|
||||||
force_set(CMAKE_INSTALL_BINDIR "." FILEPATH)
|
force_set(CMAKE_INSTALL_BINDIR "." FILEPATH)
|
||||||
|
|
||||||
|
# Versions
|
||||||
|
set(NINJA_VERSION "jobserver")
|
||||||
|
set(APPIMAGETOOL_VERSION "continuous")
|
||||||
|
set(APPSTREAM_VERSION "v1.0.4")
|
||||||
|
|
||||||
# Ninja
|
# Ninja
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(ninja
|
FetchContent_Declare(ninja
|
||||||
GIT_REPOSITORY "https://github.com/digit-google/ninja.git"
|
GIT_REPOSITORY "https://github.com/digit-google/ninja.git"
|
||||||
GIT_TAG jobserver
|
GIT_TAG "${NINJA_VERSION}"
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(ninja)
|
FetchContent_MakeAvailable(ninja)
|
||||||
|
install(PROGRAMS "${ninja_SOURCE_DIR}/misc/jobserver_pool.py" TYPE BIN)
|
||||||
# Make
|
|
||||||
include(ExternalProject)
|
|
||||||
ExternalProject_Add(make
|
|
||||||
URL "https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz"
|
|
||||||
URL_HASH "SHA256=dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3"
|
|
||||||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
|
||||||
CONFIGURE_COMMAND
|
|
||||||
"<SOURCE_DIR>/configure"
|
|
||||||
"--prefix=<INSTALL_DIR>"
|
|
||||||
"--without-guile"
|
|
||||||
"--enable-silent-rules"
|
|
||||||
"--quiet"
|
|
||||||
"CFLAGS=${CMAKE_C_FLAGS}"
|
|
||||||
BUILD_IN_SOURCE TRUE
|
|
||||||
INSTALL_COMMAND ""
|
|
||||||
)
|
|
||||||
ExternalProject_Get_Property(make SOURCE_DIR)
|
|
||||||
install(PROGRAMS "${SOURCE_DIR}/make" DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
||||||
|
|
||||||
# Download AppImageTool
|
# Download AppImageTool
|
||||||
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
@ -45,7 +37,7 @@ set(APPIMAGETOOL_NAME "appimagetool")
|
|||||||
set(APPIMAGETOOL_BIN "${CMAKE_CURRENT_BINARY_DIR}/${APPIMAGETOOL_NAME}.AppImage")
|
set(APPIMAGETOOL_BIN "${CMAKE_CURRENT_BINARY_DIR}/${APPIMAGETOOL_NAME}.AppImage")
|
||||||
safe_download(
|
safe_download(
|
||||||
"AppImageTool"
|
"AppImageTool"
|
||||||
"https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage"
|
"https://github.com/AppImage/appimagetool/releases/download/${APPIMAGETOOL_VERSION}/appimagetool-${ARCH}.AppImage"
|
||||||
"${APPIMAGETOOL_BIN}"
|
"${APPIMAGETOOL_BIN}"
|
||||||
)
|
)
|
||||||
# Fix
|
# Fix
|
||||||
@ -58,4 +50,35 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${APPIMAGETOOL_NAME}"
|
|||||||
"#!/bin/sh\n"
|
"#!/bin/sh\n"
|
||||||
"exec \"${APPIMAGETOOL_BIN}\" --appimage-extract-and-run \"\$@\"\n"
|
"exec \"${APPIMAGETOOL_BIN}\" --appimage-extract-and-run \"\$@\"\n"
|
||||||
)
|
)
|
||||||
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${APPIMAGETOOL_NAME}" DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${APPIMAGETOOL_NAME}" TYPE BIN)
|
||||||
|
|
||||||
|
# AppStream
|
||||||
|
include(ExternalProject)
|
||||||
|
ExternalProject_Add(appstream
|
||||||
|
GIT_REPOSITORY "https://github.com/ximion/appstream.git"
|
||||||
|
GIT_TAG "${APPSTREAM_VERSION}"
|
||||||
|
# Patch
|
||||||
|
PATCH_COMMAND sed -i "/i18n\\|po\\/\\|data\\/\\|docs\\/\\|tests\\//d" meson.build
|
||||||
|
# Configure
|
||||||
|
CONFIGURE_COMMAND
|
||||||
|
"meson" "setup"
|
||||||
|
"--reconfigure"
|
||||||
|
"--prefix=<INSTALL_DIR>"
|
||||||
|
"--buildtype=release"
|
||||||
|
"--default-library=static"
|
||||||
|
"-Dsystemd=false"
|
||||||
|
"-Dstemming=false"
|
||||||
|
"-Dgir=false"
|
||||||
|
"-Dzstd-support=false"
|
||||||
|
"<BINARY_DIR>" "<SOURCE_DIR>"
|
||||||
|
CONFIGURE_HANDLED_BY_BUILD TRUE
|
||||||
|
USES_TERMINAL_CONFIGURE TRUE
|
||||||
|
# Build
|
||||||
|
BUILD_COMMAND "meson" "compile"
|
||||||
|
USES_TERMINAL_BUILD TRUE
|
||||||
|
# Install
|
||||||
|
INSTALL_COMMAND "meson" "install" "--quiet"
|
||||||
|
USES_TERMINAL_INSTALL TRUE
|
||||||
|
)
|
||||||
|
ExternalProject_Get_Property(appstream INSTALL_DIR)
|
||||||
|
install(PROGRAMS "${INSTALL_DIR}/bin/appstreamcli" TYPE BIN)
|
Loading…
x
Reference in New Issue
Block a user