As an aside, this is the whole patch I'm using to create relevant files in the github folder sans the icon.
The launcher script is unique because it has to symlink around key folders DaggerfallUnity_Data/StreamingAssets then copy the contents of that folder and the binary itself to a target location (I just use the profile folder).
I parse the files to sym-link into an array, then check for the existence of each before linking. The binary picks up the absolute path of the folder from which it is run. There doesn't seem to be a way around this. (neither sym-link, or cd to the folder and run the link). As a result, I md5 compare global key files to local and replace if they don't match.
It's all really quite hackish and simplistic but, again, it seems to work.
Code: Select all
rm dfunity.sh dfunity.desktop Makefile
patch -p1 < ../dfunity.patch
cp ../unibuild/data/dfunity.svg .
diff notes
http://beta.unity3d.com/download/3709a3f954c1/UnitySetup-2018.1.2f1
http://beta.unity3d.com/download/a6cc294b73ee/UnitySetup-2018.1.9f2
diff a/dfunity.sh b/dfunity.sh
--- a/dfunity.sh 1969-12-31 17:00:00.000000000 -0700
+++ b/dfunity.sh 2018-08-08 12:41:13.390810041 -0600
@@ -0,0 +1,26 @@
+#!/bin/bash
+gmcfg="$HOME/.config/unity3d/Daggerfall Workshop/Daggerfall Unity"
+glnch="DaggerfallUnity.x86_64"
+i_syms=()
+
+test -d "$gmcfg/DaggerfallUnity_Data" || mkdir -p "$gmcfg/DaggerfallUnity_Data"
+readarray -t i_syms < <(find /usr/share/dfunity -mindepth 1 -maxdepth 2 ! \( -iname '*dfunity.sh' -o -iname '*DaggerfallUnity.x86_64' -o -ipath '*StreamingAssets*' -o -ipath '*DaggerfallUnity_Data' \) -printf '%P\n')
+for i in ${!i_syms[@]}; do
+ test -h "$gmcfg/${i_syms[$i]}" || ln -sf "/usr/share/dfunity/${i_syms[$i]}" "$gmcfg/${i_syms[$i]}"
+done
+unset i_syms
+readarray -t i_syms < <(find /usr/share/dfunity -mindepth 3 -maxdepth 4 -type d \( -iname '*DaggerfallUnity.x86_64' -o -ipath '*StreamingAssets*' \) -printf '%P\n')
+for i in ${!i_syms[@]}; do
+ test -d "$gmcfg/${i_syms[$i]}" || mkdir -p "$gmcfg/${i_syms[$i]}"
+done
+unset i_syms
+readarray -t i_syms < <(find /usr/share/dfunity -mindepth 1 -maxdepth 4 -type f \( -iname '*DaggerfallUnity.x86_64' -o -ipath '*StreamingAssets*' \) -printf '%P\n')
+for i in ${!i_syms[@]}; do
+ if [ -f "$gmcfg/${i_syms[$i]}" ]; then
+ test "$(md5sum "$gmcfg/${i_syms[$i]}" | cut -d' ' -f1)" == "$(md5sum "/usr/share/dfunity/${i_syms[$i]}" | cut -d' ' -f1)" || cp -f "/usr/share/dfunity/${i_syms[$i]}" "$gmcfg/${i_syms[$i]}"
+ else
+ cp "/usr/share/dfunity/${i_syms[$i]}" "$gmcfg/${i_syms[$i]}"
+ fi
+done
+unset i_syms
+(cd "$gmcfg" && "$gmcfg/$glnch")
diff a/dfunity.desktop b/dfunity.desktop
--- a/dfunity.desktop
+++ b/dfunity.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Daggerfall Unity
+Comment=Open source recreation of Daggerfall in the Unity engine.
+Keywords=game;console;
+Exec=/usr/share/dfunity/dfunity.sh
+Icon=dfunity
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;Game;
+StartupNotify=false
diff a/Makefile b/Makefile
--- a/Makefile 1969-12-31 17:00:00.000000000 -0700
+++ b/Makefile 2018-08-08 12:41:13.390810041 -0600
@@ -0,0 +1,44 @@
+prefix := /usr
+name := DaggerfallUnity
+game := $(prefix)/games
+bindir := $(prefix)/share/dfunity
+icondir := $(prefix)/share/icons/hicolor/scalable/apps
+
+.PHONY: all
+all:
+ $(HOME)/Unity/Hub/Editor/2018.1.9f2/Editor/Unity -quit -batchmode -logFile stdout.log -buildTarget linux64 -buildLinux64Player "build/$(name).x86_64"
+
+.PHONY: clean
+clean:
+ rm -rf build/$(name)_Data
+ rm -f "build/Daggerfall Unity Manual.pdf"
+ rm -f build/$(name).x86_64
+
+.PHONY: realclean
+realclean: clean
+ rm -rf Library
+
+.PHONY: distclean
+distclean: realclean
+ rm -rf Assets
+ git reset --hard
+ git checkout . -f
+ git submodule update --checkout -f
+
+.PHONY: install
+install:
+ mkdir -p $(prefix)/share/applications/
+ mkdir -p $(icondir)/
+ mkdir -p $(bindir)/
+ install -m 755 build/$(name).x86_64 $(bindir)
+ install -m 755 dfunity.sh $(bindir)
+ cp -r build/$(name)_Data $(bindir)/
+ cp "build/Daggerfall Unity Manual.pdf" "$(bindir)/Daggerfall Unity Manual.pdf"
+ cp dfunity.desktop $(prefix)/share/applications/dfunity.desktop
+ cp dfunity.svg $(icondir)/dfunity.svg
+
+.PHONY: uninstall
+uninstall:
+ rm -rf $(bindir)
+ rm -f $(prefix)/share/applications/dfunity.desktop
+ rm -f $(icondir)/dfunity.svg