From be565ce0ef08f308752ca531cefeed928609cedd Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Sat, 24 Oct 2015 05:21:12 +0100 Subject: [PATCH] save up, many changes, mostly adding support 16 alpha --- docker/Dockerfile | 6 +- docker/defaults/configures/16/config_options | 31 ++ docker/defaults/patches/16/headless.patch | 349 ++++++++++++++++++ docker/init/30_get_source.sh | 15 +- docker/init/50_build_kodi.sh | 6 + docker/init/60_make_fpm.sh | 42 ++- .../pre_build/build_lists/14/build_apps.list | 1 - .../pre_build/build_lists/15/build_apps.list | 1 - .../pre_build/build_lists/16/build_apps.list | 45 +++ 9 files changed, 489 insertions(+), 7 deletions(-) create mode 100644 docker/defaults/configures/16/config_options create mode 100644 docker/defaults/patches/16/headless.patch create mode 100644 docker/pre_build/build_lists/16/build_apps.list diff --git a/docker/Dockerfile b/docker/Dockerfile index e784d6b..6385756 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,8 +3,8 @@ FROM linuxserver/baseimage.python MAINTAINER Sparklyballs # these two values control what version this box builds -ENV kodi_version="15.2" -ENV kodi_checkout="15.2-Isengard" +ENV kodi_version="16.01" +ENV kodi_checkout="16.0a3-Jarvis" # set some environment variables ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 @@ -35,3 +35,5 @@ RUN chmod -v +x /etc/my_init.d/*.sh # set output volume VOLUME /builds + + diff --git a/docker/defaults/configures/16/config_options b/docker/defaults/configures/16/config_options new file mode 100644 index 0000000..fb48d72 --- /dev/null +++ b/docker/defaults/configures/16/config_options @@ -0,0 +1,31 @@ +config_opts="--disable-airplay \ +--disable-airtunes \ +--disable-alsa \ +--disable-asap-codec \ +--disable-avahi \ +--disable-dbus \ +--disable-debug \ +--disable-dvdcss \ +--disable-fishbmc \ +--disable-goom \ +--disable-joystick \ +--disable-libcap \ +--disable-libcec \ +--disable-libusb \ +--disable-non-free \ +--disable-openmax \ +--disable-optical-drive \ +--disable-projectm \ +--disable-pulse \ +--disable-rsxs \ +--disable-rtmp \ +--disable-spectrum \ +--disable-udev \ +--disable-vaapi \ +--disable-vdpau \ +--disable-vtbdecoder \ +--disable-waveform \ +--enable-libbluray \ +--enable-nfs \ +--enable-ssh \ +--enable-upnp" diff --git a/docker/defaults/patches/16/headless.patch b/docker/defaults/patches/16/headless.patch new file mode 100644 index 0000000..e0692fc --- /dev/null +++ b/docker/defaults/patches/16/headless.patch @@ -0,0 +1,349 @@ +From 5053b17a1de91ff9771c30fce63e03af515e7d6b Mon Sep 17 00:00:00 2001 +From: Celed +Date: Thu, 1 Oct 2015 10:40:05 +0200 +Subject: [PATCH] Headless patch + +--- + xbmc/AppParamParser.cpp | 2 ++ + xbmc/Application.cpp | 60 ++++++++++++++++++++----------------- + xbmc/Application.h | 19 +++++++++--- + xbmc/guilib/GUIDialog.cpp | 5 ++-- + xbmc/settings/SettingConditions.cpp | 3 ++ + xbmc/xbmc.cpp | 2 +- + 6 files changed, 56 insertions(+), 35 deletions(-) + +diff --git a/xbmc/AppParamParser.cpp b/xbmc/AppParamParser.cpp +index 14886b5..56529f4 100644 +--- a/xbmc/AppParamParser.cpp ++++ b/xbmc/AppParamParser.cpp +@@ -139,6 +139,8 @@ void CAppParamParser::ParseArg(const std::string &arg) + m_testmode = true; + else if (arg.substr(0, 11) == "--settings=") + g_advancedSettings.AddSettingsFile(arg.substr(11)); ++ else if (arg == "--headless") ++ g_application.SetHeadless(true); + else if (arg.length() != 0 && arg[0] != '-') + { + if (m_testmode) +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index bc55630..847e5cf 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -299,6 +299,7 @@ CApplication::CApplication(void) + m_bPlatformDirectories = true; + + m_bStandalone = false; ++ m_headless = false; + m_bEnableLegacyRes = false; + m_bSystemScreenSaverEnable = false; + m_pInertialScrollingHandler = new CInertialScrollingHandler(); +@@ -446,7 +447,7 @@ bool CApplication::Create() + SetupNetwork(); + Preflight(); + +- // here we register all global classes for the CApplicationMessenger, ++ // here we register all global classes for the CApplicationMessenger, + // after that we can send messages to the corresponding modules + CApplicationMessenger::GetInstance().RegisterReceiver(this); + CApplicationMessenger::GetInstance().RegisterReceiver(&g_playlistPlayer); +@@ -552,7 +553,7 @@ bool CApplication::Create() + CLog::Log(LOGNOTICE, "WARNING: unsupported ffmpeg version detected"); + } + #endif +- ++ + std::string cpuModel(g_cpuInfo.getCPUModel()); + if (!cpuModel.empty()) + CLog::Log(LOGNOTICE, "Host CPU: %s, %d core%s available", cpuModel.c_str(), g_cpuInfo.getCPUCount(), (g_cpuInfo.getCPUCount() == 1) ? "" : "s"); +@@ -1507,7 +1508,7 @@ bool CApplication::OnSettingUpdate(CSetting* &setting, const char *oldSettingId, + CSettingString *audioDevice = (CSettingString*)setting; + // Gotham and older didn't enumerate audio devices per stream on osx + // add stream0 per default which should be ok for all old settings. +- if (!StringUtils::EqualsNoCase(audioDevice->GetValue(), "DARWINOSX:default") && ++ if (!StringUtils::EqualsNoCase(audioDevice->GetValue(), "DARWINOSX:default") && + StringUtils::FindWords(audioDevice->GetValue().c_str(), ":stream") == std::string::npos) + { + std::string newSetting = audioDevice->GetValue(); +@@ -1871,7 +1872,7 @@ bool CApplication::RenderNoPresent() + // g_graphicsContext.AcquireCurrentContext(); + + g_graphicsContext.Lock(); +- ++ + bool hasRendered = g_windowManager.Render(); + + g_graphicsContext.Unlock(); +@@ -2112,8 +2113,8 @@ bool CApplication::OnAction(const CAction &action) + if (action.IsMouse()) + CInputManager::GetInstance().SetMouseActive(true); + +- +- if (action.GetID() == ACTION_CREATE_EPISODE_BOOKMARK) ++ ++ if (action.GetID() == ACTION_CREATE_EPISODE_BOOKMARK) + { + CGUIDialogVideoBookmarks::OnAddEpisodeBookmark(); + } +@@ -2121,7 +2122,7 @@ bool CApplication::OnAction(const CAction &action) + { + CGUIDialogVideoBookmarks::OnAddBookmark(); + } +- ++ + // The action PLAYPAUSE behaves as ACTION_PAUSE if we are currently + // playing or ACTION_PLAYER_PLAY if we are seeking (FF/RW) or not playing. + if (action.GetID() == ACTION_PLAYER_PLAYPAUSE) +@@ -2150,7 +2151,7 @@ bool CApplication::OnAction(const CAction &action) + // notify action listeners + if (NotifyActionListeners(action)) + return true; +- ++ + // screenshot : take a screenshot :) + if (action.GetID() == ACTION_TAKE_SCREENSHOT) + { +@@ -2479,7 +2480,7 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg) + case TMSG_QUIT: + Stop(EXITCODE_QUIT); + break; +- ++ + case TMSG_SHUTDOWN: + HandleShutdownMessage(); + break; +@@ -2511,7 +2512,7 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg) + case TMSG_INHIBITIDLESHUTDOWN: + InhibitIdleShutdown(pMsg->param1 != 0); + break; +- ++ + case TMSG_ACTIVATESCREENSAVER: + ActivateScreenSaver(); + break; +@@ -2858,7 +2859,7 @@ bool CApplication::Cleanup() + #ifdef HAS_DVD_DRIVE + CLibcdio::ReleaseInstance(); + #endif +-#endif ++#endif + #if defined(TARGET_ANDROID) + // enable for all platforms once it's safe + g_sectionLoader.UnloadAll(); +@@ -3146,7 +3147,7 @@ PlayBackRet CApplication::PlayStack(const CFileItem& item, bool bRestart) + else + { + LoadVideoSettings(item); +- ++ + // see if we have the info in the database + // TODO: If user changes the time speed (FPS via framerate conversion stuff) + // then these times will be wrong. +@@ -3446,7 +3447,7 @@ PlayBackRet CApplication::PlayFile(const CFileItem& item, bool bRestart) + CSingleLock lock(m_playStateMutex); + // tell system we are starting a file + m_bPlaybackStarting = true; +- ++ + // for playing a new item, previous playing item's callback may already + // pushed some delay message into the threadmessage list, they are not + // expected be processed after or during the new item playback starting. +@@ -3768,7 +3769,7 @@ void CApplication::SaveFileState(bool bForeground /* = false */) + m_progressTrackingPlayCountUpdate, + CMediaSettings::GetInstance().GetCurrentVideoSettings(), + CMediaSettings::GetInstance().GetCurrentAudioSettings()); +- ++ + if (bForeground) + { + // Run job in the foreground to make sure it finishes +@@ -3865,11 +3866,11 @@ void CApplication::LoadVideoSettings(const CFileItem& item) + if (dbs.Open()) + { + CLog::Log(LOGDEBUG, "Loading settings for %s", item.GetPath().c_str()); +- ++ + // Load stored settings if they exist, otherwise use default + if (!dbs.GetVideoSettings(item, CMediaSettings::GetInstance().GetCurrentVideoSettings())) + CMediaSettings::GetInstance().GetCurrentVideoSettings() = CMediaSettings::GetInstance().GetDefaultVideoSettings(); +- ++ + dbs.Close(); + } + } +@@ -4211,7 +4212,7 @@ bool CApplication::OnMessage(CGUIMessage& message) + + // Update our infoManager with the new details etc. + if (m_nextPlaylistItem >= 0) +- { ++ { + // playing an item which is not in the list - player might be stopped already + // so do nothing + if (playList.size() <= m_nextPlaylistItem) +@@ -4370,15 +4371,18 @@ bool CApplication::OnMessage(CGUIMessage& message) + + if (!m_pPlayer->IsPlayingVideo()) + { +- if(g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO) +- { +- g_windowManager.PreviousWindow(); +- } +- else ++ if (!IsHeadless()) + { +- CSingleLock lock(g_graphicsContext); +- // resets to res_desktop or look&feel resolution (including refreshrate) +- g_graphicsContext.SetFullScreenVideo(false); ++ if(g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO) ++ { ++ g_windowManager.PreviousWindow(); ++ } ++ else ++ { ++ CSingleLock lock(g_graphicsContext); ++ // resets to res_desktop or look&feel resolution (including refreshrate) ++ g_graphicsContext.SetFullScreenVideo(false); ++ } + } + } + +@@ -4808,7 +4812,7 @@ float CApplication::GetVolume(bool percentage /* = true */) const + // converts the hardware volume to a percentage + return m_volumeLevel * 100.0f; + } +- ++ + return m_volumeLevel; + } + +@@ -5253,7 +5257,7 @@ void CApplication::CloseNetworkShares() + #if defined(HAS_FILESYSTEM_SMB) && !defined(TARGET_WINDOWS) + smb.Deinit(); + #endif +- ++ + #ifdef HAS_FILESYSTEM_NFS + gNfsConnection.Deinit(); + #endif +@@ -5287,6 +5291,6 @@ bool CApplication::NotifyActionListeners(const CAction &action) const + if ((*it)->OnAction(action)) + return true; + } +- ++ + return false; + } +diff --git a/xbmc/Application.h b/xbmc/Application.h +index 6029a82..6d02f3e 100644 +--- a/xbmc/Application.h ++++ b/xbmc/Application.h +@@ -342,6 +342,16 @@ public: + return m_bStandalone; + } + ++ void SetHeadless(bool value) ++ { ++ m_headless = value; ++ } ++ ++ bool IsHeadless() const ++ { ++ return m_headless; ++ } ++ + void SetEnableLegacyRes(bool value) + { + m_bEnableLegacyRes = value; +@@ -380,7 +390,7 @@ public: + ReplayGainSettings& GetReplayGainSettings() { return m_replayGainSettings; } + + void SetLoggingIn(bool loggingIn) { m_loggingIn = loggingIn; } +- ++ + /*! + \brief Register an action listener. + \param listener The listener to register +@@ -404,7 +414,7 @@ protected: + + bool LoadSkin(const std::string& skinID); + bool LoadSkin(const std::shared_ptr& skin); +- ++ + /*! + \brief Delegates the action to all registered action handlers. + \param action The action +@@ -468,6 +478,7 @@ protected: + bool m_skipGuiRender; + + bool m_bStandalone; ++ bool m_headless; + bool m_bEnableLegacyRes; + bool m_bTestMode; + bool m_bSystemScreenSaverEnable; +@@ -505,11 +516,11 @@ protected: + #endif + + ReplayGainSettings m_replayGainSettings; +- ++ + std::vector m_actionListeners; + + bool m_fallbackLanguageLoaded; +- ++ + private: + CCriticalSection m_critSection; /*!< critical section for all changes to this class, except for changes to triggers */ + }; +diff --git a/xbmc/guilib/GUIDialog.cpp b/xbmc/guilib/GUIDialog.cpp +index 841ced0..42aa62a 100644 +--- a/xbmc/guilib/GUIDialog.cpp ++++ b/xbmc/guilib/GUIDialog.cpp +@@ -142,7 +142,7 @@ void CGUIDialog::UpdateVisibility() + else + Close(); + } +- ++ + if (m_autoClosing) + { // check if our timer is running + if (!m_showStartTime) +@@ -173,7 +173,8 @@ void CGUIDialog::Open_Internal(bool bProcessRenderLoop) + CSingleLock lock(g_graphicsContext); + + if (!g_windowManager.Initialized() || +- (m_active && !m_closing && !IsAnimating(ANIM_TYPE_WINDOW_CLOSE))) ++ (m_active && !m_closing && !IsAnimating(ANIM_TYPE_WINDOW_CLOSE)) || ++ g_application.IsHeadless()) + return; + + // set running before it's added to the window manager, else the auto-show code +diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp +index 2d3c02a..0847ac8 100644 +--- a/xbmc/settings/SettingConditions.cpp ++++ b/xbmc/settings/SettingConditions.cpp +@@ -270,6 +270,9 @@ void CSettingConditions::Initialize() + if (g_application.IsStandAlone()) + m_simpleConditions.insert("isstandalone"); + ++ if (g_application.IsHeadless()) ++ m_simpleConditions.insert("is_headless"); ++ + if(CAEFactory::SupportsQualitySetting()) + m_simpleConditions.insert("has_ae_quality_levels"); + +diff --git a/xbmc/xbmc.cpp b/xbmc/xbmc.cpp +index 366e4b5..87cb32e 100644 +--- a/xbmc/xbmc.cpp ++++ b/xbmc/xbmc.cpp +@@ -80,7 +80,7 @@ extern "C" int XBMC_Run(bool renderGUI) + g_RBP.LogFirmwareVerison(); + #endif + +- if (renderGUI && !g_application.CreateGUI()) ++ if (renderGUI && !g_application.IsHeadless() && !g_application.CreateGUI()) + { + CMessagePrinter::DisplayError("ERROR: Unable to create GUI. Exiting"); + return status; +-- +2.6.0 + + diff --git a/docker/init/30_get_source.sh b/docker/init/30_get_source.sh index 3782b38..c770d8c 100644 --- a/docker/init/30_get_source.sh +++ b/docker/init/30_get_source.sh @@ -1,8 +1,19 @@ #!/bin/bash -mkdir -p /source +mkdir -p /source /build/source [[ -d /source/kodi/.git ]] && rm -rf /source/kodi -git clone https://github.com/xbmc/xbmc.git /source/kodi & +if [ ! -d "/builds/source/.git" ]; then +git clone https://github.com/xbmc/xbmc.git /builds/source & pid="$!" wait "$pid" +else +cd /builds/source +git pull +fi + +cp -pr /builds/source /source/kodi + +chown -R abc:abc /builds + + diff --git a/docker/init/50_build_kodi.sh b/docker/init/50_build_kodi.sh index df5ca6c..5132ced 100644 --- a/docker/init/50_build_kodi.sh +++ b/docker/init/50_build_kodi.sh @@ -6,6 +6,12 @@ mkdir -p /project . /defaults/configures/"$kodi_ver"/config_options +if [ "$kodi_ver" == "16" ]; then +cd /source/kodi +make -C tools/depends/target/crossguid PREFIX=/usr/local +make -C tools/depends/target/libdcadec PREFIX=/usr/local +fi + cd /source/kodi ./bootstrap ./configure \ diff --git a/docker/init/60_make_fpm.sh b/docker/init/60_make_fpm.sh index ea0fa21..8e2e180 100644 --- a/docker/init/60_make_fpm.sh +++ b/docker/init/60_make_fpm.sh @@ -5,7 +5,47 @@ kodi_ver="${kodi_version%.*}" cd /builds -if [ "$kodi_ver" == "15" ]; then +if [ "$kodi_ver" == "16" ]; then +fpm -s dir -t deb -n kodi-headless -v "$kodi_version" -C /project \ +-d "libaacs0 (>= 0.7.0-1)" \ +-d "libass4 (>= 0.10.1-3ubuntu1)" \ +-d "libavahi-client3 (>= 0.6.31-4ubuntu1)" \ +-d "libavahi-common-dev (>= 0.6.31-4ubuntu1)" \ +-d "libbluray1 (>= 1:0.5.0-1)" \ +-d "libbz2-ocaml (>= 0.6.0-6build4)" \ +-d "libcurl4-openssl-dev (>= 7.35.0-1ubuntu2.5)" \ +-d "libdbus-1-dev (>= 1.6.18-0ubuntu4.3)" \ +-d "libflac8 (>= 1.3.0-2ubuntu0.14.04.1)" \ +-d "libgle3 (>= 3.1.0-7ubuntu2)" \ +-d "libglew1.10 (>= 1.10.0-3)" \ +-d "libiso9660-8 (>= 0.83-4.1ubuntu1)" \ +-d "libjasper1 (>= 1.900.1-14ubuntu3.2)" \ +-d "libjpeg8 (>= 8c-2ubuntu8)" \ +-d "libjpeg-turbo8 (>= 1.3.0-0ubuntu2)" \ +-d "liblzo2-2 (>= 2.06-1.2ubuntu1.1)" \ +-d "libmicrohttpd10 (>= 0.9.33-1)" \ +-d "libmpeg2-4 (>= 0.5.1-5ubuntu1)" \ +-d "libmysqlclient18 (>= 5.5.44-0ubuntu0.14.04.1)" \ +-d "libnfs1 (>= 1.3.0-2ubuntu1)" \ +-d "libogg0 (>= 1.3.1-1ubuntu1)" \ +-d "libpcrecpp0 (>= 1:8.31-2ubuntu2.1)" \ +-d "libsmbclient (>= 2:4.1.6+dfsg-1ubuntu2.14.04.8)" \ +-d "libssh-4 (>= 0.6.1-0ubuntu3.1)" \ +-d "libtag1c2a (>= 1.9.1-2)" \ +-d "libtag1-vanilla (>= 1.9.1-2)" \ +-d "libtiff5 (>= 4.0.3-7ubuntu0.3)" \ +-d "libtiffxx5 (>= 4.0.3-7ubuntu0.3)" \ +-d "libtinyxml2.6.2 (>= 2.6.2-2)" \ +-d "libvorbis0a (>= 1.3.2-1.3ubuntu1)" \ +-d "libvorbisenc2 (>= 1.3.2-1.3ubuntu1)" \ +-d "libvorbisfile3 (>= 1.3.2-1.3ubuntu1)" \ +-d "libxrandr2 (>= 2:1.4.2-1)" \ +-d "libxslt1.1 (>= 1.1.28-2build1)" \ +-d "libyajl2 (>= 2.0.4-4)" \ +-d "nfs-common (>= 1:1.2.8-6ubuntu1.1)" \ +-d "zip (>= 3.0-8)" . + +elif [ "$kodi_ver" == "15" ]; then fpm -s dir -t deb -n kodi-headless -v "$kodi_version" -C /project \ -d "libaacs0 (>= 0.7.0-1)" \ -d "libass4 (>= 0.10.1-3ubuntu1)" \ diff --git a/docker/pre_build/build_lists/14/build_apps.list b/docker/pre_build/build_lists/14/build_apps.list index cb2ea72..c3dd41b 100644 --- a/docker/pre_build/build_lists/14/build_apps.list +++ b/docker/pre_build/build_lists/14/build_apps.list @@ -31,7 +31,6 @@ libsdl-ocaml-dev \ libsmbclient-dev \ libsqlite3-dev \ libssh-dev \ -libssl-dev \ libtag1-dev \ libtiff5-dev \ libtinyxml-dev \ diff --git a/docker/pre_build/build_lists/15/build_apps.list b/docker/pre_build/build_lists/15/build_apps.list index 1d80be5..5e01d58 100644 --- a/docker/pre_build/build_lists/15/build_apps.list +++ b/docker/pre_build/build_lists/15/build_apps.list @@ -28,7 +28,6 @@ libpcre3-dev \ libsmbclient-dev \ libsqlite3-dev \ libssh-dev \ -libssl-dev \ libtag1-dev \ libtiff5-dev \ libtinyxml-dev \ diff --git a/docker/pre_build/build_lists/16/build_apps.list b/docker/pre_build/build_lists/16/build_apps.list new file mode 100644 index 0000000..a5bb032 --- /dev/null +++ b/docker/pre_build/build_lists/16/build_apps.list @@ -0,0 +1,45 @@ +INPUT_APTLIST="autoconf \ +automake \ +autopoint \ +cmake \ +doxygen \ +gawk \ +gperf \ +libass-dev \ +libavahi-client-dev \ +libbluray-dev \ +libboost1.54-dev \ +libbz2-ocaml-dev \ +libcurl4-openssl-dev \ +libflac-dev \ +libgif-dev \ +libgle3-dev \ +libglew-dev \ +libgnutls-dev \ +libiso9660-dev \ +libjasper-dev \ +libjpeg-dev \ +liblzo2-dev \ +libmicrohttpd-dev \ +libmpeg2-4-dev \ +libmysqlclient-dev \ +libnfs-dev \ +libpcre3-dev \ +libsmbclient-dev \ +libsqlite3-dev \ +libssh-dev \ +libtag1-dev \ +libtiff5-dev \ +libtinyxml-dev \ +libtool \ +libvorbis-dev \ +libxml2-dev \ +libxrandr-dev \ +libxslt-dev \ +libyajl-dev \ +openjdk-7-jre-headless \ +swig \ +yasm \ +uuid-dev \ +zip" +