Skip to content

Commit

Permalink
binary addons:add visualization.projectm
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansaraev committed Jul 4, 2015
1 parent c597c2d commit ec7075a
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################

PKG_NAME="visualization.projectm"
PKG_VERSION="87b9a6d"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/notspiff/visualization.projectm"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain kodi-platform libprojectM"
PKG_PRIORITY="optional"
PKG_SECTION=""
PKG_SHORTDESC="visualization.projectm"
PKG_LONGDESC="visualization.projectm"
PKG_AUTORECONF="no"

PKG_IS_ADDON="yes"
PKG_ADDON_TYPE="xbmc.player.musicviz"

if [ "$OPENGL" = "no" ] ; then
exit 0
fi

pre_configure_target() {
export LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"`
}

configure_target() {
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_MODULE_PATH=$SYSROOT_PREFIX/usr/lib/kodi \
-DCMAKE_PREFIX_PATH=$SYSROOT_PREFIX/usr \
..
}

addon() {
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/
cp -PR $PKG_BUILD/.install_pkg/usr/share/kodi/addons/$PKG_NAME/* $ADDON_BUILD/$PKG_ADDON_ID/
cp -PL $PKG_BUILD/.install_pkg/usr/lib/kodi/addons/$PKG_NAME/*.so $ADDON_BUILD/$PKG_ADDON_ID/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
From 79c3a7d5e2d3ae0274a7122246a6922b74e8cdaf Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sat, 4 Jul 2015 21:54:09 +0300
Subject: [PATCH] Revert "changed: get rid of DATAPATH definition"

This reverts commit 60467a6492adb32b7487274ceaec4f76c13eec1a.
---
CMakeLists.txt | 2 ++
src/Main.cpp | 28 +++-------------------------
2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77bcb6e..d73d069 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,8 @@ find_package(GLEW REQUIRED)
find_package(ProjectM REQUIRED)

add_definitions(-DHAS_SDL_OPENGL)
+set(DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/xbmc/addons/visualization.projectm/resources")
+add_definitions(-DDATAPATH="${DATA_PATH}")

set(INCLUDES ${OpenGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
diff --git a/src/Main.cpp b/src/Main.cpp
index 449cb85..81205dc 100644
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -55,7 +55,6 @@ d4rk@xbmc.org

#include <kodi/xbmc_vis_dll.h>
#include <kodi/xbmc_addon_cpp_dll.h>
-#include <kodi/libXBMC_addon.h>
#include <GL/glew.h>
#include "libprojectM/projectM.hpp"
#include <string>
@@ -79,8 +78,6 @@ bool lastLockStatus;
int lastPresetIdx;
unsigned int lastLoggedPresetIdx;

-ADDON::CHelper_libXBMC_addon *XBMC = NULL;
-
//-- Create -------------------------------------------------------------------
// Called once when the visualisation is created by XBMC. Do any setup here.
//-----------------------------------------------------------------------------
@@ -89,15 +86,6 @@ extern "C" ADDON_STATUS ADDON_Create(void* hdl, void* props)
if (!props)
return ADDON_STATUS_UNKNOWN;

- if (!XBMC)
- XBMC = new ADDON::CHelper_libXBMC_addon;
-
- if (!XBMC->RegisterMe(hdl))
- {
- delete XBMC, XBMC=NULL;
- return ADDON_STATUS_PERMANENT_FAILURE;
- }
-
VIS_PROPS* visprops = (VIS_PROPS*)props;

strcpy(g_visName, visprops->name);
@@ -109,13 +97,8 @@ extern "C" ADDON_STATUS ADDON_Create(void* hdl, void* props)
g_configPM.windowHeight = visprops->height;
g_configPM.aspectCorrection = true;
g_configPM.easterEgg = 0.0;
- char path[1024];
- XBMC->GetSetting("__addonpath__", path);
- strcat(path,"/resources");
- g_configPM.titleFontURL = path;
- g_configPM.titleFontURL += "/Vera.ttf";
- g_configPM.menuFontURL = path;
- g_configPM.menuFontURL += "/VeraMono.ttf";
+ g_configPM.titleFontURL = DATAPATH"/Vera.ttf";
+ g_configPM.menuFontURL = DATAPATH"/VeraMono.ttf";
lastLoggedPresetIdx = lastPresetIdx;

return ADDON_STATUS_NEED_SAVEDSETTINGS;
@@ -351,12 +334,7 @@ void ChoosePresetPack(int pvalue)
{
g_UserPackFolder = false;
if (pvalue == 0)
- {
- char path[1024];
- XBMC->GetSetting("__addonpath__", path);
- g_configPM.presetURL = path;
- g_configPM.presetURL += "/resources/presets";
- }
+ g_configPM.presetURL = DATAPATH"/presets";
else if (pvalue == 1) //User preset folder has been chosen
g_UserPackFolder = true;
}
--
2.1.4

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 8e396c0586e511b746e377f36817e32413b7c5aa Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca>
Date: Sat, 4 Jul 2015 22:21:19 +0300
Subject: [PATCH] move datapath to /storage

---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d73d069..1043f1a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ find_package(GLEW REQUIRED)
find_package(ProjectM REQUIRED)

add_definitions(-DHAS_SDL_OPENGL)
-set(DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/xbmc/addons/visualization.projectm/resources")
+set(DATA_PATH "/storage/.kodi/addons/visualization.projectm/resources")
add_definitions(-DDATAPATH="${DATA_PATH}")

set(INCLUDES ${OpenGL_INCLUDE_DIR}
--
2.1.4

43 changes: 43 additions & 0 deletions tools/mkpkg/mkpkg_visualization.projectm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################

echo "getting sources..."
if [ ! -d visualization.projectm.git ]; then
git clone https://github.com/notspiff/visualization.projectm.git visualization.projectm.git
fi

cd visualization.projectm.git
git pull
GIT_REV=`git log -n1 --format=%h`
cd ..

echo "copying sources..."
rm -rf visualization.projectm-$GIT_REV
cp -R visualization.projectm.git visualization.projectm-$GIT_REV

echo "cleaning sources..."
rm -rf visualization.projectm-$GIT_REV/.git

echo "packing sources..."
tar cvJf visualization.projectm-$GIT_REV.tar.xz visualization.projectm-$GIT_REV

echo "remove temporary sourcedir..."
rm -rf visualization.projectm-$GIT_REV

0 comments on commit ec7075a

Please sign in to comment.