diff --git a/mingw-w64-gc/0001-winpthreads.mingw.patch b/mingw-w64-gc/0001-winpthreads.mingw.patch new file mode 100644 index 0000000000..ab00bbdabd --- /dev/null +++ b/mingw-w64-gc/0001-winpthreads.mingw.patch @@ -0,0 +1,11 @@ +--- gc-7.2/include/private/gc_locks.h.orig 2013-04-10 07:18:36 +0400 ++++ gc-7.2/include/private/gc_locks.h 2013-04-10 07:24:13 +0400 +@@ -98,7 +98,7 @@ + /* integers for each thread, though that should be true as much */ + /* as possible. */ + /* Refine to exclude platforms on which pthread_t is struct */ +-# if !defined(GC_WIN32_PTHREADS) ++# if !defined(GC_WIN32_PTHREADS) || defined(__WINPTHREADS_VERSION_MAJOR) + # define NUMERIC_THREAD_ID(id) ((unsigned long)(id)) + # define THREAD_EQUAL(id1, id2) ((id1) == (id2)) + # define NUMERIC_THREAD_ID_UNIQUE diff --git a/mingw-w64-gc/0002-export.mingw.patch b/mingw-w64-gc/0002-export.mingw.patch new file mode 100644 index 0000000000..7531ef9146 --- /dev/null +++ b/mingw-w64-gc/0002-export.mingw.patch @@ -0,0 +1,20 @@ +--- gc-7.2/tests/staticrootslib.c.orig 2013-04-10 12:41:51 +0400 ++++ gc-7.2/tests/staticrootslib.c 2013-04-10 16:28:38 +0400 +@@ -14,7 +14,7 @@ + struct treenode *y; + } * root[10]; + +-struct treenode * libsrl_mktree(int i) ++GC_API struct treenode * GC_CALL libsrl_mktree(int i) + { + struct treenode * r = GC_MALLOC(sizeof(struct treenode)); + if (0 == i) return 0; +@@ -26,7 +26,7 @@ + return r; + } + +-void * libsrl_init(void) ++GC_API void * GC_CALL libsrl_init(void) + { + GC_INIT(); + return GC_MALLOC(sizeof(struct treenode)); diff --git a/mingw-w64-gc/0003-move-docs.all.patch b/mingw-w64-gc/0003-move-docs.all.patch new file mode 100644 index 0000000000..8edd72651c --- /dev/null +++ b/mingw-w64-gc/0003-move-docs.all.patch @@ -0,0 +1,11 @@ +--- gc-7.2/doc/doc.am.orig 2012-08-09 20:25:13.000000000 +0000 ++++ gc-7.2/doc/doc.am 2013-07-21 00:59:26.535985800 +0000 +@@ -15,7 +15,7 @@ + + # installed documentation + # +-dist_pkgdata_DATA = \ ++dist_doc_DATA = \ + doc/barrett_diagram \ + doc/debugging.html \ + doc/gc.man \ diff --git a/mingw-w64-gc/PKGBUILD b/mingw-w64-gc/PKGBUILD index fd2ef100c4..209e2561dc 100644 --- a/mingw-w64-gc/PKGBUILD +++ b/mingw-w64-gc/PKGBUILD @@ -4,7 +4,7 @@ _realname=gc _mingw_suff=mingw-w64-${CARCH} pkgname="${_mingw_suff}-${_realname}" pkgver=7.2.d -pkgrel=1 +pkgrel=2 pkgdesc="A garbage collector for C and C++ (mingw-w64)" arch=('any') url="http://www.hpl.hp.com/personal/Hans_Boehm/gc" @@ -12,27 +12,39 @@ license=("GPL") makedepends=(${_mingw_suff}-gcc ${_mingw_suff}-pkg-config) depends=(${_mingw_suff}-crt) options=('staticlibs' 'strip') #!buildflags -source=("$url/gc_source/gc-7.2d.tar.gz") -md5sums=('91340b28c61753a789eb6077675d87d2') +source=("$url/gc_source/${_realname}-${pkgver%.*}d.tar.gz" + 0001-winpthreads.mingw.patch + 0002-export.mingw.patch + 0003-move-docs.all.patch) +md5sums=('91340b28c61753a789eb6077675d87d2' + '97223c965b5e0c61d9bbf2710b44ddb6' + '48a4d5cca9f3ad3218cbaea59a86bee8' + 'bbd985cd4a16d9b110cfccf4ecd2700b') + + +prepare() { + cd "${srcdir}"/${_realname}-${pkgver%.*} + patch -p1 -i ${srcdir}/0001-winpthreads.mingw.patch + patch -p1 -i ${srcdir}/0002-export.mingw.patch + patch -p1 -i ${srcdir}/0003-move-docs.all.patch +} build() { - mkdir -p "${srcdir}/${pkgname}-${pkgver}-build-${CARCH}" - cd "${srcdir}/${pkgname}-${pkgver}-build-${CARCH}" - "${srcdir}"/gc-7.2/configure \ - --prefix=${MINGW_PREFIX} \ - --build=${MINGW_CHOST} \ - --host=${MINGW_CHOST} \ - --target=${MINGW_CHOST} \ - --enable-threads=win32 \ - --without-libatomic-ops \ - --enable-cplusplus - make + mkdir -p "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + "${srcdir}"/${_realname}-${pkgver%.*}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} \ + --enable-threads=posix \ + --disable-dependency-tracking \ + --enable-cplusplus + make } package() { - cd "${srcdir}/${pkgname}-${pkgver}-build-${CARCH}" - make DESTDIR="$pkgdir" install - #find "${pkgdir}${MINGW_PREFIX}" -name '*.dll' | xargs -rtl1 strip --strip-unneeded - #find "${pkgdir}${MINGW_PREFIX}" -name '*.a' -o -name '*.dll' | xargs -rtl1 strip -g - rm -r "${pkgdir}${MINGW_PREFIX}/share" -} \ No newline at end of file + cd "${srcdir}/build-${MINGW_CHOST}" + make DESTDIR="$pkgdir" install + rm -r "${pkgdir}${MINGW_PREFIX}/share" +}