Jump to content

Compile Plugins on Linux


domenic

Recommended Posts

I have posted this in the server support forum, but I think that was the wrong place:   https://emby.media/community/index.php?/topic/39408-compile-plugins-on-linux/

So Here it is Again, likely in the correct place for this question.

 

Hi, I am new to the community and this is my first attempt at updating a plugin.  I don't have access to a Windows Build Environment and am attempting to do this on Debian Jessie. 

 

I have pulled down the Emby source code using standard Debian tools (apt-get source and build dependencies) and am able to successfully build from Source using the MediaBrowser.Mono.Build.sh script.  Before attempting anything too difficult, I have cloned the Emby.Plugins Repository and wanted to attempt to build one of the plugins.  There is not much documentation outside of the URL provided in the README.md https://github.com/M...a-Server-Plugin and the suggestion that the source code needs to be in a  folder called 'MediaBrowser' and it is 'side by side'  The URL is GUI centric so it does not help out much.

 

The folder structure is a follows:

 

/usr/src/Emby.Plugins

/usr/src/emby-server-3.0.7200

/usr/src/Media.Browser is a softlink to emby-server-3.0.7200 (which I believe is 'side by side'?)

 

I decided to attempt to compile the OneDrive plugin it appears simple enough, but fails first on Case Sensitivity (I can not believe this one!) then fails when attempting to resolve a package. 

 

I resolved the "Can not find ../.nuget/nuget.exe" by copying NuGet.exe to nuget.exe (ugh!)

below is the result of xbuild for failed packages:

 

XBuild Engine Version 14.0
Mono, Version 4.6.0.0
Copyright © 2005-2013 Various Mono authors

Build started 9/21/2016 7:40:39 AM.
__________________________________________________
Project "/usr/src/Emby.Plugins/OneDrive/OneDrive.csproj" (default target(s)):
        Target PrepareForBuild:
                Configuration: Debug Platform: AnyCPU
        Target RestorePackages:
                Executing: mono --runtime=v4.0.30319 ../.nuget/nuget.exe install "packages.config" -source ""  -RequireConsent -o "../packages"
                Restoring NuGet packages...
                To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
                Unable to find version '1.0.0.5' of package 'Interfaces.IO'.
/usr/src/Emby.Plugins/.nuget/NuGet.targets: error : Command 'mono --runtime=v4.0.30319 ../.nuget/nuget.exe install "packages.config" -source ""  -RequireConsent -o "../packages"' exited with code: 1.
        Task "Exec" execution -- FAILED
        Done building target "RestorePackages" in project "/usr/src/Emby.Plugins/OneDrive/OneDrive.csproj".-- FAILED
Done building project "/usr/src/Emby.Plugins/OneDrive/OneDrive.csproj".-- FAILED

Build FAILED.
Errors:

/usr/src/Emby.Plugins/OneDrive/OneDrive.csproj (default targets) ->
/usr/src/Emby.Plugins/.nuget/NuGet.targets (RestorePackages target) ->

        /usr/src/Emby.Plugins/.nuget/NuGet.targets: error : Command 'mono --runtime=v4.0.30319 ../.nuget/nuget.exe install "packages.config" -source ""  -RequireConsent -o "../packages"' exited with code: 1.

         0 Warning(s)
         1 Error(s)

Time Elapsed 00:00:02.0013150

 

Any direction would be appreciated.

 

Domenic

Edited by domenic
Link to comment
Share on other sites

The plugin solution is configured to use nuget restore. You need to make sure the build supports that. i'm pretty sure xamarin studio does so you could use that.

Link to comment
Share on other sites

The plugin solution is configured to use nuget restore. You need to make sure the build supports that. i'm pretty sure xamarin studio does so you could use that.

 

I am going to attempt to update a plugin: https://emby.media/community/index.php?/topic/21231-vdr-plugin-development/page-3&do=findComment&comment=368760 it is privately supported but the source code is available, and I just wanted to change one line of code and re-compile.  I was hoping that I could get away without a GUI installation and just build from the command line (just like the server build!).  The plugin does not have any GUI pieces that I would want to change....

 

Is a complete "Studio" required if the code is complete and a simple change is wanted?

 

Domenic

Link to comment
Share on other sites

Ok, let me put it this way. It requires a build environment that supports nuget restore. I'm sure you can do it without a gui app but I don't have instructions for you.

Link to comment
Share on other sites

K thanks for the tip, brain is not quite there today (had to do some research on nuget restore!)   I think there may be options to get this working,  I will post results.....

 

Domenic

Link to comment
Share on other sites

Well there is a Debian package called nuget (apt-get install nuget)  I manually ran the command:  nuget install "packages.config" -source ""  -RequireConsent -o "../packages" and it downloaded all the required packages.   Part one done.

 

Domenic

Link to comment
Share on other sites

Rather than use the Debian nuget program I replaced the nuget.exe from the Emby Source Code and xbuild is able to call nuget properly. You may want to update the nuget.exe program in the Emby.Plugins Git repository with the one used by Debian Emby Source as it makes the build more Linux friendly.

 

Version used by Debian 3.4.4.1321

 

Here is an md5sum from the working nuget

 

d2b71f5cfae2d0e1b4a8d993c1ef43b8 nuget.exe

 

Domenic

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...