Coder Social home page Coder Social logo

Cross-platform build scripts about osvr-unity HOT 5 OPEN

osvr avatar osvr commented on July 29, 2024
Cross-platform build scripts

from osvr-unity.

Comments (5)

rpavlik avatar rpavlik commented on July 29, 2024

Yeah, those two scripts you mention are primarily for the sake of the CI that's generating the binary snapshots with .unitypackage file and some subset of the source for those who want to tinker.

from osvr-unity.

ChristophHaag avatar ChristophHaag commented on July 29, 2024

Since there's a native unity editor for linux it would be nice if people could experiment with this. But the automated builds still only contain the windows plugins.

"Manually" building Managed-OSVR doesn't work on linux because the csproject files don't work with xbuild. I.e. you get the error

ClientKit/ClientKit.csproj: error : /home/chris/OSVR-Unity/Managed-OSVR/ClientKit/ClientKit.csproj: Can not evaluate " !$(DefineConstants.Contains(';NET')) " to bool.

and when you work around that you get

ClientKit/ClientKit.csproj: error : /home/chris/OSVR-Unity/Managed-OSVR/ClientKit/ClientKit.csproj: Item has already been added. Key in dictionary: 'DestDir'  Key being added: 'DestDir'

and then I gave up for the time being.

Will linux libraries and plugins come any time soon?

from osvr-unity.

ChristophHaag avatar ChristophHaag commented on July 29, 2024

Oh, I was mistaken. I believed that the precompiled packages contained windows-specific libraries, but it looks like it's all .Net code that works on linux. I tried to build a very simple project on the experimental unity editor for linux and both the in-editor view and the build work fine: It goes into side by side mode and has working head tracking fully automatically: https://www.youtube.com/watch?v=rwTlW2Nr6i0

Maybe the specific references to windows can be removed from http://access.osvr.com/binary/osvr-unity

OSVR-Unity Windows Assets
These builds contain Windows 32-bit binary packages for use with the Unity3D game engine.

from osvr-unity.

rpavlik avatar rpavlik commented on July 29, 2024

Good catch, thanks. That page's hand-written content hasn't been touched in a while apparently - we've been shipping 64-bit native binaries for Windows in there too for a while.

from osvr-unity.

ChristophHaag avatar ChristophHaag commented on July 29, 2024

This script dropped in the root of OSVR-Unity builds a .unitypackage for me with msbuild:

#!/usr/bin/bash

set -e # exit when something goes wrong

SCRIPTDIR=$(dirname "$(readlink -f "$0")")
cd ${SCRIPTDIR}

echo "Running in $pwd"

#default values can be overwritten by command line arguments
MSBUILD="/usr/share/msbuild/Microsoft.Build.Mono.Debug.14.1.0.0-prerelease/lib/MSBuild.exe"
MONO=$(which mono)
UNITY="/opt/Unity/Editor/Unity"

while [[ $# > 1 ]]
do
key="$1"

case $key in
    -b|--msbuild-path)
    MSBUILD="$2"
    shift
    ;;

    -m|--mono-path)
    MONO="$2"
    shift
    ;;

    -u|--unity-path)
    UNITY="$2"
    shift
    ;;

    *)
        echo "Usage: $0 [--msbuild-path foo/MSBuild.exe]"
    ;;
esac
shift
done

echo "MSBuild.exe path: $MSBUILD"
if [ ! -f "$MSBUILD" ]; then
  echo "Error: MSBuild.exe not found. Set with --msbuild-path"
  exit 1
fi

echo "mono path: $MONO"
if [ ! -f "$MONO" ]; then
  echo "Error: mono not found. Set with --mono-path"
  exit 1
fi

echo "Unity path: $UNITY"
if [ ! -f "$UNITY" ]; then
  echo "Error: Unity Editor not found. Set with --unity-path"
  exit 1
fi

if [ ! -d "Managed-OSVR" ]; then
  git clone https://github.com/OSVR/Managed-OSVR.git
fi

cd Managed-OSVR
mono ${MSBUILD} ClientKit/ClientKit.csproj /p:Configuration=Release20 /p:OutputPath=../Managed-OSVR-Unity /p:NativeOutputSuffix32=x86 /p:NativeOutputSuffix64=x86_64 /p:DefineConstants="NET20"

cp -r Managed-OSVR-Unity/* ../OSVR-Unity/Assets/Plugins

cd "$SCRIPTDIR"

${UNITY} -quit -batchmode -projectPath "$SCRIPTDIR/OSVR-Unity" -logFile "$SCRIPTDIR/unity.log" -executeMethod OSVRUnityBuild.build
cat "$SCRIPTDIR/unity.log"

mkdir -p OSVR-Unity-Dist
cp OSVR-Unity/*.unitypackage OSVR-Unity-Dist
echo "Your unitypackage is in $SCRIPTDIR/OSVR-Unity-Dist"

To anyone: Feel free to improve it.

from osvr-unity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.