The source code for the packages distributed via Cygwin setup is also available via Cygwin setup. To install the source for the X server, run Cygwin setup and tick the 'Src?' check-box for the 'xorg-server' package.
This may have multiple patches applied on top of the upstream X.Org X Window System source code, and is known to build and function on Cygwin, so this should be the starting point for new developers.
On installing the source code package, setup will unpack it under /usr/src. You should find the source archive, any needed .patch files, and a .cygport file which automates the distribution configuration, build and packaging tasks.
Note: Due to the large number of patches applied to the upstream source, the current source package contains a source archive prepared directly from a git repository containing those patches on top of the upstream source, rather than containing the upstream source archive and many separate patches.
The sources can unpacked and prepared using cygport as follows:
Username@CygwinHost ~ $ cd /usr/src/xorg-server-n.nn.n-n.src Username@CygwinHost /usr/src/xorg-server-n.nn.n-n.src $ cygport xorg-server-n.nn.n-n.cygport prep [lots of output as archive is unpacked and patches applied] Username@CygwinHost /usr/src/xorg-server-n.nn.n-n.src $ cygport xorg-server-n.nn.n-n.cygport compile [lots of output as source is configured and built] Username@CygwinHost /usr/src/xorg-server-n.nn.n-n.src $ cd xorg-server-n.nn.n-n/src/xorg-server-n.nn.n/ [navigate to the source directory] Username@CygwinHost /usr/src/xorg-server-n.nn.n-n/src/xorg-server-n.nn.n/ $
Note: Alternatively you may manually untar the archive and apply any patches (in the correct order).
Note: For details of using cygport to generate packages for distribution, see the Section called Packaging a Cygwin/X Distribution
The packaging script for the packages distributed via Cygwin setup is currently held in a git repository. Intermediate versions between released packages can be obtained from there.
Username@CygwinHost ~ $ git clone https://github.com/jon-turney/xorg-server-cygport.git
This will obtain a .cygport file. and any .patch files. You can then add the source archive by downloading it with cygport.
Username@CygwinHost ~ $ cygport xorg-server-n.n.n-n.cygport download
Then proceed as in the Section called Obtaining via Cygwin setup
Cygwin/X source code is contained in, and distributed with, the X Window System source code releases.
$ git clone git://anongit.freedesktop.org/git/xorg/xserver
You will probably want to look at the .cygport file in the source package obtained in the Section called Obtaining via Cygwin setup and check you understand if you need to use the configuration options used there.
Consult the git documentation for details on using git.
The CYGWIN branch exists in git for historical reasons. Current development follows the mainline (called the master branch in git terminology).