Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to to build src from a CygPort?

I have a question about the structure of the source code from a cygport package.

Here is the contents of a Cygports source file:

  • the actual source bundle for the project (tar.gz, tar.bz2, etc.)
  • the any number of *.patch files.
  • a .cygport file

I am trying to build gedit-3.4.2 from cygports repository.

How does the .cygport file help me run the proper options in the ./configure ?

For instance, in gedit if i don't specify --disable-spell it won't proceed due to error. How do I get the list of ./configure options that were used to build the project when the cygport was built?

Is there some way we can use the cygport executable to build the cygport and change the prefix too?

Here is the contents of gedit-3.4.2-1.cygport:

inherit python gnome2

DESCRIPTION="GNOME text editor"

PATCH_URI="3.4.2-cygwin.patch"

DEPEND="gnome-common gtk-doc
    girepository(Gtk-3.0)
    pkgconfig(enchant)
    pkgconfig(gtksourceview-3.0)
    pkgconfig(libpeas-gtk-1.0)"

PKG_NAMES="${PN} ${PN}-devel"
PKG_HINTS="setup devel"
gedit_CONTENTS="--exclude=gtk-doc --exclude=libgedit* etc/ usr/bin/ usr/lib/gedit/ ${PYTHON_SITELIB#/} usr/share/"
gedit_devel_CONTENTS="usr/include/ usr/lib/gedit/libgedit* usr/lib/pkgconfig/ usr/share/gtk-doc/"

DIFF_EXCLUDES="*.desktop.in *.schemas.in *-marshal.h"

CYGCONF_ARGS="--libexecdir=/usr/lib --enable-python"

KEEP_LA_FILES="none"

EDIT Someone from Cygwin Ports mailing list said:

"The configure options are

--libexecdir=/usr/lib --enable-python

Which is from CYGCONF_ARGS."

like image 922
Nicholas DiPiazza Avatar asked Jul 23 '12 19:07

Nicholas DiPiazza


1 Answers

Here is the contents of a Cygports source file:

You'd do better to think of it as a Cygwin package source file.

cygport is simply a tool for automating the creation of Cygwin binary and source packages. It is the primary tool available, but unlike with some other packaging systems, there's really nothing forcing you to use it. It is quite possible to build a Cygwin package entirely by hand, since it is really nothing more than a tarball that Cygwin's setup.exe can blindly unpack into the Cygwin root directory (typically c:\cygwin) with the expectation that this will put the package's files in sensible locations.

Before cygport existed, people did build their own ad hoc packaging systems. Many Cygwin package maintainers still use these tools they created. (Yours truly included; two of my three packages use cygport, but the third still uses a custom build system.)

Ultimately, you want to read the cygport manual, in /usr/share/doc/cygport/manual.html.

(Yes, I know, "RTFM" answers are frowned on here. But, as one who currently maintains two cygport based packages in the official Cygwin package repository, please believe me when I tell you that the manual is still the single best resource available on this topic.)

How does the .cygport file help me run the proper options in the ./configure ?

As you found out through other resources, you'd first need to edit the CYGCONF_ARGS value in the .cygport file.

The simplest possible step after that is cygport gedit-3.4.2-1.cygport all. That attempts to rebuild all the binary packages in a single step. It also builds a new source package containing updated .cygport and patch files.

If something breaks in the all build process, it is usually faster to switch to using the sub-commands contained by all instead of completely restarting the process. The all step just runs prep, compile, install, package, and finish for you, in that order. For instance, if all fails during the compilation step, there's probably no need to repeat the prep step.

(It is exceptionally uncommon for cygport or a sane build system to wreck the build tree, forcing you to re-run prep. Far more commonly, you end up needing to re-do prep when you manually wreck the build tree while trying to get a new package to build for the first time and need to start over.)

For instance, in gedit if i don't specify --disable-spell it won't proceed due to error.

You can probably fix that by installing the libaspell-devel package from the official Cygwin package repository with setup.exe.

Personally, I wouldn't disable any feature unless it meant installing unofficial packages, such as those from the Cygwin Ports project.[*] It is nice to have Cygwin Ports repository, but because it contains so many packages, installing one can end up creating an "install the world" situation: package A depends on packages B, C and D, and C depends on E, F, G, H, and G depends on I, J, K, and... Dependency hierarchies within the Cygwin package repo tend to be flatter and narrower than those in the Cygports repo.

Is there some way we can use the cygport executable to build the cygport and change the prefix too?

You have guessed that you just add --prefix=/my/private/program/tree to CYGCONF_ARGS, I trust.


[*] If you are feeling confused about "Cygwin Ports" and cygport, the naming similarity is no coincidence. cygport is a tool created by Yaakov Selkowitz for himself when creating the Cygwin Ports package repository. Later, it became popular enough among other Cygwin package maintainers that it pushed out most of the competing build systems.

like image 80
Warren Young Avatar answered Oct 10 '22 13:10

Warren Young