Skip to content

Commit

Permalink
Fix building all of the pycurl variants
Browse files Browse the repository at this point in the history
  • Loading branch information
winbuild committed Jan 30, 2020
1 parent 3de5d73 commit e392b0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
18 changes: 1 addition & 17 deletions winbuild.py
Expand Up @@ -127,7 +127,6 @@ class Config:
# http://developer.covenanteyes.com/building-openssl-for-visual-studio/

import os, os.path, sys, subprocess, shutil, contextlib, zipfile, re
import time as _time
from winbuild.utils import *
from winbuild.config import *
from winbuild.builder import *
Expand Down Expand Up @@ -210,29 +209,14 @@ def build(config):
# note: adds git_bin_path to PATH if necessary, and creates archives_path
build_dependencies(config)
with in_dir(config.archives_path):
def prepare_pycurl():
#fetch('https://dl.bintray.com/pycurl/pycurl/pycurl-%s.tar.gz' % pycurl_version)
if os.path.exists('pycurl-%s' % config.pycurl_version):
# shutil.rmtree is incapable of removing .git directory because it contains
# files marked read-only (tested on python 2.7 and 3.6)
#shutil.rmtree('pycurl-%s' % config.pycurl_version)
rm_rf(config, 'pycurl-%s' % config.pycurl_version)
#check_call([tar_path, 'xf', 'pycurl-%s.tar.gz' % pycurl_version])
shutil.copytree('c:/dev/pycurl', 'pycurl-%s' % config.pycurl_version)

prepare_pycurl()

for bitness in config.bitnesses:
for python_release in config.python_releases:
targets = ['bdist', 'bdist_wininst', 'bdist_msi']
vc_version = PYTHON_VC_VERSIONS[python_release]
bconf = BuildConfig(config, bitness=bitness, vc_version=vc_version)
builder = PycurlBuilder(bconf=bconf, python_release=python_release)
builder.prepare_tree()
builder.build(targets)

# Seems like windows can have leftover processes hanging around
# which will prevent the next build from working as builds are in place
#_time.sleep(3)

def python_metas():
metas = []
Expand Down
16 changes: 15 additions & 1 deletion winbuild/pycurl.py
Expand Up @@ -31,7 +31,7 @@ def build(self, targets):
zlib_builder = ZlibBuilder(bconf=self.bconf)
dll_paths += zlib_builder.dll_paths
dll_paths = [os.path.abspath(dll_path) for dll_path in dll_paths]
with in_dir(os.path.join('pycurl-%s' % self.bconf.pycurl_version)):
with in_dir(self.build_dir_name):
dest_lib_path = 'build/lib.%s-%s' % (self.platform_indicator,
self.python_release)
# exists for building additional targets for the same python version
Expand Down Expand Up @@ -120,3 +120,17 @@ def build(self, targets):

member = src_zip.open(name)
dest_zip.writestr(new_name, member.read(), zipfile.ZIP_DEFLATED)

@property
def build_dir_name(self):
return 'pycurl-%s-py%s-%s' % (self.bconf.pycurl_version, self.python_release, self.bconf.vc_tag)

def prepare_tree(self):
#fetch('https://dl.bintray.com/pycurl/pycurl/pycurl-%s.tar.gz' % pycurl_version)
if os.path.exists(self.build_dir_name):
# shutil.rmtree is incapable of removing .git directory because it contains
# files marked read-only (tested on python 2.7 and 3.6)
#shutil.rmtree('pycurl-%s' % config.pycurl_version)
rm_rf(self.bconf, self.build_dir_name)
#check_call([tar_path, 'xf', 'pycurl-%s.tar.gz' % pycurl_version])
shutil.copytree('c:/dev/pycurl', self.build_dir_name)

0 comments on commit e392b0d

Please sign in to comment.