diff options
author | ryoon <ryoon> | 2014-07-15 14:48:34 +0000 |
---|---|---|
committer | ryoon <ryoon> | 2014-07-15 14:48:34 +0000 |
commit | f135ed46a9f0594c5f850bcf1adcee5c70d17d2d (patch) | |
tree | dcb4ae66ed6e808d4f719d2a3219518a2edb0113 /fonts | |
parent | fbd71657deb254b63f7e21c84e7d4aa3c0805489 (diff) | |
download | pkgsrc-f135ed46a9f0594c5f850bcf1adcee5c70d17d2d.tar.gz |
Fix build under SCO OpenServer 5.0.7/3.2.
It seems that SCO OSR5 does not provide scandir(3), provide custom scandir().
Diffstat (limited to 'fonts')
-rw-r--r-- | fonts/fontconfig/Makefile | 14 | ||||
-rw-r--r-- | fonts/fontconfig/distinfo | 10 | ||||
-rw-r--r-- | fonts/fontconfig/patches/patch-configure | 25 | ||||
-rw-r--r-- | fonts/fontconfig/patches/patch-scandir.c | 142 | ||||
-rw-r--r-- | fonts/fontconfig/patches/patch-src_fccharset.c | 13 | ||||
-rw-r--r-- | fonts/fontconfig/patches/patch-src_fcftint.h | 19 | ||||
-rw-r--r-- | fonts/fontconfig/patches/patch-src_fcint.h | 37 | ||||
-rw-r--r-- | fonts/fontconfig/patches/patch-src_fcstat.c | 13 | ||||
-rw-r--r-- | fonts/fontconfig/patches/patch-test_test-migration.c | 15 |
9 files changed, 280 insertions, 8 deletions
diff --git a/fonts/fontconfig/Makefile b/fonts/fontconfig/Makefile index 8b8a8d1aa0c..58f17e4c05c 100644 --- a/fonts/fontconfig/Makefile +++ b/fonts/fontconfig/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.91 2014/06/01 16:35:33 wiz Exp $ +# $NetBSD: Makefile,v 1.92 2014/07/15 14:48:34 ryoon Exp $ DISTNAME= fontconfig-2.11.1 PKGREVISION= 1 @@ -28,6 +28,18 @@ PKGCONFIG_OVERRIDE= fontconfig.pc.in PKG_SYSCONFSUBDIR= fontconfig +.include "../../mk/compiler.mk" +# Workaround for GCC 4.2 bug, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46861 +# GCC 4.2 and -fPIC with visibility +.if !empty(CC_VERSION:Mgcc-4.2.*) +SUBST_CLASSES+= visibility +SUBST_STAGE.visibility= pre-configure +SUBST_MESSAGE.visibility= Removing visibility +SUBST_FILES.visibility= src/makealias +SUBST_SED.visibility= -e 's/__attribute((visibility("hidden")))//g' +SUBST_SED.visibility+= -e 's/, visibility("default")//g' +.endif + .include "../../mk/bsd.prefs.mk" ADDFONTS= ${PREFIX}/share/fonts/urw,${PREFIX}/share/ghostscript/fonts,${PREFIX}/share/fonts/X11 diff --git a/fonts/fontconfig/distinfo b/fonts/fontconfig/distinfo index 0c667c75551..ad33141bb0a 100644 --- a/fonts/fontconfig/distinfo +++ b/fonts/fontconfig/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.49 2014/04/01 21:21:28 wiz Exp $ +$NetBSD: distinfo,v 1.50 2014/07/15 14:48:34 ryoon Exp $ SHA1 (fontconfig-2.11.1.tar.bz2) = 08565feea5a4e6375f9d8a7435dac04e52620ff2 RMD160 (fontconfig-2.11.1.tar.bz2) = 9d0a242ec05737f5dba3949ffe095f3c100217c7 @@ -6,4 +6,10 @@ Size (fontconfig-2.11.1.tar.bz2) = 1516095 bytes SHA1 (patch-aa) = ae9a465321dcaee634faf016e2dd01e2f544af12 SHA1 (patch-ac) = 4a0b7b55aa4b5c106fd256c4ef81df2240224803 SHA1 (patch-af) = d351265c894738284215f0bb38d47cc1c8f28ec7 -SHA1 (patch-src_fcstat.c) = 9cb2d9b656bcb79d33be84a053e928ecf957dfd7 +SHA1 (patch-configure) = f03b6a4e6223b035ea6f19710f8130164e51c5a8 +SHA1 (patch-scandir.c) = 9711a60a4a952c50e7f11328228f52724d18acfa +SHA1 (patch-src_fccharset.c) = f3855554b3b3cab2530b46bc1ccec6a33303de7a +SHA1 (patch-src_fcftint.h) = d629fd7ef9713ccc56800d033ba2e09c5a9e2bff +SHA1 (patch-src_fcint.h) = 13602cc605d7dadd2f7c30633236454bb134a50a +SHA1 (patch-src_fcstat.c) = a4367e7faae72e0531535adaedc7da4365d2b403 +SHA1 (patch-test_test-migration.c) = 0fcbae562f8ebdef807978755c252626ade44a09 diff --git a/fonts/fontconfig/patches/patch-configure b/fonts/fontconfig/patches/patch-configure new file mode 100644 index 00000000000..2b04ecfc2cb --- /dev/null +++ b/fonts/fontconfig/patches/patch-configure @@ -0,0 +1,25 @@ +$NetBSD: patch-configure,v 1.1 2014/07/15 14:48:34 ryoon Exp $ + +--- configure.orig 2014-03-24 06:04:16.000000000 +0000 ++++ configure +@@ -13976,6 +13976,10 @@ $as_echo_n "checking for scandir... " >& + /* end confdefs.h. */ + + #include <dirent.h> ++ #if defined(_SCO_DS) ++ /* bogus */ ++ #include <prot.h> ++ #endif + int main(void); + + int +@@ -14004,6 +14008,9 @@ else + /* end confdefs.h. */ + + #include <dirent.h> ++ #if defined(_SCO_DS) ++ #include <prot.h> ++ #endif + int main(void); + + int diff --git a/fonts/fontconfig/patches/patch-scandir.c b/fonts/fontconfig/patches/patch-scandir.c new file mode 100644 index 00000000000..ac8f7358931 --- /dev/null +++ b/fonts/fontconfig/patches/patch-scandir.c @@ -0,0 +1,142 @@ +$NetBSD: patch-scandir.c,v 1.1 2014/07/15 14:48:34 ryoon Exp $ + +--- scandir.c.orig 2014-07-14 12:36:57.000000000 +0000 ++++ scandir.c +@@ -0,0 +1,137 @@ ++/* -*- Mode: C -*- ++ * Basename: scandir.c ++ * Revision: 1.3.1.5.1.3 ++ * Last Modified By: Ulrich Pfeifer ++ * Last Modified On: Tue May 13 13:15:16 1997 ++ * Language : C ++ * Update Count : 2 ++ * Status : Unknown, Use with caution! ++ * ++ * (C) Copyright 1997, Universität Dortmund, all rights reserved. ++ * (C) Copyright CNIDR (see ../doc/CNIDR/COPYRIGHT) ++ */ ++ ++/* ++Title: COPYRIGHT freeWAIS-0.2 ++Author: Jane Smith ++Copyright: Copyright 1993 CNIDR ++Last update: 10.01.93 ++Abstract: This file contains the copyright statement for freeWAIS 0.2 ++ ++Copyright Statement for freeWAIS 0.2 and subsquent freeWAIS ++releases: ++ ++Copyright (c) MCNC, Clearinghouse for Networked Information Discovery ++and Retrieval, 1993. ++ ++Permission to use, copy, modify, distribute, and sell this software ++and its documentation, in whole or in part, for any purpose is hereby ++granted without fee, provided that ++ ++1. The above copyright notice and this permission notice appear in all ++copies of the software and related documentation. Notices of copyright ++and/or attribution which appear at the beginning of any file included ++in this distribution must remain intact. ++ ++2. Users of this software agree to make their best efforts (a) to ++return to MCNC any improvements or extensions that they make, so that ++these may be included in future releases; and (b) to inform MCNC/CNIDR ++of noteworthy uses of this software. ++ ++3. The names of MCNC and Clearinghouse for Networked Information ++Discovery and Retrieval may not be used in any advertising or publicity ++relating to the software without the specific, prior written permission ++of MCNC/CNIDR. ++ ++THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, ++EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY ++WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ++ ++IN NO EVENT SHALL MCNC/CNIDR BE LIABLE FOR ANY SPECIAL, INCIDENTAL, ++INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER ++RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF ++THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT ++OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++*/ ++ ++/* ++ * SCANDIR ++ * Scan a directory, collecting all (selected) items into a an array. ++ */ ++ ++#include <stdio.h> ++#include <dirent.h> ++#include <stdlib.h> ++#include <string.h> ++ ++#ifdef DIRNAMLEN ++#define NLENGTH(dirent) ((dirent)->d_namlen) ++#else /* not DIRNAMLEN */ ++#define NLENGTH(dirent) (strlen((dirent)->d_name)) ++#endif /* not DIRNAMLEN */ ++ ++/* Initial guess at directory size. */ ++#define INITIAL_SIZE 20 ++ ++int ++scandir(name, list, selector, sorter) ++ char *name; ++ dirent_t ***list; ++ int (*selector)(); ++ int (*sorter)(); ++{ ++ register dirent_t **names; ++ register dirent_t *entp; ++ register DIR *dirp; ++ register int i; ++ register int size; ++ ++ /* Get initial list space and open directory. */ ++ size = INITIAL_SIZE; ++ names = (dirent_t **)malloc(size * sizeof names[0]); ++ if (names == NULL) ++ return -1; ++ dirp = opendir(name); ++ if (dirp == NULL) ++ return -1; ++ ++ /* Read entries in the directory. */ ++ for (i = 0; entp = readdir(dirp); ) ++ if (selector == NULL || (*selector)(entp)) { ++ /* User wants them all, or he wants this one. */ ++ if (++i >= size) { ++ size <<= 1; ++ names = (dirent_t **) ++ realloc((char *)names, size * sizeof names[0]); ++ if (names == NULL) { ++ closedir(dirp); ++ return -1; ++ } ++ } ++ ++ /* Copy the entry. */ ++ names[i - 1] = (dirent_t *)malloc(sizeof(dirent_t) ++ + NLENGTH(entp)+1); ++ if (names[i - 1] == NULL) { ++ closedir(dirp); ++ return -1; ++ } ++ names[i - 1]->d_ino = entp->d_ino; ++ names[i - 1]->d_reclen = entp->d_reclen; ++#ifdef DIRNAMLEN ++ names[i - 1]->d_namlen = entp->d_namlen; ++#endif ++ (void)strcpy(names[i - 1]->d_name, entp->d_name); ++ } ++ ++ /* Close things off. */ ++ names[i] = NULL; ++ *list = names; ++ closedir(dirp); ++ ++ /* Sort? */ ++ if (i && sorter) ++ qsort((char *)names, i, sizeof names[0], sorter); ++ ++ return i; ++} diff --git a/fonts/fontconfig/patches/patch-src_fccharset.c b/fonts/fontconfig/patches/patch-src_fccharset.c new file mode 100644 index 00000000000..e9c717d668f --- /dev/null +++ b/fonts/fontconfig/patches/patch-src_fccharset.c @@ -0,0 +1,13 @@ +$NetBSD: patch-src_fccharset.c,v 1.1 2014/07/15 14:48:34 ryoon Exp $ + +--- src/fccharset.c.orig 2014-01-20 08:14:20.000000000 +0000 ++++ src/fccharset.c +@@ -569,7 +569,7 @@ FcCharSetHasChar (const FcCharSet *fcs, + static FcChar32 + FcCharSetPopCount (FcChar32 c1) + { +-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) ++#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && !defined(_SCO_DS) + return __builtin_popcount (c1); + #else + /* hackmem 169 */ diff --git a/fonts/fontconfig/patches/patch-src_fcftint.h b/fonts/fontconfig/patches/patch-src_fcftint.h new file mode 100644 index 00000000000..e71f6d61ad0 --- /dev/null +++ b/fonts/fontconfig/patches/patch-src_fcftint.h @@ -0,0 +1,19 @@ +$NetBSD: patch-src_fcftint.h,v 1.1 2014/07/15 14:48:34 ryoon Exp $ + +--- src/fcftint.h.orig 2014-01-20 08:14:20.000000000 +0000 ++++ src/fcftint.h +@@ -25,7 +25,13 @@ + + #include <fontconfig/fcfreetype.h> + +-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun) ++/* Bug of GCC 4.2 (visibility and -fPIC) ++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46861 */ ++#if (__GNUC__ == 4 && __GNUC_MINOR__ == 2) && defined(__ELF__) && !defined(__sun) ++#define FcPrivate ++#define HAVE_GNUC_ATTRIBUTE 1 ++#include "fcftalias.h" ++#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2) + #define FcPrivate __attribute__((__visibility__("hidden"))) + #define HAVE_GNUC_ATTRIBUTE 1 + #include "fcftalias.h" diff --git a/fonts/fontconfig/patches/patch-src_fcint.h b/fonts/fontconfig/patches/patch-src_fcint.h new file mode 100644 index 00000000000..4209a500c1c --- /dev/null +++ b/fonts/fontconfig/patches/patch-src_fcint.h @@ -0,0 +1,37 @@ +$NetBSD: patch-src_fcint.h,v 1.1 2014/07/15 14:48:34 ryoon Exp $ + +--- src/fcint.h.orig 2014-01-20 08:14:20.000000000 +0000 ++++ src/fcint.h +@@ -68,6 +68,17 @@ extern pfnSHGetFolderPathA pSHGetFolderP + # define FC_DIR_SEPARATOR_S "/" + #endif + ++/* ++ * SCO OpenServer 5.0.7/3.2 has no MAXPATHLEN, but it has PATH_MAX (256). ++ * in limits.h. PATH_MAX is defined alternatively under non-OpenServer OS, ++ * and it is used in dirname.c of bmake. ++ */ ++#if !defined(PATH_MAX) ++#if defined(_SCO_DS) ++#define PATH_MAX 1024 ++#endif ++#endif ++ + #if __GNUC__ >= 4 + #define FC_UNUSED __attribute__((unused)) + #else +@@ -95,7 +106,13 @@ extern pfnSHGetFolderPathA pSHGetFolderP + #define FC_ABS(a) ((a) < 0 ? -(a) : (a)) + + /* slim_internal.h */ +-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun) ++/* Bug of GCC 4.2 (visibility and -fPIC) ++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46861 */ ++#if (__GNUC__ == 4 && __GNUC_MINOR__ == 2) && defined(__ELF__) && !defined(__sun) ++#define FcPrivate ++#define HAVE_GNUC_ATTRIBUTE 1 ++#include "fcalias.h" ++#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2) + #define FcPrivate __attribute__((__visibility__("hidden"))) + #define HAVE_GNUC_ATTRIBUTE 1 + #include "fcalias.h" diff --git a/fonts/fontconfig/patches/patch-src_fcstat.c b/fonts/fontconfig/patches/patch-src_fcstat.c index e88fece5c53..bd5a3485bb6 100644 --- a/fonts/fontconfig/patches/patch-src_fcstat.c +++ b/fonts/fontconfig/patches/patch-src_fcstat.c @@ -1,23 +1,26 @@ -$NetBSD: patch-src_fcstat.c,v 1.3 2013/05/20 19:56:39 adam Exp $ +$NetBSD: patch-src_fcstat.c,v 1.4 2014/07/15 14:48:34 ryoon Exp $ The argument types to scandir(3) differ between different OSes. OpenBSD seems to be still different. I used the provided alphasort instead of rewriting the equivalent sorter function. statvfs and fstatvfs need another include file, at least on MirBSD. ---- src/fcstat.c.orig 2013-01-08 06:42:23.000000000 +0000 +--- src/fcstat.c.orig 2014-03-05 09:27:42.000000000 +0000 +++ src/fcstat.c -@@ -42,6 +42,9 @@ +@@ -42,6 +42,12 @@ #ifdef HAVE_SYS_MOUNT_H #include <sys/mount.h> #endif +#ifdef __MirBSD__ +#include <sys/statvfs.h> +#endif ++#if defined(_SCO_DS) ++#include "../scandir.c" ++#endif #ifdef _WIN32 #ifdef __GNUC__ -@@ -158,7 +161,11 @@ Adler32Finish (struct Adler32 *ctx) +@@ -158,7 +164,11 @@ Adler32Finish (struct Adler32 *ctx) #ifdef HAVE_STRUCT_DIRENT_D_TYPE /* dirent.d_type can be relied upon on FAT filesystem */ static FcBool @@ -29,7 +32,7 @@ statvfs and fstatvfs need another include file, at least on MirBSD. { return entry->d_type != DT_DIR; } -@@ -189,7 +196,11 @@ FcDirChecksum (const FcChar8 *dir, time_ +@@ -197,7 +207,11 @@ FcDirChecksum (const FcChar8 *dir, time_ #else NULL, #endif diff --git a/fonts/fontconfig/patches/patch-test_test-migration.c b/fonts/fontconfig/patches/patch-test_test-migration.c new file mode 100644 index 00000000000..395248a00e2 --- /dev/null +++ b/fonts/fontconfig/patches/patch-test_test-migration.c @@ -0,0 +1,15 @@ +$NetBSD: patch-test_test-migration.c,v 1.4 2014/07/15 14:48:34 ryoon Exp $ + +--- test/test-migration.c.orig 2014-01-20 08:14:21.000000000 +0000 ++++ test/test-migration.c +@@ -153,8 +153,10 @@ main(void) + + strcpy (xdg, tmp); + strcpy (&xdg[len], "/.config"); ++#if !defined(_SCO_DS) /* SCO OpenServer 5.0.7/3.2 has no setenv. */ + setenv ("HOME", tmp, 1); + setenv ("XDG_CONFIG_HOME", xdg, 1); ++#endif + xlen = strlen (xdg); + strcpy (confd, xdg); + strcpy (&confd[xlen], "/fontconfig"); |