Skip to content

Instantly share code, notes, and snippets.

@ant32
Created January 28, 2015 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ant32/af9592669c7da2c746da to your computer and use it in GitHub Desktop.
Save ant32/af9592669c7da2c746da to your computer and use it in GitHub Desktop.
mingw-w64-plibc 0.1.7.r147-1
# Maintainer: Leo von Klenze <devel@leo.von-klenze.de>
pkgname=mingw-w64-plibc
pkgver=0.1.7.r147
pkgrel=1
pkgdesc="A POSIX compliant libc for Windows"
arch=(any)
url="http://plibc.sourceforge.net/"
license=('LGPL')
makedepends=(libtool dos2unix mingw-w64-configure subversion)
depends=(mingw-w64-crt)
options=(!libtool !strip !buildflags)
source=('svn+https://svn.code.sf.net/p/plibc/code/trunk/plibc#revision=147'
'plibc-mingw-include.patch')
md5sums=('SKIP'
'd9e3ad067957022b39c89fa86d39120a')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
pkgver() {
cd "${srcdir}/plibc"
local ver="$(svnversion)"
printf "0.1.7.r%s" "${ver//[[:alpha:]]}"
}
prepare(){
cd "${srcdir}/plibc"
patch -p2 -i ../plibc-mingw-include.patch
}
build() {
cd "${srcdir}/plibc"
unset LDFLAGS
export CPPFLAGS="$CPPFLAGS -DHAVE_DECL_GETADDRINFO -DHAVE_DECL_GETNAMEINFO -DHAVE_DECL_FREEADDRINFO"
sh ./bootstrap
for _arch in ${_architectures}; do
mkdir -p build-${_arch} && pushd build-${_arch}
${_arch}-configure
make
popd
done
}
package() {
for _arch in ${_architectures}; do
cd "${srcdir}/plibc/build-${_arch}"
make DESTDIR="$pkgdir" install
find "$pkgdir/usr/${_arch}" -name '*.exe' -o -name '*.bat' -o -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
find "$pkgdir/usr/${_arch}" -name '*.dll' | xargs -rtl1 ${_arch}-strip -x
find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs -rtl1 ${_arch}-strip -g
done
}
--- plibc-code-147-trunk/plibc/src/include/plibc.h.orig 2013-08-12 06:14:10.000000000 -0500
+++ plibc-code-147-trunk/plibc/src/include/plibc.h 2013-08-30 17:01:01.975554282 -0500
@@ -520,7 +520,9 @@
int flock(int fd, int operation);
int fsync(int fildes);
+#ifndef __MINGW64_VERSION_MAJOR
int inet_pton(int af, const char *src, void *dst);
+#endif
int inet_pton4(const char *src, u_char *dst, int pton);
#if USE_IPV6
int inet_pton6(const char *src, u_char *dst);
@@ -532,7 +534,9 @@
const char *hstrerror(int err);
int mkstemp(char *tmplate);
char *strptime (const char *buf, const char *format, struct tm *tm);
+#ifndef __MINGW64_VERSION_MAJOR
const char *inet_ntop(int af, const void *src, char *dst, size_t size);
+#endif
#ifndef gmtime_r
struct tm *gmtime_r(const time_t *clock, struct tm *result);
#endif
@@ -565,7 +569,7 @@
int _win_ftruncate(int fildes, off_t length);
int _win_kill(pid_t pid, int sig);
int _win_pipe(int *phandles);
-intptr_t _win_mkfifo(const char *path, mode_t mode);
+int _win_mkfifo(const char *path, mode_t mode);
int _win_rmdir(const char *path);
int _win_access( const char *path, int mode );
int _win_chmod(const char *filename, int pmode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment