pyca / pyca/pynacl

Document Compiling On Windows

Open
#165 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.2k
Forks
267
Avg merge
42m
Merged PRs (30d)
2

Description

Okay, so here's how I have it building against Windows with the changes in #164:

  • Grab the latest libsodium-msvc release from downloads.libsodium.org
  • Unzip it and put it some place like C:\libsodium
  • Grab http://msinttypes.googlecode.com/svn/trunk/stdint.h and put that in C:\libsodium\include (this is required for Python 2.7 but not other releases)
  • The MSVC release zip from libsodium does not have a 64-bit VS2010 release, so to link against Python 64-bit 2.7 (which is technically built against VS2008 but links just fine against the VS2010 static libs) you need to check out the libsodium git source https://github.com/jedisct1/libsodium, check out the latest release tag, then open the vcxproj file for VS2010 (it's in builds/msvc/vs2010/libsodium), set the target to static release, then build it. You can then use the resulting .lib to statically link.

With those prerequisites out of the way you can then do something like this to build:

@set SODIUM_INSTALL=system
@set PYNACL_SODIUM_STATIC=1
@set LIB="C:\libsodium\path\to\static\lib\you\need";%LIB%
@set INCLUDE="C:\libsodium\include";%INCLUDE%
pip install .

(The PYNACL_SODIUM_STATIC flag is required if you want to link against the static libraries, but not if you want to use dynamic. If you use dynamic you'll need to drop the .lib file in the appropriate place post-install though and building a wheel will be a more involved process)

The next release of pynacl will ship static windows wheels by default so this is only necessary for users who don't want to wait or want to develop this project on windows.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking the repository's existing build and Windows documentation to find the appropriate page or section. Use the issue body as the source for the libsodium, Python, MSVC, environment-variable, and pip steps, and consider the documentation complete when a Windows developer can follow the prerequisites and commands without relying on the issue thread.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
build-system, documentation, operating-systems
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.