diff -Nru orig/curl/src/Makevars.win patched/curl/src/Makevars.win
--- orig/curl/src/Makevars.win	2019-12-01 09:17:46.000000000 +0100
+++ patched/curl/src/Makevars.win	2020-07-02 18:06:00.232794500 +0200
@@ -1,20 +1,13 @@
-VERSION=7.64.1
-PKG_LIBS= -L../windows/libcurl-$(VERSION)/lib${R_ARCH} \
-	-L. -lwinhttp -lcurl -lssh2 -lz -lssl -lcrypto -lgdi32 -lws2_32 -lcrypt32 -lwldap32
+PKG_LIBS= -lwinhttp -lcurl -lrtmp -lssl -lssh2 -lgcrypt -lcrypto -lgdi32 -lz -lgdi32 -lcrypt32 -lidn2 -lunistring -liconv -lgpg-error -lws2_32 -lwldap32 -lwinmm
 
-PKG_CPPFLAGS= \
-	-I../windows/libcurl-$(VERSION)/include -DCURL_STATICLIB -DSTRICT_R_HEADERS
+PKG_CPPFLAGS= -DCURL_STATICLIB -DSTRICT_R_HEADERS
 
-all: clean winlibs libwinhttp.dll.a
-
-clean:
-	rm -f $(SHLIB) $(OBJECTS) libwinhttp.dll.a winhttp.def
+all: clean  winlibs
 
 winlibs: clean
-	"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION)
-	echo '#include <curl/curl.h>' | $(CPP) $(PKG_CPPFLAGS) -std=gnu99 -xc - | grep "^[ \t]*CURLOPT_.*," | sed s/,// > ../tools/option_table.txt
+	 echo '#include <curl/curl.h>' | $(CPP) $(PKG_CPPFLAGS) -std=gnu99 -xc - | grep "^[ \t]*CURLOPT_.*," | sed s/,// > ../tools/option_table.txt
 
-winhttp.def:
-	cp winhttp$(WIN).def.in winhttp.def
+clean:
+	rm -f $(SHLIB) $(OBJECTS)
 
-.PHONY: all winlibs clean
+.PHONY: all clean
diff -Nru orig/curl/src/winhttp32.def.in patched/curl/src/winhttp32.def.in
--- orig/curl/src/winhttp32.def.in	2019-12-01 09:17:46.000000000 +0100
+++ patched/curl/src/winhttp32.def.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-;
-; Definition file of WINHTTP.dll
-; Automatic generated by gendef
-; written by Kai Tietz 2008
-;
-LIBRARY "WINHTTP.dll"
-EXPORTS
-Private1@20
-SvchostPushServiceGlobals@4
-WinHttpAddRequestHeaders@16
-WinHttpAutoProxySvcMain@8
-WinHttpCheckPlatform@0
-WinHttpCloseHandle@4
-WinHttpConnect@16
-WinHttpCrackUrl@16
-WinHttpCreateUrl@16
-WinHttpDetectAutoProxyConfigUrl@8
-WinHttpGetDefaultProxyConfiguration@4
-WinHttpGetIEProxyConfigForCurrentUser@4
-WinHttpGetProxyForUrl@16
-WinHttpOpen@20
-WinHttpOpenRequest@28
-WinHttpQueryAuthSchemes@16
-WinHttpQueryDataAvailable@8
-WinHttpQueryHeaders@24
-WinHttpQueryOption@16
-WinHttpReadData@16
-WinHttpReceiveResponse@8
-WinHttpSendRequest@28
-WinHttpSetCredentials@24
-WinHttpSetDefaultProxyConfiguration@4
-WinHttpSetOption@16
-WinHttpSetStatusCallback@16
-WinHttpSetTimeouts@20
-WinHttpTimeFromSystemTime@8
-WinHttpTimeToSystemTime@8
-WinHttpWriteData@16
diff -Nru orig/curl/src/winhttp64.def.in patched/curl/src/winhttp64.def.in
--- orig/curl/src/winhttp64.def.in	2019-12-01 09:17:46.000000000 +0100
+++ patched/curl/src/winhttp64.def.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-;
-; Definition file of WINHTTP.dll
-; Automatic generated by gendef
-; written by Kai Tietz 2008
-;
-LIBRARY "WINHTTP.dll"
-EXPORTS
-Private1
-SvchostPushServiceGlobals
-WinHttpAddRequestHeaders
-WinHttpAutoProxySvcMain
-WinHttpCheckPlatform
-WinHttpCloseHandle
-WinHttpConnect
-WinHttpCrackUrl
-WinHttpCreateUrl
-WinHttpDetectAutoProxyConfigUrl
-WinHttpGetDefaultProxyConfiguration
-WinHttpGetIEProxyConfigForCurrentUser
-WinHttpGetProxyForUrl
-WinHttpOpen
-WinHttpOpenRequest
-WinHttpQueryAuthSchemes
-WinHttpQueryDataAvailable
-WinHttpQueryHeaders
-WinHttpQueryOption
-WinHttpReadData
-WinHttpReceiveResponse
-WinHttpSendRequest
-WinHttpSetCredentials
-WinHttpSetDefaultProxyConfiguration
-WinHttpSetOption
-WinHttpSetStatusCallback
-WinHttpSetTimeouts
-WinHttpTimeFromSystemTime
-WinHttpTimeToSystemTime
-WinHttpWriteData
diff -Nru orig/curl/tools/winlibs.R patched/curl/tools/winlibs.R
--- orig/curl/tools/winlibs.R	2019-12-01 09:17:46.000000000 +0100
+++ patched/curl/tools/winlibs.R	1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-# Build against static libraries from rwinlib
-VERSION <- commandArgs(TRUE)
-if(!file.exists(sprintf("../windows/libcurl-%s/include/curl/curl.h", VERSION))){
-  if(getRversion() < "3.3.0") setInternet2()
-  download.file(sprintf("https://github.com/rwinlib/libcurl/archive/v%s.zip", VERSION), "lib.zip", quiet = TRUE)
-  dir.create("../windows", showWarnings = FALSE)
-  unzip("lib.zip", exdir = "../windows")
-  unlink("lib.zip")
-}
