From 75eae264c5b74e1dbd6398a0c5f7d249de2632aa Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 11 Feb 2017 16:24:20 +0100
Subject: applying patch sge-030809.patch


diff --git a/Makefile b/Makefile
index a35cfa0..88b69c0 100644
--- a/Makefile
+++ b/Makefile
@@ -71,13 +71,13 @@ endif
 endif
 
 install:	shared
-	@mkdir -p $(PREFIX_H)
-	install -c -m 644 sge*.h $(PREFIX_H)
-	@mkdir -p $(PREFIX)/lib
-	install -c -m 644 libSGE.a $(PREFIX)/lib
-	install -c libSGE.so $(PREFIX)/lib/libSGE.so.$(API_VER).$(SGE_VER)
-	@cd $(PREFIX)/lib;\
+	@mkdir -p $(DESTDIR)$(PREFIX_H)
+	install -c -m 644 sge*.h $(DESTDIR)$(PREFIX_H)
+	@mkdir -p $(DESTDIR)$(PREFIX)/lib
+	install -c -m 644 libSGE.a $(DESTDIR)$(PREFIX)/lib
+	install -c libSGE.so $(DESTDIR)$(PREFIX)/lib/libSGE.so.$(API_VER).$(SGE_VER)
+	@cd $(DESTDIR)$(PREFIX)/lib;\
 	ln -sf libSGE.so.$(API_VER).$(SGE_VER) libSGE.so.$(API_VER);\
 	ln -sf libSGE.so.$(API_VER) libSGE.so
-	@echo "** Headerfiles installed in $(PREFIX_H)"
-	@echo "** Library files installed in $(PREFIX)/lib"
+	@echo "** Headerfiles installed in $(DESTDIR)$(PREFIX_H)"
+	@echo "** Library files installed in $(DESTDIR)$(PREFIX)/lib"
diff --git a/Makefile.conf b/Makefile.conf
index 50dcea3..18f9244 100644
--- a/Makefile.conf
+++ b/Makefile.conf
@@ -3,8 +3,8 @@
 # Comment/uncomment the following line to disable/enable build options
 # (See README for more info)
 C_COMP = y
-#USE_FT = n
-#USE_IMG = n
+USE_FT = y
+USE_IMG = y
 #QUIET = y
 
 
@@ -25,14 +25,14 @@ PREFIX =$(shell sdl-config --prefix)
 PREFIX_H =$(shell sdl-config --prefix)/include/SDL
 
 # Flags passed to the compiler
-CFLAGS =-Wall -O3 -ffast-math
+CFLAGS =-Wall -O0 -ffast-math
 SGE_CFLAGS =$(shell sdl-config --cflags)
 # Uncomment to make some more optimizations
 #CFLAGS =-Wall -O9 -ffast-math -march=i686
 
 
 # Libs config
-SGE_LIBS =$(shell sdl-config --libs) -lstdc++
+SGE_LIBS =$(shell sdl-config --libs)
 
 
 # Is freetype-config available?
diff --git a/sge_tt_text.cpp b/sge_tt_text.cpp
index c7d4b2c..befde47 100644
--- a/sge_tt_text.cpp
+++ b/sge_tt_text.cpp
@@ -36,10 +36,9 @@
 #include "sge_textpp.h"
 
 #ifndef _SGE_NOTTF
-#include <freetype/freetype.h>
-#include <freetype/ftoutln.h>
-#include <freetype/ttnameid.h>
-#include <freetype/internal/ftobjs.h>
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_OUTLINE_H
 
 /* The structure used to hold glyph information (cached) */
 struct glyph {
@@ -294,7 +293,7 @@ sge_TTFont *sge_TTF_OpenFontIndexRW(SDL_RWops *src, int freesrc, int ptsize, lon
 	}
 	memset(stream, 0, sizeof(*stream));
 
-	stream->memory = _sge_library->memory;
+	stream->memory = NULL;
 	stream->read = RWread;
 	stream->descriptor.pointer = src;
 	stream->pos = (unsigned long)position;
-- 
2.7.0


From 2b0006d74bfe04167e0fa3960c59a07e92d6b8c4 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 11 Feb 2017 16:28:57 +0100
Subject: Fix install dir for secondary architecture.


diff --git a/Makefile b/Makefile
index 88b69c0..7708d26 100644
--- a/Makefile
+++ b/Makefile
@@ -73,11 +73,11 @@ endif
 install:	shared
 	@mkdir -p $(DESTDIR)$(PREFIX_H)
 	install -c -m 644 sge*.h $(DESTDIR)$(PREFIX_H)
-	@mkdir -p $(DESTDIR)$(PREFIX)/lib
-	install -c -m 644 libSGE.a $(DESTDIR)$(PREFIX)/lib
-	install -c libSGE.so $(DESTDIR)$(PREFIX)/lib/libSGE.so.$(API_VER).$(SGE_VER)
-	@cd $(DESTDIR)$(PREFIX)/lib;\
+	@mkdir -p $(DESTDIR)$(LIBDIR)
+	install -c -m 644 libSGE.a $(DESTDIR)$(LIBDIR)
+	install -c libSGE.so $(DESTDIR)$(LIBDIR)/libSGE.so.$(API_VER).$(SGE_VER)
+	@cd $(DESTDIR)$(LIBDIR);\
 	ln -sf libSGE.so.$(API_VER).$(SGE_VER) libSGE.so.$(API_VER);\
 	ln -sf libSGE.so.$(API_VER) libSGE.so
 	@echo "** Headerfiles installed in $(DESTDIR)$(PREFIX_H)"
-	@echo "** Library files installed in $(DESTDIR)$(PREFIX)/lib"
+	@echo "** Library files installed in $(DESTDIR)$(LIBDIR)"
-- 
2.7.0

