diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-11 22:30:01 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-11 22:30:01 -0500 |
| commit | 5f7871ca540d41149bfcf05f78b00660a9599d5a (patch) | |
| tree | 4d46f56f4b718b38d9064aaa9929a0efbb051436 | |
| parent | 60508e1dd8a25be58dea308e5f48ff0c596f97c8 (diff) | |
| parent | 1a28548339131efa3ad862cee6fbcd8a64f939c2 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
3 files changed, 91 insertions, 21 deletions
diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj index 2b2ccbe99..0bd2a775b 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -134,13 +134,20 @@ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Content Include="..\ThirdParty\SQLite3\linux\x86\3.8.2\libsqlite3.so.0.8.6"> - <Link>lib\libsqlite3.so.0.8.6</Link> + <Link>sqlite3\linux\lib\libsqlite3.so.0.8.6</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Content Include="..\ThirdParty\SQLite3\linux\x86_64\3.8.2\libsqlite3.so.0.8.6"> - <Link>lib64\libsqlite3.so.0.8.6</Link> + <Link>sqlite3\linux\lib64\libsqlite3.so.0.8.6</Link> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="..\ThirdParty\SQLite3\mac\universal\3.8.2\libsqlite3.0.dylib"> + <Link>sqlite3\mac\libsqlite3.0.dylib</Link> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="System.Data.SQLite.dll.config"> + <Link>System.Data.SQLite.dll.config</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> - <Content Include="System.Data.SQLite.dll.config" /> </ItemGroup> </Project>
\ No newline at end of file diff --git a/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config b/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config index df4189b56..c1868d88d 100644 --- a/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config +++ b/MediaBrowser.Server.Mono/System.Data.SQLite.dll.config @@ -1,4 +1,5 @@ <configuration> - <dllmap dll="sqlite3" target="./lib/libsqlite3.so.0.8.6" os="!windows"/> - <dllmap dll="sqlite3" target="./lib64/libsqlite3.so.0.8.6" os="!windows"/> + <dllmap dll="sqlite3" target="./sqlite3/linux/lib/libsqlite3.so.0.8.6" os="linux"/> + <dllmap dll="sqlite3" target="./sqlite3/linux/lib64/libsqlite3.so.0.8.6" os="linux"/> + <dllmap dll="sqlite3" target="./sqlite3/mac/libsqlite3.0.dylib" os="osx"/> </configuration> diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index 596c9d234..7ac15dff9 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -1,4 +1,7 @@ using System; +#if __MonoCS__ +using System.Runtime.InteropServices; +#endif namespace MediaBrowser.ServerApplication.FFMpeg { @@ -35,20 +38,41 @@ namespace MediaBrowser.ServerApplication.FFMpeg return "7z"; } break; + + #if __MonoCS__ case PlatformID.Unix: - case PlatformID.MacOSX: - switch (arg) + if (IsRunningOnMac()) { - case "Version": - return "20140104"; - case "FFMpegFilename": - return "ffmpeg"; - case "FFProbeFilename": - return "ffprobe"; - case "ArchiveType": - return "gz"; + switch (arg) + { + case "Version": + return "20131121"; + case "FFMpegFilename": + return "ffmpeg"; + case "FFProbeFilename": + return "ffprobe"; + case "ArchiveType": + return "gz"; + } + break; } - break; + else + { + // Linux + switch (arg) + { + case "Version": + return "20140104"; + case "FFMpegFilename": + return "ffmpeg"; + case "FFProbeFilename": + return "ffprobe"; + case "ArchiveType": + return "gz"; + } + break; + } + #endif } return ""; } @@ -66,16 +90,54 @@ namespace MediaBrowser.ServerApplication.FFMpeg "https://www.dropbox.com/s/oghurnp5zh292ry/ffmpeg-20140105-git-70937d9-win32-static.7z?dl=1" }; + #if __MonoCS__ case PlatformID.Unix: - case PlatformID.MacOSX: - return new[] + if (IsRunningOnMac()) { - "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2014-01-04.tar.gz", - "https://www.dropbox.com/s/b7nkg71sil812hp/ffmpeg.static.32bit.2014-01-04.tar.gz?dl=1" - }; + // Mac OS X Intel 64bit + return new[] + { + "https://copy.com/ylAUbbQHYE7x/ffall-2.1.1.7z?download=1" + }; + } + else + { + // Linux + return new[] + { + "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2014-01-04.tar.gz", + "https://www.dropbox.com/s/b7nkg71sil812hp/ffmpeg.static.32bit.2014-01-04.tar.gz?dl=1" + }; + } + #endif } return new string[] {}; } + + #if __MonoCS__ + // From mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs + [DllImport ("libc")] + static extern int uname (IntPtr buf); + + static bool IsRunningOnMac() + { + IntPtr buf = IntPtr.Zero; + try { + buf = Marshal.AllocHGlobal (8192); + // This is a hacktastic way of getting sysname from uname () + if (uname (buf) == 0) { + string os = Marshal.PtrToStringAnsi (buf); + if (os == "Darwin") + return true; + } + } catch { + } finally { + if (buf != IntPtr.Zero) + Marshal.FreeHGlobal (buf); + } + return false; + } + #endif } } |
