* Fix Duy's deploy and install stuffs * Fix Makefile error and move external_include to external/zink * Bug fix: version ordering when types are disabled This commit fixes #293 * Update README.md * Add option to disable symlink to /var/mobile/Documents/.pojavlauncher (off by default) * Reset preferences option, switch to POJAV_HOME * Update bug_report.yml Update pojavlauncher directory location * Mitigation for the Apache Log4j RCE in 1.8.x-1.18 * Experimental things * Multitouch handling, allows one of these actions below to work with moving camera at the same time. - Switching hotbar slot; might not work properly - Destroying block (left mouse button) with another finger long-pressed (without pressing the PRI button) - Right mouse trigger with another finger tapped onto the screen (without pressing the SEC button); not working properly yet * Sub-pixel cursor support; not yet checked * Completely fix Log4J RCE (1.7-1.16.5) (not yet tested) TODO: checker with SHA1 * Log4J RCE patch config: disable XML format output This applies for Minecraft 1.12+ Disable XML formatting for now until we have a log viewer. * Create newsfeed.html * Update newsfeed.html * Delete newsfeed.html * WIP Demo mode stuff Sign in with a Microsoft account that doesn't own the game, demo_user will be made. This is very much WIP as my iPhone 7 doesn't feel like launching PojavLauncher. * New toggle option: Restart before launching game This option allows the launcher to restart itself before launching the game, therefore all changes are applied such as JVM Arguments and Java version. The restart mechanism doesn't always work, so a toggle is here for now. * A few UI changes Disable the Play button until version list finished loading Disable ability to go back while a version is downloading Display loading alert while logging in * Possible fix for broken Mojang login * Fix a NullPointerException when launching ≤ 1.6.4 * Bug fix: NPE when setting inherited fields Unable to insert id=null java.lang.NoSuchFieldException: id at java.lang.Class.getDeclaredField(Class.java:2070) at net.kdt.pojavlaunch.Tools.insertSafety(Tools.java:544) at net.kdt.pojavlaunch.Tools.getVersionInfo(Tools.java:466) at net.kdt.pojavlaunch.PLaunchApp.launchMinecraft(PLaunchApp.java:61) at net.kdt.pojavlaunch.uikit.UIKit.callback_SurfaceViewController_launchMi necraft(UIKit.java:104) at net.kdt.pojavlaunch.uikit.UIKit.launchUI(Native Method) at net.kdt.pojavlaunch.PLaunchApp.main(PLaunchApp.java:40) * Keyboard + Mouse input handling; some cleanups * Keyboard input: KeyboardInput.m - Requires iOS 13.4. Used pressesBegan and pressesEnded. - Not all keys are handled, these will be handled later. * Mouse input - Requires iOS 13.0 for hovering. Used UIHoverGestureRecognizer. - Requires iOS 14.0 for L/R mouse buttons and scroll handling. Used GCMouse for now. We will use iOS 13.4(?)'s API later. - Pointer lock is not yet handled. These above apply to iPadOS aswell, not sure about tvOS. iPhone users need to disable "Perform Touch Gestures" in the AssistiveTouch Accessibility settings in order to get the pointer hovering to work. * Cleanups - Use asprintf instead of sprintf when possible - CallbackBridge functions: removed unnecessary JNI fields. - Condition cleanup (managing virtual mouse position). * Use the old jvm arguments parser back for now There’s no handling for backslash yet, or ignoring spaces inside delimiters. * Remove duplicated code * Support for input cursor movement from keyboard New class: TrackedTextField. This class keeps track of the pointer in the text field. The hidden text field now has 40 placeholder spaces and the pointer is placed at the middle. When typing, placeholder spaces won't get removed as before. Autocorrect seem to be broken a bit for now. Additional changes: - Added missing GLFW functions (array version of other functions) - Hotbar handling: doubled barWidth and barHeight Bug fix: - Touching onto the hotbar breaks the handling of on-screen tap/long-press gestures * Bug fix: inputStringLength is not set back to 40 This caused a bug that clears the text when pressing backspace after the keyboard is displayed again. * Consolidate some code * Fix undeclared identifier * Consolidate some more code, fix my dumb mistake * Added VGPU renderer Commit: https://github.com/PojavLauncherTeam/VGPU/commit/9f4ded5934b24c62368d70 1647855c9c9077d903 * Update LauncherPreferencesViewController.m This line was mistakenly removed * Various bug fixes - Input cursor movement seems too fast, attempt to reduce it by setting larger font size in the hidden text field. - latestlog.txt doesn't log in 1.12+ since Log4j patch. Fixed by adding some config lines. - Makefile: building is broken when run make from a path with space(s). Fixed by handling spaces with backslashes. - text2speech is not overridden properly. Fixed by excluding it from download list and adding launcher.jar itself to the classpath. - XML log output in < 1.12 since Log4j patch. Fixed by using our own configuration file. Some more changes: - Commented out a debug line in LWJGLX - Fix a typo. - JavaLauncher: use (ObjC)BOOL instead of (std)bool. * Better click handling * Finish make ipa Still requires proper codesigning afterwards, and until I figure out the depends folder you'll need to download a copy of the Azul JDK artifact on our android-openjdk-build-multiarch repository and extract it to depends/jre. Tested and working on my MacBook Pro, although I need to find out why libjsig.dylib is defined twice (this issue doesn't hinder the build though, install_name_tool just doesn't apply changes). * Added readable MSA errors * Merge unjailbroken changes with main (#313) * fix that lol * IPABuilder moment * typo moment * Hooking changes Now hook only dladdr and realpath, JRE works now. However, need to obtain libffi. * Sole more changes Add RPATH to libraries Hook dlopen since loading libawt_headless somehow point to Frameworks directory. * Update development.yml * Update development.yml Co-authored-by: Duy Tran Khanh <[email protected]> Co-authored-by: Duy Tran Khanh <[email protected]> * Fix issue with text alignment * Makefile: multi-jobs building native code * Bump to Xcode 13.2.1 * Bump to Xcode 13.2.1 pt 2 * use gnproc and nproc (for procursus on macos) on the road development is bumpy * oops * [Custom controls] Added color picker for iOS < 14 Might aswell add an option to optionally use this instead of the system color picker on iOS 14+. Used library: Alderis Other changes - [Custom controls] The editor is now fullscreen due to the presentation of the color picker. - Fixes scroll wheel input is always int * I’m too tired of getting dpkg exits, so it’s here * Fix broken share log * Bug fix: Fabric 1.17+ crash at startup(fixes #304) Microsoft account now set accountType to msa. Minor change in custom control view controller. * Add Arc capes * Minor bug fix for Arc capes switch * Change how the login progress is displayed Login progress now displays on the title bar instead of a dialog. This will prevent infinite loading in case a connection error occurs. Closes #315 * Bug fix: Arc DNS injector breaks on Java 16+ This is caused by a missing function in our class loader. Error: System class loader does not define the appendToClassPathForInstrumentation method Unable to add /Applications/PojavLauncher.app/libs/arc_dns_injector.jar to system class path - the system class loader does not define the appendToClassPathForInstrumentation method or the method failed FATAL ERROR in native method: processing of -javaagent failed, appending to system class path failed * Why did I add set -e * Add changelog for 2.1 release * FAQ changes * Workflow changes and typo fix * Workflow changes part 2 * Fixes swipeable button state handling * Update informational.yml * Add A7 warning * Remove codesign from Alderis + thin lib * Only load Alderis.framework when needed * CC editor: view controller now follow bounds(#326) * Update README.md (#324) * Update LauncherPreferencesViewController.m Co-authored-by: Duy Tran Khanh <[email protected]> Co-authored-by: Duy Tran Khanh <[email protected]> Co-authored-by: Silly Sock <[email protected]>
425 lines
18 KiB
Makefile
425 lines
18 KiB
Makefile
SHELL := /bin/bash
|
|
.SHELLFLAGS = -ec
|
|
|
|
# Prerequisite variables
|
|
SOURCEDIR := $(shell printf "%q\n" "$(shell pwd)")
|
|
OUTPUTDIR := $(SOURCEDIR)/artifacts
|
|
WORKINGDIR := $(SOURCEDIR)/Natives/build
|
|
DETECTPLAT := $(shell uname -s)
|
|
DETECTARCH := $(shell uname -m)
|
|
VERSION := $(shell cat $(SOURCEDIR)/DEBIAN/control.development | grep Version | cut -b 10-60)
|
|
COMMIT := $(shell git log --oneline | sed '2,10000000d' | cut -b 1-7)
|
|
IOS15PREF := private/preboot/procursus
|
|
|
|
# Release vs Debug
|
|
RELEASE ?= 0
|
|
|
|
ifeq (1,$(RELEASE))
|
|
CMAKE_BUILD_TYPE := Release
|
|
else
|
|
CMAKE_BUILD_TYPE := Debug
|
|
endif
|
|
|
|
|
|
# Distinguish iOS from macOS, and *OS from others
|
|
ifeq ($(DETECTPLAT),Darwin)
|
|
ifeq ($(shell sw_vers -productName),macOS)
|
|
IOS := 0
|
|
SDKPATH ?= $(shell xcrun --sdk iphoneos --show-sdk-path)
|
|
BOOTJDK ?= /usr/bin
|
|
ifneq (,$(findstring arm,DETECTARCH))
|
|
SYSARCH := arm
|
|
$(warning Building on an Apple-Silicon Mac.)
|
|
else ifneq (,$(findstring 86,$(DETECTARCH)))
|
|
SYSARCH := x86_64
|
|
$(warning Building on an Intel or AMD-based Mac.)
|
|
endif
|
|
ifdef DEVICE_IP
|
|
DEVICE_PORT ?= 22
|
|
endif
|
|
else
|
|
IOS := 1
|
|
SDKPATH ?= /usr/share/SDKs/iPhoneOS.sdk
|
|
BOOTJDK ?= /usr/lib/jvm/java-8-openjdk/bin
|
|
SYSARCH := arm
|
|
DEVICE_IP ?= 127.0.0.1
|
|
DEVICE_PORT ?= 22
|
|
$(warning Building on a jailbroken iOS device.)
|
|
endif
|
|
else
|
|
$(error This platform is not currently supported for building PojavLauncher.)
|
|
endif
|
|
|
|
# IPABuilder depending variables
|
|
ifeq ($(IOS),1)
|
|
POJAV_BUNDLE_DIR ?= /Applications/PojavLauncher.app
|
|
POJAV_JRE_DIR ?= /usr/lib/jvm/java-8-openjdk
|
|
else
|
|
POJAV_BUNDLE_DIR ?= $(OUTPUTDIR)/PojavLauncher.app
|
|
POJAV_JRE_DIR ?= $(SOURCEDIR)/depends/jre
|
|
endif
|
|
POJAV_BUNDLE_DYLIBS ?= $(shell cd "$(POJAV_BUNDLE_DIR)/Frameworks" && echo *.dylib)
|
|
POJAV_JRE_DYLIBS ?= $(shell cd "$(POJAV_JRE_DIR)" && find . -name "*.dylib")
|
|
|
|
# Function to use later for checking dependencies
|
|
DEPCHECK = $(shell type $(1) >/dev/null 2>&1 && echo 1)
|
|
|
|
# Function to modify Info.plist files
|
|
INFOPLIST = \
|
|
if [ '$(4)' = '0' ]; then \
|
|
plutil -replace $(1) -string $(2) $(3); \
|
|
else \
|
|
plutil -value $(2) -key $(1) $(3); \
|
|
fi
|
|
|
|
# Function to use for packaging
|
|
PACKAGING = \
|
|
mkdir -p $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
|
|
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
|
|
mkdir -p {DEBIAN,Applications,usr/share/pojavlauncher/{instances/default,Library/{Application\ Support,Caches}}}; \
|
|
cd usr/share/pojavlauncher; \
|
|
ln -sf ../../instances/default Library/Application\ Support/minecraft; \
|
|
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
|
|
if [ '$(NOSTDIN)' = '1' ]; then \
|
|
echo '$(SUDOPASS)' | sudo -S chown -R 501:501 usr/share/pojavlauncher; \
|
|
else \
|
|
sudo chown -R 501:501 usr/share/pojavlauncher; \
|
|
fi; \
|
|
cp -r $(OUTPUTDIR)/PojavLauncher.app Applications/PojavLauncher.app; \
|
|
cp $(SOURCEDIR)/DEBIAN/control.$(1) DEBIAN/control; \
|
|
cp $(SOURCEDIR)/DEBIAN/postinst DEBIAN/postinst; \
|
|
ldid -S$(SOURCEDIR)/entitlements.xml Applications/PojavLauncher.app; \
|
|
cd $(OUTPUTDIR); \
|
|
fakeroot dpkg-deb -b $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
|
|
mkdir -p $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64; \
|
|
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64; \
|
|
mkdir -p {DEBIAN,$(IOS15PREF)/{Applications,usr/share/pojavlauncher/{instances/default,Library/{Application\ Support,Caches}}}}; \
|
|
cd $(IOS15PREF)/usr/share/pojavlauncher; \
|
|
ln -sf ../../instances/default Library/Application\ Support/minecraft; \
|
|
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64; \
|
|
if [ '$(NOSTDIN)' = '1' ]; then \
|
|
echo '$(SUDOPASS)' | sudo -S chown -R 501:501 $(IOS15PREF)/usr/share/pojavlauncher; \
|
|
else \
|
|
sudo chown -R 501:501 $(IOS15PREF)/usr/share/pojavlauncher; \
|
|
fi; \
|
|
cp -r $(OUTPUTDIR)/PojavLauncher.app $(IOS15PREF)/Applications/PojavLauncher.app; \
|
|
cp -r $(SOURCEDIR)/DEBIAN/control.$(1)-rootless DEBIAN/control; \
|
|
cp $(SOURCEDIR)/DEBIAN/postinst DEBIAN/postinst; \
|
|
ldid -S$(SOURCEDIR)/entitlements.xml $(IOS15PREF)/Applications/PojavLauncher.app; \
|
|
cd $(OUTPUTDIR); \
|
|
fakeroot dpkg-deb -b $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64
|
|
|
|
# Function to check directories
|
|
DIRCHECK = \
|
|
if [ ! -d '$(1)' ]; then \
|
|
mkdir $(1); \
|
|
else \
|
|
sudo rm -rf $(1)/*; \
|
|
fi
|
|
|
|
# Function to copy + install
|
|
INSTALL = \
|
|
echo 'Please note that this may not work properly. If it doesn'\''t work for you, you can manually extract the .deb in /var/tmp/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb with dpkg or Filza.'; \
|
|
if [ '$(4)' = '0' ]; then \
|
|
scp -P $(DEVICE_PORT) $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb root@$(DEVICE_IP):/var/tmp/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb; \
|
|
ssh root@$(DEVICE_IP) -p $(DEVICE_PORT) -t "dpkg -i /var/tmp/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb; uicache -p $(3)/Applications/PojavLauncher.app"; \
|
|
else \
|
|
sudo dpkg -i $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb; uicache -p $(3)/Applications/PojavLauncher.app; \
|
|
fi
|
|
|
|
# Function to copy + deploy
|
|
DEPLOY = \
|
|
ldid -S$(SOURCEDIR)/entitlements.xml $(WORKINGDIR)/PojavLauncher.app/PojavLauncher; \
|
|
if [ '$(2)' = '0' ]; then \
|
|
scp -r -P $(DEVICE_PORT) -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" \
|
|
$(WORKINGDIR)/libOSMesaOverride.dylib.framework \
|
|
$(WORKINGDIR)/libawt_xawt.dylib \
|
|
$(WORKINGDIR)/PojavLauncher.app/PojavLauncher \
|
|
$(SOURCEDIR)/JavaApp/local_out/launcher.jar \
|
|
root@$(DEVICE_IP):/var/tmp/; \
|
|
ssh root@$(DEVICE_IP) -p $(DEVICE_PORT) -t " \
|
|
mv /var/tmp/libawt_xawt.dylib $(1)/Applications/PojavLauncher.app/Frameworks/libawt_xawt.dylib && \
|
|
mv /var/tmp/libOSMesaOverride.dylib.framework $(1)/Applications/PojavLauncher.app/Frameworks/libOSMesaOverride.dylib.framework && \
|
|
mv /var/tmp/PojavLauncher $(1)/Applications/PojavLauncher.app/PojavLauncher && \
|
|
mv /var/tmp/launcher.jar $(1)/Applications/PojavLauncher.app/libs/launcher.jar && \
|
|
cd $(1)/Applications/PojavLauncher.app/Frameworks && \
|
|
ln -sf libawt_xawt.dylib libawt_headless.dylib && \
|
|
chown -R 501:501 $(1)/Applications/PojavLauncher.app/*"; \
|
|
else \
|
|
sudo mv $(WORKINGDIR)/libawt_xawt.dylib $(1)/Applications/PojavLauncher.app/Frameworks/libawt_xawt.dylib; \
|
|
sudo mv $(WORKINGDIR)/libOSMesaOverride.dylib.framework $(1)/Applications/PojavLauncher.app/Frameworks/libOSMesaOverride.dylib.framework; \
|
|
sudo mv $(WORKINGDIR)/PojavLauncher $(1)/Applications/PojavLauncher.app/PojavLauncher; \
|
|
sudo mv $(WORKINGDIR)/launcher.jar $(1)/Applications/PojavLauncher.app/libs/launcher.jar; \
|
|
cd $(1)/Applications/PojavLauncher.app/Frameworks; \
|
|
sudo ln -sf libawt_xawt.dylib libawt_headless.dylib; \
|
|
sudo chown -R 501:501 $(1)/Applications/PojavLauncher.app/*; \
|
|
fi
|
|
|
|
# Make sure everything is already available for use. Error if they require something
|
|
ifeq ($(call HAS_COMMAND,cmake --version),1)
|
|
$(error You need to install cmake)
|
|
endif
|
|
|
|
ifeq ($(call HAS_COMMAND,$(BOOTJDK)/javac -version),1)
|
|
$(error You need to install JDK 8)
|
|
endif
|
|
|
|
ifeq ($(IOS),0)
|
|
ifeq ($(filter 1.8.0,$(shell $(BOOTJDK)/javac -version &> javaver.txt && cat javaver.txt | cut -b 7-11 && rm -rf javaver.txt)),)
|
|
$(error You need to install JDK 8)
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(call HAS_COMMAND,ldid),1)
|
|
$(error You need to install ldid)
|
|
endif
|
|
|
|
ifeq ($(call HAS_COMMAND,fakeroot -v),1)
|
|
$(error You need to install fakeroot)
|
|
endif
|
|
|
|
ifeq ($(call HAS_COMMAND,dpkg-deb --version),1)
|
|
$(error You need to install dpkg-dev)
|
|
endif
|
|
|
|
ifeq ($(call HAS_COMMAND,nproc --version),1)
|
|
ifeq ($(call HAS_COMMAND,gnproc --version),1)
|
|
$(warning Unable to determine number of threads, defaulting to 2.)
|
|
JOBS ?= 2
|
|
else
|
|
JOBS ?= $(shell gnproc)
|
|
endif
|
|
else
|
|
JOBS ?= $(shell nproc)
|
|
endif
|
|
|
|
# Now for the actual Makefile recipes.
|
|
# all - runs clean, native, java, extras, and package.
|
|
# check - Makes sure that all variables are correct.
|
|
# native - Builds the Objective-C code.
|
|
# java - Builds the Java code.
|
|
# extras - Builds the Assets and Storyboard.
|
|
# deb - Builds the Debian package.
|
|
# ipa - Builds the application package.
|
|
# install - runs deb + installs to jailbroken device.
|
|
# deploy - runs native and java + installs to jailbroken device.
|
|
|
|
all: clean native java extras deb
|
|
|
|
check:
|
|
@printf '\nDumping all Makefile variables.\n'
|
|
@printf 'DETECTPLAT - $(DETECTPLAT)\n'
|
|
@printf 'DETECTARCH - $(DETECTARCH)\n'
|
|
@printf 'SDKPATH - $(SDKPATH)\n'
|
|
@printf 'BOOTJDK - $(BOOTJDK)\n'
|
|
@printf 'SOURCEDIR - $(SOURCEDIR)\n'
|
|
@printf 'WORKINGDIR - $(WORKINGDIR)\n'
|
|
@printf 'OUTPUTDIR - $(OUTPUTDIR)\n'
|
|
@printf 'JOBS - $(JOBS)\n'
|
|
@printf 'VERSION - $(VERSION)\n'
|
|
@printf 'COMMIT - $(COMMIT)\n'
|
|
@printf 'RELEASE - $(RELEASE)\n'
|
|
@printf 'IOS15PREF - $(IOS15PREF)\n'
|
|
@printf 'IOS - $(IOS)\n'
|
|
@printf 'SYSARCH - $(SYSARCH)\n'
|
|
@printf 'POJAV_BUNDLE_DIR - $(POJAV_BUNDLE_DIR)\n'
|
|
@printf 'POJAV_JRE_DIR - $(POJAV_JRE_DIR)\n'
|
|
@printf 'DEVICE_IP - $(DEVICE_IP)\n'
|
|
@printf 'DEVICE_PORT - $(DEVICE_PORT)\n'
|
|
@printf '\nVerify that all of the variables are correct.\n'
|
|
|
|
native:
|
|
@echo 'Building PojavLauncher $(VERSION) - NATIVES - Start'
|
|
@mkdir -p $(WORKINGDIR)
|
|
@cd $(WORKINGDIR) && cmake . \
|
|
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|
|
-DCMAKE_CROSSCOMPILING=true \
|
|
-DCMAKE_SYSTEM_NAME=Darwin \
|
|
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
|
|
-DCMAKE_OSX_SYSROOT="$(SDKPATH)" \
|
|
-DCMAKE_OSX_ARCHITECTURES=arm64 \
|
|
-DCMAKE_C_FLAGS="-arch arm64 -miphoneos-version-min=12.0" \
|
|
-DCONFIG_COMMIT="$(COMMIT)" \
|
|
-DCONFIG_RELEASE=$(RELEASE) \
|
|
..
|
|
|
|
@cmake --build $(WORKINGDIR) --config $(CMAKE_BUILD_TYPE) -j$(JOBS)
|
|
# --target awt_headless awt_xawt libOSMesaOverride.dylib PojavLauncher
|
|
@rm $(WORKINGDIR)/libawt_headless.dylib
|
|
@echo 'Building PojavLauncher $(VERSION) - NATIVES - End'
|
|
|
|
java:
|
|
@echo 'Building PojavLauncher $(VERSION) - JAVA - Start'
|
|
@cd $(SOURCEDIR)/JavaApp; \
|
|
mkdir -p local_out/classes; \
|
|
$(BOOTJDK)/javac -cp "libs/*:libs_caciocavallo/*" -d local_out/classes $$(find src -type f -name "*.java" -print) -XDignore.symbol.file || exit 1; \
|
|
cd local_out/classes; \
|
|
$(BOOTJDK)/jar -cf ../launcher.jar * || exit 1
|
|
@echo 'Building PojavLauncher $(VERSION) - JAVA - End'
|
|
|
|
extras:
|
|
@echo 'Building PojavLauncher $(VERSION) - EXTRA - Start'
|
|
@if [ '$(IOS)' = '0' ]; then \
|
|
mkdir -p $(WORKINGDIR)/PojavLauncher.app/Base.lproj; \
|
|
xcrun actool $(SOURCEDIR)/Natives/Assets.xcassets --compile $(SOURCEDIR)/Natives/resources --platform iphoneos --minimum-deployment-target 12.0 --app-icon AppIcon --output-partial-info-plist /dev/null || exit 1; \
|
|
ibtool --compile $(WORKINGDIR)/PojavLauncher.app/Base.lproj/LaunchScreen.storyboardc $(SOURCEDIR)/Natives/en.lproj/LaunchScreen.storyboard || exit 1; \
|
|
elif [ '$(IOS)' = '1' ]; then \
|
|
echo 'Due to the required tools not being available, you cannot compile the extras for PojavLauncher with an iOS device.'; \
|
|
fi
|
|
@echo 'Building PojavLauncher $(VERSION) - EXTRAS - End'
|
|
|
|
deb: native java extras
|
|
@echo 'Building PojavLauncher $(VERSION) - DEB - Start'
|
|
@if [ '$(IOS)' = '1' ]; then \
|
|
mkdir -p $(WORKINGDIR)/PojavLauncher.app/{Frameworks,Base.lproj}; \
|
|
cp -R $(SOURCEDIR)/Natives/en.lproj/*.storyboardc $(WORKINGDIR)/PojavLauncher.app/Base.lproj/ || exit 1; \
|
|
cp -R $(SOURCEDIR)/Natives/Info.plist $(WORKINGDIR)/PojavLauncher.app/Info.plist || exit 1;\
|
|
cp -R $(SOURCEDIR)/Natives/PkgInfo $(WORKINGDIR)/PojavLauncher.app/PkgInfo || exit 1; \
|
|
fi
|
|
$(call DIRCHECK,$(WORKINGDIR)/PojavLauncher.app/libs)
|
|
$(call DIRCHECK,$(WORKINGDIR)/PojavLauncher.app/libs_caciocavallo)
|
|
@cp -R $(SOURCEDIR)/Natives/resources/* $(WORKINGDIR)/PojavLauncher.app/ || exit 1
|
|
@cp $(WORKINGDIR)/libawt_xawt.dylib $(WORKINGDIR)/PojavLauncher.app/Frameworks/ || exit 1
|
|
@( cd $(WORKINGDIR)/PojavLauncher.app/Frameworks; ln -sf libawt_xawt.dylib libawt_headless.dylib ) || exit 1
|
|
@cp -R $(WORKINGDIR)/libOSMesaOverride.dylib.framework $(WORKINGDIR)/PojavLauncher.app/Frameworks/ || exit 1
|
|
@cp $(SOURCEDIR)/JavaApp/local_out/launcher.jar $(WORKINGDIR)/PojavLauncher.app/libs/launcher.jar || exit 1
|
|
@cp -R $(SOURCEDIR)/JavaApp/libs/* $(WORKINGDIR)/PojavLauncher.app/libs/ || exit 1
|
|
@cp -R $(SOURCEDIR)/JavaApp/libs_caciocavallo/* $(WORKINGDIR)/PojavLauncher.app/libs_caciocavallo/ || exit 1
|
|
$(call DIRCHECK,$(OUTPUTDIR))
|
|
@cp -R $(WORKINGDIR)/PojavLauncher.app $(OUTPUTDIR)
|
|
@if [ '$(RELEASE)' = '1' ]; then \
|
|
$(call PACKAGING,release); \
|
|
else \
|
|
$(call PACKAGING,development); \
|
|
fi
|
|
@echo 'Building PojavLauncher $(VERSION) - DEB - Start'
|
|
|
|
|
|
ipa: native java extras
|
|
echo 'Building PojavLauncher $(VERSION) - IPA - Start'
|
|
cd $(OUTPUTDIR); \
|
|
$(call DIRCHECK,$(OUTPUTDIR)/Payload); \
|
|
cp -R $(POJAV_BUNDLE_DIR) $(OUTPUTDIR)/Payload; \
|
|
rm -rf $(OUTPUTDIR)/Payload/PojavLauncher.app/Frameworks/*.dylib; \
|
|
rm -rf $(OUTPUTDIR)/Payload/PojavLauncher.app/jre; \
|
|
cp -R $(POJAV_JRE_DIR) $(OUTPUTDIR)/Payload/PojavLauncher.app/jre; \
|
|
rm $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/jre $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/lib/src.zip $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/lib/tools.jar; \
|
|
cd $(OUTPUTDIR)/Payload/PojavLauncher.app/jre; \
|
|
rm -f lib/libjsig.dylib; \
|
|
cd $(OUTPUTDIR); \
|
|
$(call DIRCHECK,$(OUTPUTDIR)/IPABuilder); \
|
|
mkdir -p $(OUTPUTDIR)/IPABuilder/{OpenJDK/{Frameworks,jre/lib/jli,jre/lib/server},PojavCore/Frameworks}; \
|
|
cd $(OUTPUTDIR)/IPABuilder/OpenJDK/Frameworks; \
|
|
touch $(OUTPUTDIR)/IPABuilder/int.txt; \
|
|
for dylib in $(POJAV_JRE_DYLIBS); do \
|
|
dylib_name=$$(basename $$dylib); \
|
|
mkdir -p $$dylib_name.framework; \
|
|
cd $$dylib_name.framework; \
|
|
cp $(SOURCEDIR)/depends/Info.plist Info.plist; \
|
|
plist=$$(pwd)/Info.plist; \
|
|
$(call INFOPLIST,CFBundleExecutable,$$dylib_name,$$plist,$(IOS)); \
|
|
$(call INFOPLIST,CFBundleName,$$dylib_name,$$plist,$(IOS)); \
|
|
$(call INFOPLIST,CFBundleIdentifier,"net.kdt.pojavlauncher.$$dylib_name",$$plist,$(IOS)); \
|
|
mv $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/$$dylib $$dylib_name; \
|
|
RPATH_LIST+="-add_rpath @loader_path/../$$dylib_name.framework "; \
|
|
echo "-add_rpath @loader_path/../$$dylib_name.framework " >> $(OUTPUTDIR)/IPABuilder/int.txt; \
|
|
cd ..; \
|
|
echo "- (JRE) Finished $$dylib_name"; \
|
|
done; \
|
|
for dylib in $(POJAV_JRE_DYLIBS); do \
|
|
dylib_name=$$(basename $$dylib); \
|
|
install_name_tool $$(cat $(OUTPUTDIR)/IPABuilder/int.txt | sort | uniq) $$dylib_name.framework/$$dylib_name; \
|
|
done; \
|
|
mv $(OUTPUTDIR)/IPABuilder/OpenJDK/Frameworks/* $(OUTPUTDIR)/Payload/PojavLauncher.app/Frameworks; \
|
|
cd $(OUTPUTDIR)/IPABuilder/PojavCore/Frameworks; \
|
|
for dylib in $(POJAV_BUNDLE_DYLIBS); do \
|
|
dylib_name=$$(basename $$dylib); \
|
|
mkdir -p $$dylib_name.framework; \
|
|
cd $$dylib_name.framework; \
|
|
plist=$$(pwd)/Info.plist; \
|
|
cp $(SOURCEDIR)/depends/Info.plist Info.plist; \
|
|
$(call INFOPLIST,CFBundleExecutable,$$dylib_name,$$plist,$(IOS)); \
|
|
$(call INFOPLIST,CFBundleName,$$dylib_name,$$plist,$(IOS)); \
|
|
$(call INFOPLIST,CFBundleIdentifier,"net.kdt.pojavlauncher.$$dylib_name",$$plist,$(IOS)); \
|
|
cp $(POJAV_BUNDLE_DIR)/Frameworks/$$dylib_name $$dylib_name; \
|
|
cd ..; \
|
|
echo "- (PojavCore) Finished $$dylib_name"; \
|
|
done; \
|
|
rm -r $(OUTPUTDIR)/IPABuilder/PojavCore/Frameworks/libawt_headless.dylib.framework; \
|
|
mv $(OUTPUTDIR)/IPABuilder/PojavCore/Frameworks/* $(OUTPUTDIR)/Payload/PojavLauncher.app/Frameworks; \
|
|
ldid -S$(SOURCEDIR)/entitlements.xml $(OUTPUTDIR)/Payload/PojavLauncher.app; \
|
|
rm -f $(OUTPUTDIR)/*.ipa; \
|
|
zip --symlinks -r $(OUTPUTDIR)/net.kdt.pojavlauncher-$(VERSION).ipa $(OUTPUTDIR)/Payload/*
|
|
@echo 'Building PojavLauncher $(VERSION) - IPA - End'
|
|
|
|
install: deb
|
|
@echo 'Building PojavLauncher $(VERSION) - INSTALL - Start'
|
|
@if [ '$(DEVICE_IP)' != '' ]; then \
|
|
if [ '$(RELEASE)' = '1' ]; then \
|
|
if [ '$(ROOTLESS)' = '1' ]; then \
|
|
$(call INSTALL,release-rootless,iphoneos-arm64,$(IOS15PREF)); \
|
|
else \
|
|
$(call INSTALL,release,iphoneos-arm); \
|
|
fi; \
|
|
else \
|
|
if [ '$(ROOTLESS)' = '1' ]; then \
|
|
$(call INSTALL,development-rootless,iphoneos-arm64,$(IOS15PREF)); \
|
|
else \
|
|
$(call INSTALL,development,iphoneos-arm); \
|
|
fi; \
|
|
fi; \
|
|
else \
|
|
echo 'You need to run '\''export DEVICE_IP=<your iOS device IP>'\'' to use make install.'; \
|
|
echo 'If you specified a different port for your device to listen for SSH connections, you need to run '\''export DEVICE_PORT=<your port>'\'' as well.'; \
|
|
fi
|
|
@echo 'Building PojavLauncher $(VERSION) - INSTALL - End'
|
|
|
|
deploy: deb
|
|
@echo 'Building PojavLauncher $(VERSION) - DEPLOY - Start'
|
|
@if [ '$(DEVICE_IP)' != '' ]; then \
|
|
if [ '$(ROOTLESS)' = '1' ]; then \
|
|
$(call DEPLOY,$(IOS15PREF),$(IOS)); \
|
|
else \
|
|
$(call DEPLOY,'/',$(IOS)); \
|
|
fi; \
|
|
else \
|
|
echo 'You need to run '\''export DEVICE_IP=<your iOS device IP>'\'' to use make deploy.'; \
|
|
echo 'If you specified a different port for your device to listen for SSH connections, you need to run '\''export DEVICE_PORT=<your port>'\'' as well.'; \
|
|
fi;
|
|
@echo 'Building PojavLauncher $(VERSION) - DEPLOY - End'
|
|
|
|
dsym: deb
|
|
@echo 'Building PojavLauncher $(VERSION) - DSYM - Start'
|
|
@cd $(OUTPUTDIR) && dsymutil --arch arm64 $(OUTPUTDIR)/PojavLauncher.app/PojavLauncher
|
|
@cp -r $(OUTPUTDIR)/PojavLauncher.app/PojavLauncher.dSYM $(OUTPUTDIR)/PojavLauncher.dSYM
|
|
@echo 'Building PojavLauncher $(VERSION) - DSYM - Start'
|
|
|
|
clean:
|
|
@echo 'Building PojavLauncher $(VERSION) - CLEAN - Start'
|
|
@if [ '$(NOSTDIN)' = '1' ]; then \
|
|
echo '$(SUDOPASS)' | sudo -S rm -rf $(WORKINGDIR); \
|
|
echo '$(SUDOPASS)' | sudo -S rm -rf JavaApp/build; \
|
|
echo '$(SUDOPASS)' | sudo -S rm -rf $(OUTPUTDIR); \
|
|
else \
|
|
sudo rm -rf $(WORKINGDIR); \
|
|
sudo rm -rf JavaApp/build; \
|
|
sudo rm -rf $(OUTPUTDIR); \
|
|
fi
|
|
@echo 'Building PojavLauncher $(VERSION) - CLEAN - End'
|
|
|
|
help:
|
|
@echo 'Makefile to compile PojavLauncher'
|
|
@echo ''
|
|
@echo 'Usage:'
|
|
@echo ' make Makes everything under all'
|
|
@echo ' make all Builds natives, javaapp, extras, and package'
|
|
@echo ' make native Builds the native app'
|
|
@echo ' make java Builds the Java app'
|
|
@echo ' make deb Builds deb of PojavLauncher'
|
|
# @echo ' make ipa Builds ipa of PojavLauncher'
|
|
@echo ' make install Copy package to local iDevice'
|
|
@echo ' make deploy Copy package to local iDevice'
|
|
@echo ' make clean Cleans build directories'
|
|
|
|
.PHONY: all clean native java extras deb ipa install deploy
|