Project

General

Profile

Actions

LegacyDevelopersWin32Environment » History » Revision 24

« Previous | Revision 24/28 (diff) | Next »
Bernhard Hailer, 04/21/2020 05:12 PM


h1. Setting up a Win32 Development Environment

{{toc}}

h2. Overview

Chirp is written in Python, an interpreted language. To run the chirp code directly you need Python installed as well as several other external libraries:

  • PyGTK - GTK cross-platform GUI,
  • PySerial - serial port connectivity for Python
  • PyLibXML2 - XML processing

You must also obtain a copy of the chirp source code, either by downloading the .tar.gz archive or by using the Mercurial source code management system, known as hg. Installing Mercurial will allow you to pull the latest updates from the chirp site and automates submission of patches for inclusion in future chirp builds. If you intend on submitting patches and working with the chirp development community is it strongly recommended that you install Mercurial and use it for submitting patches and keeping your sources current.

For MS windows, chirp is distributed as a compiled .exe file that installs the compiled code and the necessary runtime dependencies. The compiled .exe files eliminate the need for the Python interpreter. Additional downloads and steps are needed to create chirp installer (.exe) files if you need to distribute your work to other systems for testing.

To summarize the steps are:

# install python
# install additional python libraries PyGTK, PySerial, PyLibXML2
# install Mercurial (hg) SCM
# Use Mercurial to download the current chirp source code and keep it up to date.

h2. Installing Python

To run chirp you will need to install Python 2.7.x from either "Python.org":http://python.org or "ActiveState":http://www.activestate.com/activepython. Do not install Python 3 as chirp is currently written for Python 2.7 and above, but will generally run on Python 2.6.x.

See the steps below to add Python to your system's path after installation.

h2. Library and Runtime Prerequisites

In addition to Python, several other libraries are needed for the GTK cross-platform GUI, serial port connectivity, and XML processing.

Get and install the following in this order:

# "PyGTK Win32 All-in-one installer":http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/
# "PyLibXML2":http://users.skynet.be/sbi/libxml-python/
# "PyWin32":http://sourceforge.net/projects/pywin32/files/pywin32/
# "PySerial":http://sourceforge.net/projects/pyserial/files/pyserial/2.5/

Notes:

  • For any of the above, be sure to get the latest version, and the py27 variant if/when available.
  • If you are on 64-bit Windows, you must download the versions with the same bitness (either 64-bit or 32-bit) in order for everything to work together, all 32-bit or all 64-bit. ** If your intent is to be able to build an .exe for others to test/use, you should use only the 32-bit versions to ensure the generated .exe will install and run on the widest range of Windows systems.
  • On Windows 7, 8.1, and 10, the PyLibXML2 installer will generate an error during the installation about not being able to modify the runtime directory. (This appears to be benign.)

When everything is installed, you will want to make sure that Python is in your system PATH variable:

h2. Putting Python in your path.

After installing python, you will need to add it to your path. The Active State Python installer for ActivePython handles this for you. If you installed from python.org follow these instructions.

h3. Windows XP

  • On the Desktop or in the Start menu, right-click on My Computer and choose Properties
  • In the dialog that opens, on the Advanced tab, click on Environment Variables
  • Under System variables, find Path, select it, and then edit Edit
  • At the end of the existing value, add exactly this string: @;C:\Python27@ (obviously adjust this path if you installed it elsewhere. Don't forget the leading semicolon)
  • Click the OK buttons until you're done.

h3. Windows Vista/7

  • In the Windows menu, right-click on the Computer item and choose Properties
  • Click on Advanced System Settings on the left
  • In the dialog that opens, click on Environment Variables
  • Under System variables, find Path, select it, and then edit Edit
  • At the end of the existing value, add exactly this string: @;C:\Python27\bin@ (obviously adjust this path if you installed it elsewhere. Don't forget the leading semicolon)
  • Click the OK buttons until you're done.

h1. CHIRP source code and development process.

The chirp developers use the "Mercurial source code management system":http://mercurial.selenic.com/, also known as hg for managing the chirp source code and supporting distributed development. Installing Mercurial will allow you to pull the latest updates from the chirp site and automates submission of patches for inclusion in future chirp builds. While you can download a .tar.gz copy of the chirp sources this is not recommend as your sources will become quickly out of date.

h2. Install Mercurial

Get and install the mercurial source code management tool:

h2. Clone the repository

The next step is to download a copy of the repository. This is done from the command-line, and will create a @chirp.hg/@ directory in your current directory. Thus, you should change to the place you want it to be first. For example:

C:\Users\Foo> cd \MyWorkspace
C:\MyWorkspace> hg clone http://d-rats.com/hg/chirp.hg

h2. Learn about the Chirp development process and how to use Mercurial

See Chirp Development Process.

h1. Run chirp

Python should be in your search path from the install, but if not, put it in the system PATH environment variable. Once you do that, you should be able to enter the directory that was created in the clone step above, and run chirpw with python:

C:\MyWorkspace> cd chirp.hg
C:\MyWorkspace\chirp.hg> python chirpw

Updated by Bernhard Hailer over 4 years ago · 24 revisions