diff -ruN text2skin-cvs20080303-orig/Makefile text2skin-cvs20080303-darwin/Makefile
--- text2skin-cvs20080303-orig/Makefile	2005-01-27 19:32:07.000000000 +0200
+++ text2skin-cvs20080303-darwin/Makefile	2008-10-12 20:17:37.000000000 +0300
@@ -7,7 +7,7 @@
 
 # comment this out if you don't want to use FreeType font rendering
 
-HAVE_FREETYPE=1
+#HAVE_FREETYPE=1
 
 
 # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING
@@ -22,6 +22,8 @@
 #
 PLUGIN = text2skin
 
+APPLE_DARWIN = $(shell gcc -dumpmachine | grep -q 'apple-darwin' && echo "1" || echo "0")
+
 ### The version number of this plugin (taken from the main source file):
 
 VERSION = $(shell grep 'const char \*cText2SkinPlugin::VERSION *=' $(PLUGIN).c | awk '{ print $$5 }' | sed -e 's/[";]//g')
@@ -29,18 +31,25 @@
 ### The C++ compiler and options:
 
 CXX      ?= g++
-CXXFLAGS ?= -Wall -Woverloaded-virtual
+ifeq ($(APPLE_DARWIN), 1)
+CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses -fno-common -bundle -flat_namespace -undefined suppress
+else
+CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
+endif
 
 ### The directory environment:
 
 DVBDIR = ../../../../DVB
 VDRDIR = ../../..
 LIBDIR = ../../lib
+ifeq ($(APPLE_DARWIN), 1)
+LIBDIRS  = -L/sw/lib -L/usr/X11R6/lib -L/opt/local/lib
+endif
 TMPDIR = /tmp
 
-### The version number of VDR (taken from VDR's "config.h"):
+### The version number of VDR's plugin API (taken from VDR's "config.h"):
 
-VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
+APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
 
 ### The name of the distribution archive:
 
@@ -69,7 +78,11 @@
 
 ifdef HAVE_IMAGEMAGICK
 	DEFINES += -DHAVE_IMAGEMAGICK
+ifeq ($(APPLE_DARWIN), 1)
+	LIBS += -lMagick++
+else
 	LIBS += -lMagick -lMagick++
+endif
 #	LIBS += $(shell Magick++-config --ldflags --libs)
 endif
 
@@ -78,7 +91,7 @@
 		INCLUDES += $(shell freetype-config --cflags)
 		LIBS += $(shell freetype-config --libs)
 	else
-		INCLUDES += -I/usr/include/freetype -I/usr/local/include/freetype
+		INCLUDES += -I/usr/include/freetype -I/usr/local/include/freetype 
 		LIBS += -lfreetype
 	endif
 	DEFINES += -DHAVE_FREETYPE
@@ -96,6 +109,9 @@
 endif
 
 INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/linux/include -I$(DVBDIR)/include -I.
+ifeq ($(APPLE_DARWIN), 1)
+INCLUDES += -I/sw/include -I/opt/local/include -I/opt/local/include/ImageMagick -I/sw/include/ImageMagick
+endif
 
 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
 
@@ -118,11 +134,15 @@
 all: libvdr-$(PLUGIN).so
 
 libvdr-$(PLUGIN).so: $(OBJS)
+ifeq ($(APPLE_DARWIN), 1)
+	$(CXX) $(CXXFLAGS) -dynamic $(OBJS) $(LIBS) $(LIBDIRS) -o $@
+else
 	$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
-	@cp $@ $(LIBDIR)/$@.$(VDRVERSION)
-ifndef DEBUG
-	strip $(LIBDIR)/$@.$(VDRVERSION)
 endif
+	@cp $@ $(LIBDIR)/$@.$(APIVERSION)
+#ifndef DEBUG
+#	strip $(LIBDIR)/$@.$(APIVERSION)
+#endif
 
 dist: clean
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
diff -ruN text2skin-cvs20080303-orig/bitmap.c text2skin-cvs20080303-darwin/bitmap.c
--- text2skin-cvs20080303-orig/bitmap.c	2005-06-03 11:54:10.000000000 +0300
+++ text2skin-cvs20080303-darwin/bitmap.c	2008-10-12 20:03:49.000000000 +0300
@@ -36,10 +36,12 @@
 	std::string fname = Filename;
 
 	cText2SkinBitmap *res = NULL;
+#ifndef __APPLE__
 	if (mCache.Contains(spec)) {
 		res = mCache[spec];
 		Dprintf("..cache ok\n");
 	} else {
+#endif
 		int pos;
 		if ((pos = fname.find('*')) != -1) {
 			glob_t gbuf;
@@ -69,7 +71,8 @@
 				result = res->LoadMagick(fname.c_str(),height,width,colors, Quiet);
 #	else
 				if (!Quiet)
-					esyslog("ERROR: text2skin: unknown file format for %s", fname);
+					//esyslog("ERROR: text2skin: unknown file format for %s", fname);
+					;
 #	endif
 #endif
 			}
@@ -81,8 +84,10 @@
 			res->SetAlpha(Alpha);
 		else
 			DELETENULL(res);
+#ifndef __APPLE__
 		mCache[spec] = res;
 	}
+#endif
 	return res;
 }
 
diff -ruN text2skin-cvs20080303-orig/cache.h text2skin-cvs20080303-darwin/cache.h
--- text2skin-cvs20080303-orig/cache.h	2005-01-31 16:40:29.000000000 +0200
+++ text2skin-cvs20080303-darwin/cache.h	2008-10-12 20:03:49.000000000 +0300
@@ -9,6 +9,10 @@
 #include <vector>
 #include <string>
 
+#ifdef __MAC_OS_X_VERSION_10_5
+typedef unsigned int	uint;
+#endif
+
 template<class key_type, class data_type>
 class cxCache {
 private:
diff -ruN text2skin-cvs20080303-orig/file.c text2skin-cvs20080303-darwin/file.c
--- text2skin-cvs20080303-orig/file.c	2005-11-06 17:58:30.000000000 +0200
+++ text2skin-cvs20080303-darwin/file.c	2008-10-12 20:03:49.000000000 +0300
@@ -4,6 +4,9 @@
 
 #include "file.h"
 #include <unistd.h>
+#ifdef __APPLE__
+#include <vdr/darwinutils.h>
+#endif
 
 cText2SkinFile::cText2SkinFile(const char *Skin) {
 	mSkin = Skin;
@@ -22,7 +25,11 @@
 			char *buffer = NULL;
 			size_t buflen = 0;
 			result = true;
+#ifdef __APPLE__
+			while (getline_darwin(&buffer, &buflen, f) != -1) {
+#else
 			while (getline(&buffer, &buflen, f) != -1) {
+#endif
 				line++;
 				char *ptr = skipspace(stripspace(buffer));
 				if (!isempty(ptr) && ptr[0] != '#') {
diff -ruN text2skin-cvs20080303-orig/font.c text2skin-cvs20080303-darwin/font.c
--- text2skin-cvs20080303-orig/font.c	2005-01-05 21:29:10.000000000 +0200
+++ text2skin-cvs20080303-darwin/font.c	2008-10-12 20:03:49.000000000 +0300
@@ -31,8 +31,13 @@
 	const cFont *res = NULL;
 #ifdef HAVE_FREETYPE
 	char *cachename;
+#if VDRVERSNUM >= 10507
+	asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, I18nCurrentLanguage());
+	if (mFontCache.Load(Path + "/" + Filename, cachename, Size, I18nCurrentLanguage(), Width))
+#else
 	asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, Setup.OSDLanguage);
 	if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage, Width))
+#endif
 		res = mFontCache.GetFont(cachename);
 	else
 		esyslog("ERROR: Text2Skin: Couldn't load font %s:%d", Filename.c_str(), Size);
diff -ruN text2skin-cvs20080303-orig/graphtft/font.c text2skin-cvs20080303-darwin/graphtft/font.c
--- text2skin-cvs20080303-orig/graphtft/font.c	2005-01-30 20:09:42.000000000 +0200
+++ text2skin-cvs20080303-darwin/graphtft/font.c	2008-10-12 20:03:49.000000000 +0300
@@ -102,7 +102,12 @@
 		char char_buff = c;
 		wchar_t wchar_buff;
 
+#ifdef __APPLE__
+		const char *in_buff;
+		char *out_buff;
+#else
 		char *in_buff,*out_buff;
+#endif
 		size_t in_len, out_len, count;
 
 		in_len=1; out_len=4;
diff -ruN text2skin-cvs20080303-orig/i18n.c text2skin-cvs20080303-darwin/i18n.c
--- text2skin-cvs20080303-orig/i18n.c	2005-05-30 12:23:41.000000000 +0300
+++ text2skin-cvs20080303-darwin/i18n.c	2008-10-12 20:03:49.000000000 +0300
@@ -166,7 +166,11 @@
 
 cText2SkinI18n::~cText2SkinI18n() {
 	for (int i = 0; mPhrases[i][0]; ++i) {
+#if VDRVERSNUM >= 10507
+		for (int j = 0; j < I18nLanguages()->Size(); ++j)
+#else
 		for (int j = 0; j < I18nNumLanguages; ++j)
+#endif
 			free((void*)mPhrases[i][j]);
 	}
 	free(mPhrases);
@@ -182,7 +186,11 @@
 			memset(&p, 0, sizeof(tI18nPhrase));
 			Text += 17;
 
+#if VDRVERSNUM >= 10507
+			for (i = 0; i < I18nLanguages()->Size(); ++i) {
+#else
 			for (i = 0; i < I18nNumLanguages; ++i) {
+#endif
 				char *langs = strdup(I18nLanguageCode(i));
 				char *ptr = langs, *ep;
 				std::string text;
@@ -200,7 +208,11 @@
 			}
 
 			int idx = mNumPhrases++;
+#if VDRVERSNUM >= 10507
+			for (i = 0; i < I18nLanguages()->Size(); ++i)
+#else
 			for (i = 0; i < I18nNumLanguages; ++i)
+#endif
 				if (!p[i]) p[i] = "";
 			mPhrases = (tI18nPhrase*)realloc(mPhrases, (mNumPhrases + 1) * sizeof(tI18nPhrase));
 			memcpy(mPhrases[idx], p, sizeof(tI18nPhrase));
@@ -214,7 +226,9 @@
 
 bool cText2SkinI18n::Load(const std::string &Filename) {
 	if (cText2SkinFile::Load(Filename)) {
+#if VDRVERSNUM <= 10506
 		I18nRegister(mPhrases, mIdentity.c_str());
+#endif
 		return true;
 	}
 	return false;
diff -ruN text2skin-cvs20080303-orig/status.c text2skin-cvs20080303-darwin/status.c
--- text2skin-cvs20080303-orig/status.c	2006-03-17 20:25:57.000000000 +0200
+++ text2skin-cvs20080303-darwin/status.c	2008-10-12 20:03:49.000000000 +0300
@@ -109,8 +109,13 @@
 
 void cText2SkinStatus::OsdClear(void) 
 {
+#if VDRVERSNUM >= 10507
+	if (I18nCurrentLanguage() != mLastLanguage) {
+		mLastLanguage = I18nCurrentLanguage();
+#else
 	if (Setup.OSDLanguage != mLastLanguage) {
 		mLastLanguage = Setup.OSDLanguage;
+#endif
 		cxString::Reparse();
 	}
 }
diff -ruN text2skin-cvs20080303-orig/text2skin.c text2skin-cvs20080303-darwin/text2skin.c
--- text2skin-cvs20080303-orig/text2skin.c	2005-05-30 13:09:50.000000000 +0300
+++ text2skin-cvs20080303-darwin/text2skin.c	2008-10-12 20:03:49.000000000 +0300
@@ -25,7 +25,11 @@
 
 bool cText2SkinPlugin::Start(void) {
 	RegisterI18n(Phrases);
+#if VDRVERSNUM >= 10507
+	Text2SkinStatus.SetLanguage(I18nCurrentLanguage());
+#else
 	Text2SkinStatus.SetLanguage(Setup.OSDLanguage);
+#endif
 	cText2SkinLoader::Start();
 	return true;
 }

