diff -ruN text2skin-1.3/Makefile text2skin-1.3-darwin/Makefile
--- text2skin-1.3/Makefile	2009-07-17 02:16:35.000000000 +0300
+++ text2skin-1.3-darwin/Makefile	2010-04-19 21:58:44.000000000 +0300
@@ -24,6 +24,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')
@@ -31,13 +33,20 @@
 ### The C++ compiler and options:
 
 CXX      ?= g++
+ifeq ($(APPLE_DARWIN), 1)
+CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -fno-common -bundle -flat_namespace -undefined suppress -arch i386
+else
 CXXFLAGS ?= -fPIC -Wall -Woverloaded-virtual
+endif
 
 ### The directory environment:
 
 VDRDIR = ../../..
 LIBDIR = ../../lib
 TMPDIR = /tmp
+ifeq ($(APPLE_DARWIN), 1)
+LIBDIRS  = -L/sw/lib -L/usr/X11R6/lib -L/opt/local/lib
+endif
 
 ### Allow user defined options to overwrite defaults:
 
@@ -94,6 +103,9 @@
 endif
 
 INCLUDES += -I$(VDRDIR)/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)"'
 
@@ -140,11 +152,16 @@
 ### Targets:
 
 libvdr-$(PLUGIN).so: $(OBJS)
-	$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
+ifeq ($(APPLE_DARWIN), 1)
+	$(CXX) $(CXXFLAGS) -dynamic $(OBJS) $(LIBS) $(LIBDIRS) -o $@
+	@cp $@ $(LIBDIR)/$@.$(APIVERSION)
+else
+    $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
 	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
-ifndef DEBUG
-	$(STRIP) $(LIBDIR)/$@.$(APIVERSION)
 endif
+#ifndef DEBUG
+#	$(STRIP) $(LIBDIR)/$@.$(APIVERSION)
+#endif
 
 dist: clean
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
diff -ruN text2skin-1.3/bitmap.c text2skin-1.3-darwin/bitmap.c
--- text2skin-1.3/bitmap.c	2009-07-17 02:16:35.000000000 +0300
+++ text2skin-1.3-darwin/bitmap.c	2010-04-18 11:37:37.000000000 +0300
@@ -35,10 +35,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;
@@ -71,8 +73,10 @@
 			res->SetAlpha(Alpha);
 		else
 			DELETENULL(res);
+#ifndef __APPLE__
 		mCache[spec] = res;
 	}
+#endif
 	return res;
 }
 
diff -ruN text2skin-1.3/cache.h text2skin-1.3-darwin/cache.h
--- text2skin-1.3/cache.h	2009-06-01 12:51:53.000000000 +0300
+++ text2skin-1.3-darwin/cache.h	2010-04-18 12:44:30.000000000 +0300
@@ -10,6 +10,12 @@
 #include <vector>
 #include <string>
 
+#ifdef __APPLE__
+#ifndef __MAC_OS_X_VERSION_10_4
+typedef unsigned int	uint;
+#endif
+#endif
+
 template<class key_type, class data_type>
 class cxCache {
 private:
diff -ruN text2skin-1.3/file.c text2skin-1.3-darwin/file.c
--- text2skin-1.3/file.c	2009-06-01 12:51:53.000000000 +0300
+++ text2skin-1.3-darwin/file.c	2010-04-18 11:37:37.000000000 +0300
@@ -4,7 +4,10 @@
 
 #include "file.h"
 #include <unistd.h>
-
+#ifdef __APPLE__
+#include <vdr/darwinutils.h>
+#endif
+ 
 cText2SkinFile::cText2SkinFile(const char *Skin) {
 	mSkin = Skin;
 }
@@ -22,8 +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) {
-				line++;
+#endif				line++;
 				char *ptr = skipspace(stripspace(buffer));
 				if (!isempty(ptr) && ptr[0] != '#') {
 					if (!Parse(ptr)) {

