SDL_Pango: init at 0.1.2

This commit is contained in:
Puck Meerburg 2019-10-23 11:33:13 +00:00
parent ea8686e253
commit b4ce8c3642
3 changed files with 182 additions and 0 deletions

View File

@ -0,0 +1,32 @@
{ stdenv, fetchpatch, fetchurl, SDL, autoreconfHook, pango, pkgconfig }:
stdenv.mkDerivation rec {
pname = "SDL_Pango";
version = "0.1.2";
src = fetchurl {
url = "mirror://sourceforge/sdlpango/${pname}-${version}.tar.gz";
sha256 = "197baw1dsg0p4pljs5k0fshbyki00r4l49m1drlpqw6ggawx6xbz";
};
patches = [
(fetchpatch {
url = https://sources.debian.org/data/main/s/sdlpango/0.1.2-6/debian/patches/api_additions.patch;
sha256 = "00p5ry5gd3ixm257p9i2c4jg0qj8ipk8nf56l7c9fma8id3zxyld";
})
./fixes.patch
];
preConfigure = "autoreconf -i -f";
nativeBuildInputs = [ pkgconfig autoreconfHook ];
buildInputs = [ SDL pango ];
meta = with stdenv.lib; {
description = "Connects the Pango rendering engine to SDL";
license = licenses.lgpl21Plus;
platforms = platforms.all;
homepage = http://sdlpango.sourceforge.net/;
maintainers = with maintainers; [ puckipedia ];
};
}

View File

@ -0,0 +1,148 @@
diff --git a/SDL_Pango.pc.in b/SDL_Pango.pc.in
index 750d091..3af38ff 100644
--- a/SDL_Pango.pc.in
+++ b/SDL_Pango.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
Name: SDL_Pango
Description: SDL library for internationalized text rendering
Version: @VERSION@
-Requires: pango
+Requires: pango pangoft2
Libs: -L${libdir} -lSDL_Pango
Cflags: -I${includedir}
\ No newline at end of file
diff --git a/src/SDL_Pango.c b/src/SDL_Pango.c
index b969bc1..cc2c3f5 100644
--- a/src/SDL_Pango.c
+++ b/src/SDL_Pango.c
@@ -231,6 +231,41 @@
#include "SDL_Pango.h"
+const SDLPango_Matrix _MATRIX_WHITE_BACK
+ = {255, 0, 0, 0,
+ 255, 0, 0, 0,
+ 255, 0, 0, 0,
+ 255, 255, 0, 0,};
+const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK;
+
+const SDLPango_Matrix _MATRIX_BLACK_BACK
+ = {0, 255, 0, 0,
+ 0, 255, 0, 0,
+ 0, 255, 0, 0,
+ 255, 255, 0, 0,};
+const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK;
+
+const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
+ = {0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 255, 0, 0,};
+const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
+
+const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
+ = {255, 255, 0, 0,
+ 255, 255, 0, 0,
+ 255, 255, 0, 0,
+ 0, 255, 0, 0,};
+const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
+
+const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
+ = {255, 255, 0, 0,
+ 255, 255, 0, 0,
+ 255, 255, 0, 0,
+ 0, 0, 0, 0,};
+const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
+
//! non-zero if initialized
static int IS_INITIALIZED = 0;
diff --git a/src/SDL_Pango.h b/src/SDL_Pango.h
index 6ebdf78..b7e5e58 100644
--- a/src/SDL_Pango.h
+++ b/src/SDL_Pango.h
@@ -47,57 +47,32 @@ typedef struct _SDLPango_Matrix {
Uint8 m[4][4]; /*! Matrix variables */
} SDLPango_Matrix;
-const SDLPango_Matrix _MATRIX_WHITE_BACK
- = {255, 0, 0, 0,
- 255, 0, 0, 0,
- 255, 0, 0, 0,
- 255, 255, 0, 0,};
/*!
Specifies white back and black letter.
*/
-const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK;
+extern const SDLPango_Matrix *MATRIX_WHITE_BACK;
-const SDLPango_Matrix _MATRIX_BLACK_BACK
- = {0, 255, 0, 0,
- 0, 255, 0, 0,
- 0, 255, 0, 0,
- 255, 255, 0, 0,};
/*!
Specifies black back and white letter.
*/
-const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK;
+extern const SDLPango_Matrix *MATRIX_BLACK_BACK;
-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
- = {0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 255, 0, 0,};
/*!
Specifies transparent back and black letter.
*/
-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
+extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
- = {255, 255, 0, 0,
- 255, 255, 0, 0,
- 255, 255, 0, 0,
- 0, 255, 0, 0,};
/*!
Specifies transparent back and white letter.
*/
-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
+extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
- = {255, 255, 0, 0,
- 255, 255, 0, 0,
- 255, 255, 0, 0,
- 0, 0, 0, 0,};
/*!
Specifies transparent back and transparent letter.
This is useful for KARAOKE like rendering.
*/
-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
+extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
/*!
Specifies direction of text. See Pango reference for detail
@@ -186,7 +161,8 @@ extern DECLSPEC void SDLCALL SDLPango_SetBaseDirection(
SDLPango_Direction direction);
-#ifdef __FT2_BUILD_UNIX_H__
+
+#ifdef __PANGO_H__
extern DECLSPEC void SDLCALL SDLPango_CopyFTBitmapToSurface(
const FT_Bitmap *bitmap,
@@ -194,11 +170,8 @@ extern DECLSPEC void SDLCALL SDLPango_CopyFTBitmapToSurface(
const SDLPango_Matrix *matrix,
SDL_Rect *rect);
-#endif /* __FT2_BUILD_UNIX_H__ */
-#ifdef __PANGO_H__
-
extern DECLSPEC PangoFontMap* SDLCALL SDLPango_GetPangoFontMap(
SDLPango_Context *context);

View File

@ -13645,6 +13645,8 @@ in
SDL_net = callPackage ../development/libraries/SDL_net { };
SDL_Pango = callPackage ../development/libraries/SDL_Pango {};
SDL_sound = callPackage ../development/libraries/SDL_sound { };
SDL_stretch= callPackage ../development/libraries/SDL_stretch { };