Generate portable build automagically

This commit is contained in:
JFronny 2021-11-24 15:03:34 +01:00
parent 3f945fe454
commit 10f690c981
No known key found for this signature in database
GPG Key ID: BEC5ACBBD4EE17E5
4 changed files with 42 additions and 20 deletions

View File

@ -8,6 +8,7 @@ before_script:
stages:
- build
- portable
- deploy
build_test:
@ -37,6 +38,33 @@ build_test:
only:
- master
portable:
stage: portable
image: archlinux:latest
script:
- pacman -Sy p7zip curl jq --noconfirm
- mkdir -p portable/run/libraries/io/gitlab/jfronny/inceptum/Inceptum
- mkdir -p portable/jvm
- cp wrapper.jar portable/
- main="$(find build/libs/ -type f -iname "Inceptum-*-windows.jar")"
- mkdir "portable/run/libraries/io/gitlab/jfronny/inceptum/Inceptum/${${main##*/Inceptum-}%%-windows*}"
- mv "$main" "portable/run/libraries/io/gitlab/jfronny/inceptum/Inceptum/${${main##*/Inceptum-}%%-windows*}/${main##*/}"
- curl -L "$(curl https://api.github.com/repos/pal1000/mesa-dist-win/releases/latest | jq -r ".assets[] | select(.name | test(\"release-msvc.7z\")) | .browser_download_url")" --output mesa.7z
- 7z e mesa.7z -oportable/run/natives/forceload x64/dxil.dll x64/libglapi.dll x64/opengl32.dll
- curl -L "https://api.adoptium.net/v3/binary/latest/17/ga/windows/x64/jdk/hotspot/normal/eclipse?project=jdk" --output jvm.zip
- 7z x jvm.zip -oportable/
- mv portable/jdk*/* portable/jvm/
- rm -r portable/jdk*
- cp resource/launch.bat portable/
- cd portable
- 7z a ../portable.7z * -mx9
artifacts:
paths:
- portable.7z
expire_in: 2 days
only:
- master
deploy:
rules:
- if: $CI_COMMIT_TAG && '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^master/'
@ -47,3 +75,5 @@ deploy:
- gradle --build-cache build publish -Pflavor=windows -Ppublic
- gradle --build-cache build publish -Pflavor=linux -Ppublic
- gradle --build-cache build publish -Pflavor=macos -Ppublic
only:
- master

View File

@ -13,25 +13,11 @@ On most modern systems, simply launching the wrapper and waiting for it to downl
It will be placed in your config directory (~/.config/Inceptum, %APPDATA%\Inceptum or ~/Library/Application Support/Inceptum).\
On some older systems without OpenGL drivers, Inceptum won't run by default. For these, look at the next section
# Using Mesa
THIS METHOD WILL ONLY WORK ON WINDOWS! If you use linux, just install Mesa from your package manager\
Steps:
- Download a Mesa build from [here](https://github.com/pal1000/mesa-dist-win/releases/latest) (choose release-msvc.7z)
- Unpack the following files into your Inceptum directory as follows:
- x64\dxil.dll to natives\forceload\dxil.dll
- x64\libglapi.dll to natives\forceload\libglapi.dll
- x64\opengl32.dll to natives\forceload\opengl32.dll
- Launch Inceptum as normal
WARNING: Libraries added this way will also be added to any JVM which is downloaded afterwards.\
This is done so they can be loaded from the JVM binaries directory, prioritizing them before system libraries.\
This means you WILL need to remove downloaded JVMs if you change this. (Inceptum\natives)
# Using a portable JVM
- Download an [Adoptium JVM build](https://api.adoptium.net/v3/binary/latest/17/ga/windows/x64/jdk/hotspot/normal/eclipse?project=jdk)
- Extract the directory inside the zip file into your wrappers directory
- Create a batch script (launch.bat) with the following content, adjust the JVM path if necessary: `.\jdk-17.0.1+12\bin\java -jar wrapper.jar`
- Launch the batch script instead of the jar
# Portable installation for Windows systems without OpenGL and/or java
Download the portable build from [here](https://gitlab.com/JFronny/inceptum/-/jobs/artifacts/master/raw/portable.7z?job=portable) \
This archive includes Inceptum using the Inceptum wrapper, a JVM and a Mesa build for CPU-based graphics.\
Please be aware that mesa WILL result in lower FPS.
If all your systems support OpenGL and are simply missing java, remove the `run/natives/forceload` subdirectory!
## Licenses
Inceptum utilizes code/libraries/assets from:
@ -49,4 +35,4 @@ Inceptum utilizes code/libraries/assets from:
- [Ubuntu](https://design.ubuntu.com/font/): Used with nerd font symbols as the font
- [Nerd Fonts](https://www.nerdfonts.com/): Extra symbols for the font, currently unused
- [meteor-client](https://github.com/MeteorDevelopment/meteor-client): A simple HTTP client
- Several of [my other projects](https://gitlab.com/jfmods)
- Several of [my other projects](https://gitlab.com/jfmods)

6
resource/launch.bat Normal file
View File

@ -0,0 +1,6 @@
@echo off
set MESA_GL_VERSION_OVERRIDE=4.6FC
set MESA_GLSL_VERSION_OVERRIDE=460
set GALLIUM_DRIVER=llvmpipe
jvm\bin\java -jar wrapper.jar
pause