diff --git a/mingw-w64-libbotan/PKGBUILD b/mingw-w64-libbotan/PKGBUILD new file mode 100644 index 0000000000..64e05e0ded --- /dev/null +++ b/mingw-w64-libbotan/PKGBUILD @@ -0,0 +1,76 @@ +# Maintainer: Nazar Mishturak + +_realname=libbotan +pkgbase="mingw-w64-${_realname}" +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=1.11.21 +pkgrel=1 +arch=('any') +url='http://botan.randombit.net/' +pkgdesc='Botan is a C++ cryptography library released under the permissive Simplified BSD license. (mingw-w64)' +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-bzip2" + "${MINGW_PACKAGE_PREFIX}-xz" + "${MINGW_PACKAGE_PREFIX}-sqlite3" + "${MINGW_PACKAGE_PREFIX}-zlib" + "${MINGW_PACKAGE_PREFIX}-boost") +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-python3" + "${MINGW_PACKAGE_PREFIX}-doxygen") +license=('BSD') +options=('strip' 'staticlibs' 'docs') +source=(http://botan.randombit.net/releases/Botan-${pkgver}.tgz{,.asc} + 'boost-link.patch' + 'winsock-link.patch' + 'disable-mkgmtime.patch') +sha1sums=('513099c151898c629b334165b7d2cc2b4c06e2a1' + 'SKIP' + '407e623b46ef1b288b90195d9acadb34611b088b' + '867667533df37c6b88b267c0e95b979d8115dea7' + '57289f42ad28111d5a5a05eab58ac5887d7e1f84') +validpgpkeys=('621DAF6411E1851C4CF9A2E16211EBF1EFBADFBC') + +prepare() { + cd "${srcdir}/Botan-${pkgver}" + patch -p1 -i "${srcdir}/boost-link.patch" + patch -p1 -i "${srcdir}/winsock-link.patch" + patch -p1 -i "${srcdir}/disable-mkgmtime.patch" +} + +build() { + cd "${srcdir}/Botan-${pkgver}" + + local BUILD_TYPE_FLAGS='--build-mode=release' + if check_option 'debug' 'y'; then + BUILD_TYPE_FLAGS='--build-mode=debug --debug-mode' + fi + + # Set prefix to mingw{32,64} not full path. Remove starting slash + ${MINGW_PREFIX}/bin/python3 configure.py \ + --disable-shared \ + --os=mingw \ + --cc=gcc \ + --cpu=${CARCH} \ + --destdir='$(DESTDIR)' \ + ${BUILD_TYPE_FLAGS} \ + --makefile-style=gmake \ + --link-method=copy \ + --with-doxygen \ + --with-boost \ + --with-bzip2 \ + --with-lzma \ + --with-sqlite3 \ + --with-zlib + + make +} + +check() { + cd "${srcdir}/Botan-${pkgver}" + ./botan-test +} + +package() { + cd "${srcdir}/Botan-${pkgver}" + make DESTDIR="${pkgdir}${MINGW_PREFIX}" install +} diff --git a/mingw-w64-libbotan/boost-link.patch b/mingw-w64-libbotan/boost-link.patch new file mode 100644 index 0000000000..522e14d0d9 --- /dev/null +++ b/mingw-w64-libbotan/boost-link.patch @@ -0,0 +1,11 @@ +--- Botan-1.11.21/src/lib/utils/boost/info.txt.orig 2015-10-12 08:53:49.742291300 +0300 ++++ Botan-1.11.21/src/lib/utils/boost/info.txt 2015-10-12 08:53:54.340367300 +0300 +@@ -5,7 +5,7 @@ + load_on vendor + + +-all -> boost_system,boost_filesystem ++all -> boost_system-mt,boost_filesystem-mt + + + diff --git a/mingw-w64-libbotan/disable-mkgmtime.patch b/mingw-w64-libbotan/disable-mkgmtime.patch new file mode 100644 index 0000000000..c6e901993c --- /dev/null +++ b/mingw-w64-libbotan/disable-mkgmtime.patch @@ -0,0 +1,34 @@ +--- Botan-1.11.21/src/lib/utils/calendar.cpp.orig 2015-10-11 14:31:25.000000000 +0300 ++++ Botan-1.11.21/src/lib/utils/calendar.cpp 2015-10-12 19:59:06.522921000 +0300 +@@ -39,8 +39,6 @@ + return tm; + } + +-#if !defined(BOTAN_TARGET_OS_HAS_TIMEGM) && !defined(BOTAN_TARGET_OS_HAS_MKGMTIME) +- + #if defined(BOTAN_HAS_BOOST_DATETIME) + + std::time_t boost_timegm(std::tm *tm) +@@ -109,8 +107,6 @@ + } + #endif // BOTAN_HAS_BOOST_DATETIME + +-#endif +- + } + + std::chrono::system_clock::time_point calendar_point::to_std_timepoint() +@@ -136,12 +132,7 @@ + tm.tm_year = year - 1900; + + // Define a function alias `botan_timegm` +- #if defined(BOTAN_TARGET_OS_HAS_TIMEGM) +- std::time_t (&botan_timegm)(std::tm *tm) = timegm; +- #elif defined(BOTAN_TARGET_OS_HAS_MKGMTIME) +- // http://stackoverflow.com/questions/16647819/timegm-cross-platform +- std::time_t (&botan_timegm)(std::tm *tm) = _mkgmtime; +- #elif defined(BOTAN_HAS_BOOST_DATETIME) ++ #if defined(BOTAN_HAS_BOOST_DATETIME) + std::time_t (&botan_timegm)(std::tm *tm) = boost_timegm; + #else + std::time_t (&botan_timegm)(std::tm *tm) = fallback_timegm; diff --git a/mingw-w64-libbotan/winsock-link.patch b/mingw-w64-libbotan/winsock-link.patch new file mode 100644 index 0000000000..d7a18c9c23 --- /dev/null +++ b/mingw-w64-libbotan/winsock-link.patch @@ -0,0 +1,9 @@ +--- Botan-1.11.21/src/lib/entropy/cryptoapi_rng/info.txt.orig 2015-10-12 09:13:49.188061800 +0300 ++++ Botan-1.11.21/src/lib/entropy/cryptoapi_rng/info.txt 2015-10-12 09:14:09.519021200 +0300 +@@ -18,5 +18,5 @@ + + + windows -> advapi32.lib +-mingw -> advapi32 ++mingw -> advapi32,ws2_32,mswsock +