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.
The sources can unpacked and prepared using cygport as follows:
Username@CygwinHost ~ $ cd /usr/src Username@CygwinHost /usr/src $ cygport xorg-server-n.n.n-n.cygport prep [lots of output as archive is unpacked and patches applied] $ cygport xorg-server-n.n.n-n.cygport compile [lots of output as source is configured and built] Username@CygwinHost /usr/src $ cd xorg-server-n.n.n-n/src/xorg-server-n.n.n/ [navigate to the source directory] Username@CygwinHost /usr/src/xorg-server-n.n.n-n/src/xorg-server-n.n.n/ $
Note: Alternatively you may manually untar the archive and apply any patches (in the correct order).
Note: It is necessary to run the package's autogen.sh script to regenerate the configure script and Makefiles if the patches modify the autoconf or automake source files
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 are currently held in a git repository. Intermediate versions between released packages can be obtained from there.
Username@CygwinHost ~ $ git clone git://cygwin-ports.git.sourceforge.net/gitroot/cygwin-ports/xorg-server
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. For example:
$ ./configure --prefix=/usr --with-log-dir=/var/log
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).