File tree Expand file tree Collapse file tree 5 files changed +38
-76
lines changed
Expand file tree Collapse file tree 5 files changed +38
-76
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ crate-type = ["cdylib"]
1111
1212[features ]
1313gpl = [] # Enable for FFmpeg support on Windows. Always enabled on Linux
14+ nix = []
1415
1516[dependencies ]
1617alvr_common.workspace = true
Original file line number Diff line number Diff line change 11use std:: { env, path:: PathBuf } ;
22
33fn get_ffmpeg_path ( ) -> PathBuf {
4- let ffmpeg_path = alvr_filesystem:: deps_dir ( )
5- . join ( if cfg ! ( target_os = "linux" ) {
6- "linux"
7- } else {
8- "windows"
9- } )
10- . join ( "ffmpeg" ) ;
4+ if cfg ! ( not( feature = "nix" ) ) {
5+ let ffmpeg_path = alvr_filesystem:: deps_dir ( )
6+ . join ( if cfg ! ( target_os = "linux" ) {
7+ "linux"
8+ } else {
9+ "windows"
10+ } )
11+ . join ( "ffmpeg" ) ;
1112
12- if cfg ! ( target_os = "linux" ) {
13- ffmpeg_path. join ( "alvr_build" )
13+ if cfg ! ( target_os = "linux" ) {
14+ ffmpeg_path. join ( "alvr_build" )
15+ } else {
16+ ffmpeg_path
17+ }
1418 } else {
15- ffmpeg_path
19+ pkg_config:: Config :: new ( )
20+ . probe ( "libavcodec" )
21+ . unwrap ( )
22+ . to_owned ( )
23+ . include_paths
24+ . pop ( )
25+ . unwrap ( )
26+ . parent ( )
27+ . unwrap ( )
28+ . to_path_buf ( )
1629 }
1730}
1831
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3636 pkg-config
3737 rustToolchain
3838 rustPlatform . bindgenHook
39- llvmPackages . bintools
39+ llvmPackages . bintools
4040 vulkan-headers
4141 vulkan-loader
42- #libGL
4342 ] ;
4443
4544 dependencyPackages = [
7675 xvidcore
7776 bzip2
7877 gmp
79- jdk
80- jre
8178 ] ;
8279
8380 nvidiaPackages = with cudaPackages ; [
8683 libnpp
8784 ] ;
8885
89- libsPatch = toString (
90- replaceVars ./fix-finding-libs.patch {
91- ffmpeg = lib . getDev ffmpeg ;
92- x264 = lib . getDev x264 ;
93- }
94- ) ;
95-
9686 androidComposition = androidenv . composeAndroidPackages {
9787 minPlatformVersion = "28" ;
9888 maxPlatformVersion = "32" ;
152142 ] )
153143 ] ;
154144 RUST_BACKTRACE = "1" ;
155- shellHook = ''
156- git apply ${ libsPatch }
157- '' ;
158145 } ;
159146 in
160147 {
169156 "-lssl"
170157 ] ;
171158 RUSTFLAGS = toString [
172- "-C link-self-contained=-linker"
159+ "-C link-self-contained=-linker"
173160 ( map ( a : "-C link-args=${ a } " ) [
174161 "-Wl,--push-state,--no-as-needed"
175162 "-lEGL"
179166 ] )
180167 ] ;
181168 cargoBuildFlags = [
169+ "--workspace"
182170 "--exclude alvr_xtask"
183- "--workspace"
184171 ] ;
185172 buildNoDefaultFeatures = true ;
186- patches = [
187- ( replaceVars ./fix-finding-libs.patch {
188- ffmpeg = lib . getDev ffmpeg ;
189- x264 = lib . getDev x264 ;
190- } )
191- ] ;
173+ buildFeatures = [ "nix" ] ;
192174 version = "21.0.0-master" ; # TODO Change to the release
193175 doCheck = false ; # TODO Broken right now
194176 src = ./. ;
213195 cp -r ./build/alvr_streamer_linux/share/. $out/share
214196 ln -s $out/lib $out/lib64
215197 '' ;
198+ # TODO FIX that it needs to run the below command.
216199 postBuild = ''
217200 # Build SteamVR driver ("streamer")
218201 cargo xtask build-streamer --release
You can’t perform that action at this time.
0 commit comments