-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kodiPlugins: move build funs to common
- Loading branch information
Showing
3 changed files
with
97 additions
and
73 deletions.
There are no files selected for viewing
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,84 @@ | ||
{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, lib | ||
, unzip, cmake, kodiPlain, steam, libcec_platform, tinyxml | ||
, libusb, pcre-cpp, jsoncpp, libhdhomerun }: | ||
|
||
rec { | ||
|
||
pluginDir = "/share/kodi/addons"; | ||
|
||
kodi-platform = stdenv.mkDerivation rec { | ||
project = "kodi-platform"; | ||
version = "17.1"; | ||
name = "${project}-${version}"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "xbmc"; | ||
repo = project; | ||
rev = "c8188d82678fec6b784597db69a68e74ff4986b5"; | ||
sha256 = "1r3gs3c6zczmm66qcxh9mr306clwb3p7ykzb70r3jv5jqggiz199"; | ||
}; | ||
|
||
buildInputs = [ cmake kodiPlain libcec_platform tinyxml ]; | ||
|
||
}; | ||
|
||
mkKodiAPIPlugin = { plugin, namespace, version, src, meta, sourceDir ? null, ... }: | ||
stdenv.lib.makeOverridable stdenv.mkDerivation rec { | ||
|
||
inherit src meta sourceDir; | ||
|
||
name = "kodi-plugin-${plugin}-${version}"; | ||
|
||
passthru = { | ||
kodiPlugin = pluginDir; | ||
namespace = namespace; | ||
}; | ||
|
||
dontStrip = true; | ||
|
||
installPhase = '' | ||
${if isNull sourceDir then "" else "cd $src/$sourceDir"} | ||
d=$out${pluginDir}/${namespace} | ||
mkdir -p $d | ||
sauce="." | ||
[ -d ${namespace} ] && sauce=${namespace} | ||
cp -R "$sauce/"* $d | ||
''; | ||
|
||
}; | ||
|
||
mkKodiPlugin = mkKodiAPIPlugin; | ||
|
||
mkKodiABIPlugin = { plugin, namespace, version, src, meta | ||
, extraBuildInputs ? [], sourceDir ? null, ... }: | ||
stdenv.lib.makeOverridable stdenv.mkDerivation rec { | ||
|
||
inherit src meta sourceDir; | ||
|
||
name = "kodi-plugin-${plugin}-${version}"; | ||
|
||
passthru = { | ||
kodiPlugin = pluginDir; | ||
namespace = namespace; | ||
}; | ||
|
||
dontStrip = true; | ||
|
||
buildInputs = [ cmake kodiPlain kodi-platform libcec_platform ] | ||
++ extraBuildInputs; | ||
|
||
# disables check ensuring install prefix is that of kodi | ||
cmakeFlags = [ | ||
"-DOVERRIDE_PATHS=1" | ||
]; | ||
|
||
# kodi checks for plugin .so libs existance in the addon folder (share/...) | ||
# and the non-wrapped kodi lib/... folder before even trying to dlopen | ||
# them. Symlinking .so, as setting LD_LIBRARY_PATH is of no use | ||
installPhase = let n = namespace; in '' | ||
make install | ||
ln -s $out/lib/addons/${n}/${n}.so.${version} $out/${pluginDir}/${n}.so | ||
''; | ||
|
||
}; | ||
} |
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
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