openhmd: 0.3.0-rc1-20181218 -> 0.3.0
This commit is contained in:
parent
9dd4ddac2f
commit
586e08cc07
@ -1,45 +1,52 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub, pkgconfig, cmake, hidapi
|
{ stdenv
|
||||||
, withExamples ? true, SDL2 ? null, libGL ? null, glew ? null
|
, fetchFromGitHub
|
||||||
|
, cmake
|
||||||
|
, pkg-config
|
||||||
|
, hidapi
|
||||||
|
, SDL2
|
||||||
|
, libGL
|
||||||
|
, glew
|
||||||
|
, withExamples ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
let examplesOnOff = if withExamples then "ON" else "OFF"; in
|
||||||
|
|
||||||
let onoff = if withExamples then "ON" else "OFF"; in
|
stdenv.mkDerivation rec {
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "openhmd";
|
pname = "openhmd";
|
||||||
version = "0.3.0-rc1-20181218";
|
version = "0.3.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "OpenHMD";
|
owner = "OpenHMD";
|
||||||
repo = "OpenHMD";
|
repo = "OpenHMD";
|
||||||
rev = "80d51bea575a5bf71bb3a0b9683b80ac3146596a";
|
rev = version;
|
||||||
sha256 = "09011vnlsn238r5vbb1ab57x888ljaa34xibrnfbm5bl9417ii4z";
|
sha256 = "1hkpdl4zgycag5k8njvqpx01apxmm8m8pvhlsxgxpqiqy9a38ccg";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig cmake ];
|
nativeBuildInputs = [ cmake pkg-config ];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
hidapi
|
hidapi
|
||||||
] ++ optionals withExamples [
|
] ++ stdenv.lib.optionals withExamples [
|
||||||
SDL2 libGL glew
|
SDL2
|
||||||
|
glew
|
||||||
|
libGL
|
||||||
];
|
];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DBUILD_BOTH_STATIC_SHARED_LIBS=ON"
|
"-DBUILD_BOTH_STATIC_SHARED_LIBS=ON"
|
||||||
"-DOPENHMD_EXAMPLE_SIMPLE=${onoff}"
|
"-DOPENHMD_EXAMPLE_SIMPLE=${examplesOnOff}"
|
||||||
"-DOPENHMD_EXAMPLE_SDL=${onoff}"
|
"-DOPENHMD_EXAMPLE_SDL=${examplesOnOff}"
|
||||||
"-DOpenGL_GL_PREFERENCE=GLVND"
|
"-DOpenGL_GL_PREFERENCE=GLVND"
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = optionalString withExamples ''
|
postInstall = stdenv.lib.optionalString withExamples ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
install -D examples/simple/simple $out/bin/openhmd-example-simple
|
install -D examples/simple/simple $out/bin/openhmd-example-simple
|
||||||
install -D examples/opengl/openglexample $out/bin/openhmd-example-opengl
|
install -D examples/opengl/openglexample $out/bin/openhmd-example-opengl
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
homepage = "http://www.openhmd.net";
|
homepage = "http://www.openhmd.net"; # https does not work
|
||||||
description = "Library API and drivers immersive technology";
|
description = "Library API and drivers immersive technology";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
OpenHMD is a very simple FLOSS C library and a set of drivers
|
OpenHMD is a very simple FLOSS C library and a set of drivers
|
||||||
@ -48,7 +55,7 @@ stdenv.mkDerivation {
|
|||||||
Oculus Rift, HTC Vive, Windows Mixed Reality, and etc.
|
Oculus Rift, HTC Vive, Windows Mixed Reality, and etc.
|
||||||
'';
|
'';
|
||||||
license = licenses.boost;
|
license = licenses.boost;
|
||||||
maintainers = [ maintainers.oxij ];
|
maintainers = with maintainers; [ oxij ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user