-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
slimevr, slimevr-server: init at 0.13.2
- Loading branch information
1 parent
a78c346
commit 67f4d93
Showing
7 changed files
with
7,160 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 79534cdf..4f298e66 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -1,3 +1,2 @@ | ||
plugins { | ||
- id("org.ajoberstar.grgit") | ||
} | ||
diff --git a/server/desktop/build.gradle.kts b/server/desktop/build.gradle.kts | ||
index 9ebb84a7..6130e45f 100644 | ||
--- a/server/desktop/build.gradle.kts | ||
+++ b/server/desktop/build.gradle.kts | ||
@@ -13,7 +13,6 @@ plugins { | ||
application | ||
id("com.gradleup.shadow") | ||
id("com.github.gmazzo.buildconfig") | ||
- id("org.ajoberstar.grgit") | ||
} | ||
|
||
kotlin { | ||
@@ -86,12 +85,10 @@ buildConfig { | ||
useKotlinOutput { topLevelConstants = true } | ||
packageName("dev.slimevr.desktop") | ||
|
||
- val gitVersionTag = providers.exec { | ||
- commandLine("git", "--no-pager", "tag", "--sort", "-taggerdate", "--points-at", "HEAD") | ||
- }.standardOutput.asText.get().split('\n').first() | ||
- buildConfigField("String", "GIT_COMMIT_HASH", "\"${grgit.head().abbreviatedId}\"") | ||
+ val gitVersionTag = "@version@" | ||
+ buildConfigField("String", "GIT_COMMIT_HASH", "\"NOT AVAILABLE\"") | ||
buildConfigField("String", "GIT_VERSION_TAG", "\"${gitVersionTag.trim()}\"") | ||
- buildConfigField("boolean", "GIT_CLEAN", grgit.status().isClean.toString()) | ||
+ buildConfigField("boolean", "GIT_CLEAN", "true") | ||
} | ||
|
||
tasks.run<JavaExec> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
runCommand, | ||
replaceVars, | ||
slimevr, | ||
jdk17_headless, | ||
gradle, | ||
hidapi, | ||
makeWrapper, | ||
}: | ||
let | ||
java = jdk17_headless; | ||
# Without this the hidapi bundled with `org.hid4java:hid4java` will be used. | ||
# The bundled version won't be able to find `libudev.so.1`. | ||
javaOptions = | ||
let | ||
# hid4java tries to load `libhidapi.so` which doesn't exist in Nix's hidapi. | ||
# The `libhidapi.so` it expects is actually `libhidapi-hidraw.so`. | ||
libhidapi = runCommand "libhidapi" { } '' | ||
mkdir -p $out/lib | ||
ln -s ${hidapi}/lib/libhidapi-hidraw.so $out/lib/libhidapi.so | ||
''; | ||
in | ||
"-Djna.library.path='${ | ||
lib.makeLibraryPath [ | ||
hidapi | ||
libhidapi | ||
] | ||
}'"; | ||
in | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "slimevr-server"; | ||
|
||
inherit (slimevr) | ||
src | ||
version | ||
; | ||
|
||
mitmCache = gradle.fetchDeps { | ||
inherit (finalAttrs) pname; | ||
data = ./deps.json; | ||
}; | ||
|
||
patches = [ | ||
# Upstream code uses Git to find the program version | ||
(replaceVars ./no-grgit.patch { | ||
inherit (finalAttrs) version; | ||
}) | ||
]; | ||
|
||
postPatch = '' | ||
# Disable Android, so its files don't have to be patched. | ||
substituteInPlace settings.gradle.kts \ | ||
--replace-fail 'include(":server:android")' "" | ||
''; | ||
|
||
nativeBuildInputs = [ | ||
gradle | ||
makeWrapper | ||
]; | ||
|
||
# this is required for using mitm-cache on Darwin | ||
__darwinAllowLocalNetworking = true; | ||
|
||
gradleFlags = [ "-Dorg.gradle.java.home=${java}" ]; | ||
|
||
gradleBuildTask = "shadowJar"; | ||
|
||
doCheck = true; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
install -Dm644 server/desktop/build/libs/slimevr.jar $out/share/slimevr/slimevr.jar | ||
makeWrapper ${java}/bin/java $out/bin/slimevr-server \ | ||
--add-flags "${javaOptions}" \ | ||
--add-flags "-jar $out/share/slimevr/slimevr.jar" | ||
runHook postInstall | ||
''; | ||
|
||
passthru = { | ||
inherit java javaOptions; | ||
# `slimevr-server` is updated by the `slimevr` update script. | ||
}; | ||
|
||
meta = { | ||
homepage = "https://docs.slimevr.dev/"; | ||
description = "App for facilitating full-body tracking in virtual reality"; | ||
license = with lib.licenses; [ | ||
mit | ||
asl20 | ||
]; | ||
maintainers = with lib.maintainers; [ | ||
gale-username | ||
imurx | ||
]; | ||
platforms = with lib.platforms; darwin ++ linux; | ||
mainProgram = "slimevr-server"; | ||
}; | ||
}) |
Oops, something went wrong.