diff options
-rw-r--r-- | .SRCINFO | 46 | ||||
-rw-r--r-- | PKGBUILD | 92 | ||||
-rw-r--r-- | eula.txt | 4 | ||||
-rwxr-xr-x | unity-editor-vrchat | 64 | ||||
-rw-r--r-- | unity-editor-vrchat-icon.png | bin | 0 -> 25613 bytes | |||
-rw-r--r-- | unity-editor-vrchat.desktop | 10 | ||||
-rw-r--r-- | unity-editor-vrchat.install | 12 |
7 files changed, 228 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..104159ed4a3d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,46 @@ +pkgbase = unity-editor-vrchat + pkgdesc = Allows building your Unity projects for VRChat + pkgver = 2018.4.20f1 + pkgrel = 1 + epoch = 1 + url = https://unity3d.com/ + install = unity-editor-vrchat.install + arch = x86_64 + license = custom + depends = desktop-file-utils + depends = xdg-utils + depends = gcc-libs + depends = lib32-gcc-libs + depends = gconf + depends = libgl + depends = glu + depends = nss + depends = libpng12 + depends = libxtst + depends = libpqxx + depends = npm + depends = intel-tbb + depends = gtk3 + optdepends = unityhub + optdepends = jq: needed for UnityHub integration helpers --register/--deregister + conflicts = unity-editor + conflicts = unity-editor-windows + noextract = 2018.4.20f1-android.pkg + options = !strip + source = 2018.4.20f1.tar.xz::https://download.unity3d.com/download_unity/008688490035/LinuxEditorInstaller/Unity.tar.xz + source = 2018.4.20f1-win.pkg::https://download.unity3d.com/download_unity/008688490035/MacEditorTargetInstaller/UnitySetup-Windows-Mono-Support-for-Editor-2018.4.20f1.pkg + source = 2018.4.20f1-android.pkg::https://download.unity3d.com/download_unity/008688490035/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2018.4.20f1.pkg + source = unity-editor-vrchat + source = unity-editor-vrchat.desktop + source = unity-editor-vrchat-icon.png + source = eula.txt + md5sums = d1651b6b0a6d639253e8d149c4bc6b6a + md5sums = 2af219c4a5f6a9679af9ae43a86d7dfb + md5sums = 5272bd150acd2d9a412118978407d885 + md5sums = a8fe2e41f06489dd09f651b08ec87125 + md5sums = ee60f0d4d3c3fa9e0a52da085b1f3be6 + md5sums = 723f9e556821810682a6d1f4be540a74 + md5sums = 24f6741eba3d591a0761f3c92e3cc1f7 + +pkgname = unity-editor-vrchat + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f5a287d88493 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,92 @@ +# Maintainer: sksat <sksat@sksat.net> +# Unity for VRChat(2018.4.20f1) +# UnityHub link: unityhub://2018.4.20f1/008688490035 + +_prefix=/opt/Unity + +pkgname=unity-editor-vrchat +pkgver=2018.4.20f1 +pkgrel=1 +epoch=1 +pkgdesc="Allows building your Unity projects for VRChat" +arch=('x86_64') +url='https://unity3d.com/' +license=('custom') +depends=('desktop-file-utils' + 'xdg-utils' + 'gcc-libs' + 'lib32-gcc-libs' + 'gconf' + 'libgl' + 'glu' + 'nss' + 'libpng12' + 'libxtst' + 'libpqxx' + 'npm' + 'intel-tbb' + 'gtk3') +optdepends=("unityhub" + "jq: needed for UnityHub integration helpers --register/--deregister") +conflicts=("unity-editor" + "unity-editor-windows") +install=${pkgname}.install +source=("${pkgver}.tar.xz::https://download.unity3d.com/download_unity/008688490035/LinuxEditorInstaller/Unity.tar.xz" + "${pkgver}-win.pkg::https://download.unity3d.com/download_unity/008688490035/MacEditorTargetInstaller/UnitySetup-Windows-Mono-Support-for-Editor-${pkgver}.pkg" + "${pkgver}-android.pkg::https://download.unity3d.com/download_unity/008688490035/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-${pkgver}.pkg" + "${pkgname}" + "${pkgname}.desktop" + "${pkgname}-icon.png" + "eula.txt") +noextract=("${pkgver}-android.pkg") +md5sums=("d1651b6b0a6d639253e8d149c4bc6b6a" + "2af219c4a5f6a9679af9ae43a86d7dfb" + "5272bd150acd2d9a412118978407d885" + 'a8fe2e41f06489dd09f651b08ec87125' + 'ee60f0d4d3c3fa9e0a52da085b1f3be6' + '723f9e556821810682a6d1f4be540a74' + '24f6741eba3d591a0761f3c92e3cc1f7') +options=(!strip) +PKGEXT='.pkg.tar' # Prevent compressing of the final package + +prepare(){ + mkdir "${srcdir}/Android" + cd "${srcdir}/Android" + bsdtar -xvf "${srcdir}/${pkgver}-android.pkg" + cd .. +} + +package() { + install -d "${pkgdir}/${_prefix}" + mv "${srcdir}/Editor" "${pkgdir}/${_prefix}" + + # HACK: fixes WebGL builds by adding a symlink (python -> python2) to the PATH + ln -s /usr/bin/python2 "${pkgdir}${_prefix}/Editor/python" + + # Fix permissions + find "${pkgdir}${_prefix}/Editor/Data" -type d -exec chmod ga+rx {} \; + + # Add version to desktop file + sed -i "/^Version=/c\Version=${pkgver}" "${srcdir}/${pkgname}.desktop" + + # Add version/name to launch script + sed -i "s/%PKGNAME%/${pkgname}/g" "${srcdir}/${pkgname}" + sed -i "s/%PKGVER%/${pkgver}/g" "${srcdir}/${pkgname}" + + install -Dm644 -t "${pkgdir}/usr/share/applications" "${srcdir}/${pkgname}.desktop" + install -Dm644 -t "${pkgdir}/usr/share/icons/hicolor/256x256/apps" "${srcdir}/${pkgname}-icon.png" + install -Dm755 -t "${pkgdir}/usr/bin" "${srcdir}/${pkgname}" + install -Dm644 "${srcdir}/eula.txt" "${pkgdir}/usr/share/licenses/${pkgname}/eula.txt" + + _dest_win="${pkgdir}/${_prefix}/Editor/Data/PlaybackEngines/WindowsStandaloneSupport" + install -d "${_dest_win}" + cd "${_dest_win}" + cat "${srcdir}/TargetSupport.pkg.tmp/Payload" | gzip -dc | cpio -i + cd .. + + _dest_android="${pkgdir}/${_prefix}/Editor/Data/PlaybackEngines/AndroidPlayer" + install -d "${_dest_android}" + cd "${_dest_android}" + cat "${srcdir}/Android/TargetSupport.pkg.tmp/Payload" | gzip -dc | cpio -i +} + diff --git a/eula.txt b/eula.txt new file mode 100644 index 000000000000..43e8523dc7a2 --- /dev/null +++ b/eula.txt @@ -0,0 +1,4 @@ +For updated terms of service see here: https://unity3d.com/legal/terms-of-service + +You may contact legal@unity3d.com with questions. + diff --git a/unity-editor-vrchat b/unity-editor-vrchat new file mode 100755 index 000000000000..d068ad203bf5 --- /dev/null +++ b/unity-editor-vrchat @@ -0,0 +1,64 @@ +#!/bin/sh + +unityhub_editors_path="$HOME/.config/UnityHub" +unityhub_editors_json="$unityhub_editors_path/editors.json" + +check_jq() { + hash jq 2> /dev/null + if [ $? -ne 0 ]; then + echo "ERROR: You need to install 'jq' to register/deregister %PKGNAME% with unithub" + exit 1 + fi +} + +check_unityhub() { + local unityhub_pids=$(pgrep unityhub) + if [ ! -z "$unityhub_pids" ]; then + echo "ERROR: Can't UnityHub config while it's running. Close all Unity/UnityHub processes and try again." + exit 1 + fi +} + +ensure_json() { + if [ ! -f "$unityhub_editors_json" ] || [ ! -s "$unityhub_editors_json" ]; then + mkdir -p "$unityhub_editors_path" + echo "{}" > "$unityhub_editors_json" + fi +} + +unityhub_remove() { + local oldentries=$(cat "$unityhub_editors_json" \ + | jq 'to_entries[] | select(.value.location == ["/usr/bin/%PKGNAME%"]) | [.key?]' \ + | jq -cs '.') + cat "$unityhub_editors_json" | jq -c "delpaths($oldentries)" > /tmp/editors.json + mv /tmp/editors.json "$unityhub_editors_json" +} + +unityhub_add() { + unityhub_remove + cat "$unityhub_editors_json" | jq -c ". + {\"%PKGVER%\":{version:\"%PKGVER%\",location:[\"/usr/bin/%PKGNAME%\"],manual:true}}" > /tmp/editors.json + mv /tmp/editors.json "$unityhub_editors_json" +} + +if [ "$1" == "--register" ]; then + check_jq + check_unityhub + ensure_json + unityhub_add + exit 0 +elif [ "$1" == "--deregister" ]; then + check_jq + check_unityhub + ensure_json + unityhub_remove + exit 0 +fi + +# This prevents the editor from crashing when opening projects in some systems +unset GTK_IM_MODULE + +# HACK: fixes WebGL builds by adding a symlink (python -> python2) to the PATH +export PATH=/opt/Unity/Editor:$PATH + +mkdir -p ~/.local/share/unity3d/Packages +exec /opt/Unity/Editor/Unity -no-throttle-updates "$@" diff --git a/unity-editor-vrchat-icon.png b/unity-editor-vrchat-icon.png Binary files differnew file mode 100644 index 000000000000..ef980860bbf5 --- /dev/null +++ b/unity-editor-vrchat-icon.png diff --git a/unity-editor-vrchat.desktop b/unity-editor-vrchat.desktop new file mode 100644 index 000000000000..26fdbb08b922 --- /dev/null +++ b/unity-editor-vrchat.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version= +Name=Unity +Exec=/usr/bin/unity-editor +Icon=unity-editor-icon +Terminal=false +Type=Application +StartupNotify=true +Categories=Development;IDE;Application; +MimeType=x-scheme-handler/com.unity3d.kharma; diff --git a/unity-editor-vrchat.install b/unity-editor-vrchat.install new file mode 100644 index 000000000000..fd5aca096ffa --- /dev/null +++ b/unity-editor-vrchat.install @@ -0,0 +1,12 @@ +unityhub_msg() { + echo "To integrate with UnityHub you can run 'unity-editor-vrchat --register' after every update." + echo "To remove the integration you can run 'unity-editor-vrchat --deregister' or manually remove the entry in UnityHub's GUI." +} + +post_install() { + unityhub_msg +} + +post_upgrade() { + unityhub_msg +} |