Vendor Zenity For AppImages

This commit is contained in:
TheBrokenRail 2022-03-11 00:00:13 -05:00
parent 8792e5749d
commit 07baea7b5a
8 changed files with 50 additions and 10 deletions

4
.gitmodules vendored
View File

@ -10,3 +10,7 @@
path = dependencies/glfw/src
url = https://github.com/glfw/glfw.git
shallow = true
[submodule "dependencies/zenity/src"]
path = dependencies/zenity/src
url = https://gitea.thebrokenrail.com/TheBrokenRail/zenity.git
shallow = true

View File

@ -42,15 +42,10 @@ set(MCPI_INSTALL_DIR "lib/${MCPI_VARIANT_NAME}")
set(MCPI_LIB_DIR "${MCPI_INSTALL_DIR}/lib")
set(MCPI_FALLBACK_LIB_DIR "${MCPI_INSTALL_DIR}/fallback-lib")
# Optimizations
# Build Mode
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(-O3)
else()
add_compile_options(-g)
endif()
# Start Project
project(minecraft-pi-reborn)
@ -65,6 +60,13 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "" FORCE)
endif()
# Optimizations
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(-O3)
else()
add_compile_options(-g)
endif()
# Use LLD When Using Clang
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_link_options("-fuse-ld=lld")
@ -73,6 +75,9 @@ endif()
# PIC
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
# Fast Math
add_compile_options(-ffast-math)
# Buld Dependencies
add_subdirectory(dependencies)
@ -83,9 +88,6 @@ add_definitions(-D_GNU_SOURCE)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)
# Fast Math
add_compile_options(-ffast-math)
# Specify Constants
if(MCPI_SERVER_MODE)
add_definitions(-DMCPI_SERVER_MODE)

View File

@ -6,4 +6,6 @@ macro(setup_toolchain target)
set(CMAKE_FIND_ROOT_PATH "/usr/${target}" "/usr/lib/${target}")
# Extra
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# pkg-config
set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/${target}/pkgconfig:/usr/${target}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig")
endmacro()

View File

@ -16,3 +16,7 @@ endif()
if(BUILD_NATIVE_COMPONENTS AND NOT MCPI_HEADLESS_MODE)
add_subdirectory(glfw)
endif()
# Zenity (Minimal AppImage Build)
if(BUILD_NATIVE_COMPONENTS AND NOT MCPI_HEADLESS_MODE AND MCPI_IS_APPIMAGE_BUILD)
add_subdirectory(zenity)
endif()

15
dependencies/zenity/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,15 @@
project(zenity)
# Silence Warnings
add_compile_options(-w)
## Zenity
# Download
add_subdirectory(src EXCLUDE_FROM_ALL)
# Ensure Build
add_custom_target(zenity-build ALL DEPENDS zenity)
# Install
install(TARGETS zenity DESTINATION "bin")

1
dependencies/zenity/src vendored Submodule

@ -0,0 +1 @@
Subproject commit 6f08afb7989c420282654eee9dea9d5df01e914a

View File

@ -29,7 +29,9 @@ const packages = [
if (mode === 'client') {
// GLFW's Dependencies Aren't Included As They Should Be Provided By The Host System
packages.push(
'zenity',
'libgtk-3-0',
'libglib2.0-0',
'libgdk-pixbuf2.0-0',
'libcanberra-gtk3-module',
'libfreeimage3',
'libopenal1'

View File

@ -51,6 +51,11 @@ queue_pkg \
libxrandr-dev \
libxext-dev
# Zenity Dependencies
queue_pkg \
libgtk-3-dev \
libglib2.0-dev
# ARM Packages
if [ ! -z "${ARM_PACKAGES_SUPPORTED}" ]; then
# Build Tools
@ -72,6 +77,11 @@ if [ ! -z "${ARM_PACKAGES_SUPPORTED}" ]; then
libxinerama-dev:armhf libxinerama-dev:arm64 \
libxrandr-dev:armhf libxrandr-dev:arm64 \
libxext-dev:armhf libxext-dev:arm64
# Zenity Dependencies
queue_pkg \
libgtk-3-dev:armhf libgtk-3-dev:arm64 \
libglib2.0-dev:armhf libglib2.0-dev:arm64
fi
# Install appimagetool & appimage-builder Dependencies