diff --git a/mingw-w64-libutp/001-fix-linking.patch b/mingw-w64-libutp/001-fix-linking.patch new file mode 100644 index 0000000000..c1ba5448ef --- /dev/null +++ b/mingw-w64-libutp/001-fix-linking.patch @@ -0,0 +1,13 @@ +--- libutp/CMakeLists.txt.orig 2023-03-10 13:43:56.824850700 +0100 ++++ libutp/CMakeLists.txt 2023-03-10 12:50:54.616220500 +0100 +@@ -77,6 +77,10 @@ + add_library(${PROJECT_NAME}::libutp ALIAS libutp) + endif() + ++if(WIN32) ++ target_link_libraries(libutp ws2_32) ++endif() ++ + set_target_properties(libutp + PROPERTIES + OUTPUT_NAME utp) diff --git a/mingw-w64-libutp/PKGBUILD b/mingw-w64-libutp/PKGBUILD index 6df6c709d8..0619a326d6 100644 --- a/mingw-w64-libutp/PKGBUILD +++ b/mingw-w64-libutp/PKGBUILD @@ -4,7 +4,7 @@ _realname=libutp pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=r175.9cb9f9c -pkgrel=1 +pkgrel=2 pkgdesc='uTorrent Transport Protocol library (mingw-w64)' arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -16,8 +16,16 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" 'git') # from this branch: https://github.com/transmission/libutp/commits/post-3.4-transmission _commit='9cb9f9c4f0073d78b08d6542cebaea6564ecadfe' -source=("${_realname}"::"git+https://github.com/transmission/libutp.git#commit=${_commit}") -sha256sums=('SKIP') +source=("${_realname}"::"git+https://github.com/transmission/libutp.git#commit=${_commit}" + "001-fix-linking.patch") +sha256sums=('SKIP' + '8471926f6a64658d75812c74d0afa7a9de957b46ada467ce7e23e8127181dda1') + +prepare() { + cd "${srcdir}/${_realname}" + + patch -Np1 -i "${srcdir}/001-fix-linking.patch" +} pkgver() { cd "${srcdir}/${_realname}" @@ -43,6 +51,7 @@ build() { -GNinja \ -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ -DLIBUTP_BUILD_PROGRAMS=NO \ + -DLIBUTP_SHARED=ON \ "${extra_config[@]}" \ ../${_realname}