You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(68) |
Aug
(4) |
Sep
|
Oct
(23) |
Nov
(95) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
|
Mar
|
Apr
(51) |
May
(81) |
Jun
(2) |
Jul
(86) |
Aug
(143) |
Sep
(3) |
Oct
(31) |
Nov
(63) |
Dec
(90) |
2005 |
Jan
(277) |
Feb
(157) |
Mar
(99) |
Apr
(195) |
May
(151) |
Jun
(148) |
Jul
(98) |
Aug
(123) |
Sep
(20) |
Oct
(174) |
Nov
(155) |
Dec
(26) |
2006 |
Jan
(51) |
Feb
(19) |
Mar
(16) |
Apr
(12) |
May
(5) |
Jun
|
Jul
(11) |
Aug
(7) |
Sep
(10) |
Oct
(31) |
Nov
(174) |
Dec
(56) |
2007 |
Jan
(45) |
Feb
(52) |
Mar
(10) |
Apr
(5) |
May
(47) |
Jun
(16) |
Jul
(80) |
Aug
(29) |
Sep
(14) |
Oct
(59) |
Nov
(46) |
Dec
(16) |
2008 |
Jan
(10) |
Feb
(1) |
Mar
|
Apr
|
May
(49) |
Jun
(26) |
Jul
(8) |
Aug
(4) |
Sep
(25) |
Oct
(53) |
Nov
(9) |
Dec
(1) |
2009 |
Jan
(66) |
Feb
(11) |
Mar
(1) |
Apr
(14) |
May
(8) |
Jun
(1) |
Jul
(2) |
Aug
(2) |
Sep
(9) |
Oct
(23) |
Nov
(35) |
Dec
|
2010 |
Jan
(7) |
Feb
(2) |
Mar
(39) |
Apr
(19) |
May
(161) |
Jun
(19) |
Jul
(32) |
Aug
(65) |
Sep
(113) |
Oct
(120) |
Nov
(2) |
Dec
|
2012 |
Jan
|
Feb
(5) |
Mar
(4) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(12) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(17) |
Mar
(4) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(8) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Andy S. <And...@co...> - 2010-05-22 15:10:50
|
diffing dir... Sat May 22 10:31:14 EDT 2010 Jens Petersen <pet...@ha...> * update ghc version info in INSTALL Ignore-this: 12355060648bf7ec2fc24972ff058cfd { hunk ./INSTALL 27 -The GHC Haskell compiler, version 6.10.4 or greater, is required. +The GHC Haskell compiler, version 6.10.x or greater, is required. hunk ./INSTALL 29 +ghc-6.12.2 has a runtime issue that can cause gtk2hs apps to crash, +so better to avoid it. } |
From: Andy S. <And...@co...> - 2010-05-22 15:10:47
|
diffing dir... Sat May 22 10:25:12 EDT 2010 Jens Petersen <pet...@ha...> * update INSTALL Ignore-this: 91efe1d455ef4068f3381cf7619f10fa { hunk ./INSTALL 5 -The library currently wraps most functions from the Gtk+ 2.8 libraries. -Furthermore there is support for cairo, cairo svg loader, pango, the libglade -UI loader, the Gtk+ OpenGL extension, the SourceView widget, the GConf -configuration system, and the Mozilla rendering engine embedded in a widget. +Gtk2hs is a set of Haskell packages wrapping the GTK GUI stack: hunk ./INSTALL 7 -The GHC Haskell compiler, version 6.0 or greater, is required. -Gtk2Hs is known to compile on Linux, Windows, OSX, FreeBSD, and Solaris. - -These instruuctions are about building Gtk2Hs from source. If you would rather -install a binary (pre-compiled) package, please check the Gtk2Hs web site. - -Building --------- - -This section assumes that you are building a source distribution (.tar.gz). -If you are building on Windows, read "Building on Windows" first. If you -are using the darcs version, please read "Building from darcs". - -The following assumes that the sources are in ~/gtk2hs. - -1. Run the configure script. ----------------------------- - -The configure script has several useful options, particularly: - ---with-hc=<path to your ghc> - Uses the specified GHC for compilation and for installation of the package. - ---with-hcflags=<path to your ghc> - If you find that you need to pass any special flags to the Haskell compiler - then use this option to specify them. This overrides the default flags which - is just "-O" to compile using optimisations. Use -O0 for a quicker build. - ---enable-profiling - Build profiling versions of all the libraries in addition to the normal ones. - ---disable-split-objs - By default the libraries are built using GHC's 'split-objs' feature. This - makes for considerably smaller binaries since it allows the linker to - include only the functions needed. However split-objs doesn't work on every - platform so if you get linker errors then you can can try disabling it. - Building the Gtk2Hs libs with split-objs turned on is considerably - slower and uses more memory so you may prefer to turn it off. - ---with-user-pkgconf - Instead of registering Gtk2Hs with GHC's global package file, register in the - user's one instead. This is useful if you want to install to your own user - space rather than system wide. - ---enable-docs - This builds reference documentation in html format. These are also available - from the website but you may prefer to keep a local copy. You will need - haddock version 0.7 or later to build the documentation. - ---enable-PACKAGE {- substitute package name for PACKAGE -} ---disable-PACKAGE - Gtk2Hs contains bindings to some libraries that are not part of Gtk+ but - closely related. This option forces a particular package to be built or - not built. The default is to autodetect if a given package is installed - (except in --packager-mode where the default is --disable-PACKAGE for all - packages). At the time of writing the possible values for PACKAGE are: - - libglade : A library to load XML user interface descriptions that were - generated by the Glade user interface builder. - - gconf : A library to store configuration data in a Gnome-compatible way. - - sourceview : An enhancement of the TextView-widget of Gtk+. It adds features - useful for editing source code, e.g. syntax highlighting. - - firefox / seamonkey / xulrunner / mozilla : A widget that renders HTML. - - cairo : A library for rendering vector graphics. - - svg : SVG file rendering for cairo. - - opengl : Bindings for the Gtk OpenGL extension - ---disable-deprecated - There are many Gtk+ APIs that have been deprecated as new versions of Gtk+ - have come out. This option makes sure that no deprecated APIs are used. You - might want to use this option to make sure that you are not using deprecated - APIs in your new programs. - ---with-pkgconf=<path to a local .conf file> - Instead of registering Gtk2Hs with GHC's global package file, use a specific - file. If this file doesn't exit, it is created. - ---without-pkgreg - This option disables registering the packages with GHC at all. This - is useful to people building on one machine but wanting to install on - another, e.g. people packaging Gtk2Hs for use with a package management - system. +* gtk (GUI toolkit) +* cairo (graphics library) +* svgcairo (Cairo SVG loader) +* pango (text rendering) +* glade (libglade UI loader) +* glib (GLib2 library) +* gio (VFS library) +* gtkglext (Gtk+ OpenGL extension) +* gtksourceview2 (source code editor) +* gconf (GConf2 configuration system) +* gstreamer (media codec library) +* vte (terminal emulator) +* webkit (WebKit rendering engine) hunk ./INSTALL 21 ---enable-packager-mode - Enables --without-pkgreg and does not build any optional packages unless - these are specified with --enable-PACKAGE. On Windows it also does some - other stuff that helps with building an installer. +Also gtk2hs-buildtools and the soegtk library are provided. hunk ./INSTALL 23 +The following packages are deprecated: +* gnomevfs (replaced by gio) +* mozembed (replaced by webkit) hunk ./INSTALL 27 -If you want to do a quick build use: - -~/gtk2hs:$ ./configure --with-hcflags=-O0 --disable-split-objs +The GHC Haskell compiler, version 6.10.4 or greater, is required. +Gtk2Hs is known to compile on Linux, Windows, OSX, FreeBSD, and Solaris. hunk ./INSTALL 30 -If you want to install into your home directory rather than system-wide use: +These instruuctions are about building Gtk2Hs from source. If you would rather +install a binary (pre-compiled) package, please check the Gtk2Hs web site: +your distribution may also provide gtk2hs packages. hunk ./INSTALL 34 -~/gtk2hs:$ ./configure --prefix=$HOME --with-user-pkgconf hunk ./INSTALL 35 -2. Building the sources. +Building +-------- hunk ./INSTALL 38 -In the following "make" stands for GNU make. If your system has a program -called "gmake" then "make" is probably not GNU make. In this case use "gmake". +From version 0.11, gtk2hs is now distributed as separate packages on hackage. +So the easiest way to install it is using "cabal-install", eg +$ cabal install gtk hunk ./INSTALL 42 -To build the sources you issue: +This section assumes that you are building from a darcs checkout or snapshot. +If you are building on Windows, read "Building on Windows" first. hunk ./INSTALL 45 -~/gtk2hs:$ make +The following assumes that the sources are in ~/gtk2hs. hunk ./INSTALL 47 +Building from darcs +------------------- hunk ./INSTALL 50 -3. Install the libraries. -------------------------- +Building the latest sources from the darcs repository is normally straight +forward. In fact, since Gtk2Hs is only a wrapper around Gtk+, the development +version is usually not as "unstable" as it is for most software projects. +You must have all the appropriate development packages installed of course +(glib2, pango, gtk2, etc) for all the packages you wish to build. hunk ./INSTALL 56 -If you are installing system-wide then use: +You can get the latest development darcs source tree by running: hunk ./INSTALL 58 -~/gtk2hs:$ sudo make install +~:$ darcs get --lazy http://code/haskell.org/gtk2hs hunk ./INSTALL 60 -or if you use the 'su' command rather than 'sudo': +The easiest way to build everything is to run the script: hunk ./INSTALL 62 -~/gtk2hs:$ su -~/gtk2hs:# make install +~/gtk2hs:$ sh bootstrap.sh hunk ./INSTALL 64 -If you configured to install into your home directory then just say: +which build the tools and all the main supported libraries. hunk ./INSTALL 66 -~/gtk2hs:$ make install +Otherwise you can run "cabal install" by hand in a appropriate order +in a desired subset of the individual package directories. hunk ./INSTALL 70 -4. Compiling a program. ------------------------ +Running the demos. +------------------ hunk ./INSTALL 82 -The program should pop up a dialog box when you say +The program should pop up a dialog box when you run hunk ./INSTALL 87 -5. Documentation ----------------- +Documentation +------------- hunk ./INSTALL 90 -The documentation is avaliable on the website. You can also build the -documentation locally. You say +The documentation is available on the website and in hackage. +You can also build the documentation locally with cabal. hunk ./INSTALL 93 -~/gtk2hs:$ ./configure --enable-docs hunk ./INSTALL 94 - -6. Deinstallation +Deinstallation hunk ./INSTALL 96 +Alteratively, you can uninstall by unregistering the packages with ghc-pkg +and deleting the installed files. Eg reversing the order in bootstrap.sh: hunk ./INSTALL 99 -So long as you do not delete the source tree you can easily uninstall -everything that gtk2hs installed by saying - -~/gtk2hs:$ make uninstall - -in the root of the source tree. This will properly remove the package from -GHC and remove any installed file. - -Alteratively, if you do not keep the source tree around then you can -uninstall by unregistering the packages with ghc-pkg and deleting all the -installed files. Assuming that you installed in the default location -(ie did not specify --prefix= during ./configure) then that would mean -doing the following: - -# for pkg in glib gtk cairo glade gtkglext svgcairo gconf sourceview mozembed soegtk; \ +# for pkg in webkit vte svgcairo soegtk gtksourceview2 gtkglext gstreamer glade gconf gtk pango cairo gio glib gtk2hs-buildtools ; \ hunk ./INSTALL 101 -# rm -rf /usr/local/lib/gtk2hs/ -# rm -rf /usr/local/share/doc/gtk2hs/ #if you installed the docs hunk ./INSTALL 112 -Building from darcs -------------------- - -Building the latest sources from the darcs repository is normally straight -forward. In fact, since Gtk2Hs is only a wrapper around Gtk+, the development -version is usually not as "unstable" as it is for most software projects. - -Building the development version proceeds as normal building, except that you -need to run "autoreconf" first. You will need sufficiently new versions of the -automake/autoconf toolsuite installed. (automake 1.8.x, autoconf 2.59) - -Note that dependencies are generated only in a clean tree. Hence, if the -import structure of files change, the build might fail due to missing -dependencies. The easy way out is "make clean; make", the faster way is -to delete the lib*.deps files in each subdirectory. - - - } |
From: Andy S. <And...@co...> - 2010-05-21 08:06:15
|
diffing dir... Fri May 21 04:03:28 EDT 2010 Andy Stewart <laz...@gm...> * Fix gio flag in IconTheme.chs. Ignore-this: aee6873a5a061822123217d07a8537b6 { hunk ./gio/gio.cabal 48 + System.GIO.Types[_^I_][_^I_] [_$_] hunk ./gio/gio.cabal 51 - System.GIO.Types[_^I_][_^I_] [_$_] hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 76 -#if GTK_CHECK_VERSION(2,4,0) && HAVE_GIO +#if GTK_CHECK_VERSION(2,4,0) hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 109 -#ifdef ENABLE_GIO +#ifdef HAVE_GIO hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 156 -#ifdef ENABLE_GIO +#ifdef HAVE_GIO hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 162 -#if GTK_CHECK_VERSION(2,4,0) && HAVE_GIO +#if GTK_CHECK_VERSION(2,4,0) hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 368 -#ifdef ENABLE_GIO +#ifdef HAVE_GIO } |
From: Axel S. <si...@co...> - 2010-05-20 15:18:57
|
diffing dir... Sat Feb 20 13:13:59 EST 2010 ar...@rp... * Add pixbufRenderThresholdAlpha Ignore-this: f7c25ecfc1aba9f8437d7b49bda903be { hunk ./gtk/Graphics/UI/Gtk/Gdk/Pixbuf.chs 113 - pixbufGetFromDrawable + pixbufGetFromDrawable, + + pixbufRenderThresholdAlpha, + pixbufRenderPixmapAndMaskForColormap hunk ./gtk/Graphics/UI/Gtk/Gdk/Pixbuf.chs 130 +import Graphics.UI.Gtk.Gdk.Pixmap (Bitmap, Pixmap) hunk ./gtk/Graphics/UI/Gtk/Gdk/Pixbuf.chs 717 + + + +-- | Takes the opacity values in a rectangular portion of a pixbuf and +-- thresholds them to produce a bi-level alpha mask that can be used +-- as a clipping mask for a drawable. +pixbufRenderThresholdAlpha :: + Pixbuf -- ^ A pixbuf. + -> Bitmap -- ^ Bitmap where the bilevel mask will be painted to. + -> Int -- ^ Source X coordinate. + -> Int -- ^ source Y coordinate. + -> Int -- ^ Destination X coordinate. + -> Int -- ^ Destination Y coordinate. + -> Int -- ^ Width of region to threshold, or -1 to use pixbuf width + -> Int -- ^ Height of region to threshold, or -1 to use pixbuf height + -> Int -- ^ Opacity values below this will be painted as zero; all other values will be painted as one. + -> IO () +pixbufRenderThresholdAlpha src dest srcX srcY destX destY w h at = + withForeignPtr (unPixmap dest) $ \destPtr -> + {#call unsafe pixbuf_render_threshold_alpha#} src + (castPtr destPtr) + (fromIntegral srcX) + (fromIntegral srcY) + (fromIntegral destX) + (fromIntegral destY) + (fromIntegral w) + (fromIntegral h) + (fromIntegral at) + + + + + +-- | Creates a pixmap and a mask bitmap which are returned and renders +-- a pixbuf and its corresponding thresholded alpha mask to them. This +-- is merely a convenience function; applications that need to render +-- pixbufs with dither offsets or to given drawables should use +-- 'Graphics.UI.Gtk.Gdk.Drawable.drawPixbuf', and +-- 'pixbufRenderThresholdAlpha'. +-- +-- The pixmap that is created uses the 'Colormap' specified by +-- colormap. This colormap must match the colormap of the window where +-- the pixmap will eventually be used or an error will result. +-- +-- If the pixbuf does not have an alpha channel, then the returned +-- mask will be @Nothing@. +-- +pixbufRenderPixmapAndMaskForColormap :: + Pixbuf -- ^ A pixbuf. + -> Colormap -- ^ A Colormap + -> Int -- ^ Threshold value for opacity values + -> IO (Pixmap, Maybe Bitmap) -- ^ (Created pixmap, created mask) +pixbufRenderPixmapAndMaskForColormap pixbuf colormap threshold = + alloca $ \pmRetPtr -> + alloca $ \bmRetPtr -> do + {#call unsafe pixbuf_render_pixmap_and_mask_for_colormap#} pixbuf + colormap + (castPtr pmRetPtr) -- seems to reject Pixmap**, so cast + (castPtr bmRetPtr) + (fromIntegral threshold) + pm <- constructNewGObject mkPixmap (peek pmRetPtr :: IO (Ptr Pixmap)) + bm <- maybeNull (constructNewGObject mkPixmap) (peek bmRetPtr :: IO (Ptr Bitmap)) + return (pm, bm) + + } |
From: Axel S. <si...@co...> - 2010-05-20 06:38:33
|
diffing dir... Sun May 16 15:10:44 EDT 2010 Axe...@in... * Ensure that package can be built with Cabal 1.6. { hunk ./cairo/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./cairo/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./cairo/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./cairo/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./cairo/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./cairo/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./cairo/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./cairo/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./cairo/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./cairo/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./cairo/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./cairo/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./cairo/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./cairo/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./cairo/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./gconf/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./gconf/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./gconf/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./gconf/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./gconf/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./gconf/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./gconf/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./gconf/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./gconf/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./gconf/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./gconf/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./gconf/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./gconf/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./gconf/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./gconf/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./gio/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./gio/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./gio/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./gio/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./gio/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./gio/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./gio/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./gio/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./gio/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./gio/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./gio/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./gio/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./gio/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./gio/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./gio/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./glade/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./glade/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./glade/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./glade/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./glade/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./glade/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./glade/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./glade/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./glade/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./glade/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./glade/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./glade/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./glade/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./glade/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./glade/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./glib/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./glib/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./glib/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./glib/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./glib/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./glib/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./glib/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./glib/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./glib/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./glib/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./glib/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./glib/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./glib/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./glib/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./glib/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./gnomevfs/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./gnomevfs/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./gnomevfs/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./gnomevfs/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./gnomevfs/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./gnomevfs/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./gnomevfs/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./gnomevfs/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./gnomevfs/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./gnomevfs/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./gnomevfs/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./gnomevfs/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./gnomevfs/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./gnomevfs/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./gnomevfs/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./gstreamer/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./gstreamer/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./gstreamer/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./gstreamer/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + fromFlagOrDefault, defaultRegisterFlags) hunk ./gstreamer/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +#if CABAL_VERSION_CHECK(1,8,0) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./gstreamer/Gtk2HsSetup.hs 89 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./gstreamer/Gtk2HsSetup.hs 96 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./gstreamer/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook +#else + instHook simpleUserHooks pd lbi uh flags >> hunk ./gstreamer/Gtk2HsSetup.hs 122 +#endif hunk ./gstreamer/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ +-- Lots of stuff for windows ghci support +------------------------------------------------------------------------------ + +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./gstreamer/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./gstreamer/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./gtk/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./gtk/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./gtk/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./gtk/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./gtk/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./gtk/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./gtk/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./gtk/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./gtk/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./gtk/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./gtk/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./gtk/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./gtk/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./gtk/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./gtk/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./gtkglext/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./gtkglext/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./gtkglext/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./gtkglext/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./gtkglext/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./gtkglext/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./gtkglext/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./gtkglext/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./gtkglext/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./gtkglext/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./gtkglext/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./gtkglext/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./gtkglext/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./gtkglext/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./gtkglext/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./gtksourceview2/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./gtksourceview2/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./gtksourceview2/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./gtksourceview2/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./gtksourceview2/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./gtksourceview2/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./gtksourceview2/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./gtksourceview2/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./gtksourceview2/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./gtksourceview2/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./gtksourceview2/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./gtksourceview2/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./gtksourceview2/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./gtksourceview2/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./gtksourceview2/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./pango/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./pango/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./pango/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./pango/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./pango/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./pango/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./pango/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./pango/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./pango/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./pango/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./pango/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./pango/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./pango/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./pango/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./pango/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./svgcairo/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./svgcairo/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./svgcairo/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./svgcairo/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./svgcairo/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./svgcairo/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./svgcairo/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./svgcairo/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./svgcairo/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./svgcairo/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./svgcairo/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./svgcairo/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./svgcairo/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./svgcairo/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./svgcairo/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./vte/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./vte/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./vte/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./vte/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./vte/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./vte/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./vte/Gtk2HsSetup.hs 119 +#else + instHook simpleUserHooks pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest +#endif hunk ./vte/Gtk2HsSetup.hs 125 +------------------------------------------------------------------------------ hunk ./vte/Gtk2HsSetup.hs 127 +------------------------------------------------------------------------------ + hunk ./vte/Gtk2HsSetup.hs 139 +-- The following code is a big copy-and-paste job from the sources of +-- Cabal 1.8 just to be able to fix a field in the package file. Yuck. + +#if CABAL_VERSION_CHECK(1,8,0) + [_$_] hunk ./vte/Gtk2HsSetup.hs 180 -#if defined(mingw32_HOST_OS) || defined(__MINGW32__) hunk ./vte/Gtk2HsSetup.hs 184 -#else - let installedPkgInfo = installedPkgInfoRaw -#endif hunk ./vte/Gtk2HsSetup.hs 206 +#else +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyInPlace = installInPlace flags, + copyUseWrapper = installUseWrapper flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg_descr lbi regFlags = do + let verbosity = fromFlag (regVerbosity regFlags) + warn verbosity "Cannot register ghci libraries with Cabal 1.6 (need 1.8)." + Register.register pkg_descr lbi regFlags + [_$_] +#endif + +------------------------------------------------------------------------------ hunk ./vte/Gtk2HsSetup.hs 247 +------------------------------------------------------------------------------ + hunk ./vte/Gtk2HsSetup.hs 256 +------------------------------------------------------------------------------ +-- Processing .chs files with our local c2hs. +------------------------------------------------------------------------------ + hunk ./webkit/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), lhcPkgProgram, + Program(..), ConfiguredProgram(..), hunk ./webkit/Gtk2HsSetup.hs 76 - defaultRegisterFlags) + fromFlagOrDefault, defaultRegisterFlags) hunk ./webkit/Gtk2HsSetup.hs 79 +#if CABAL_VERSION_CHECK(1,8,0) hunk ./webkit/Gtk2HsSetup.hs 81 +#else +import qualified Distribution.Simple.Register as Register ( register ) +#endif hunk ./webkit/Gtk2HsSetup.hs 90 -import Data.Maybe ( isJust, fromMaybe, maybeToList ) +import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList ) hunk ./webkit/Gtk2HsSetup.hs 114 - instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + instHook = \pd lbi uh flags -> +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + installHook pd lbi uh flags >> hunk ./webkit/Gtk2HsSetup.hs 119 +#else ... [truncated message content] |
From: Axel S. <si...@co...> - 2010-05-20 06:38:29
|
diffing dir... Sun May 16 10:07:08 EDT 2010 Axe...@in... * Adapt Hamish's Windows patch to support the renaming of Setup.hs to Gtk2HsSetup.hs which broke for pango. Ignore-this: 242a375c16d531d6c08268fac074c154 { hunk ./pango/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./pango/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./pango/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./pango/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./pango/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./pango/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./pango/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./pango/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./pango/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./pango/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./pango/Setup.hs 1 -{-# LANGUAGE CPP #-} - -#define CABAL_VERSION_ENCODE(major, minor, micro) ( \ - ((major) * 10000) \ - + ((minor) * 100) \ - + ((micro) * 1)) - -#define CABAL_VERSION_CHECK(major,minor,micro) \ - (CABAL_VERSION >= CABAL_VERSION_ENCODE(major,minor,micro)) - --- now, this is bad, but Cabal doesn't seem to actually pass any information about --- its version to CPP, so guess the version depending on the version of GHC -#ifdef CABAL_VERSION_MINOR -#ifndef CABAL_VERSION_MAJOR -#define CABAL_VERSION_MAJOR 1 -#endif -#ifndef CABAL_VERSION_MICRO -#define CABAL_VERSION_MICRO 0 -#endif -#define CABAL_VERSION CABAL_VERSION_ENCODE( \ - CABAL_VERSION_MAJOR, \ - CABAL_VERSION_MINOR, \ - CABAL_VERSION_MICRO) -#else -#warning Setup.hs is guessing the version of Cabal. If compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) -#if (__GLASGOW_HASKELL__ >= 612) -#define CABAL_VERSION CABAL_VERSION_ENCODE(1,8,0) -#else -#define CABAL_VERSION CABAL_VERSION_ENCODE(1,6,0) -#endif -#endif - --- | Build a Gtk2hs package. --- -import Distribution.Simple -import Distribution.Simple.PreProcess -import Distribution.InstalledPackageInfo ( importDirs ) -import Distribution.Simple.PackageIndex ( -#if CABAL_VERSION_CHECK(1,8,0) - lookupInstalledPackageId -#else - lookupPackageId -#endif - ) -import Distribution.Package ( PackageId(..) ) -import Distribution.PackageDescription as PD ( PackageDescription(..), - updatePackageDescription, - BuildInfo(..), - emptyBuildInfo, allBuildInfo, - Library(..), - libModules) -import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..), - InstallDirs(..), -#if CABAL_VERSION_CHECK(1,8,0) - componentPackageDeps, -#else - packageDeps, -#endif - absoluteInstallDirs) -import Distribution.Simple.Compiler ( Compiler(..) ) -import Distribution.Simple.Program ( - Program(..), ConfiguredProgram(..), - rawSystemProgramConf, rawSystemProgramStdoutConf, - c2hsProgram, pkgConfigProgram, - simpleProgram, lookupProgram, rawSystemProgramStdout, ProgArg) -import Distribution.ModuleName ( ModuleName, components, toFilePath ) -import Distribution.Simple.Utils -import Distribution.Simple.Setup (CopyFlags(..), InstallFlags(..), CopyDest(..), - defaultCopyFlags, ConfigFlags(configVerbosity), - fromFlag, toFlag) +-- Setup file for a Gtk2Hs module. Contains only adjustments specific to this module, +-- all Gtk2Hs-specific boilerplate is stored in Gtk2HsSetup.hs which should be kept +-- identical across all modules. +import Distribution.Simple ( defaultMainWithHooks, UserHooks(postConf), + PackageIdentifier(..), PackageName(..) ) +import Gtk2HsSetup ( gtk2hsUserHooks, getPkgConfigPackages ) +import Distribution.Simple.Setup ( ConfigFlags(configVerbosity), fromFlag) +import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..) ) hunk ./pango/Setup.hs 10 -import Distribution.Text ( simpleParse, display ) -import System.FilePath -import System.Directory ( doesFileExist ) -import Distribution.Version (Version(..)) +import Distribution.Text ( display ) +import Distribution.Version ( Version(..) ) hunk ./pango/Setup.hs 13 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) -import Data.List (isPrefixOf, nub) -import Data.Char (isAlpha) -import qualified Data.Map as M -import qualified Data.Set as S - +import Distribution.Simple.Utils +import System.FilePath hunk ./pango/Setup.hs 19 - genSynthezisedFiles (fromFlag (configVerbosity cf)) pd lbi - postConf simpleUserHooks args cf pd lbi, - buildHook = \pd lbi uh bf -> fixDeps pd >>= \pd -> - (buildHook simpleUserHooks) pd lbi uh bf, - copyHook = \pd lbi uh flags -> (copyHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (copyVerbosity flags)) (fromFlag (copyDest flags)), - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + let verb = (fromFlag (configVerbosity cf)) + cPkgs <- getPkgConfigPackages verb lbi pd + let [pangoVersion] = [ v | PackageIdentifier (PackageName "pango") v <- cPkgs ] + writePangoVersionHeaderFile verb lbi pangoVersion + postConf gtk2hsUserHooks args cf pd lbi hunk ./pango/Setup.hs 26 --- This is a hack for Cabal-1.8, It is not needed in Cabal-1.9.1 or later -adjustLocalBuildInfo :: LocalBuildInfo -> LocalBuildInfo -adjustLocalBuildInfo lbi = - let extra = (Just libBi, []) - libBi = emptyBuildInfo { includeDirs = [ autogenModulesDir lbi - , buildDir lbi ] } - in lbi { localPkgDescr = updatePackageDescription extra (localPkgDescr lbi) } - -ourC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor -ourC2hs bi lbi = PreProcessor { - platformIndependent = False, - runPreProcessor = runC2HS bi lbi -} - -runC2HS :: BuildInfo -> LocalBuildInfo -> - (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO () -runC2HS bi lbi (inDir, inFile) (outDir, outFile) verbosity = do - -- have the header file name if we don't have the precompiled header yet - header <- case lookup "x-c2hs-header" (customFieldsBI bi) of - Just h -> return h - Nothing -> die ("Need x-c2hs-Header definition in the .cabal Library section "++ - "that sets the C header file to process .chs.pp files.") - - -- c2hs will output files in out dir, removing any leading path of the input file. - -- Thus, append the dir of the input file to the output dir. - let (outFileDir, newOutFile) = splitFileName outFile - let newOutDir = outDir </> outFileDir - -- additional .chi files might be needed that other packages have installed; - -- we assume that these are installed in the same place as .hi files - let chiDirs = [ dir | -#if CABAL_VERSION_CHECK(1,8,0) - ipi <- maybe [] (map fst . componentPackageDeps) (libraryConfig lbi), - dir <- maybe [] importDirs (lookupInstalledPackageId (installedPkgs lbi) ipi) ] -#else - ipi <- packageDeps lbi, - dir <- maybe [] importDirs (lookupPackageId (installedPkgs lbi) ipi) ] -#endif - rawSystemProgramConf verbosity c2hsLocal (withPrograms lbi) $ - map ("--include=" ++) (outDir:chiDirs) - ++ ["--cppopts=" ++ opt | opt <- getCppOptions bi lbi] - ++ ["--output-dir=" ++ newOutDir, - "--output=" ++ newOutFile, - "--precomp=" ++ buildDir lbi </> precompFile, - header, inDir </> inFile] - -getCppOptions :: BuildInfo -> LocalBuildInfo -> [String] -getCppOptions bi lbi - = nub $ - ["-I" ++ dir | dir <- PD.includeDirs bi] - ++ [opt | opt@('-':c:_) <- (PD.cppOptions bi ++ PD.ccOptions bi), c `elem` "DIU"] - -installCHI :: PackageDescription -- ^information from the .cabal file - -> LocalBuildInfo -- ^information from the configure step - -> Verbosity -> CopyDest -- ^flags sent to copy or install - -> IO () -installCHI pk...@PD...ckageDescription { library = Just lib } lbi verbosity copydest = do - let InstallDirs { libdir = libPref } = absoluteInstallDirs pkg lbi copydest - -- cannot use the recommended 'findModuleFiles' since it fails if there exists - -- a modules that does not have a .chi file - mFiles <- mapM (findFileWithExtension' ["chi"] [buildDir lbi]) - (map toFilePath -#if CABAL_VERSION_CHECK(1,8,0) - (PD.libModules lib) -#else - (PD.libModules pkg) -#endif - ) - let files = [ f | Just f <- mFiles ] -#if CABAL_VERSION_CHECK(1,8,0) - installOrdinaryFiles verbosity libPref files -#else - copyFiles verbosity libPref files -#endif - - [_$_] -installCHI _ _ _ _ = return () - ------------------------------------------------------------------------------- --- Generating the type hierarchy and signal callback .hs files. ------------------------------------------------------------------------------- - -typeGenProgram :: Program -typeGenProgram = (simpleProgram "gtk2hsTypeGen") - -signalGenProgram :: Program -signalGenProgram = (simpleProgram "gtk2hsHookGenerator") - -c2hsLocal :: Program -c2hsLocal = (simpleProgram "gtk2hsC2hs") - -genSynthezisedFiles :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO () -genSynthezisedFiles verb pd lbi = do - - cPkgs <- getPkgConfigPackages verb lbi pd - - let xList = maybe [] (customFieldsBI . libBuildInfo) (library pd) - ++customFieldsPD pd - typeOpts :: [ProgArg] - typeOpts = concat [ map (\val -> '-':'-':drop 8 field++'=':val) (words content) - | (field,content) <- xList, - "x-types-" `isPrefixOf` field, - field /= "x-types-file"] - ++ [ "--tag=" ++ tag - | PackageIdentifier name (Version (major:minor:_) _) <- cPkgs - , let name' = filter isAlpha (display name) - , tag <- name' - : [ name' ++ "-" ++ show major ++ "." ++ show digit - | digit <- [0,2..minor] ] - ] - - genFile :: Program -> [ProgArg] -> FilePath -> IO () - genFile prog args outFile = do - res <- rawSystemProgramStdoutConf verb prog (withPrograms lbi) args - rewriteFile outFile res - - case lookup "x-types-file" xList of - Nothing -> return () - Just f -> do - info verb ("Ensuring that class hierarchy in "++f++" is up-to-date.") - genFile typeGenProgram typeOpts f - - case (lookup "x-signals-file" xList, - lookup "x-signals-modname" xList) of - (Just _, Nothing) -> die "You need to specify the module name (X-Signals-ModName) \ - \to generate a signal file." - (Just f, Just mod) -> do - info verb ("Ensuring that callback hooks in "++f++" are up-to-date.") - genFile signalGenProgram [mod] f - (_,_) -> return () - - let [pangoVersion] = [ v | PackageIdentifier (PackageName "pango") v <- cPkgs ] - writePangoVersionHeaderFile verb lbi pangoVersion - ---FIXME: Cabal should tell us the selected pkg-config package versions in the --- LocalBuildInfo or equivalent. --- In the mean time, ask pkg-config again. - -getPkgConfigPackages :: Verbosity -> LocalBuildInfo -> PackageDescription -> IO [PackageId] -getPkgConfigPackages verbosity lbi pkg = - sequence - [ do version <- pkgconfig ["--modversion", display pkgname] - case simpleParse version of - Nothing -> die $ "parsing output of pkg-config --modversion failed" - Just v -> return (PackageIdentifier pkgname v) - | Dependency pkgname _ <- concatMap pkgconfigDepends (allBuildInfo pkg) ] - where - pkgconfig = rawSystemProgramStdoutConf verbosity - pkgConfigProgram (withPrograms lbi) - } |
From: Axel S. <si...@co...> - 2010-05-20 06:38:28
|
diffing dir... Sun May 9 22:08:43 EDT 2010 Hamish Mackenzie <ham...@go...> * Set extraGHCiLibraries on windows using full DLL names Ignore-this: 7fee9866cac034c3dcd87c470fe81cf3 { hunk ./cairo/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./cairo/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./cairo/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./cairo/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./cairo/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./cairo/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./cairo/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./cairo/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./cairo/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./cairo/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./gconf/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./gconf/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./gconf/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./gconf/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./gconf/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./gconf/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./gconf/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./gconf/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./gconf/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./gconf/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./gio/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./gio/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./gio/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./gio/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./gio/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./gio/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./gio/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./gio/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./gio/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./gio/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./glade/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./glade/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./glade/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./glade/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./glade/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./glade/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./glade/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./glade/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./glade/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./glade/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./glib/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./glib/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./glib/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./glib/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./glib/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./glib/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./glib/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./glib/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./glib/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./glib/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./gnomevfs/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./gnomevfs/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./gnomevfs/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./gnomevfs/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./gnomevfs/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./gnomevfs/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./gnomevfs/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./gnomevfs/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./gnomevfs/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./gnomevfs/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./gtk/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./gtk/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./gtk/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./gtk/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./gtk/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./gtk/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./gtk/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./gtk/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./gtk/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./gtk/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./gtkglext/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./gtkglext/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./gtkglext/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./gtkglext/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./gtkglext/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./gtkglext/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./gtkglext/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./gtkglext/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./gtkglext/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./gtkglext/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + hunk ./gtksourceview2/Gtk2HsSetup.hs 39 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./gtksourceview2/Gtk2HsSetup.hs 56 - libModules) + libModules, hasLibs) hunk ./gtksourceview2/Gtk2HsSetup.hs 67 - Program(..), ConfiguredProgram(..), + Program(..), ConfiguredProgram(..), lhcPkgProgram, hunk ./gtksourceview2/Gtk2HsSetup.hs 69 - c2hsProgram, pkgConfigProgram, + c2hsProgram, pkgConfigProgram, requireProgram, ghcPkgProgram, hunk ./gtksourceview2/Gtk2HsSetup.hs 75 - fromFlag, toFlag) + fromFlag, toFlag, RegisterFlags(..), flagToMaybe, + defaultRegisterFlags) hunk ./gtksourceview2/Gtk2HsSetup.hs 78 +import Distribution.Simple.Install ( install ) +import Distribution.Simple.Register ( generateRegistrationInfo, registerPackage ) hunk ./gtksourceview2/Gtk2HsSetup.hs 85 -import Control.Monad (unless) -import Data.Maybe (fromMaybe) +import Control.Monad (when, unless, filterM) +import Data.Maybe ( isJust, fromMaybe, maybeToList ) hunk ./gtksourceview2/Gtk2HsSetup.hs 92 +import Control.Applicative ((<$>)) +import System.Directory (getDirectoryContents, doesDirectoryExist) hunk ./gtksourceview2/Gtk2HsSetup.hs 110 - instHook = \pd lbi uh flags -> (instHook simpleUserHooks) pd lbi uh flags >> - installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest + instHook = \pd lbi uh flags -> installHook pd lbi uh flags >> + installCHI pd lbi (fromFlag (installVerbosity flags)) NoCopyDest, + regHook = registerHook hunk ./gtksourceview2/Gtk2HsSetup.hs 115 +-- Lots of stuff for windows ghci support +getDlls :: [FilePath] -> IO [FilePath] +getDlls dirs = filter ((== ".dll") . takeExtension) . concat <$> + mapM getDirectoryContents dirs + +fixLibs :: [FilePath] -> [String] -> [String] +fixLibs dlls = concatMap $ \ lib -> + case filter (("lib" ++ lib) `isPrefixOf`) dlls of + dll:_ -> [dropExtension dll] + _ -> if lib == "z" then [] else [lib] + +installHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> InstallFlags -> IO () +installHook pkg_descr localbuildinfo _ flags = do + let copyFlags = defaultCopyFlags { + copyDistPref = installDistPref flags, + copyDest = toFlag NoCopyDest, + copyVerbosity = installVerbosity flags + } + install pkg_descr localbuildinfo copyFlags + let registerFlags = defaultRegisterFlags { + regDistPref = installDistPref flags, + regInPlace = installInPlace flags, + regPackageDB = installPackageDB flags, + regVerbosity = installVerbosity flags + } + when (hasLibs pkg_descr) $ register pkg_descr localbuildinfo registerFlags + +registerHook :: PackageDescription -> LocalBuildInfo + -> UserHooks -> RegisterFlags -> IO () +registerHook pkg_descr localbuildinfo _ flags = + if hasLibs pkg_descr + then register pkg_descr localbuildinfo flags + else setupMessage verbosity + "Package contains no library to register:" (packageId pkg_descr) + where verbosity = fromFlag (regVerbosity flags) + +register :: PackageDescription -> LocalBuildInfo + -> RegisterFlags -- ^Install in the user's database?; verbose + -> IO () +register pkg@PackageDescription { library = Just lib } + lbi@LocalBuildInfo { libraryConfig = Just clbi } regFlags + = do + + installedPkgInfoRaw <- generateRegistrationInfo + verbosity pkg lib lbi clbi inplace distPref + +#if defined(mingw32_HOST_OS) || defined(__MINGW32__) + dllsInScope <- getSearchPath >>= (filterM doesDirectoryExist) >>= getDlls + let libs = fixLibs dllsInScope (extraLibraries installedPkgInfoRaw) + installedPkgInfo = installedPkgInfoRaw { + extraGHCiLibraries = libs } +#else + let installedPkgInfo = installedPkgInfoRaw +#endif + + -- Three different modes: + case () of + _ | modeGenerateRegFile -> die "Generate Reg File not supported" + | modeGenerateRegScript -> die "Generate Reg Script not supported" + | otherwise -> registerPackage verbosity + installedPkgInfo pkg lbi inplace packageDb + + where + modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags)) + modeGenerateRegScript = fromFlag (regGenScript regFlags) + inplace = fromFlag (regInPlace regFlags) + packageDb = case flagToMaybe (regPackageDB regFlags) of + Just db -> db + Nothing -> registrationPackageDB (withPackageDB lbi) + distPref = fromFlag (regDistPref regFlags) + verbosity = fromFlag (regVerbosity regFlags) + +register _ _ regFlags = notice verbosity "No package to register" + where + verbosity = fromFlag (regVerbosity regFlags) + merger 0.0 ( hunk ./pango/Setup.hs 1 -{-# LANGUAGE CPP #-} - -#define CABAL_VERSION_ENCODE(major, minor, micro) ( \ - ((major) * 10000) \ - + ((minor) * 100) \ - + ((micro) * 1)) - -#define CABAL_VERSION_CHECK(major,minor,micro) \ - (CABAL_VERSION >= CABAL_VERSION_ENCODE(major,minor,micro)) - --- now, this is bad, but Cabal doesn't seem to actually pass any information about --- its version to CPP, so guess the version depending on the version of GHC -#ifdef CABAL_VERSION_MINOR -#ifndef CABAL_VERSION_MAJOR -#define CABAL_VERSION_MAJOR 1 -#endif -#ifndef CABAL_VERSION_MICRO -#define CABAL_VERSION_MICRO 0 -#endif -#define CABAL_VERSION CABAL_VERSION_ENCODE( \ - CABAL_VERSION_MAJOR, \ - CABAL_VERSION_MINOR, \ - CABAL_VERSION_MICRO) -#else -#warning Setup.hs is guessing the version of Cabal. If compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) -#if (__GLASGOW_HASKELL__ >= 612) -#define CABAL_VERSION CABAL_VERSION_ENCODE(1,8,0) -#else -#define CABAL_VERSION CABAL_VERSION_ENCODE(1,6,0) -#endif -#endif - --- | Build a Gtk2hs package. --- -import Distribution.Simple -import Distribution.Simple.PreProcess -import Distribution.InstalledPackageInfo ( importDirs ) -import Distribution.Simple.PackageIndex ( -#if CABAL_VERSION_CHECK(1,8,0) - lookupInstalledPackageId -#else - lookupPackageId -#endif - ) -import Distribution.Package ( PackageId(..) ) -import Distribution.PackageDescription as PD ( PackageDescription(..), - updatePackageDescription, - BuildInfo(..), - emptyBuildInfo, allBuildInfo, - Library(..), - libModules) -import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..), - InstallDirs(..), -#if CABAL_VERSION_CHECK(1,8,0) - componentPackageDeps, -#else - packageDeps, -#endif - absoluteInstallDirs) -import Distribution.Simple.Compiler ( Compiler(..) ) -import Distribution.Simple.Program ( - Program(..), ConfiguredProgram(..), - rawSystemProgramConf, rawSystemProgramStdoutConf, - c2hsProgram, pkgConfigProgram, - simpleProgram, lookupProgram, rawSystemProgramStdout, ProgArg) -import Distribution.ModuleName ( ModuleName, components, toFilePath ) -import Distribution.Simple.Utils -import Distribution.Simple.Setup (CopyFlags(..), InstallFlags(..), CopyDest(..), - defaultCopyFlags, ConfigFlags(configVerbosity), - fromFlag, toFlag) +-- Setup file for a Gtk2Hs module. Contains only adjustments specific to this module, +-- all Gtk2Hs-specific boilerplate is stored in Gtk2HsSetup.hs which should be kept +-- identical across all modules. +import Distribution.Simple ( defaultMainWithHooks, UserHooks(postConf), + PackageIdentifier(..), PackageName(..) ) +import Gtk2HsSetup ( gtk2hsUserHooks, getPkgConfigPackages ) +import Distribution.Simple.Setup ( ConfigFlags(configVerbosity), fromFlag) +import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..) ) hunk ./pango/Setup.hs 37 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) ) merger 0.0 ( merger 0.0 ( hunk ./pango/Setup.hs 37 -import Distribution.InstalledPackageInfo ( importDirs ) +import Distribution.InstalledPackageInfo ( importDirs, + showInstalledPackageInfo, + libraryDirs, + extraLibraries, + extraGHCiLibraries ) hunk ./pango/Setup.hs 1 -{-# LANGUAGE CPP #-} - -#define CABAL_VERSION_ENCODE(major, minor, micro) ( \ - ((major) * 10000) \ - + ((minor) * 100) \ - + ((micro) * 1)) - -#define CABAL_VERSION_CHECK(major,minor,micro) \ - (CABAL_VERSION >= CABAL_VERSION_ENCODE(major,minor,micro)) - --- now, this is bad, but Cabal doesn't seem to actually pass any information about --- its version to CPP, so guess the version depending on the version of GHC -#ifdef CABAL_VERSION_MINOR -#ifndef CABAL_VERSION_MAJOR -#define CABAL_VERSION_MAJOR 1 -#endif -#ifndef CABAL_VERSION_MICRO -#define CABAL_VERSION_MICRO 0 -#endif -#define CABAL_VERSION CABAL_VERSION_ENCODE( \ - CABAL_VERSION_MAJOR, \ - CABAL_VERSION_MINOR, \ - CABAL_VERSION_MICRO) -#else -#warning Setup.hs is guessing the version of Cabal. If compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) -#if (__GLASGOW_HASKELL__ >= 612) -#define CABAL_VERSION CABAL_VERSION_ENCODE(1,8,0) -#else -#define CABAL_VERSION CABAL_VERSION_ENCODE(1,6,0) -#endif -#endif - --- | Build a Gtk2hs package. --- -import Distribution.Simple -import Distribution.Simple.PreProcess -import Distribution.InstalledPackageInfo ( importDirs ) -import Distribution.Simple.PackageIndex ( -#if CABAL_VERSION_CHECK(1,8,0) - lookupInstalledPackageId -#else - lookupPackageId -#endif - ) -import Distribution.Package ( PackageId(..) ) -import Distribution.PackageDescription as PD ( PackageDescription(..), - updatePackageDescription, - BuildInfo(..), - emptyBuildInfo, allBuildInfo, - Library(..), - libModules) -import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..), - InstallDirs(..), -#if CABAL_VERSION_CHECK(1,8,0) - componentPackageDeps, -#else - packageDeps, -#endif - absoluteInstallDirs) -import Distribution.Simple.Compiler ( Compiler(..) ) -import Distribution.Simple.Program ( - Program(..), ConfiguredProgram(..), - rawSystemProgramConf, rawSystemProgramStdoutConf, - c2hsProgram, pkgConfigProgram, - simpleProgram, lookupProgram, rawSystemProgramStdout, ProgArg) -import Distribution.ModuleName ( ModuleName, components, toFilePath ) -import Distribution.Simple.Utils -import Distribution.Simple.Setup (CopyFlags(..), InstallFlags(..), CopyDest(..), - defaultCopyFlags, ConfigFlags(configVerbosity), - fromFlag, toFlag) +-- Setup file for a Gtk2Hs module. Contains only adjustments specific to this module, +-- all Gtk2Hs-specific boilerplate is stored in Gtk2HsSetup.hs which should be kept +-- identical across all modules. +import Distribution.Simple ( defaultMainWithHooks, UserHooks(postConf), + PackageIdentifier(..), P... [truncated message content] |
From: Axel S. <si...@co...> - 2010-05-20 06:38:24
|
diffing dir... Sun May 9 22:05:30 EDT 2010 Hamish Mackenzie <ham...@go...> * Use win32 critical section in hsgthread.c finalizer code Ignore-this: 6bfaec66f7c3453aaa13d96072ff013f { hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 21 + * + * Also g_static_mutex_lock and g_static_mutex_unlock cause problems ghci + * on windows so using a Win32 critical section instead hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 31 +#if defined( WIN32 ) +#include <windows.h> +#endif + hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 37 -static GStaticMutex gtk2hs_finalizer_mutex; +#if defined( WIN32 ) +static int mutex_initialised = 0; +static CRITICAL_SECTION gtk2hs_finalizer_mutex; +#else +static GStaticMutex gtk2hs_finalizer_mutex = G_STATIC_MUTEX_INIT; +#endif hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 62 + +#if defined( WIN32 ) + if (!mutex_initialised) { + InitializeCriticalSection( >k2hs_finalizer_mutex ); + mutex_initialised = 1; + } + EnterCriticalSection( >k2hs_finalizer_mutex ); +#else hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 71 +#endif hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 98 +#if defined( WIN32 ) + LeaveCriticalSection( >k2hs_finalizer_mutex ); +#else hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 102 +#endif hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 110 +#if defined( WIN32 ) + if (!mutex_initialised) { + InitializeCriticalSection( >k2hs_finalizer_mutex ); + mutex_initialised = 1; + } + EnterCriticalSection( >k2hs_finalizer_mutex ); +#else hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 118 +#endif hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 131 +#if defined( WIN32 ) + LeaveCriticalSection( >k2hs_finalizer_mutex ); +#else hunk ./gtk/Graphics/UI/Gtk/General/hsgthread.c 135 +#endif hunk ./gtk/gtk.cabal 250 + extra-libraries: kernel32 } |
From: Andy S. <And...@co...> - 2010-05-20 06:08:56
|
diffing dir... Thu May 20 02:07:58 EDT 2010 Andy Stewart <laz...@gm...> * Add `tools` in bootstrap.sh. Ignore-this: 3d49a4b3b524a84b6702efbed0acae39 hunk ./bootstrap.sh 5 -for pkg in glib gio cairo pango gtk gconf glade gnomevfs gstreamer gtkglext gtksourceview2 soegtk svgcairo vte webkit; do [_$_] +for pkg in tools glib gio cairo pango gtk gconf glade gnomevfs gstreamer gtkglext gtksourceview2 soegtk svgcairo vte webkit; do [_$_] |
From: Andy S. <And...@co...> - 2010-05-16 11:23:45
|
diffing dir... Sun May 16 07:22:28 EDT 2010 Andy Stewart <laz...@gm...> * Fix treeView.chs docs. Ignore-this: ada6ac9d84280032af04f7d05b737736 { hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 955 --- | @gtkTreeViewTreeToWidgetCoords@ has been deprecated since version 2.12 and should not be used in +-- | 'treeViewTreeToWidgetCoords' has been deprecated since version 2.12 and should not be used in hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 957 --- @binWindow@ coordinates to coordinates relative to @binWindow@, please see +-- bin window coordinates to coordinates relative to bin window, please see hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 960 --- Converts tree coordinates (coordinates in full scrollable area of the tree) to @binWindow@ +-- Converts tree coordinates (coordinates in full scrollable area of the tree) to bin window hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 979 --- | @gtkTreeViewWidgetToTreeCoords@ has been deprecated since version 2.12 and should not be used in +-- | 'treeViewWidgetToTreeCoords' has been deprecated since version 2.12 and should not be used in hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 981 --- coordinates relative to the widget to @binWindow@ coordinates, please see +-- coordinates relative to the widget to bin window coordinates, please see hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 984 --- Converts @binWindow@ coordinates to coordinates for the tree (the full scrollable area of the tree). +-- Converts bin window coordinates to coordinates for the tree (the full scrollable area of the tree). hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 1073 --- | Converts widget coordinates to coordinates for the 'window (see gtkTreeViewGetBinWindow'. +-- | Converts widget coordinates to coordinates for the window (see 'treeViewGetBinWindow' ). } |
From: Andy S. <And...@co...> - 2010-05-16 10:51:34
|
diffing dir... Sun May 16 06:50:21 EDT 2010 Andy Stewart <laz...@gm...> * Add new coordinate functions to get "header height" of treeView. (Deprecated `treeViewWidgetToTreeCoords` and `treeViewTreeToWidgetCoords`) Ignore-this: 22a088c548bdd3e09dcdf3624356893d { hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 141 - treeViewWidgetToTreeCoords, - treeViewTreeToWidgetCoords, +#if GTK_CHECK_VERSION(2,12,0) + treeViewConvertBinWindowToTreeCoords, + treeViewConvertBinWindowToWidgetCoords, + treeViewConvertTreeToBinWindowCoords, + treeViewConvertTreeToWidgetCoords, + treeViewConvertWidgetToBinWindowCoords, + treeViewConvertWidgetToTreeCoords, +#endif hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 228 + treeViewWidgetToTreeCoords, + treeViewTreeToWidgetCoords, + hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 954 --- | Convert tree to widget pixel coordinates. --- --- * See module description. +#ifndef DISABLE_DEPRECATED +-- | @gtkTreeViewTreeToWidgetCoords@ has been deprecated since version 2.12 and should not be used in +-- newly-written code. Due to historial reasons the name of this function is incorrect. For converting +-- @binWindow@ coordinates to coordinates relative to @binWindow@, please see +-- 'treeViewConvertBinWindowToWidgetCoords'. +-- [_$_] +-- Converts tree coordinates (coordinates in full scrollable area of the tree) to @binWindow@ +-- coordinates. hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 979 --- | Convert widget to tree pixel coordinates. --- --- * See module description. +-- | @gtkTreeViewWidgetToTreeCoords@ has been deprecated since version 2.12 and should not be used in +-- newly-written code. Due to historial reasons the name of this function is incorrect. For converting +-- coordinates relative to the widget to @binWindow@ coordinates, please see +-- 'treeViewConvertWidgetToBinWindowCoords'. +-- [_$_] +-- Converts @binWindow@ coordinates to coordinates for the tree (the full scrollable area of the tree). hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs 1001 +#endif + +#if GTK_CHECK_VERSION(2,12,0) +-- | Converts bin window coordinates to coordinates for the tree (the full scrollable area of the tree). +treeViewConvertBinWindowToTreeCoords :: TreeViewClass self => self + -> Point -- ^ @(bx, by)@ - bin window X and Y coordinates + -> IO Point -- ^ @(tx, ty)@ returns tree X and Y coordinates [_$_] +treeViewConvertBinWindowToTreeCoords self (bx, by) = + alloca $ \txPtr -> + alloca $ \tyPtr -> do + {# call unsafe tree_view_convert_bin_window_to_tree_coords #} + (toTreeView self) + (fromIntegral bx) + (fromIntegral by) + txPtr + tyPtr + tx <- peek txPtr + ty <- peek tyPtr + return (fromIntegral tx, fromIntegral ty) + +-- | Converts bin window coordinates (see 'treeViewGetBinWindow' to widget relative coordinates. +treeViewConvertBinWindowToWidgetCoords :: TreeViewClass self => self + -> Point -- ^ @(bx, by)@ - bin window X and Y coordinates + -> IO Point -- ^ @(wx, wy)@ returns widget X and Y coordinates [_$_] +treeViewConvertBinWindowToWidgetCoords self (bx, by) = + alloca $ \wxPtr -> + alloca $ \wyPtr -> do + {# call unsafe tree_view_convert_bin_window_to_widget_coords #} + (toTreeView self) + (fromIntegral bx) + (fromIntegral by) + wxPtr + wyPtr + wx <- peek wxPtr + wy <- peek wyPtr + return (fromIntegral wx, fromIntegral wy) + +-- | Converts tree coordinates (coordinates in full scrollable area of the tree) to bin window +-- coordinates. +treeViewConvertTreeToBinWindowCoords :: TreeViewClass self => self + -> Point -- ^ @(tx, ty)@ - tree X and Y coordinates + -> IO Point -- ^ @(bx, by)@ returns bin window X and Y coordinates [_$_] +treeViewConvertTreeToBinWindowCoords self (tx, ty) = + alloca $ \bxPtr -> + alloca $ \byPtr -> do + {# call unsafe tree_view_convert_tree_to_bin_window_coords #} + (toTreeView self) + (fromIntegral tx) + (fromIntegral ty) + bxPtr + byPtr + bx <- peek bxPtr + by <- peek byPtr + return (fromIntegral bx, fromIntegral by) + +-- | Converts tree coordinates (coordinates in full scrollable area of the tree) to widget coordinates. +treeViewConvertTreeToWidgetCoords :: TreeViewClass self => self + -> Point -- ^ @(tx, ty)@ - tree X and Y coordinates + -> IO Point -- ^ @(wx, wy)@ returns widget X and Y coordinates [_$_] +treeViewConvertTreeToWidgetCoords self (wx, wy) = + alloca $ \bxPtr -> + alloca $ \byPtr -> do + {# call unsafe tree_view_convert_tree_to_widget_coords #} + (toTreeView self) + (fromIntegral wx) + (fromIntegral wy) + bxPtr + byPtr + bx <- peek bxPtr + by <- peek byPtr + return (fromIntegral bx, fromIntegral by) + +-- | Converts widget coordinates to coordinates for the 'window (see gtkTreeViewGetBinWindow'. +treeViewConvertWidgetToBinWindowCoords :: TreeViewClass self => self + -> Point -- ^ @(wx, wy)@ - widget X and Y coordinates + -> IO Point -- ^ @(bx, by)@ returns bin window X and Y coordinates [_$_] +treeViewConvertWidgetToBinWindowCoords self (wx, wy) = + alloca $ \bxPtr -> + alloca $ \byPtr -> do + {# call unsafe tree_view_convert_widget_to_bin_window_coords #} + (toTreeView self) + (fromIntegral wx) + (fromIntegral wy) + bxPtr + byPtr + bx <- peek bxPtr + by <- peek byPtr + return (fromIntegral bx, fromIntegral by) + +-- | Converts widget coordinates to coordinates for the tree (the full scrollable area of the tree). +treeViewConvertWidgetToTreeCoords :: TreeViewClass self => self + -> Point -- ^ @(wx, wy)@ - bin window X and Y coordinates + -> IO Point -- ^ @(tx, ty)@ returns tree X and Y coordinates [_$_] +treeViewConvertWidgetToTreeCoords self (wx, wy) = + alloca $ \txPtr -> + alloca $ \tyPtr -> do + {# call unsafe tree_view_convert_widget_to_tree_coords #} + (toTreeView self) + (fromIntegral wx) + (fromIntegral wy) + txPtr + tyPtr + tx <- peek txPtr + ty <- peek tyPtr + return (fromIntegral tx, fromIntegral ty) +#endif } |
From: Andy S. <And...@co...> - 2010-05-15 17:52:07
|
diffing dir... Sat May 15 13:46:44 EDT 2010 Andy Stewart <laz...@gm...> * Delete unused files. Ignore-this: a3c69a2051d009b8d1c28da7a8c2f408 { hunk ./mk/chsDepend.in 1 -#!/bin/sh -# Write dependency information for a c2hs file. -# Usage: -# chsDepend [-i<seachPath>] {<file>(.hs|.chs|.chs.pp)} - -# Generate dependency information for the given files looking for -# dependant files in the colon-separated search path <searchPath>. - -SED=@SED@; -GREP=@GREP@; -DEPDIR=@DEPDIR@; -DEPDIRSLASH=`if test -n "$DEPDIR"; then echo $DEPDIR/; fi`; - -SEARCHPATH=.; - -TMPCMDLINE=$@; -OLDIFS=$IFS; - -case $1 in - -[iI]*) SEARCHPATH=`echo "$1" | $SED 's/-[iI]//'`; shift ;; -esac - -for FULLNAME in $@; do - FULLNAMEDEP=`echo "$FULLNAME" | $SED 's/\.chs/.dep/'`; - FULLNAMEHS=`echo "$FULLNAME" | $SED 's/\.chs/.hs/'`; - if test -f "$FULLNAME"; then - DEPS="`$GREP '{#[ \t]*import' $FULLNAME 2> /dev/null \ - | $SED 'y|.|/|;s|^.*{#[ ]*import[ ][ ]*\([a-zA-Z1-9/]*\)[ ]*#}.*|\1|'`"; - #echo Looking for dependent files: $DEPS - DEPNAMES=; - for DEP in $DEPS; do - IFS=:; - FOUND=no; - for DEPDIR in $SEARCHPATH; do - DEPNAME=`echo "$DEPDIR/$DEP" | $SED 's%\.//*%%'`; - #echo Looking for $DEP in $DEPDIR , i.e.: $DEPNAME - if test -f "$DEPNAME.chs" -o -f "$DEPNAME.chs.pp"; then - #echo Found $DEP in $DEPDIR - DEPNAMES="$DEPNAMES $DEPNAME.chi"; - FOUND=yes; - break; - fi; - done; - if test $FOUND = no; then - echo could not find $DEP.chs on search path $SEARCHPATH; - exit 1; - fi; - IFS=$OLDIFS; - done; - echo "# .chs dependencies for $FULLNAME" > $FULLNAMEDEP; - if test -n "$DEPNAMES"; then - echo "$FULLNAMEHS : $DEPNAMES" >> $FULLNAMEDEP; - fi; -# echo Writing dependency information for $FULLNAME - else - echo Warning: $FULLNAME not found. - fi; -done; - rmfile ./mk/chsDepend.in hunk ./mk/common.mk 1 -# --*Makefile*-- - -EMPTY := -SPACE := $(EMPTY) $(EMPTY) - -# Define a reverse function in pure GNU make -reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1)))) $(firstword $(1)) - -# Cunning make hackery, this function translates from a file name to the -# package variable name prefix, eg -# "gtk/Graphics/UI/Gtk.hs" to "libHSgtk_a" -# using a make var -# gtk_PKGNAME = libHSgtk_a -# -PKG = \ - $(if $(call $(firstword $(subst /, ,$@))_PKGNAME,$@),$(strip \ - $(call $(firstword $(subst /, ,$@))_PKGNAME,$@)), \ - $(error PKG: cannot find PKGNAME for "$@", $(1) flag requested)) - -# necessary so support packages under the tools directory -tools_PKGNAME = $(call tools_$(word 2,$(subst /, ,$(1)))_PKGNAME,$(1)) - -# necessary to support optional compat extensions to other packages -# we map compat_foo_PKGNAME to foo_PKGNAME -compat_PKGNAME = $(call $(word 2,$(subst /, ,$(1)))_PKGNAME,$(1)) - -getVar = $($(subst .,_,$(subst /,_,$(1)))_$(2)) - -LINK = $(strip $(HC) -o $@ $(HCFLAGS) $($(PKG)_HCFLAGS) \ - $(addprefix -package ,$($(PKG)_EXTERNALDEPS)) \ - $(addprefix -optl,$(AM_LDFLAGS) $(LDFLAGS) $($(PKG)_LDFLAGS))) - -HS_SEARCH_PATH = $(subst $(SPACE),:,$($(PKG)_SOURCESDIRS)) -CHS_SEARCH_PATH = $(subst $(SPACE),:,$($(PKG)_INTERNALDEPS) $($(PKG)_NAME)) - -HCFLAGS_PACKAGE_DEPS = \ - -package-conf package.conf.inplace $(HIDE_ALL_PACKAGES) \ - $(addprefix -ignore-package ,$($(PKG)_NAME)) \ - $(addprefix -package ,$($(PKG)_EXTERNALDEPS)) \ - $(addprefix -package ,$(addsuffix -$(VERSION),$($(PKG)_INTERNALDEPS))) - -HCFLAGS_PACKAGE_NAME = \ - $(addprefix -package-name ,$(addsuffix -$(VERSION),$($(PKG)_NAME))) - -#Using pattern rule here to prevent automake from understanding the rule -#and falsely concluding that two source files will produce the same object -#file even though the object files will be in different directories. -#Obviously the 'subdir-objects' option only works for C/C++ files. -if ENABLE_SPLITOBJS -%.o : %.hs $(CONFIG_HEADER) - $(if $($(PKG)_NOSPLITOBJS),,rm -rf $@ $*_split/; mkdir -p $*_split) - $(strip $(HC) +RTS $(HSTOOLFLAGS) -RTS \ - $(if $($(PKG)_NOSPLITOBJS),,-split-objs) \ - -c $< -o $@ $(HCFLAGS) $($(PKG)_HCFLAGS) \ - $(call getVar,$<,HCFLAGS) -i$(HS_SEARCH_PATH) \ - $(HCFLAGS_PACKAGE_DEPS) $(HCFLAGS_PACKAGE_NAME) \ - $(addprefix '-#include<,$(addsuffix >', $($(PKG)_HEADER))) \ - $(AM_CPPFLAGS) $($(PKG)_CPPFLAGS)) - $(strip if test -f $@; then :; else $(LINK_SPLIT_OBJS); fi) - -if LD_INPUT -# On some platforms (notably Windows) the length of command lines -# is a real limitation. We often bump into the problem that there -# are so many .o files in the _split/ directory that we can not -# link them all in a single ivocation. Fortunately the recent mingw -# versions of GNU ld support the @FILE option to read commands from -# a file rather than as command line args. So we dump the names of -# all the .o files into another file and use ld @ on that. -LINK_SPLIT_OBJS=find $*_split/ -name '*.o' > $*_split/list; \ - $(LD) -r $(LD_X) -o $@ @$*_split/list -else -LINK_SPLIT_OBJS=cd $*_split/; $(LD) -r $(LD_X) -o ../$(notdir $@) *.o; cd .. -endif - -else -%.o : %.hs $(CONFIG_HEADER) - $(strip $(HC) +RTS $(HSTOOLFLAGS) -RTS \ - -c $< -o $@ $(HCFLAGS) $($(PKG)_HCFLAGS) \ - $(call getVar,$<,HCFLAGS) -i$(HS_SEARCH_PATH) \ - $(HCFLAGS_PACKAGE_DEPS) $(HCFLAGS_PACKAGE_NAME) \ - $(addprefix '-#include<,$(addsuffix >', $($(PKG)_HEADER))) \ - $(AM_CPPFLAGS) $($(PKG)_CPPFLAGS)) -endif - -%.p_o : %.hs $(CONFIG_HEADER) - $(strip $(HC) +RTS $(HSTOOLFLAGS) -RTS \ - -prof -hisuf p_hi -osuf p_o \ - -c $< -o $@ $(HCFLAGS) $($(PKG)_HCFLAGS) \ - $(call getVar,$<,HCFLAGS) -i$(HS_SEARCH_PATH) \ - $(HCFLAGS_PACKAGE_DEPS) $(HCFLAGS_PACKAGE_NAME) \ - $(addprefix '-#include<,$(addsuffix >', $($(PKG)_HEADER))) \ - $(AM_CPPFLAGS) $($(PKG)_CPPFLAGS)) - -.DELETE_ON_ERROR : %.deps %.p_deps - -# A string that is non-empty if dependencies should not be calculated. [_$_] -# All but the "clean" target are run during dependencies calculation -# and hence are listed here to avoid nasty recursion. -noDeps := $(strip $(findstring clean,$(MAKECMDGOALS)) \ - $(findstring c2hsLocal,$(MAKECMDGOALS)) \ - $(findstring .hs,$(MAKECMDGOALS)) \ - $(findstring .precomp,$(MAKECMDGOALS))) - -# Dependencies are only calculated if the .deps files does not exist. [_$_] -# Thereafter it is never updated. A fix that likely works is to -# recalculate the dependencies of a .hs file each time it is -# recompiled. This does not work if some module reexports entities of -# another module. A sound fix would be to calculate dependencies each -# time which is too time consuming. - -if GHC_VERSION_610 -DEP_MAKEFILE=-dep-makefile -OPTDEP_F= -else -DEP_MAKEFILE= -OPTDEP_F=-f -endif - -%.deps : package.conf.inplace - $(if $(strip \ - $(if $(findstring c2hs,$@),\ - $(findstring clean,$(MAKECMDGOALS)),$(noDeps))),,\ - touch $@; \ - $(if $(word 2,$($(PKG)_HSFILES)),\ - $(HC) -M $(DEP_MAKEFILE) $(addprefix -optdep,$(OPTDEP_F) $@) -fglasgow-exts \ - $(HCFLAGS) $($(PKG)_HCFLAGS) -i$(HS_SEARCH_PATH) \ - $(HCFLAGS_PACKAGE_DEPS) \ - $(AM_CPPFLAGS) $($(PKG)_CPPFLAGS) $($(PKG)_HSFILES);)) - -%.p_deps : package.conf.inplace - $(if $(strip \ - $(if $(findstring c2hs,$@),\ - $(findstring clean,$(MAKECMDGOALS)),$(noDeps))),,\ - touch $@; \ - $(if $(word 2,$($(PKG)_HSFILES)),\ - $(MAKE) $(AM_MAKEFLAGS) $($(PKG)_HSFILES); \ - $(HC) -M $(DEP_MAKEFILE) $(addprefix -optdep,$(OPTDEP_F) $@) -fglasgow-exts \ - -hisuf p_hi -osuf p_o \ - $(HCFLAGS) $($(PKG)_HCFLAGS) -i$(HS_SEARCH_PATH) \ - $(HCFLAGS_PACKAGE_DEPS) \ - $(AM_CPPFLAGS) $($(PKG)_CPPFLAGS) $($(PKG)_HSFILES);)) - -.chs.dep : - $(CHSDEPEND) -i$(CHS_SEARCH_PATH) $< - -.hs.chi : - @: - -.o.hi: - @: - -.p_o.p_hi: - @: - -.c.o: - $(strip $(HC) -c $< -o $@ $(INCLUDES) \ - $(AM_CPPFLAGS) $($(PKG)_CPPFLAGS) $(CPPFLAGS) \ - $(addprefix -optc,$(AM_CFLAGS) $($(PKG)_CFLAGS) \ - $(call getVar,$<,CFLAGS) $(CFLAGS)) \ - $(addprefix -opta,$(AM_CFLAGS) $($(PKG)_CFLAGS) \ - $(call getVar,$<,CFLAGS) $(CFLAGS))) - -# The cheeky rule for .hi files says that .hi files can be created as -# side-effect of generating a .o file. Make sure the .hi files are not -# deleted as normal intermediate files are. -.PRECIOUS: %.hi %.p_hi - -# Same for .chi -.PRECIOUS: %.chi - -%.precomp : $(C2HS) - $(strip $(C2HS) $(C2HS_FLAGS) \ - +RTS $(HSTOOLFLAGS) $(PROFFLAGS) -RTS \ - $(addprefix -C,$($(PKG)_CFLAGS) $($(PKG)_CPPFLAGS)) \ - --cppopts='-include "$(CONFIG_HEADER)"' \ - --precomp=$($(PKG)_PRECOMP) $($(PKG)_HEADER)) - -.chs.pp.chs: $(CONFIG_HEADER) - $(strip $(HSCPP) $(AM_CPPFLAGS) \ - $($(PKG)_CPPFLAGS) $($(PKG)_CFLAGS) \ - -DGTK2HS_HS_PREPROC \ - $(addprefix -include ,$(CONFIG_HEADER)) \ - $< -o $@) - -.hs.pp.hs: $(CONFIG_HEADER) - $(strip $(HSCPP) $(AM_CPPFLAGS) \ - $($(PKG)_CPPFLAGS) $($(PKG)_CFLAGS) \ - -DGTK2HS_HS_PREPROC \ - $(addprefix -include ,$(CONFIG_HEADER)) \ - $< -o $@) - -.hsc.hs: $(CONFIG_HEADER) template-hsc-gtk2hs.h - $(strip $(HSC2HS) $(HSCFLAGS) +RTS $(HSTOOLFLAGS) -RTS \ - $(addprefix -L-optl,$(AM_LDFLAGS) $(LDFLAGS) $($(PKG)_LIBS)) \ - $(addprefix -C, $(filter-out -I%,$(AM_CPPFLAGS) $(CPPFLAGS)) \ - $(addprefix -optc,$(AM_CFLAGS) $(CFLAGS) $($(PKG)_CFLAGS))\ - $(addprefix -opta,$(AM_CFLAGS) $(CFLAGS) $($(PKG)_CFLAGS)))\ - $(filter -I%,$(AM_CPPFLAGS) $(CPPFLAGS)) $($(PKG)_CPPFLAGS)\ - -C'-optc-include' -C'-optc$(CONFIG_HEADER)' \ - -C'-optc-include' -C'-optctemplate-hsc-gtk2hs.h' \ - --include $($(PKG)_HEADER) \ - --cc="$(HC)" --lflag=-no-hs-main $<) - -.chs.hs: $(C2HS) - $(strip $(C2HS) $(C2HS_FLAGS) \ - +RTS $(HSTOOLFLAGS) -RTS \ - -i$(CHS_SEARCH_PATH) --precomp=$($(PKG)_PRECOMP) -o $@ $<) - rmfile ./mk/common.mk hunk ./mk/fix-package-conf.sh.in 1 -#!/bin/sh - -FILE="$1" -MODULES="$2" -TMPFILE="${FILE}.tmp" - -if [ "$#" != 2 ] ; then - echo "usage: $0 foo.package.conf \"Module1 Module2 ...\"" 1>&2 - exit 1 -fi - -if [ ! -f "$FILE" ] ; then - echo "$FILE does not exist" - exit 1 -fi - -WIN32_INSTALLER= -@WIN32_INSTALLER_TRUE@ WIN32_INSTALLER=yes - -if [ -z "$WIN32_INSTALLER" ] ; then - [_$_] - @SED@ \ - -e 's|\${pkglibdir}|@libdir@/@PACKAGE@|g' - -e "s|\${modules}|${MODULES}|" \ - < "${FILE}" > "${TMPFILE}" || exit 1 - [_$_] -else # WIN32_INSTALLER - - @SED@ \ - -e 's|@GTK_BASEPATH@|${GTK_BASEPATH}|g' \ - -e "s|\${modules}|${MODULES}|" \ - < "${FILE}" > "${TMPFILE}" || exit 1 - - DLLS="" - - ORIG_SHORTNAMES="$( cat "$FILE" | \ - @GREP@ '^[ ]*extra-libraries[ ]*:' | \ - @SED@ -e 's/^[ ]*extra-libraries[ ]*:[ ]*//' -e 's/[ ]*,[ ]*/ /g' -e 's,\",,g' )" - - echo "processing $FILE" 1>&2 - for lib in $ORIG_SHORTNAMES ; do - echo "processing library $lib" 1>&2 - [_$_] - case $lib in - glu32|opengl32|user32|kernel32|gdi32) - DLLS="$DLLS $lib" - ;; - *) - foundfile= - IFS=: - for dir in $PATH ; do - unset IFS - for base in {,lib}${lib} {,lib}${lib}-{0,1,2,3,4,5,6,7,8,9} ; do - testfile="$dir/$base.dll" - #echo "testing $testfile" 1>&2 - if [ -f "$testfile" ] ; then - if [ -n "$foundfile" ] ; then - echo duplicate found for "$lib": "$testfile" 1>&2 - exit 1 - else - foundfile="$testfile" - echo "found $foundfile" 1>&2 - if [ -n "$DLLS" ]; then - DLLS="$DLLS, \"$base\"" - else - DLLS="\"$base\"" - fi - fi - fi - done - done - if [ -z "$foundfile" ] - then - echo "file for $lib not found" 1>&2 - exit 1 - fi - ;; - esac - done - [_$_] - echo "extra-ghci-libraries: ${DLLS}" >> "$TMPFILE" -fi - -mv -f "$TMPFILE" "$FILE" || exit 1 rmfile ./mk/fix-package-conf.sh.in hunk ./mk/link-splitobjs.sh.in 1 -#!/bin/sh hunk ./mk/link-splitobjs.sh.in 2 -lib=$1 -shift -rm -f ${lib}.list -for obj in $@; do - dir=`dirname ${obj}`/`basename ${obj} .o`_split - if test -d ${dir}; then - find ${dir}/ -name '*.o' >> ${lib}.list - else - echo ${obj} >> ${lib}.list - fi -done -exitcode=0 -echo "Linking ${lib}, for larger libs this can take quite some time..." -if [ -z "@XARGS@" ] ; then - cat ${lib}.list | while read file ; do - @AR@ q ${lib} ${file} < /dev/null || { - exitcode=$? - break - } - done -else - cat ${lib}.list | @XARGS@ @AR@ q ${lib} || exitcode=$? -fi -rm ${lib}.list - -exit $exitcode rmfile ./mk/link-splitobjs.sh.in rmdir ./mk hunk ./Makefile.am.stale 1 -AUTOMAKE_OPTIONS = 1.8 foreign no-dependencies -SUFFIXES = .hs.uncpp .hs.pp .chs.pp .chs .hsc .deps .p_deps .dep -MOSTLYCLEANFILES = */*.bak tools/*/*.bak -CLEANFILES = */*.precomp $(pkglib_LIBRARIES:.a=_p.a) */*.deps */*.p_deps -DISTCLEANFILES = - -if GHC_VERSION_610 -FFI = -XForeignFunctionInterface -else -FFI = -fffi -endif - -htmldoc_HSFILES_HIDDEN = -htmldoc_HSFILES_EXCLUDE = - -EXTRA_DIST = \ - template-hsc-gtk2hs.h \ - tools/callbackGen/Signal.chs.template \ - tools/callbackGen/gtkmarshal.list \ - tools/checkDirs.sh \ - tools/c2hs/toplevel/c2hs_config.h \ - tools/hierarchyGen/hierarchy.list \ - tools/hierarchyGen/Hierarchy.chs.template \ - gconf/System/Gnome/GConf/marshal.list \ - sourceview/sourceview.h \ - gtksourceview2/gtksourceview2.h \ - gtk/hsgtk.h \ - gtk/wingtk.h \ - glib/System/Glib/hsgclosure.h \ - cairo/COPYRIGHT \ - cairo/cairo-gtk2hs.h \ - svgcairo/svgcairo.h \ - gtk/Graphics/UI/Gtk/General/hsgthread.h \ - gnomevfs/hsgnomevfs-2.14.h \ - gnomevfs/System/Gnome/VFS/hsfileinfo.h \ - gnomevfs/marshal.list \ - gstreamer/hsgstreamer.h \ - gstreamer/mini-hierarchy.list \ - gstreamer/marshal.list \ - gio/marshal.list \ - gtksourceview2/marshal.list \ - gtk/Graphics/UI/Gtk/ModelView/Gtk2HsStore.h \ - vte/Graphics/UI/Gtk/Vte/VteCharAttrFields.h \ - COPYING.LGPLv3 COPYING.GPLv3 - -# There are no other files in these dirs and tar excludes empty dirs -dist-hook: - mkdir $(distdir)/glade/Graphics/UI/Gtk/Glade - touch $(distdir)/glade/Graphics/UI/Gtk/Glade/.keep - mkdir $(distdir)/mozembed/Graphics/UI/Gtk/MozEmbed - touch $(distdir)/mozembed/Graphics/UI/Gtk/MozEmbed/.keep - -CHSDEPEND = $(srcdir)/mk/chsDepend - -# all packages and applications -pkglib_LIBRARIES = \ - libHSglib.a -if ENABLE_CAIRO -pkglib_LIBRARIES += libHScairo.a -endif -if ENABLE_SVGCAIRO -pkglib_LIBRARIES += libHSsvgcairo.a -endif -if ENABLE_GTK -pkglib_LIBRARIES += \ - libHSgtk.a \ - libHSsoegtk.a -endif - -if ENABLE_GIO -pkglib_LIBRARIES += libHSgio.a -endif -if ENABLE_LIBGLADE -pkglib_LIBRARIES += libHSglade.a -endif -if ENABLE_VTE -pkglib_LIBRARIES += libHSvte.a -endif -if ENABLE_WEBKIT -pkglib_LIBRARIES += libHSwebkit.a -endif -if ENABLE_GCONF -pkglib_LIBRARIES += libHSgconf.a -endif -if ENABLE_SOURCEVIEW -pkglib_LIBRARIES += libHSsourceview.a -endif -if ENABLE_GTKSOURCEVIEW2 -pkglib_LIBRARIES += libHSgtksourceview2.a -endif -if ENABLE_MOZEMBED -pkglib_LIBRARIES += libHSmozembed.a -endif -if ENABLE_GTKGLEXT -pkglib_LIBRARIES += libHSgtkglext.a -endif -if ENABLE_GNOMEVFS -pkglib_LIBRARIES += libHSgnomevfs.a -endif -if ENABLE_GSTREAMER -pkglib_LIBRARIES += libHSgstreamer.a -endif - -noinst_PROGRAMS = \ - tools/hierarchyGen/TypeGenerator \ - tools/callbackGen/HookGenerator \ - tools/c2hs/c2hsLocal - -pkglibincludedir = $(pkglibdir)/include -pkglibinclude_DATA = gtk2hs-config.h - -hidir = $(pkglibdir)/imports - -EARLY_DEPS = tools/c2hs/c2hsLocal.deps -all: dep -dep: $(EARLY_DEPS) - -DONT_USE_DEPS = $(strip $(if $(findstring clean,$(MAKECMDGOALS))$(findstring dist,$(MAKECMDGOALS))$(filter dep,$(MAKECMDGOALS))$(filter all,$(MAKECMDGOALS)),true,$(if $(MAKECMDGOALS),,true))) - -# -# TypeGenerator Tool -# -################################################################################ - -# While building the program <name>, set the variable NAME to <name> so -# we can access program-specific variables like <name>_EXTERNALDEPS. The -# following is a hack to prevent automake from assuming that we are overriding -# the tools/hierarchyGen/TypeGenerator goal. -tools_hierarchyGen_PKGNAME = tools_hierarchyGen_TypeGenerator - -tools_hierarchyGen_TypeGenerator_MAIN = \ - $(tools_hierarchyGen_TypeGenerator_SOURCES) -tools_hierarchyGen_TypeGenerator_EXTERNALDEPS = base-$(PKG_BASE_VERSION) -tools_hierarchyGen_TypeGenerator_NOSPLITOBJS = yes -tools_hierarchyGen_TypeGenerator_SOURCESDIRS = tools/hierarchyGen -tools_hierarchyGen_TypeGenerator_SOURCES = \ - tools/hierarchyGen/TypeGen.hs -# Fix automake - the subdir-objects option doesn't work here. -am_tools_hierarchyGen_TypeGenerator_OBJECTS = $(addsuffix .$(OBJEXT),\ - $(basename $(tools_hierarchyGen_TypeGenerator_SOURCES))) -MOSTLYCLEANFILES+= $(am_tools_hierarchyGen_TypeGenerator_OBJECTS) -MOSTLYCLEANFILES+= $(tools_hierarchyGen_TypeGenerator_SOURCES:.hs=.hi) - -# -# HookGenerator Tool -# -################################################################################ - -tools_callbackGen_PKGNAME = tools_callbackGen_HookGenerator - -tools_callbackGen_HookGenerator_MAIN = \ - $(tools_callbackGen_HookGenerator_SOURCES) -tools_callbackGen_HookGenerator_EXTERNALDEPS = base-$(PKG_BASE_VERSION) -tools_callbackGen_HookGenerator_NOSPLITOBJS = yes -tools_callbackGen_HookGenerator_SOURCESDIRS = tools/callbackGen -tools_callbackGen_HookGenerator_SOURCES = \ - tools/callbackGen/HookGenerator.hs -tools_callbackGen_HookGenerator_hs_HCFLAGS = -I. [_$_] -am_tools_callbackGen_HookGenerator_OBJECTS = $(addsuffix .$(OBJEXT),\ - $(basename $(tools_callbackGen_HookGenerator_SOURCES))) -MOSTLYCLEANFILES+= $(am_tools_callbackGen_HookGenerator_OBJECTS) -MOSTLYCLEANFILES+= $(tools_callbackGen_HookGenerator_SOURCES:.hs=.hi) - -# -# c2hs interface generator -# -################################################################################ - -tools_c2hs_PKGNAME = tools_c2hs_c2hsLocal - -tools_c2hs_c2hsLocal_MAIN = c2hs/toplevel/Main.hs -tools_c2hs_c2hsLocal_EXTERNALDEPS = base-$(PKG_BASE_VERSION) haskell98-$(PKG_HASKELL98_VERSION) -if HAVE_SPLIT_BASE -tools_c2hs_c2hsLocal_EXTERNALDEPS += pretty-$(PKG_PRETTY_VERSION) containers-$(PKG_CONTAINERS_VERSION) array-$(PKG_ARRAY_VERSION) -endif -tools_c2hs_c2hsLocal_NOSPLITOBJS = yes - -tools_c2hs_c2hsLocal_SOURCESDIRS = \ - tools/c2hs/base/admin tools/c2hs/base/errors \ - tools/c2hs/base/general tools/c2hs/base/state \ - tools/c2hs/base/syms tools/c2hs/base/syntax \ - tools/c2hs/c tools/c2hs/chs tools/c2hs/gen \ - tools/c2hs/state tools/c2hs/toplevel - -tools_c2hs_c2hsLocal_SOURCES = \ - tools/c2hs/base/admin/BaseVersion.hs \ - tools/c2hs/base/admin/Config.hs \ - tools/c2hs/base/errors/Errors.hs \ - tools/c2hs/base/general/DLists.hs \ - tools/c2hs/base/general/FileOps.hs \ - tools/c2hs/base/general/FNameOps.hs \ - tools/c2hs/base/general/Map.hs \ - tools/c2hs/base/general/Position.hs \ - tools/c2hs/base/general/Set.hs \ - tools/c2hs/base/general/UNames.hs \ - tools/c2hs/base/general/Binary.hs \ - tools/c2hs/base/general/FastMutInt.hs \ - tools/c2hs/base/state/CIO.hs \ - tools/c2hs/base/state/StateBase.hs \ - tools/c2hs/base/state/State.hs \ - tools/c2hs/base/state/StateTrans.hs \ - tools/c2hs/base/syms/Attributes.hs \ - tools/c2hs/base/syms/Idents.hs \ - tools/c2hs/base/syms/NameSpaces.hs \ - tools/c2hs/base/syntax/Lexers.hs \ - tools/c2hs/c/CAST.hs \ - tools/c2hs/c/CAttrs.hs \ - tools/c2hs/c/CBuiltin.hs \ - tools/c2hs/c/C.hs \ - tools/c2hs/c/CLexer.hs \ - tools/c2hs/c/CNames.hs \ - tools/c2hs/c/CParser.hs \ - tools/c2hs/c/CParserMonad.hs \ - tools/c2hs/c/CPretty.hs \ - tools/c2hs/c/CTokens.hs \ - tools/c2hs/c/CTrav.hs \ - tools/c2hs/chs/CHS.hs \ - tools/c2hs/chs/CHSLexer.hs \ - tools/c2hs/gen/CInfo.hs \ - tools/c2hs/gen/GBMonad.hs \ - tools/c2hs/gen/GenBind.hs \ - tools/c2hs/gen/GenHeader.hs \ - tools/c2hs/state/C2HSState.hs \ - tools/c2hs/state/Switches.hs \ - tools/c2hs/toplevel/Main.hs \ - tools/c2hs/toplevel/Version.hs \ - tools/c2hs/toplevel/c2hs_config.c \ - tools/c2hs/toplevel/C2HSConfig.hs - -tools_c2hs_c2hsLocal_ALLSOURCES = \ - $(tools_c2hs_c2hsLocal_SOURCES) - -tools_c2hs_base_general_Binary_hs_HCFLAGS = -O -funbox-strict-fields -tools_c2hs_base_general_FastMutInt_hs_HCFLAGS = -O -tools_c2hs_base_syntax_Parsers_hs_HCFLAGS = -fglasgow-exts -tools_c2hs_toplevel_C2HSConfig_hs_HCFLAGS = $(FFI) '-\#include<c2hs_config.h>' \ - -cpp -D_C2HS_CPP=\""$(CPP)"\" [_$_] - -tools/c2hs/c/CLexer.hs : tools/c2hs/c/CLexer.x - $(ALEX) --ghc -o $@ $< - -tools/c2hs/c/CParser.hs : tools/c2hs/c/CParser.y - $(HAPPY) --ghc --array --coerce --strict -o $@ $< - -MAINTAINERCLEANFILES = \ - tools/c2hs/c/CParser.hs \ - tools/c2hs/c/CLexer.hs - -EXTRA_DIST += \ - tools/c2hs/c/CParser.y \ - tools/c2hs/c/CLexer.x - -tools_c2hs_c2hsLocal_HSFILES = \ - $(filter %.hs,$(tools_c2hs_c2hsLocal_ALLSOURCES)) -# Fix automake - the subdir-objects option doesn't work here. -am_tools_c2hs_c2hsLocal_OBJECTS = \ - $(addsuffix .$(OBJEXT),$(basename $(tools_c2hs_c2hsLocal_ALLSOURCES))) -$(am_tools_c2hs_c2hsLocal_OBJECTS): | tools/c2hs/c2hsLocal.deps -tools/c2hs/c2hsLocal.deps: $(tools_c2hs_c2hsLocal_HSFILES) -c2hs_MOSTLYCLEANFILES = $(am_tools_c2hs_c2hsLocal_OBJECTS) -c2hs_MOSTLYCLEANFILES += $(tools_c2hs_c2hsLocal_HSFILES:.hs=.hi) -c2hs_CLEANFILES = tools/c2hs/c2hsLocal.deps - -ifeq (,$(DONT_USE_DEPS)) --include tools/c2hs/c2hsLocal.deps - endif - -# -# glib package -# -################################################################################ - -glib_PKGNAME = libHSglib_a - -libHSglib_a_NAME = glib -libHSglib_a_CONFIG = glib/glib.package.conf -libHSglib_a_EXTERNALDEPS = base-$(PKG_BASE_VERSION) -libHSglib_a_INTERNALDEPS = [_$_] -libHSglib_a_HEADER = glib-object.h -libHSglib_a_PRECOMP = glib/glib.precomp -libHSglib_a_LIBS = $(GLIB_LIBS) -libHSglib_a_HCFLAGS = $(FFI) -libHSglib_a_CFLAGS = $(filter-out -I% -D%,$(GLIB_CFLAGS)) -libHSglib_a_CPPFLAGS = $(filter -I% -D%,$(GLIB_CFLAGS)) - -libHSglib_a_SOURCESDIRS = glib - -libHSglib_a_SOURCES = \ - glib/System/Glib.hs \ - glib/System/Glib/FFI.hs.pp \ - glib/System/Glib/UTFString.hs.pp \ - glib/System/Glib/Types.chs \ - glib/System/Glib/GType.chs \ - glib/System/Glib/GTypeConstants.hsc \ - glib/System/Glib/GValue.chs \ - glib/System/Glib/GValueTypes.chs \ - glib/System/Glib/GParameter.hsc \ - glib/System/Glib/StoreValue.hsc \ - glib/System/Glib/GObject.chs.pp \ - glib/System/Glib/Properties.chs \ - glib/System/Glib/Attributes.hs \ - glib/System/Glib/GError.chs.pp \ - glib/System/Glib/GList.chs \ - glib/System/Glib/Signals.chs.pp \ - glib/System/Glib/Flags.hs \ - glib/System/Glib/MainLoop.chs.pp \ - glib/System/Glib/GDateTime.chs.pp \ - glib/System/Glib/Utils.chs - -htmldoc_HSFILES_HIDDEN += \ - glib/System/Glib/FFI.hs \ - glib/System/Glib/Types.hs - -if USE_GCLOSUE_SIGNALS_IMPL -libHSglib_a_SOURCES += glib/System/Glib/hsgclosure.c -# make calling an undefined function an error so we can catch changes in the -# GHC RTS API: -glib_System_Glib_hsgclosure_c_CFLAGS = -Werror-implicit-function-declaration -endif - -glib_System_Glib_Types_hs_HCFLAGS = -fglasgow-exts -glib_System_Glib_GError_hs_HCFLAGS = -fglasgow-exts -glib_System_Glib_Attributes_hs_HCFLAGS = -fglasgow-exts -glib_System_Glib_Signals_hs_HCFLAGS = '-\#include"hsgclosure.h"' - -libHSglib_a_LIBADD = \ - glib/System/Glib/GObject_stub.o \ - glib/System/Glib/MainLoop_stub.o - -if !USE_GCLOSUE_SIGNALS_IMPL -libHSglib_a_LIBADD += glib/System/Glib/Signals_stub.o -endif - -am_libHSglib_a_OBJECTS = \ - $(addsuffix .$(OBJEXT),$(basename $(basename $(libHSglib_a_SOURCES)))) - -libHSglib_a_HSPPFILES = $(filter %.hs.pp, $(libHSglib_a_SOURCES)) -libHSglib_a_CHSPPFILES = $(filter %.chs.pp,$(libHSglib_a_SOURCES)) -libHSglib_a_CHSFILES = \ - $(filter %.chs,$(libHSglib_a_SOURCES:.chs.pp=.chs)) -libHSglib_a_CHSFILES_HS = $(libHSglib_a_CHSFILES:.chs=.hs) -libHSglib_a_HSCFILES = $(filter %.hsc, $(libHSglib_a_SOURCES)) -libHSglib_a_HSCFILES_HS = $(libHSglib_a_HSCFILES:.hsc=.hs) -libHSglib_a_BUILDSOURCES = \ - $(libHSglib_a_HSPPFILES:.hs.pp=.hs) \ - $(libHSglib_a_CHSPPFILES:.chs.pp=.chs) \ - $(libHSglib_a_CHSFILES_HS) \ - $(libHSglib_a_HSCFILES_HS) -libHSglib_a_HSFILES = \ - $(filter %.hs,$(libHSglib_a_BUILDSOURCES)) \ - $(filter %.hs,$(libHSglib_a_SOURCES)) -libHSglib_a_CFILES = $(filter %.c,$(libHSglib_a_SOURCES)) - -nobase_hi_DATA = $(libHSglib_a_HSFILES:.hs=.hi) - -glib_MOSTLYCLEANFILES = $(am_libHSglib_a_OBJECTS) -glib_MOSTLYCLEANFILES += $(libHSglib_a_HSFILES:.hs=.hi) -glib_MOSTLYCLEANFILES += \ - $(libHSglib_a_CHSFILES:.chs=.chi) \ - $(libHSglib_a_CHSFILES:.chs=_stub.h) \ - $(libHSglib_a_CHSFILES:.chs=_stub.o) \ - $(libHSglib_a_CHSFILES:.chs=_stub.c) -glib_CLEANFILES = $(libHSglib_a_BUILDSOURCES) -glib_CLEANFILES += $(libHSglib_a_CHSFILES_HS:.hs=.dep) -glib_CLEANFILES += \ - $(libHSglib_a_HSCFILES:.hsc=_hsc_make$(EXEEXT)) \ - $(libHSglib_a_HSCFILES:.hsc=_hsc_make.c) \ - $(libHSglib_a_HSCFILES:.hsc=_hsc_make.o) - -glib/libHSglib_a.deps: $(libHSglib_a_HSFILES) | \ - $(foreach pkg,$(libHSglib_a_INTERNALDEPS),$(pkg)/libHS$(pkg)_a.deps) -$(libHSglib_a_CHSFILES:.chs=.dep): \ - $(foreach pkg,glib $(libHSglib_a_INTERNALDEPS),$(libHS$(pkg)_a_CHSFILES)) -$(libHSglib_a_CHSFILES_HS): $(libHSglib_a_PRECOMP) -$(libHSglib_a_OBJECTS) : \ - $(foreach pkg,$(libHSglib_a_INTERNALDEPS),$(libHS$(pkg)_a_OBJECTS)) - -EARLY_DEPS += $(libHSglib_a_CHSFILES:.chs=.dep) - -ifeq (,$(DONT_USE_DEPS)) --include $(libHSglib_a_CHSFILES:.chs=.dep) glib/libHSglib_a.deps - endif - -if ENABLE_SPLITOBJS -libHSglib_a_AR = $(srcdir)/mk/link-splitobjs.sh -glib_CLEANFILES_SPLIT = $(libHSglib_a_HSFILES:.hs=_split/) -else -libHSglib_a_AR = $(AR) $(ARFLAGS) -endif - -libHSglib_a_DEPENDENCIES = HSglib.o -pkglib_DATA = HSglib.o -HSglib.o : $(libHSglib_a_OBJECTS) - $(LD) -r $(LD_X) -o $@ $(libHSglib_a_OBJECTS) $(libHSglib_a_LIBADD) - -if ENABLE_PROFILING -libHSglib_a_DEPENDENCIES += libHSglib_p.a -pkglib_DATA += libHSglib_p.a -libHSglib_p.a : $(libHSglib_a_HSFILES:.hs=.p_o) \ - $(libHSglib_a_CFILES:.c=.o) \ - $(libHSglib_a_LIBADD:.o=.p_o) - $(AR) $(ARFLAGS) $@ $^ - -ifeq (,$(DONT_USE_DEPS)) --include glib/libHSglib_a.p_deps - endif - -nobase_hi_DATA += $(libHSglib_a_HSFILES:.hs=.p_hi) -glib_MOSTLYCLEANFILES += $(libHSglib_a_HSFILES:.hs=.p_hi) -glib_MOSTLYCLEANFILES += $(libHSglib_a_HSFILES:.hs=.p_o) -glib_MOSTLYCLEANFILES += $(libHSglib_a_LIBADD:.o=.p_o) -endif - -# -# gio package -# -################################################################################ - -if ENABLE_GIO - -gio_PKGNAME = libHSgio_a - -libHSgio_a_NAME = gio -libHSgio_a_CONFIG = gio/gio.package.conf -libHSgio_a_EXTERNALDEPS = base-$(PKG_BASE_VERSION) -if HAVE_SPLIT_BASE -libHSgio_a_EXTERNALDEPS += bytestring-$(PKG_BYTESTRING_VERSION) -endif -libHSgio_a_INTERNALDEPS = glib -libHSgio_a_HEADER = gio/gio.h -libHSgio_a_PRECOMP = gio/gio.precomp -libHSgio_a_LIBS = $(GLIB_LIBS) $(GIO_LIBS) -libHSgio_a_HCFLAGS = $(FFI) -fglasgow-exts -libHSgio_a_CFLAGS = $(filter-out -I% -D%,$(GLIB_CFLAGS) $(GIO_CFLAGS)) -libHSgio_a_CPPFLAGS = $(filter -I% -D%,$(GLIB_CFLAGS) $(GIO_CFLAGS)) - -libHSgio_a_SOURCESDIRS = gio - -libHSgio_a_GENERATEDSOURCES = \ - gio/System/GIO/Types.chs \ - gio/System/GIO/Signals.chs - -nodist_libHSgio_a_SOURCES = $(libHSgio_a_GENERATEDSOURCES) - -libHSgio_a_SOURCES = \ - gio/System/GIO/AsyncResult.chs \ - gio/System/GIO/Base.chs \ - gio/System/GIO/Cancellable.chs \ - gio/System/GIO/FileAttribute.hsc \ - gio/System/GIO/File.chs.pp \ - gio/System/GIO.hs - -htmldoc_HSFILES_HIDDEN += \ - $(libHSgio_a_GENERATEDSOURCES:.chs=.hs) - -libHSgio_a_LIBADD = \ - gio/System/GIO/Base_stub.o - -if !USE_GCLOSUE_SIGNALS_IMPL -libHSgio_a_LIBADD += \ - gio/System/GIO/Signals_stub.o -endif - -gio/System/GIO/Types.chs : \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ - $@ --tag=gio --lib=gio --prefix=g \ - --modname=System.GIO.Types \ - --import=*System.Glib.GObject) - -gio/System/GIO/Signals.chs : \ - $(srcdir)/tools/callbackGen/Signal.chs.template \ - $(srcdir)/gio/marshal.list \ - $(srcdir)/tools/callbackGen/HookGenerator$(EXEEXT) - $(strip $(srcdir)/tools/callbackGen/HookGenerator$(EXEEXT) \ - $(srcdir)/gio/marshal.list \ - $(srcdir)/tools/callbackGen/Signal.chs.template $@ \ - System.GIO.Signals) - -libHSgio_a_ALLSOURCES = $(libHSgio_a_SOURCES) $(nodist_libHSgio_a_SOURCES) - -am_libHSgio_a_OBJECTS = \ - $(addsuffix .$(OBJEXT),$(basename $(basename $(libHSgio_a_ALLSOURCES)))) - -libHSgio_a_HSPPFILES = $(filter %.hs.pp, $(libHSgio_a_ALLSOURCES)) -libHSgio_a_CHSPPFILES = $(filter %.chs.pp,$(libHSgio_a_ALLSOURCES)) -libHSgio_a_CHSFILES = \ - $(filter %.chs,$(libHSgio_a_ALLSOURCES:.chs.pp=.chs)) -libHSgio_a_CHSFILES_HS = $(libHSgio_a_CHSFILES:.chs=.hs) -libHSgio_a_HSCFILES = $(filter %.hsc, $(libHSgio_a_ALLSOURCES)) -libHSgio_a_HSCFILES_HS = $(libHSgio_a_HSCFILES:.hsc=.hs) -libHSgio_a_BUILDSOURCES = \ - $(libHSgio_a_HSPPFILES:.hs.pp=.hs) \ - $(libHSgio_a_CHSPPFILES:.chs.pp=.chs) \ - $(libHSgio_a_CHSFILES_HS) \ - $(libHSgio_a_HSCFILES_HS) \ - $(libHSgio_a_GENERATEDSOURCES) - -libHSgio_a_HSFILES = \ - $(filter %.hs,$(libHSgio_a_BUILDSOURCES)) \ - $(filter %.hs,$(libHSgio_a_ALLSOURCES)) -libHSgio_a_CFILES = $(filter %.c,$(libHSgio_a_ALLSOURCES)) - -nobase_hi_DATA += $(libHSgio_a_HSFILES:.hs=.hi) - -gio_MOSTLYCLEANFILES = $(am_libHSgio_a_OBJECTS) -gio_MOSTLYCLEANFILES += $(libHSgio_a_HSFILES:.hs=.hi) -gio_MOSTLYCLEANFILES += \ - $(libHSgio_a_CHSFILES:.chs=.chi) \ - $(libHSgio_a_CHSFILES:.chs=.h) \ - $(libHSgio_a_CHSFILES:.chs=_stub.h) \ - $(libHSgio_a_CHSFILES:.chs=_stub.o) \ - $(libHSgio_a_CHSFILES:.chs=_stub.c) -gio_CLEANFILES = $(libHSgio_a_BUILDSOURCES) -gio_CLEANFILES += $(libHSgio_a_CHSFILES_HS:.hs=.dep) -gio_CLEANFILES += \ - $(libHSgio_a_HSCFILES:.hsc=_hsc_make$(EXEEXT)) \ - $(libHSgio_a_HSCFILES:.hsc=_hsc_make.c) \ - $(libHSgio_a_HSCFILES:.hsc=_hsc_make.o) - -gio/libHSgio_a.deps: $(libHSgio_a_HSFILES) | \ - $(foreach pkg,$(libHSgio_a_INTERNALDEPS),$(pkg)/libHS$(pkg)_a.deps) -$(libHSgio_a_CHSFILES:.chs=.dep): \ - $(foreach pkg,gio $(libHSgio_a_INTERNALDEPS),$(libHS$(pkg)_a_CHSFILES)) -$(libHSgio_a_CHSFILES_HS): $(libHSgio_a_PRECOMP) -$(libHSgio_a_OBJECTS) : \ - $(foreach pkg,$(libHSgio_a_INTERNALDEPS),$(libHS$(pkg)_a_OBJECTS)) - -EARLY_DEPS += $(libHSgio_a_CHSFILES:.chs=.dep) - -ifeq (,$(DONT_USE_DEPS)) --include $(libHSgio_a_CHSFILES:.chs=.dep) gio/libHSgio_a.deps - endif - -if ENABLE_SPLITOBJS -libHSgio_a_AR = $(srcdir)/mk/link-splitobjs.sh -gio_CLEANFILES_SPLIT = $(libHSgio_a_HSFILES:.hs=_split/) -else -libHSgio_a_AR = $(AR) $(ARFLAGS) -endif - -libHSgio_a_DEPENDENCIES = HSgio.o -pkglib_DATA += HSgio.o -HSgio.o : $(libHSgio_a_OBJECTS) - $(LD) -r $(LD_X) -o $@ $(libHSgio_a_OBJECTS) $(libHSgio_a_LIBADD) - -if ENABLE_PROFILING -libHSgio_a_DEPENDENCIES += libHSgio_p.a -pkglib_DATA += libHSgio_p.a -libHSgio_p.a : $(libHSgio_a_HSFILES:.hs=.p_o) \ - $(libHSgio_a_CFILES:.c=.o) \ - $(libHSgio_a_LIBADD:.o=.p_o) - $(AR) $(ARFLAGS) $@ $^ - -ifeq (,$(DONT_USE_DEPS)) --include gio/libHSgio_a.p_deps - endif - -nobase_hi_DATA += $(libHSgio_a_HSFILES:.hs=.p_hi) -gio_MOSTLYCLEANFILES += $(libHSgio_a_HSFILES:.hs=.p_hi) -gio_MOSTLYCLEANFILES += $(libHSgio_a_HSFILES:.hs=.p_o) -gio_MOSTLYCLEANFILES += $(libHSgio_a_LIBADD:.o=.p_o) -endif - -endif #ENABLE_GIO - -# -# gtk package -# -################################################################################ - -if ENABLE_GTK - -gtk_PKGNAME = libHSgtk_a - -libHSgtk_a_NAME = gtk -libHSgtk_a_CONFIG = gtk/gtk.package.conf -libHSgtk_a_EXTERNALDEPS = base-$(PKG_BASE_VERSION) mtl-$(PKG_MTL_VERSION) -if HAVE_SPLIT_BASE -libHSgtk_a_EXTERNALDEPS += containers-$(PKG_CONTAINERS_VERSION) array-$(PKG_ARRAY_VERSION) -endif -libHSgtk_a_INTERNALDEPS = glib -libHSgtk_a_HEADER = gtk/hsgtk.h -libHSgtk_a_PRECOMP = gtk/gtk.precomp -libHSgtk_a_LIBS = $(GLIB_LIBS) $(GTK_LIBS) -libHSgtk_a_HCFLAGS = $(FFI) -libHSgtk_a_CFLAGS = $(filter-out -I% -D%,$(GLIB_CFLAGS) $(GTK_CFLAGS)) -libHSgtk_a_CPPFLAGS = $(filter -I% -D%,$(GLIB_CFLAGS) $(GTK_CFLAGS)) -I. - -libHSgtk_a_SOURCESDIRS = gtk - -if ENABLE_CAIRO -libHSgtk_a_INTERNALDEPS += cairo -endif - -libHSgtk_a_GENERATEDSOURCES = \ - gtk/Graphics/UI/Gtk/Types.chs \ - gtk/Graphics/UI/Gtk/Signals.chs - -nodist_libHSgtk_a_SOURCES = $(libHSgtk_a_GENERATEDSOURCES) - -libHSgtk_a_SOURCES = \ - gtk/Graphics/UI/Gtk.hs.pp \ - gtk/Graphics/UI/Gtk/Pango/Types.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Structs.hsc \ - gtk/Graphics/UI/Gtk/Multiline/Types.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Region.chs.pp \ - gtk/Graphics/UI/Gtk/Abstract/Bin.chs \ - gtk/Graphics/UI/Gtk/Abstract/Box.chs \ - gtk/Graphics/UI/Gtk/Abstract/ButtonBox.chs.pp \ - gtk/Graphics/UI/Gtk/Abstract/Container.chs.pp \ - gtk/Graphics/UI/Gtk/Abstract/ContainerChildProperties.chs \ - gtk/Graphics/UI/Gtk/Abstract/IMContext.chs \ - gtk/Graphics/UI/Gtk/Abstract/Misc.chs \ - gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp \ - gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp \ - gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp \ - gtk/Graphics/UI/Gtk/Abstract/Scale.chs \ - gtk/Graphics/UI/Gtk/Abstract/Widget.chs.pp \ - gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp \ - gtk/Graphics/UI/Gtk/Buttons/CheckButton.chs \ - gtk/Graphics/UI/Gtk/Buttons/RadioButton.chs.pp \ - gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs.pp \ - gtk/Graphics/UI/Gtk/Display/AccelLabel.chs \ - gtk/Graphics/UI/Gtk/Display/Image.chs.pp \ - gtk/Graphics/UI/Gtk/Display/Label.chs.pp \ - gtk/Graphics/UI/Gtk/Display/ProgressBar.chs.pp \ - gtk/Graphics/UI/Gtk/Display/Statusbar.chs.pp \ - gtk/Graphics/UI/Gtk/Display/StatusIcon.chs.pp \ - gtk/Graphics/UI/Gtk/Embedding/Plug.chs.pp \ - gtk/Graphics/UI/Gtk/Embedding/Socket.chs.pp \ - gtk/Graphics/UI/Gtk/Embedding/Embedding.hsc \ - gtk/Graphics/UI/Gtk/Entry/Editable.chs.pp \ - gtk/Graphics/UI/Gtk/Entry/Entry.chs.pp \ - gtk/Graphics/UI/Gtk/Entry/EntryCompletion.chs.pp \ - gtk/Graphics/UI/Gtk/Entry/HScale.chs \ - gtk/Graphics/UI/Gtk/Entry/SpinButton.chs \ - gtk/Graphics/UI/Gtk/Entry/VScale.chs \ - gtk/Graphics/UI/Gtk/General/Clipboard.chs.pp \ - gtk/Graphics/UI/Gtk/General/Enums.chs.pp \ - gtk/Graphics/UI/Gtk/General/General.chs \ - gtk/Graphics/UI/Gtk/General/hsgthread.c \ - gtk/Graphics/UI/Gtk/General/IconFactory.chs.pp \ - gtk/Graphics/UI/Gtk/General/Style.chs \ - gtk/Graphics/UI/Gtk/Layout/Alignment.chs.pp \ - gtk/Graphics/UI/Gtk/Layout/AspectFrame.chs \ - gtk/Graphics/UI/Gtk/Layout/Expander.chs.pp \ - gtk/Graphics/UI/Gtk/Layout/Fixed.chs \ - gtk/Graphics/UI/Gtk/Layout/HBox.chs \ - gtk/Graphics/UI/Gtk/Layout/HButtonBox.chs \ - gtk/Graphics/UI/Gtk/Layout/HPaned.chs \ - gtk/Graphics/UI/Gtk/Layout/Layout.chs \ - gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp \ - gtk/Graphics/UI/Gtk/Layout/Table.chs \ - gtk/Graphics/UI/Gtk/Layout/VBox.chs \ - gtk/Graphics/UI/Gtk/Layout/VButtonBox.chs \ - gtk/Graphics/UI/Gtk/Layout/VPaned.chs \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/CheckMenuItem.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/Combo.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBoxEntry.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/ImageMenuItem.chs \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/Menu.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuBar.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuItem.chs \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuShell.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/OptionMenu.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/RadioMenuItem.chs \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/TearoffMenuItem.chs \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolItem.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/Toolbar.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/ToolButton.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/MenuToolButton.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/ToggleToolButton.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/RadioToolButton.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/SeparatorMenuItem.chs.pp \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/SeparatorToolItem.chs.pp \ - gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs.pp \ - gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup.chs.pp \ - gtk/Graphics/UI/Gtk/ActionMenuToolbar/ToggleAction.chs.pp \ - gtk/Graphics/UI/Gtk/ActionMenuToolbar/RadioAction.chs.pp \ - gtk/Graphics/UI/Gtk/ActionMenuToolbar/UIManager.chs.pp \ - gtk/Graphics/UI/Gtk/Misc/Adjustment.chs.pp \ - gtk/Graphics/UI/Gtk/Misc/Calendar.chs.pp \ - gtk/Graphics/UI/Gtk/Misc/DrawingArea.chs \ - gtk/Graphics/UI/Gtk/Misc/EventBox.chs.pp \ - gtk/Graphics/UI/Gtk/Misc/Arrow.chs \ - gtk/Graphics/UI/Gtk/Misc/HandleBox.chs \ - gtk/Graphics/UI/Gtk/Misc/IMMulticontext.chs.pp \ - gtk/Graphics/UI/Gtk/Misc/SizeGroup.chs.pp \ - gtk/Graphics/UI/Gtk/Misc/Tooltips.chs.pp \ - gtk/Graphics/UI/Gtk/Misc/Viewport.chs \ - gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp \ - gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp \ - gtk/Graphics/UI/Gtk/Multiline/TextMark.chs.pp \ - gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp \ - gtk/Graphics/UI/Gtk/Multiline/TextTagTable.chs \ - gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp \ - gtk/Graphics/UI/Gtk/Ornaments/Frame.chs \ - gtk/Graphics/UI/Gtk/Ornaments/HSeparator.chs \ - gtk/Graphics/UI/Gtk/Ornaments/VSeparator.chs \ - gtk/Graphics/UI/Gtk/Scrolling/HScrollbar.chs \ - gtk/Graphics/UI/Gtk/Scrolling/ScrolledWindow.chs.pp \ - gtk/Graphics/UI/Gtk/Scrolling/VScrollbar.chs \ - gtk/Graphics/UI/Gtk/Selectors/ColorButton.chs.pp \ - gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs \ - gtk/Graphics/UI/Gtk/Selectors/ColorSelectionDialog.chs \ - gtk/Graphics/UI/Gtk/Selectors/FontButton.chs.pp \ - gtk/Graphics/UI/Gtk/Selectors/FontSelection.chs \ - gtk/Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs \ - gtk/Graphics/UI/Gtk/Selectors/FileSelection.chs.pp \ - gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp \ - gtk/Graphics/UI/Gtk/Selectors/FileChooserButton.chs.pp \ - gtk/Graphics/UI/Gtk/Selectors/FileChooserWidget.chs.pp \ - gtk/Graphics/UI/Gtk/Selectors/FileChooserDialog.chs.pp \ - gtk/Graphics/UI/Gtk/Selectors/FileFilter.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList.hs \ - gtk/Graphics/UI/Gtk/TreeList/CellRenderer.hs \ - gtk/Graphics/UI/Gtk/TreeList/CellRendererPixbuf.chs \ - gtk/Graphics/UI/Gtk/TreeList/CellRendererText.chs \ - gtk/Graphics/UI/Gtk/TreeList/CellRendererToggle.chs \ - gtk/Graphics/UI/Gtk/TreeList/CellView.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/IconView.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/ListStore.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeIter.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeModel.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeModelSort.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreePath.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeSelection.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeStore.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeView.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeViewColumn.chs.pp \ - gtk/Graphics/UI/Gtk/TreeList/TreeRowReference.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView.hs \ - gtk/Graphics/UI/Gtk/ModelView/CellLayout.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CellRenderer.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CellRendererCombo.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CellRendererPixbuf.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CellRendererProgress.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CellRendererText.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CellRendererToggle.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CellView.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/CustomStore.chs \ - gtk/Graphics/UI/Gtk/ModelView/Gtk2HsStore.c \ - gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/ListStore.hs.pp \ - gtk/Graphics/UI/Gtk/ModelView/Sequence.hs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeDrag.chs \ - gtk/Graphics/UI/Gtk/ModelView/TreeModel.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeModelSort.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeModelFilter.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeSortable.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeSelection.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs \ - gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeViewColumn.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/TreeRowReference.chs.pp \ - gtk/Graphics/UI/Gtk/ModelView/Types.chs \ - gtk/Graphics/UI/Gtk/Windows/AboutDialog.chs.pp \ - gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp \ - gtk/Graphics/UI/Gtk/Windows/MessageDialog.chs.pp \ - gtk/Graphics/UI/Gtk/Windows/Window.chs.pp \ - gtk/Graphics/UI/Gtk/Windows/Invisible.chs.pp \ - gtk/Graphics/UI/Gtk/Windows/WindowGroup.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Cursor.chs \ - gtk/Graphics/UI/Gtk/Gdk/Drawable.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/GC.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Gdk.chs \ - gtk/Graphics/UI/Gtk/Gdk/Enums.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Keys.chs \ - gtk/Graphics/UI/Gtk/Gdk/PixbufData.hs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Pixbuf.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/PixbufAnimation.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Pixmap.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/Display.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Attributes.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Description.chs \ - gtk/Graphics/UI/Gtk/Pango/Font.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Enums.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/GlyphStorage.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Context.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Layout.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Rendering.chs.pp \ - gtk/Graphics/UI/Gtk/General/StockItems.hsc \ - gtk/Graphics/UI/Gtk/General/Structs.hsc \ - gtk/Graphics/UI/Gtk/Gdk/Events.hsc \ - gtk/Graphics/UI/Gtk/Gdk/EventM.hsc \ - gtk/Graphics/UI/Gtk/Abstract/Scrollbar.hs \ - gtk/Graphics/UI/Gtk/Abstract/Separator.hs \ - gtk/Graphics/UI/Gtk/Builder.chs.pp \ - gtk/Graphics/UI/Gtk/Gdk/DrawWindow.chs.pp \ - gtk/Graphics/UI/Gtk/Pango/Markup.hs.pp \ - gtk/Graphics/UI/Gtk/General/RcStyle.chs.pp \ - gtk/Graphics/UI/Gtk/General/Selection.chs.pp \ - gtk/Graphics/UI/Gtk/General/Drag.chs.pp \ - gtk/Graphics/UI/Gtk/General/DNDTypes.chs \ - gtk/Graphics/UI/Gtk/General/Threading.hs - -gtk/Graphics/UI/Gtk/ModelView/Gtk2HsStore.o: gtk/Graphics/UI/Gtk/ModelView/CustomStore.o - -if ENABLE_CAIRO -libHSgtk_a_SOURCES += \ - gtk/Graphics/UI/Gtk/Cairo.chs.pp -endif - -htmldoc_HSFILES_HIDDEN += \ - $(libHSgtk_a_GENERATEDSOURCES:.chs=.hs) \ - gtk/Graphics/UI/Gtk/Gdk/PixbufData.hs \ - gtk/Graphics/UI/Gtk/General/Structs.hs \ - gtk/Graphics/UI/Gtk/Pango/Description.hs \ - gtk/Graphics/UI/Gtk/Pango/Types.hs \ - gtk/Graphics/UI/Gtk/Pango/Structs.hs \ - gtk/Graphics/UI/Gtk/Pango/Attributes.hs \ - gtk/Graphics/UI/Gtk/Pango/GlyphStorage.hs \ - gtk/Graphics/UI/Gtk/TreeList/TreePath.hs \ - gtk/Graphics/UI/Gtk/ModelView/Types.hs \ - gtk/Graphics/UI/Gtk/ModelView/Sequence.hs \ - gtk/Graphics/UI/Gtk/Multiline/Types.hs \ - gtk/Graphics/UI/Gtk/Abstract/ContainerChildProperties.hs \ - gtk/Graphics/UI/Gtk/General/DNDTypes.hs \ - gtk/Graphics/UI/Gtk/General/Threading.hs - -gtk_Graphics_UI_Gtk_hs_HCFLAGS = -fno-warn-duplicate-exports #FIXME -gtk_Graphics_UI_Gtk_Gdk_Enums_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_Types_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_General_Structs_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_Gdk_Events_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_Gdk_EventM_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_General_StockItems_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_Gdk_Region_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_Gdk_Drawable_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_ModelView_Types_hs_HCFLAGS = -fglasgow-exts -gtk_Graphics_UI_Gtk_Gdk_PixbufData_hs_HCFLAGS = -fglasgow-exts - -if WIN32 -gtk_Graphics_UI_Gtk_General_General_hs_HCFLAGS = '-\#include"gtk/wingtk.h"' -I. -endif - -libHSgtk_a_LIBADD = \ - gtk/Graphics/UI/Gtk/Abstract/Object_stub.o \ - gtk/Graphics/UI/Gtk/General/Clipboard_stub.o \ - gtk/Graphics/UI/Gtk/Abstract/Container_stub.o \ - gtk/Graphics/UI/Gtk/Multiline/TextIter_stub.o \ - gtk/Graphics/UI/Gtk/Multiline/TextTagTable_stub.o \ - gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBox_stub.o \ - gtk/Graphics/UI/Gtk/TreeList/TreeModel_stub.o \ - gtk/Graphics/UI/Gtk/TreeList/TreeSelection_stub.o \ - gtk/Graphics/UI/Gtk/TreeList/TreeView_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/TreeModel_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/TreeModelFilter_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/TreeSelection_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/TreeView_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/TreeSortable_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/CustomStore_stub.o - -if HAVE_GTK_VERSION_2_4 -libHSgtk_a_LIBADD += \ - gtk/Graphics/UI/Gtk/Entry/EntryCompletion_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/CellLayout_stub.o \ - gtk/Graphics/UI/Gtk/Selectors/FileFilter_stub.o \ - gtk/Graphics/UI/Gtk/ActionMenuToolbar/ActionGroup_stub.o -endif - -if HAVE_GTK_VERSION_2_6 -libHSgtk_a_LIBADD += \ - gtk/Graphics/UI/Gtk/TreeList/IconView_stub.o \ - gtk/Graphics/UI/Gtk/ModelView/IconView_stub.o \ - gtk/Graphics/UI/Gtk/Windows/AboutDialog_stub.o -endif - -if !USE_GCLOSUE_SIGNALS_IMPL -libHSgtk_a_LIBADD += gtk/Graphics/UI/Gtk/Signals_stub.o -endif - -gtk/Graphics/UI/Gtk/Types.chs : \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ - $@ $(addprefix --tag=,$(CREATE_TYPES)) \ - --modname=Graphics.UI.Gtk.Types \ - --forward=*System.Glib.GObject --destructor=objectUnrefFromMainloop \ - --forward=Graphics.UI.Gtk.General.Threading ) - -gtk/Graphics/UI/Gtk/Signals.chs : \ - $(srcdir)/tools/callbackGen/Signal.chs.template \ - $(srcdir)/tools/callbackGen/gtkmarshal.list \ - $(srcdir)/tools/callbackGen/HookGenerator$(EXEEXT) - $(strip $(srcdir)/tools/callbackGen/HookGenerator$(EXEEXT) \ - $(srcdir)/tools/callbackGen/gtkmarshal.list \ - $(srcdir)/tools/callbackGen/Signal.chs.template $@ \ - Graphics.UI.Gtk.Signals) - -libHSgtk_a_ALLSOURCES = $(libHSgtk_a_SOURCES) $(nodist_libHSgtk_a_SOURCES) - -am_libHSgtk_a_OBJECTS = \ - $(addsuffix .$(OBJEXT),$(basename $(basename $(libHSgtk_a_ALLSOURCES)))) -libHSgtk_a_objects_deps = $(libHSglib_a_OBJECTS) -if ENABLE_CAIRO -libHSgtk_a_objects_deps += $(libHScairo_a_OBJECTS) -endif - -libHSgtk_a_HSPPFILES = $(filter %.hs.pp, $(libHSgtk_a_ALLSOURCES)) -libHSgtk_a_CHSPPFILES = $(filter %.chs.pp,$(libHSgtk_a_ALLSOURCES)) -libHSgtk_a_CHSFILES = $(filter %.chs,$(libHSgtk_a_ALLSOURCES:.chs.pp=.chs)) -libHSgtk_a_CHSFILES_HS = $(libHSgtk_a_CHSFILES:.chs=.hs) -libHSgtk_a_HSCFILES = $(filter %.hsc, $(libHSgtk_a_ALLSOURCES)) -libHSgtk_a_HSCFILES_HS = $(libHSgtk_a_HSCFILES:.hsc=.hs) - -libHSgtk_a_BUILDSOURCES = \ - $(libHSgtk_a_HSPPFILES:.hs.pp=.hs) \ - $(libHSgtk_a_CHSPPFILES:.chs.pp=.chs) \ - $(libHSgtk_a_CHSFILES_HS) \ - $(libHSgtk_a_HSCFILES_HS) \ - $(libHSgtk_a_GENERATEDSOURCES) -libHSgtk_a_HSFILES = \ - $(filter %.hs,$(libHSgtk_a_BUILDSOURCES)) \ - $(filter %.hs,$(libHSgtk_a_ALLSOURCES)) -libHSgtk_a_CFILES = $(filter %.c,$(libHSgtk_a_ALLSOURCES)) - -nobase_hi_DATA += $(libHSgtk_a_HSFILES:.hs=.hi) - -gtk_MOSTLYCLEANFILES = $(am_libHSgtk_a_OBJECTS) -gtk_MOSTLYCLEANFILES += $(libHSgtk_a_HSFILES:.hs=.hi) -gtk_MOSTLYCLEANFILES += \ - $(libHSgtk_a_CHSFILES:.chs=.chi) \ - $(libHSgtk_a_CHSFILES:.chs=_stub.h) \ - $(libHSgtk_a_CHSFILES:.chs=_stub.o) \ - $(libHSgtk_a_CHSFILES:.chs=_stub.c) -gtk_CLEANFILES = $(libHSgtk_a_BUILDSOURCES) -gtk_CLEANFILES += $(libHSgtk_a_CHSFILES_HS:.hs=.dep) -gtk_CLEANFILES += \ - $(libHSgtk_a_HSCFILES:.hsc=_hsc_make$(EXEEXT)) \ - $(libHSgtk_a_HSCFILES:.hsc=_hsc_make.c) \ - $(libHSgtk_a_HSCFILES:.hsc=_hsc_make.o) - -$(libHSgtk_a_PRECOMP): $(libHSgtk_a_HEADER) -gtk/libHSgtk_a.deps: $(libHSgtk_a_HSFILES) | \ - $(foreach pkg,$(libHSgtk_a_INTERNALDEPS),$(pkg)/libHS$(pkg)_a.deps) -$(libHSgtk_a_CHSFILES:.chs=.dep): \ - $(foreach pkg,gtk $(libHSgtk_a_INTERNALDEPS),$(libHS$(pkg)_a_CHSFILES)) -$(libHSgtk_a_CHSFILES_HS): $(libHSgtk_a_PRECOMP) $(libHSgtk_a_HEADER) -$(libHSgtk_a_HSCFILES_HS): $(libHSgtk_a_HEADER) -$(libHSgtk_a_OBJECTS) : \ - $(foreach pkg,$(libHSgtk_a_INTERNALDEPS),$(libHS$(pkg)_a_OBJECTS)) - -EARLY_DEPS += $(libHSgtk_a_CHSFILES:.chs=.dep) - -ifeq (,$(DONT_USE_DEPS)) --include $(libHSgtk_a_CHSFILES_HS:.hs=.dep) gtk/libHSgtk_a.deps - endif - -if ENABLE_SPLITOBJS -libHSgtk_a_AR = $(srcdir)/mk/link-splitobjs.sh -gtk_CLEANFILES_SPLIT = $(libHSgtk_a_HSFILES:.hs=_split/) -else -libHSgtk_a_AR = $(AR) $(ARFLAGS) -endif - -libHSgtk_a_DEPENDENCIES = HSgtk.o -pkglib_DATA += HSgtk.o -HSgtk.o : $(libHSgtk_a_OBJECTS) - $(LD) -r $(LD_X) -o $@ $(libHSgtk_a_OBJECTS) $(libHSgtk_a_LIBADD) - -if ENABLE_PROFILING -libHSgtk_a_DEPENDENCIES += libHSgtk_p.a -pkglib_DATA += libHSgtk_p.a -libHSgtk_p.a : $(libHSgtk_a_HSFILES:.hs=.p_o) \ - $(libHSgtk_a_CFILES:.c=.o) \ - $(libHSgtk_a_LIBADD:.o=.p_o) - $(AR) $(ARFLAGS) $@ $^ - -ifeq (,$(DONT_USE_DEPS)) --include gtk/libHSgtk_a.p_deps - endif - -nobase_hi_DATA += $(libHSgtk_a_HSFILES:.hs=.p_hi) -gtk_MOSTLYCLEANFILES += $(libHSgtk_a_HSFILES:.hs=.p_hi) -gtk_MOSTLYCLEANFILES += $(libHSgtk_a_HSFILES:.hs=.p_o) -gtk_MOSTLYCLEANFILES += $(libHSgtk_a_LIBADD:.o=.p_o) -endif - -endif #ENABLE_GTK - -# -# glade package -# -################################################################################ - -if ENABLE_LIBGLADE - -glade_PKGNAME = libHSglade_a - -libHSglade_a_NAME = glade -libHSglade_a_CONFIG = glade/glade.package.conf -libHSglade_a_EXTERNALDEPS = base-$(PKG_BASE_VERSION) -libHSglade_a_INTERNALDEPS = gtk glib -libHSglade_a_HEADER = glade/glade.h -libHSglade_a_PRECOMP = glade/glade.precomp -libHSglade_a_LIBS = $(GLIB_LIBS) $(GTK_LIBS) $(LIBGLADE_LIBS) -libHSglade_a_HCFLAGS = $(FFI) -libHSglade_a_CFLAGS = $(filter-out -I% -D%,$(GLIB_CFLAGS) $(GTK_CFLAGS) $(LIBGLADE_CFLAGS)) -libHSglade_a_CPPFLAGS = $(filter -I% -D%,$(GLIB_CFLAGS) $(GTK_CFLAGS) $(LIBGLADE_CFLAGS)) - -libHSglade_a_SOURCESDIRS = glade - -libHSglade_a_GENERATEDSOURCES = \ - glade/Graphics/UI/Gtk/Glade/Types.chs - -nodist_libHSglade_a_SOURCES = $(libHSglade_a_GENERATEDSOURCES) - -libHSglade_a_SOURCES = \ - glade/Graphics/UI/Gtk/Glade.chs - -htmldoc_HSFILES_HIDDEN += $(libHSglade_a_GENERATEDSOURCES:.chs=.hs) - -glade_Graphics_UI_Gtk_Glade_Types_hs_HCFLAGS = -fglasgow-exts - -glade/Graphics/UI/Gtk/Glade/Types.chs : $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ - $(srcdir)/tools/hierarchyGen/hierarchy.list \ - $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ - $@ --tag=libglade --lib=glade --prefix=glade \ - --modname=Graphics.UI.Gtk.Glade.Types \ - --destructor=objectUnrefFromMainloop \ - --import=*Graphics.UI.Gtk.Types) - -libHSglade_a_ALLSOURCES = $(libHSglade_a_SOURCES) $(nodist_libHSglade_a_SOURCES) - -am_libHSglade_a_OBJECTS = \ - $(addsuffix .$(OBJEXT),$(basename $(basename $(libHSglade_a_ALLSOURCES)))) - -libHSglade_a_HSPPFILES = $(filter %.hs.pp, $(libHSglade_a_ALLSOURCES)) -libHSglade_a_CHSPPFILES = $(filter %.chs.pp,$(libHSglade_a_ALLSOURCES)) -libHSglade_a_CHSFILES = \ - $(filter %.chs,$(libHSglade_a_ALLSOURCES:.chs.pp=.chs)) -libHSglade_a_CHSFILES_HS = $(libHSglade_a_CHSFILES:.chs=.hs) -libHSglade_a_HSCFILES = $(filter %.hsc, $(libHSglade_a_ALLSOURCES)) -libHSglade_a_HSCFILES_HS = $(libHSglade_a_HSCFILES:.hsc=.hs) -libHSglade_a_BUILDSOURCES = \ - $(libHSglade_a_HSPPFILES:.hs.pp=.hs) \ - $(libHSglade_a_CHSPPFILES:.chs.pp=.chs) \ - $(libHSglade_a_CHSFILES_HS) \ - $(libHSglade_a_HSCFILES_HS) \ - $(libHSglade_a_GENERATEDSOURCES) -libHSglade_a_HSFILES = \ - $(filter %.hs,$(libHSglade_a_BUILDSOURCES)) \ - $(filter %.hs,$(libHSglade_a_ALLSOURCES)) - -nobase_hi_DATA += $(libHSglade_a_HSFILES:.hs=.hi) - -glade_MOSTLYCLEANFILES = $(am_libHSglade_a_OBJECTS) -glade_MOSTLYCLEANFILES += $(libHSglade_a_HSFILES:.hs=.hi) -glade_MOSTLYCLEANFILES += $(libHSglade_a_CHSFILES:.chs=.chi) -glade_CLEANFILES = $(libHSglade_a_BUILDSOURCES) -glade_CLEANFILES += $(libHSglade_a_CHSFILES_HS:.hs=.dep) -glade_CLEANFILES += \ - $(libHSglade_a_HSCFILES:.hsc=_hsc_make$(EXEEXT)) \ - $(libHSglade_a_HSCFILES:.hsc=_hsc_make.c) \ - $(libHSglade_a_HSCFILES:.hsc=_hsc_make.o) - -glade/libHSglade_a.deps: $(libHSglade_a_HSFILES) | \ - $(foreach pkg,$(libHSglade_a_INTERNALDEPS),$(pkg)/libHS$(pkg)_a.deps) -$(libHSglade_a_CHSFILES:.chs=.dep): \ - $(foreach pkg,glade $(libHSglib_a_INTERNALDEPS),$(libHS$(pkg)_a_CHSFILES)) -$(libHSglade_a_CHSFILES_HS): $(libHSglade_a_PRECOMP) -$(libHSglade_a_OBJECTS) : \ - $(foreach pkg,$(libHSglade_a_INTERNALDEPS),$(libHS$(pkg)_a_OBJECTS)) - -EARLY_DEPS += $(libHSglade_a_CHSFILES:.chs=.dep) - -ifeq (,$(DONT_USE_DEPS)) --include $(libHSglade_a_CHSFILES:.chs=.dep) glade/libHSglade_a.deps - endif - -if ENABLE_SPLITOBJS -libHSglade_a_AR = $(srcdir)/mk/link-splitobjs.sh -glade_CLEANFILES_SPLIT = $(libHSglade_a_HSFILES:.hs=_split/) -else -libHSglade_a_AR = $(AR) $(ARFLAGS) -endif - -libHSglade_a_DEPENDENCIES = HSglade.o -pkglib_DATA += HSglade.o -HSglade.o : $(libHSglade_a_OBJECTS) - $(LD) -r $(LD_X) -o $@ $(libHSglade_a_OBJECTS) $(libHSglade_a_LIBADD) - -if ENABLE_PROFILING -libHSglade_a_DEPENDENCIES += libHSglade_p.a -pkglib_DATA += libHSglade_p.a -libHSglade_p.a : $(libHSglade_a_HSFILES:.hs=.p_o) \ - $(libHSglade_a_LIBADD:.o=.p_o) - $(AR) $(ARFLAGS) $@ $^ - -ifeq (,$(DONT_USE_DEPS)) --include glade/libHSglade_a.p_deps - endif - -nobase_hi_DATA += $(libHSglade_a_HSFILES:.hs=.p_hi) -glade_MOSTLYCLEANFILES += $(libHSglade_a_HSFILES:.hs=.p_hi) -glade_MOSTLYCLEANFILES += $(... [truncated message content] |
From: Andy S. <And...@co...> - 2010-05-15 17:52:06
|
diffing dir... Sat May 15 13:49:41 EDT 2010 Andy Stewart <laz...@gm...> * Move gstreamer demo to gstreamer/demo Ignore-this: edaafa1e0fa565a8ade88e8db82ab292 { hunk ./demo/gstreamer/Makefile 1 - -PROGS = vorbis-play -SOURCES = VorbisPlay.hs - -all: $(PROGS) - -vorbis-play : VorbisPlay.hs - $(HC_RULE) - -HC_RULE = $(HC) --make $< -o $@ $(HCFLAGS) - -clean: - rm -f $(SOURCES:.hs=.hi) $(SOURCES:.hs=.o) $(PROGS) - -HC=ghc rmfile ./demo/gstreamer/Makefile hunk ./demo/gstreamer/VorbisPlay.hs 1 -import System.Exit -import Data.Maybe -import qualified Media.Streaming.GStreamer as Gst -import qualified System.Glib as G -import qualified System.Glib.MainLoop as G -import qualified System.Glib.Properties as G -import qualified System.Glib.GError as G -import qualified System.Glib.Signals as G -import Text.Printf -import Control.Monad -import System.IO -import System - -mkElement action = - do element <- action - case element of - Just element' -> - return element' - Nothing -> [_$_] - do hPutStrLn stderr "could not create all GStreamer elements\n" - exitFailure - -main = - do args <- getArgs - when (length args /= 1) $ - do hPutStrLn stderr "Usage: vorbis-play <Ogg/Vorbis filename>\n" - exitFailure - [_$_] - Gst.init - [_$_] - mainLoop <- G.mainLoopNew Nothing True - [_$_] - pipeline <- Gst.pipelineNew "audio-player" - source <- mkElement $ Gst.elementFactoryMake "filesrc" $ Just "file-source" - parser <- mkElement $ Gst.elementFactoryMake "oggdemux" $ Just "ogg-parser" - decoder <- mkElement $ Gst.elementFactoryMake "vorbisdec" $ Just "vorbis-decoder" - conv <- mkElement $ Gst.elementFactoryMake "audioconvert" $ Just "convert" - sink <- mkElement $ Gst.elementFactoryMake "alsasink" $ Just "alsa-output" - [_$_] - let elements = [source, parser, decoder, conv, sink] - [_$_] - G.objectSetPropertyString "location" source (head args) - [_$_] - bus <- Gst.pipelineGetBus (Gst.castToPipeline pipeline) - Gst.busAddWatch bus G.priorityDefault $ \bus message -> - do case Gst.messageType message of - Gst.MessageEOS -> - do putStrLn "end of stream" - G.mainLoopQuit mainLoop - Gst.MessageError -> - let G.GError _ _ msg = fst $ fromJust $ Gst.messageParseError message - messageStr = "Error: " ++ msg - in do hPutStrLn stderr messageStr - G.mainLoopQuit mainLoop - _ -> return () - return True - [_$_] - mapM_ (Gst.binAdd $ Gst.castToBin pipeline) elements - [_$_] - Gst.elementLink source parser - Gst.elementLink decoder conv - Gst.elementLink conv sink - [_$_] - G.on parser Gst.elementPadAdded $ \pad -> - do sinkPad <- Gst.elementGetStaticPad decoder "sink" - Gst.padLink pad $ fromJust sinkPad - return () - [_$_] - flip G.timeoutAdd 100 $ do - position <- Gst.elementQueryPosition pipeline Gst.FormatTime - duration <- Gst.elementQueryDuration pipeline Gst.FormatTime - case position of - Just (_, position') -> - case duration of - Just (_, duration') -> do - printf "%10d / %10d\r" [_$_] - (fromIntegral (position' `div` Gst.second)::Integer) - (fromIntegral (duration' `div` Gst.second)::Integer) - Nothing -> do - putStr "no information\r" - Nothing -> do - putStr "no information\r" - hFlush stdout - return True - [_$_] - Gst.elementSetState pipeline Gst.StatePlaying - [_$_] - G.mainLoopRun mainLoop - [_$_] - Gst.elementSetState pipeline Gst.StateNull - [_$_] - return () rmfile ./demo/gstreamer/VorbisPlay.hs rmdir ./demo/gstreamer adddir ./gstreamer/demo addfile ./gstreamer/demo/Makefile hunk ./gstreamer/demo/Makefile 1 + +PROGS = vorbis-play +SOURCES = VorbisPlay.hs + +all: $(PROGS) + +vorbis-play : VorbisPlay.hs + $(HC_RULE) + +HC_RULE = $(HC) --make $< -o $@ $(HCFLAGS) + +clean: + rm -f $(SOURCES:.hs=.hi) $(SOURCES:.hs=.o) $(PROGS) + +HC=ghc addfile ./gstreamer/demo/VorbisPlay.hs hunk ./gstreamer/demo/VorbisPlay.hs 1 +import System.Exit +import Data.Maybe +import qualified Media.Streaming.GStreamer as Gst +import qualified System.Glib as G +import qualified System.Glib.MainLoop as G +import qualified System.Glib.Properties as G +import qualified System.Glib.GError as G +import qualified System.Glib.Signals as G +import Text.Printf +import Control.Monad +import System.IO +import System + +mkElement action = + do element <- action + case element of + Just element' -> + return element' + Nothing -> [_$_] + do hPutStrLn stderr "could not create all GStreamer elements\n" + exitFailure + +main = + do args <- getArgs + when (length args /= 1) $ + do hPutStrLn stderr "Usage: vorbis-play <Ogg/Vorbis filename>\n" + exitFailure + [_$_] + Gst.init + [_$_] + mainLoop <- G.mainLoopNew Nothing True + [_$_] + pipeline <- Gst.pipelineNew "audio-player" + source <- mkElement $ Gst.elementFactoryMake "filesrc" $ Just "file-source" + parser <- mkElement $ Gst.elementFactoryMake "oggdemux" $ Just "ogg-parser" + decoder <- mkElement $ Gst.elementFactoryMake "vorbisdec" $ Just "vorbis-decoder" + conv <- mkElement $ Gst.elementFactoryMake "audioconvert" $ Just "convert" + sink <- mkElement $ Gst.elementFactoryMake "alsasink" $ Just "alsa-output" + [_$_] + let elements = [source, parser, decoder, conv, sink] + [_$_] + G.objectSetPropertyString "location" source (head args) + [_$_] + bus <- Gst.pipelineGetBus (Gst.castToPipeline pipeline) + Gst.busAddWatch bus G.priorityDefault $ \bus message -> + do case Gst.messageType message of + Gst.MessageEOS -> + do putStrLn "end of stream" + G.mainLoopQuit mainLoop + Gst.MessageError -> + let G.GError _ _ msg = fst $ fromJust $ Gst.messageParseError message + messageStr = "Error: " ++ msg + in do hPutStrLn stderr messageStr + G.mainLoopQuit mainLoop + _ -> return () + return True + [_$_] + mapM_ (Gst.binAdd $ Gst.castToBin pipeline) elements + [_$_] + Gst.elementLink source parser + Gst.elementLink decoder conv + Gst.elementLink conv sink + [_$_] + G.on parser Gst.elementPadAdded $ \pad -> + do sinkPad <- Gst.elementGetStaticPad decoder "sink" + Gst.padLink pad $ fromJust sinkPad + return () + [_$_] + flip G.timeoutAdd 100 $ do + position <- Gst.elementQueryPosition pipeline Gst.FormatTime + duration <- Gst.elementQueryDuration pipeline Gst.FormatTime + case position of + Just (_, position') -> + case duration of + Just (_, duration') -> do + printf "%10d / %10d\r" [_$_] + (fromIntegral (position' `div` Gst.second)::Integer) + (fromIntegral (duration' `div` Gst.second)::Integer) + Nothing -> do + putStr "no information\r" + Nothing -> do + putStr "no information\r" + hFlush stdout + return True + [_$_] + Gst.elementSetState pipeline Gst.StatePlaying + [_$_] + G.mainLoopRun mainLoop + [_$_] + Gst.elementSetState pipeline Gst.StateNull + [_$_] + return () } |
From: Andy S. <And...@co...> - 2010-05-15 17:04:32
|
diffing dir... Sat May 15 13:03:02 EDT 2010 Andy Stewart <laz...@gm...> * Make `gnomevfs` generate individual signals Ignore-this: f443a25445bcaf282acc6e381272c7c5 { hunk ./gnomevfs/System/Gnome/VFS/Drive.chs 89 +{#import System.Gnome.VFS.Signals#} hunk ./gnomevfs/System/Gnome/VFS/VolumeMonitor.chs 67 +{#import System.Gnome.VFS.Signals#} hunk ./gnomevfs/gnomevfs.cabal 22 - -x-Types-File: System/Gnome/VFS/Types.chs -x-Types-ModName: System.Gnome.VFS.Types -x-Types-Forward: Graphics.UI.GtkInternals hunk ./gnomevfs/gnomevfs.cabal 25 + marshal.list + +x-Types-File: System/Gnome/VFS/Types.chs +x-Types-Tag: gnomevfs +x-Types-ModName: System.Gnome.VFS.Types +x-Types-Forward: Graphics.UI.GtkInternals +x-Types-Destructor: objectUnrefFromMainloop hunk ./gnomevfs/gnomevfs.cabal 64 + System.Gnome.VFS.Signals hunk ./gnomevfs/gnomevfs.cabal 72 - x-Types-Tag: gnomevfs + x-Signals-File: System/Gnome/VFS/Signals.chs + x-Signals-Modname: System.Gnome.VFS.Signals + x-Signals-Types: marshal.list + x-Signals-Import: Graphics.UI.GtkInternals +[_^I_][_^I_][_$_] addfile ./gnomevfs/marshal.list hunk ./gnomevfs/marshal.list 1 +# see glib-genmarshal(1) for a detailed description of the file format, +# possible parameter types are: +# VOID indicates no return type, or no extra +# parameters. if VOID is used as the parameter +# list, no additional parameters may be present. +# BOOLEAN for boolean types (gboolean) +# CHAR for signed char types (gchar) +# UCHAR for unsigned char types (guchar) +# INT for signed integer types (gint) +# UINT for unsigned integer types (guint) +# LONG for signed long integer types (glong) +# ULONG for unsigned long integer types (gulong) +# ENUM for enumeration types (gint) +# FLAGS for flag enumeration types (guint) +# FLOAT for single-precision float types (gfloat) +# DOUBLE for double-precision float types (gdouble) +# STRING for string types (gchar*) +# BOXED for boxed (anonymous but reference counted) types (GBoxed*) +# POINTER for anonymous pointer types (gpointer) +# NONE deprecated alias for VOID +# BOOL deprecated alias for BOOLEAN + +# +# One discrepancy from Gtk+ is that for signals that may pass NULL for an object +# reference, the Haskell signal should be passed a 'Maybe GObject'. +# We therefore have two variants that are marshalled as a maybe type: +# +# OBJECT for GObject or derived types (GObject*) +# MOBJECT for GObject or derived types (GObject*) that may be NULL + +# Furthermore, some objects needs to be destroyed synchronously from the main loop of +# Gtk rather than during GC. These objects need to be marshalled using TOBJECT (for thread-safe +# object). It doesn't hurt to use TOBJECT for an object that doesn't need it, except for the +# some performance. As a rule of thumb, use TOBJECT for all libraries that build on package +# 'gtk' and use OBJECT for all packages that only need packages 'glib', 'pango', 'cairo', +# 'gio'. Again both variants exist. Note that the same names will be generated for OBJECT and +# TOBJECT, so you have to remove the OBJECT handler if you need both. +# +# TOBJECT for GObject or derived types (GObject*) +# MTOBJECT for GObject or derived types (GObject*) that may be NULL + +# If you add a new signal type, please check that it actually works! +# If it is a Boxed type check that the reference counting is right. + +NONE:TOBJECT } |
From: Andy S. <And...@co...> - 2010-05-15 17:04:29
|
diffing dir... Sat May 15 12:38:58 EDT 2010 Andy Stewart <laz...@gm...> * Remove unused signals from gtk/marshal.list. Ignore-this: 3450dd0b141afd2cb8861287bc336ca3 { hunk ./gtk/marshal.list 148 -# for Vte -VOID:STRING,INT hunk ./gtk/marshal.list 156 -# for WebKit -VOID:POINTER,POINTER -BOOLEAN:TOBJECT -BOOLEAN:TOBJECT,STRING,BOXED -POINTER:TOBJECT -BOOLEAN:INT,INT,STRING -BOOLEAN:STRING,STRING,INT,STRING -BOOLEAN:TOBJECT,STRING -BOOLEAN:TOBJECT,STRING,STRING -BOOLEAN:TOBJECT,TOBJECT,TOBJECT,TOBJECT -BOOLEAN:TOBJECT,TOBJECT,STRING,TOBJECT -NONE:TOBJECT,TOBJECT,TOBJECT,TOBJECT -BOOLEAN:ENUM,INT } |
From: Andy S. <And...@co...> - 2010-05-15 17:04:27
|
diffing dir... Sat May 15 12:37:17 EDT 2010 Andy Stewart <laz...@gm...> * Make `webkit` generate individual signals. Ignore-this: cddff1a5bf1671f47f4d3ffd69c3ae3d { hunk ./webkit/Graphics/UI/Gtk/WebKit/Download.chs 78 +{#import Graphics.UI.Gtk.WebKit.Signals#} hunk ./webkit/Graphics/UI/Gtk/WebKit/Internal.chs 44 +{#import Graphics.UI.Gtk.WebKit.Signals#} hunk ./webkit/Graphics/UI/Gtk/WebKit/WebInspector.chs 61 +{#import Graphics.UI.Gtk.WebKit.Signals#} hunk ./webkit/Graphics/UI/Gtk/WebKit/WebView.chs 200 +{#import Graphics.UI.Gtk.WebKit.Signals#} hunk ./webkit/Graphics/UI/Gtk/WebKit/WebView.chs 203 -import Graphics.UI.GtkInternals addfile ./webkit/marshal.list hunk ./webkit/marshal.list 1 +# see glib-genmarshal(1) for a detailed description of the file format, +# possible parameter types are: +# VOID indicates no return type, or no extra +# parameters. if VOID is used as the parameter +# list, no additional parameters may be present. +# BOOLEAN for boolean types (gboolean) +# CHAR for signed char types (gchar) +# UCHAR for unsigned char types (guchar) +# INT for signed integer types (gint) +# UINT for unsigned integer types (guint) +# LONG for signed long integer types (glong) +# ULONG for unsigned long integer types (gulong) +# ENUM for enumeration types (gint) +# FLAGS for flag enumeration types (guint) +# FLOAT for single-precision float types (gfloat) +# DOUBLE for double-precision float types (gdouble) +# STRING for string types (gchar*) +# BOXED for boxed (anonymous but reference counted) types (GBoxed*) +# POINTER for anonymous pointer types (gpointer) +# NONE deprecated alias for VOID +# BOOL deprecated alias for BOOLEAN + +# +# One discrepancy from Gtk+ is that for signals that may pass NULL for an object +# reference, the Haskell signal should be passed a 'Maybe GObject'. +# We therefore have two variants that are marshalled as a maybe type: +# +# OBJECT for GObject or derived types (GObject*) +# MOBJECT for GObject or derived types (GObject*) that may be NULL + +# Furthermore, some objects needs to be destroyed synchronously from the main loop of +# Gtk rather than during GC. These objects need to be marshalled using TOBJECT (for thread-safe +# object). It doesn't hurt to use TOBJECT for an object that doesn't need it, except for the +# some performance. As a rule of thumb, use TOBJECT for all libraries that build on package +# 'gtk' and use OBJECT for all packages that only need packages 'glib', 'pango', 'cairo', +# 'gio'. Again both variants exist. Note that the same names will be generated for OBJECT and +# TOBJECT, so you have to remove the OBJECT handler if you need both. +# +# TOBJECT for GObject or derived types (GObject*) +# MTOBJECT for GObject or derived types (GObject*) that may be NULL + +# If you add a new signal type, please check that it actually works! +# If it is a Boxed type check that the reference counting is right. + +VOID:POINTER,POINTER +BOOLEAN:TOBJECT +BOOLEAN:TOBJECT,STRING,BOXED +POINTER:TOBJECT +BOOLEAN:INT,INT,STRING +BOOLEAN:STRING,STRING,INT,STRING +BOOLEAN:TOBJECT,STRING +BOOLEAN:TOBJECT,STRING,STRING +BOOLEAN:TOBJECT,TOBJECT,TOBJECT,TOBJECT +BOOLEAN:TOBJECT,TOBJECT,STRING,TOBJECT +NONE:TOBJECT,TOBJECT,TOBJECT,TOBJECT +BOOLEAN:ENUM,INT +BOOLEAN:NONE +NONE:NONE +NONE:TOBJECT,STRING +NONE:TOBJECT,TOBJECT +NONE:STRING,STRING +NONE:TOBJECT +NONE:INT +NONE:STRING hunk ./webkit/webkit.cabal 23 -x-Types-File: Graphics/UI/Gtk/WebKit/Types.chs -x-Types-ModName: Graphics.UI.Gtk.WebKit.Types -x-Types-Forward: *Graphics.UI.GtkInternals -x-Types-Destructor: objectUnrefFromMainloop hunk ./webkit/webkit.cabal 25 + marshal.list +[_^I_][_^I_][_^I_][_^I_][_^I_][_$_] +x-Types-File: Graphics/UI/Gtk/WebKit/Types.chs +x-Types-Tag: webkit +x-Types-ModName: Graphics.UI.Gtk.WebKit.Types +x-Types-Forward: *Graphics.UI.GtkInternals +x-Types-Destructor: objectUnrefFromMainloop hunk ./webkit/webkit.cabal 69 + Graphics.UI.Gtk.WebKit.Signals hunk ./webkit/webkit.cabal 73 + x-Signals-File: Graphics/UI/Gtk/WebKit/Signals.chs + x-Signals-Modname: Graphics.UI.Gtk.WebKit.Signals + x-Signals-Types: marshal.list + x-Signals-Import: Graphics.UI.GtkInternals +[_^I_][_^I_][_$_] hunk ./webkit/webkit.cabal 79 - x-Types-Tag: webkit } |
From: Andy S. <And...@co...> - 2010-05-15 17:04:24
|
diffing dir... Sat May 15 12:35:57 EDT 2010 Andy Stewart <laz...@gm...> * Make `vte` generate individual signals Ignore-this: ca2a5ee118474793b135ffa223b8f39d { hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs 208 +{#import Graphics.UI.Gtk.Vte.Signals#} addfile ./vte/marshal.list hunk ./vte/marshal.list 1 +# see glib-genmarshal(1) for a detailed description of the file format, +# possible parameter types are: +# VOID indicates no return type, or no extra +# parameters. if VOID is used as the parameter +# list, no additional parameters may be present. +# BOOLEAN for boolean types (gboolean) +# CHAR for signed char types (gchar) +# UCHAR for unsigned char types (guchar) +# INT for signed integer types (gint) +# UINT for unsigned integer types (guint) +# LONG for signed long integer types (glong) +# ULONG for unsigned long integer types (gulong) +# ENUM for enumeration types (gint) +# FLAGS for flag enumeration types (guint) +# FLOAT for single-precision float types (gfloat) +# DOUBLE for double-precision float types (gdouble) +# STRING for string types (gchar*) +# BOXED for boxed (anonymous but reference counted) types (GBoxed*) +# POINTER for anonymous pointer types (gpointer) +# NONE deprecated alias for VOID +# BOOL deprecated alias for BOOLEAN + +# +# One discrepancy from Gtk+ is that for signals that may pass NULL for an object +# reference, the Haskell signal should be passed a 'Maybe GObject'. +# We therefore have two variants that are marshalled as a maybe type: +# +# OBJECT for GObject or derived types (GObject*) +# MOBJECT for GObject or derived types (GObject*) that may be NULL + +# Furthermore, some objects needs to be destroyed synchronously from the main loop of +# Gtk rather than during GC. These objects need to be marshalled using TOBJECT (for thread-safe +# object). It doesn't hurt to use TOBJECT for an object that doesn't need it, except for the +# some performance. As a rule of thumb, use TOBJECT for all libraries that build on package +# 'gtk' and use OBJECT for all packages that only need packages 'glib', 'pango', 'cairo', +# 'gio'. Again both variants exist. Note that the same names will be generated for OBJECT and +# TOBJECT, so you have to remove the OBJECT handler if you need both. +# +# TOBJECT for GObject or derived types (GObject*) +# MTOBJECT for GObject or derived types (GObject*) that may be NULL + +# If you add a new signal type, please check that it actually works! +# If it is a Boxed type check that the reference counting is right. + +NONE:NONE +NONE:INT +NONE:INT,INT +NONE:LONG,LONG +NONE:TOBJECT,TOBJECT +NONE:STRING,INT + hunk ./vte/vte.cabal 21 -x-Types-File: Graphics/UI/Gtk/Vte/Types.chs -x-Types-ModName: Graphics.UI.Gtk.Vte.Types -x-Types-Forward: *Graphics.UI.GtkInternals -x-Types-Destructor: objectUnrefFromMainloop hunk ./vte/vte.cabal 23 + marshal.list + +x-Types-File: Graphics/UI/Gtk/Vte/Types.chs +x-Types-Tag: vte[_^I_][_^I_][_$_] +x-Types-ModName: Graphics.UI.Gtk.Vte.Types +x-Types-Forward: *Graphics.UI.GtkInternals +x-Types-Destructor: objectUnrefFromMainloop hunk ./vte/vte.cabal 40 - cairo >= 0.10.5 && < 0.11, hunk ./vte/vte.cabal 49 + Graphics.UI.Gtk.Vte.Signals hunk ./vte/vte.cabal 54 + x-Signals-File: Graphics/UI/Gtk/Vte/Signals.chs + x-Signals-Modname: Graphics.UI.Gtk.Vte.Signals + x-Signals-Types: marshal.list + x-Signals-Import: Graphics.UI.GtkInternals +[_^I_][_^I_][_$_] hunk ./vte/vte.cabal 61 - x-Types-Tag: vte[_^I_][_^I_][_$_] } |
From: Andy S. <And...@co...> - 2010-05-15 17:04:19
|
diffing dir... Sat May 15 12:32:55 EDT 2010 Andy Stewart <laz...@gm...> * Make `gtksourceview2` generate individual signals. Ignore-this: 341bf4e0dcc796bda0541d192921ddcd { hunk ./gtksourceview2/Graphics/UI/Gtk/SourceView/SourceBuffer.chs 70 -import Graphics.UI.GtkInternals +{#import Graphics.UI.Gtk.SourceView.Signals#} hunk ./gtksourceview2/Graphics/UI/Gtk/SourceView/SourceIter.chs 46 -import Graphics.UI.GtkInternals hunk ./gtksourceview2/Graphics/UI/Gtk/SourceView/SourceView.chs 79 +{#import Graphics.UI.Gtk.SourceView.Signals#} hunk ./gtksourceview2/gtksourceview2.cabal 20 -x-Types-File: Graphics/UI/Gtk/SourceView/Types.chs -x-Types-ModName: Graphics.UI.Gtk.SourceView.Types -x-Types-Forward: *Graphics.UI.GtkInternals -x-Types-Destructor: objectUnrefFromMainloop hunk ./gtksourceview2/gtksourceview2.cabal 22 + marshal.list + +x-Types-File: Graphics/UI/Gtk/SourceView/Types.chs +x-Types-Tag: gtksourceview2 +x-Types-ModName: Graphics.UI.Gtk.SourceView.Types +x-Types-Forward: *Graphics.UI.GtkInternals +x-Types-Destructor: objectUnrefFromMainloop hunk ./gtksourceview2/gtksourceview2.cabal 38 - pango >= 0.10.5 && < 0.11, [_$_] - cairo >= 0.10.5 && < 0.11, hunk ./gtksourceview2/gtksourceview2.cabal 56 + Graphics.UI.Gtk.SourceView.Signals hunk ./gtksourceview2/gtksourceview2.cabal 60 + x-Signals-File: Graphics/UI/Gtk/SourceView/Signals.chs + x-Signals-Modname: Graphics.UI.Gtk.SourceView.Signals + x-Signals-Types: marshal.list +[_^I_][_^I_][_$_] hunk ./gtksourceview2/gtksourceview2.cabal 65 - x-Types-Tag: gtksourceview2 addfile ./gtksourceview2/marshal.list hunk ./gtksourceview2/marshal.list 1 +# see glib-genmarshal(1) for a detailed description of the file format, +# possible parameter types are: +# VOID indicates no return type, or no extra +# parameters. if VOID is used as the parameter +# list, no additional parameters may be present. +# BOOLEAN for boolean types (gboolean) +# CHAR for signed char types (gchar) +# UCHAR for unsigned char types (guchar) +# INT for signed integer types (gint) +# UINT for unsigned integer types (guint) +# LONG for signed long integer types (glong) +# ULONG for unsigned long integer types (gulong) +# ENUM for enumeration types (gint) +# FLAGS for flag enumeration types (guint) +# FLOAT for single-precision float types (gfloat) +# DOUBLE for double-precision float types (gdouble) +# STRING for string types (gchar*) +# BOXED for boxed (anonymous but reference counted) types (GBoxed*) +# POINTER for anonymous pointer types (gpointer) +# NONE deprecated alias for VOID +# BOOL deprecated alias for BOOLEAN + +# +# One discrepancy from Gtk+ is that for signals that may pass NULL for an object +# reference, the Haskell signal should be passed a 'Maybe GObject'. +# We therefore have two variants that are marshalled as a maybe type: +# +# OBJECT for GObject or derived types (GObject*) +# MOBJECT for GObject or derived types (GObject*) that may be NULL + +# Furthermore, some objects needs to be destroyed synchronously from the main loop of +# Gtk rather than during GC. These objects need to be marshalled using TOBJECT (for thread-safe +# object). It doesn't hurt to use TOBJECT for an object that doesn't need it, except for the +# some performance. As a rule of thumb, use TOBJECT for all libraries that build on package +# 'gtk' and use OBJECT for all packages that only need packages 'glib', 'pango', 'cairo', +# 'gio'. Again both variants exist. Note that the same names will be generated for OBJECT and +# TOBJECT, so you have to remove the OBJECT handler if you need both. +# +# TOBJECT for GObject or derived types (GObject*) +# MTOBJECT for GObject or derived types (GObject*) that may be NULL + +# If you add a new signal type, please check that it actually works! +# If it is a Boxed type check that the reference counting is right. + +NONE:NONE +NONE:BOXED,BOXED } |
From: Andy S. <And...@co...> - 2010-05-15 17:04:15
|
diffing dir... Sat May 15 12:30:32 EDT 2010 Andy Stewart <laz...@gm...> * Remove Gtk.Signals from GtkInternals.chs Ignore-this: c91e85a23ec5a4303fd1b59e19daf7b1 { hunk ./gtk/Graphics/UI/GtkInternals.chs 33 - module Graphics.UI.Gtk.Signals, hunk ./gtk/Graphics/UI/GtkInternals.chs 38 -{#import Graphics.UI.Gtk.Signals#} + } |
From: Andy S. <And...@co...> - 2010-05-15 15:07:23
|
diffing dir... Sat May 15 11:06:30 EDT 2010 Andy Stewart <laz...@gm...> * Add gstreamer to bootstrap.sh Ignore-this: 1a576a2c792ea139fd96b43b501f2bf7 hunk ./bootstrap.sh 5 -for pkg in glib gio cairo pango gtk gconf glade gnomevfs gtkglext gtksourceview2 soegtk svgcairo vte webkit; do [_$_] +for pkg in glib gio cairo pango gtk gconf glade gnomevfs gstreamer gtkglext gtksourceview2 soegtk svgcairo vte webkit; do [_$_] |
From: Axel S. <si...@co...> - 2010-05-15 14:49:34
|
diffing dir... Sat May 15 10:48:01 EDT 2010 Axe...@in... * Forgot to add the hierarchy.list file. Ignore-this: 6eb2f2f318d443b5a120cb9597007e9 { addfile ./gstreamer/hierarchy.list hunk ./gstreamer/hierarchy.list 1 +# This list is the result of a copy-and-paste from the GtkObject hierarchy +# html documentation. Deprecated widgets are uncommented. Some additional +# object have been defined at the end of the copied list. + +# The Gtk prefix of every object is removed, the other prefixes are +# kept. The indentation implies the object hierarchy. In case the +# type query function cannot be derived from the name or the type name +# is different, an alternative name and type query function can be +# specified by appending 'as typename, <query_func>'. In case this +# function is not specified, the <name> is converted to +# gtk_<name'>_get_type where <name'> is <name> where each upperscore +# letter is converted to an underscore and lowerletter. The underscore +# is omitted if an upperscore letter preceeded: GtkHButtonBox -> +# gtk_hbutton_box_get_type. The generation of a type can be +# conditional by appending 'if <tag>'. Such types are only produces if +# --tag=<tag> is given on the command line of TypeGenerator. + + + GObject [_$_] + +## GStreamer classes + GstObject as Object, gst_object_get_type if gstreamer + GstPad as Pad, gst_pad_get_type if gstreamer + GstGhostPad as GhostPad, gst_ghost_pad_get_type if gstreamer + GstPluginFeature as PluginFeature, gst_plugin_feature_get_type if gstreamer + GstElementFactory as ElementFactory, gst_element_factory_get_type if gstreamer + GstTypeFindFactory as TypeFindFactory, gst_type_find_factory_get_type if gstreamer + GstIndexFactory as IndexFactory, gst_index_factory_get_type if gstreamer + GstElement as Element, gst_element_get_type if gstreamer + GstBin as Bin, gst_bin_get_type if gstreamer + GstPipeline as Pipeline, gst_pipeline_get_type if gstreamer + GstImplementsInterface as ImplementsInterface, gst_implements_interface_get_type if gstreamer + GstTagSetter as TagSetter, gst_tag_setter_get_type if gstreamer + GstBaseSrc as BaseSrc, gst_base_src_get_type if gstreamer + GstPushSrc as PushSrc, gst_push_src_get_type if gstreamer + GstBaseSink as BaseSink, gst_base_sink_get_type if gstreamer + GstBaseTransform as BaseTransform, gst_base_transform_get_type if gstreamer + GstPlugin as Plugin, gst_plugin_get_type if gstreamer + GstRegistry as Registry, gst_registry_get_type if gstreamer + GstBus as Bus, gst_bus_get_type if gstreamer + GstClock as Clock, gst_clock_get_type if gstreamer + GstAudioClock as AudioClock, gst_audio_clock_get_type if gstreamer + GstSystemClock as SystemClock, gst_system_clock_get_type if gstreamer + GstNetClientClock as NetClientClock, gst_net_client_clock_get_type if gstreamer + GstIndex as Index, gst_index_get_type if gstreamer + GstPadTemplate as PadTemplate, gst_pad_template_get_type if gstreamer + GstTask as Task, gst_task_get_type if gstreamer + GstXML as XML, gst_xml_get_type if gstreamer + GstChildProxy as ChildProxy, gst_child_proxy_get_type if gstreamer + GstCollectPads as CollectPads, gst_collect_pads_get_type if gstreamer +## these are actually GInterfaces + GstURIHandler as URIHandler, gst_uri_handler_get_type if gstreamer + GstAdapter as Adapter, gst_adapter_get_type if gstreamer + GstController as Controller, gst_controller_get_type if gstreamer } |
From: Axel S. <si...@co...> - 2010-05-15 14:49:27
|
diffing dir... Sat May 15 08:39:27 EDT 2010 Axe...@in... * Add the forgotten Nothing case to readFile. Ignore-this: b4eac2af3784ef2691b3fb6a0cb8a2a2 hunk ./gio/System/GIO/File/File.chs 427 +fileRead file Nothing = constructNewGObject mkFileInputStream $ + propagateGError $ {# call file_read #} (toFile file) (Cancellable nullForeignPtr) |
From: Axel S. <si...@co...> - 2010-05-15 14:49:24
|
diffing dir... Sat May 15 08:07:36 EDT 2010 Axe...@in... * Fix Andy's compilation problem. Ignore-this: dd397744339db5ead222592511a744ac hunk ./gio/System/GIO/File/File.chs 180 -import System.GIO.Base +{#import System.GIO.Base#} |
From: Andy S. <And...@co...> - 2010-05-08 13:08:38
|
Sat May 8 09:06:57 EDT 2010 Andy Stewart <laz...@gm...> * Fix crash bug of treeViewColumnGetWidget. Ignore-this: bf8dc177526ddc4a3af03ee2c5b2013d When you first call treeViewColumnGetWidget will got error "main: user error (makeNewObject: object is NULL)" Details see : http://library.gnome.org/devel/gtk/stable/GtkTreeViewColumn.html#gtk-tree-view-column-get-widget hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeViewColumn.chs 379 - -> widget + -> Maybe widget hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeViewColumn.chs 384 - (toWidget widget) + (maybe (Widget nullForeignPtr) toWidget widget) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeViewColumn.chs 390 -treeViewColumnGetWidget :: TreeViewColumn -> IO Widget -treeViewColumnGetWidget self = - makeNewObject mkWidget $ - {# call unsafe tree_view_column_get_widget #} - self +treeViewColumnGetWidget :: TreeViewColumn [_$_] + -> IO (Maybe Widget) -- ^ returns the 'Widget' in the column header, or 'Nothing' +treeViewColumnGetWidget self = do + widgetPtr <- {# call unsafe tree_view_column_get_widget #} self + if widgetPtr == nullPtr + then return Nothing + else liftM Just $ makeNewObject mkWidget (return widgetPtr) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeViewColumn.chs 688 -treeViewColumnWidget :: WidgetClass widget => ReadWriteAttr TreeViewColumn Widget widget +treeViewColumnWidget :: WidgetClass widget => ReadWriteAttr TreeViewColumn (Maybe Widget) (Maybe widget) |
From: Andy S. <And...@co...> - 2010-05-08 10:59:13
|
Sat May 8 06:39:08 EDT 2010 Andy Stewart <laz...@gm...> * Add module `IconTheme` to support GIO (get icon pixbuf for files). Ignore-this: f038b0bb54a5b9b01b7b364542d771be hunk ./gtk/Graphics/UI/Gtk.chs 46 + module Graphics.UI.Gtk.General.IconTheme, hunk ./gtk/Graphics/UI/Gtk.chs 234 +import Graphics.UI.Gtk.General.IconTheme addfile ./gtk/Graphics/UI/Gtk/General/IconTheme.chs hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 1 +{-# LANGUAGE CPP #-} +-- -*-haskell-*- +-- GIMP Toolkit (GTK) Widget IconTheme +-- +-- Author : Andy Stewart +-- +-- Created: 28 Mar 2010 +-- +-- Copyright (C) 2010 Andy Stewart +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- | +-- Maintainer : gtk...@li... +-- Stability : provisional +-- Portability : portable (depends on GHC) +-- +-- Looking up icons by name +-- +-- * Module available since Gtk+ version 2.4 +-- +module Graphics.UI.Gtk.General.IconTheme ( + +-- * Detail +-- +-- | 'IconTheme' provides a facility for looking up icons by name and size. The main reason for using a +-- name rather than simply providing a filename is to allow different icons to be used depending on +-- what icon theme is selecetd by the user. The operation of icon themes on Linux and Unix follows the +-- Icon Theme Specification. There is a default icon theme, named hicolor where applications should +-- install their icons, but more additional application themes can be installed as operating system +-- vendors and users choose. +-- [_$_] +-- Named icons are similar to the Themeable Stock Images(3) facility, and the distinction between the +-- two may be a bit confusing. A few things to keep in mind: +-- [_$_] +-- [_\e2_][_\97_][_\8f_] Stock images usually are used in conjunction with Stock Items(3)., such as ''StockOk'' or +-- ''StockOpen''. Named icons are easier to set up and therefore are more useful for new icons +-- that an application wants to add, such as application icons or window icons. +-- [_$_] +-- [_\e2_][_\97_][_\8f_] Stock images can only be loaded at the symbolic sizes defined by the 'IconSize' enumeration, or +-- by custom sizes defined by 'iconSizeRegister', while named icons are more flexible and any +-- pixel size can be specified. +-- [_$_] +-- [_\e2_][_\97_][_\8f_] Because stock images are closely tied to stock items, and thus to actions in the user interface, +-- stock images may come in multiple variants for different widget states or writing directions. +-- [_$_] +-- A good rule of thumb is that if there is a stock image for what you want to use, use it, otherwise +-- use a named icon. It turns out that internally stock images are generally defined in terms of one or +-- more named icons. (An example of the more than one case is icons that depend on writing direction; +-- ''StockGoForward'' uses the two themed icons 'gtkStockGoForwardLtr' and +-- 'gtkStockGoForwardRtl'.) +-- [_$_] +-- In many cases, named themes are used indirectly, via 'Image' or stock items, rather than directly, +-- but looking up icons directly is also simple. The 'IconTheme' object acts as a database of all the +-- icons in the current theme. You can create new 'IconTheme' objects, but its much more efficient to +-- use the standard icon theme for the 'Screen' so that the icon information is shared with other +-- people looking up icons. In the case where the default screen is being used, looking up an icon can +-- be as simple as: +-- +-- * Class Hierarchy +-- +-- | +-- @ +-- | 'GObject' +-- | +----IconTheme +-- @ + +#if GTK_CHECK_VERSION(2,4,0) +-- * Types + IconTheme, + IconThemeClass, + castToIconTheme, + toIconTheme, + + IconInfo, + +-- * Enums + IconLookupFlags(..), + IconThemeError(..), + +-- * Constructors + iconThemeNew, + +#if GTK_CHECK_VERSION(2,14,0) + iconInfoNewForPixbuf, +#endif + +-- * Methods + iconThemeGetDefault, + iconThemeGetForScreen, + iconThemeSetScreen, + iconThemeSetSearchPath, + iconThemeGetSearchPath, + iconThemeAppendSearchPath, + iconThemePrependSearchPath, + iconThemeSetCustomTheme, + iconThemeHasIcon, + iconThemeLookupIcon, +#if GTK_CHECK_VERSION(2,12,0) + iconThemeChooseIcon, +#ifdef ENABLE_GIO +#if GTK_CHECK_VERSION(2,14,0) + iconThemeLookupByGicon, +#endif +#endif +#endif + iconThemeLoadIcon, +#if GTK_CHECK_VERSION(2,12,0) + iconThemeListContexts, +#endif + iconThemeListIcons, +#if GTK_CHECK_VERSION(2,6,0) + iconThemeGetIconSizes, +#endif + iconThemeGetExampleIconName, + iconThemeRescanIfNeeded, + iconThemeAddBuiltinIcon, + iconThemeErrorQuark, + + iconInfoCopy, + iconInfoGetAttachPoints, + iconInfoGetBaseSize, + iconInfoGetBuiltinPixbuf, + iconInfoGetDisplayName, + iconInfoGetEmbeddedRect, + iconInfoGetFilename, + iconInfoLoadIcon, + iconInfoSetRawCoordinates, + +-- * Signals + iconThemeChanged, +#endif + ) where + +import Control.Monad (liftM) + +import System.Glib.FFI +import System.Glib.Attributes +import System.Glib.Properties +import System.Glib.UTFString +import System.Glib.GList +import System.Glib.Flags +import System.Glib.GObject (constructNewGObject, makeNewGObject, Quark) +import System.Glib.GError (GErrorDomain, GErrorClass(..), propagateGError) +import Graphics.UI.Gtk.General.Structs (Rectangle, Point) +{#import Graphics.UI.Gtk.Types#} +{#import Graphics.UI.Gtk.Signals#} +#ifdef ENABLE_GIO +{#import System.GIO.Types#} +#endif + +{# context lib="gtk" prefix="gtk" #} + +#if GTK_CHECK_VERSION(2,4,0) +-------------------- +-- Enums +{#enum IconLookupFlags {underscoreToCase} deriving (Bounded,Eq,Show)#} + +{#enum IconThemeError {underscoreToCase} deriving (Bounded,Eq,Show)#} + +-------------------- +-- Constructors + +-- | Creates a new icon theme object. Icon theme objects are used to lookup up +-- an icon by name in a particular icon theme. Usually, you'll want to use +-- 'iconThemeGetDefault' or 'iconThemeGetForScreen' rather than creating a new +-- icon theme object for scratch. +-- +iconThemeNew :: IO IconTheme +iconThemeNew = + constructNewGObject mkIconTheme $ + {# call gtk_icon_theme_new #} + +-------------------- +-- Methods + +-- | Gets the icon theme for the default screen. See 'iconThemeGetForScreen'. +-- +iconThemeGetDefault :: + IO IconTheme -- ^ returns A unique 'IconTheme' associated with the default + -- screen. This icon theme is associated with the screen and + -- can be used as long as the screen is open. [_$_] +iconThemeGetDefault = + makeNewGObject mkIconTheme $ + {# call gtk_icon_theme_get_default #} + +-- | Gets the icon theme object associated with @screen@; if this function has +-- not previously been called for the given screen, a new icon theme object +-- will be created and associated with the screen. Icon theme objects are +-- fairly expensive to create, so using this function is usually a better +-- choice than calling than 'iconThemeNew' and setting the screen yourself; by +-- using this function a single icon theme object will be shared between users. +-- +iconThemeGetForScreen :: + Screen -- ^ @screen@ - a 'Screen' + -> IO IconTheme -- ^ returns A unique 'IconTheme' associated with the given + -- screen. [_$_] +iconThemeGetForScreen screen = + makeNewGObject mkIconTheme $ + {# call gtk_icon_theme_get_for_screen #} + screen + +-- | Sets the screen for an icon theme; the screen is used to track the user's +-- currently configured icon theme, which might be different for different +-- screens. +-- +iconThemeSetScreen :: IconThemeClass self => self + -> Screen -- ^ @screen@ - a 'Screen' + -> IO () +iconThemeSetScreen self screen = + {# call gtk_icon_theme_set_screen #} + (toIconTheme self) + screen + +-- | Sets the search path for the icon theme object. When looking for an icon +-- theme, Gtk+ will search for a subdirectory of one or more of the directories +-- in @path@ with the same name as the icon theme. (Themes from multiple of the +-- path elements are combined to allow themes to be extended by adding icons in +-- the user's home directory.) +-- +-- In addition if an icon found isn't found either in the current icon theme +-- or the default icon theme, and an image file with the right name is found +-- directly in one of the elements of @path@, then that image will be used for +-- the icon name. (This is legacy feature, and new icons should be put into the +-- default icon theme, which is called DEFAULT_THEME_NAME, rather than directly +-- on the icon path.) +-- +iconThemeSetSearchPath :: IconThemeClass self => self + -> [FilePath] -- ^ @path@ - list of directories that are searched for icon + -- themes + -> Int -- ^ @nElements@ - number of elements in @path@. + -> IO () +iconThemeSetSearchPath self path nElements = + withUTFStringArray path $ \pathPtr -> + {# call gtk_icon_theme_set_search_path #} + (toIconTheme self) + pathPtr + (fromIntegral nElements) + +-- | Gets the current search path. See 'iconThemeSetSearchPath'. +-- +iconThemeGetSearchPath :: IconThemeClass self => self + -> IO ([FilePath], Int) -- ^ @(path, nElements)@ [_$_] + -- @path@ - location to store a list of icon theme path + -- directories. [_$_] +iconThemeGetSearchPath self = + alloca $ \nElementsPtr -> [_$_] + allocaArray 0 $ \pathPtr -> do + {# call gtk_icon_theme_get_search_path #} + (toIconTheme self) + (castPtr pathPtr) + nElementsPtr + pathStr <- readUTFStringArray0 pathPtr + nElements <- peek nElementsPtr + return (pathStr, fromIntegral nElements) + +-- | Appends a directory to the search path. See 'iconThemeSetSearchPath'. +-- +iconThemeAppendSearchPath :: IconThemeClass self => self + -> FilePath -- ^ @path@ - directory name to append to the icon path + -> IO () +iconThemeAppendSearchPath self path = + withUTFString path $ \pathPtr -> + {# call gtk_icon_theme_append_search_path #} + (toIconTheme self) + pathPtr + +-- | Prepends a directory to the search path. See 'iconThemeSetSearchPath'. +-- +iconThemePrependSearchPath :: IconThemeClass self => self + -> FilePath -- ^ @path@ - directory name to prepend to the icon path + -> IO () +iconThemePrependSearchPath self path = + withUTFString path $ \pathPtr -> + {# call gtk_icon_theme_prepend_search_path #} + (toIconTheme self) + pathPtr + +-- | Sets the name of the icon theme that the 'IconTheme' object uses +-- overriding system configuration. This function cannot be called on the icon +-- theme objects returned from 'iconThemeGetDefault' and +-- 'iconThemeGetForScreen'. +-- +iconThemeSetCustomTheme :: IconThemeClass self => self + -> (Maybe String) -- ^ @themeName@ name of icon theme to use instead of configured theme, or 'Nothing' to unset a previously set custom theme + -> IO () +iconThemeSetCustomTheme self themeName = + maybeWith withUTFString themeName $ \themeNamePtr -> + {# call gtk_icon_theme_set_custom_theme #} + (toIconTheme self) + themeNamePtr + +-- | Checks whether an icon theme includes an icon for a particular name. +-- +iconThemeHasIcon :: IconThemeClass self => self + -> String -- ^ @iconName@ - the name of an icon + -> IO Bool -- ^ returns @True@ if @iconTheme@ includes an icon for + -- @iconName@. +iconThemeHasIcon self iconName = + liftM toBool $ + withUTFString iconName $ \iconNamePtr -> + {# call gtk_icon_theme_has_icon #} + (toIconTheme self) + iconNamePtr + +-- | Looks up a named icon and returns a structure containing information such +-- as the filename of the icon. The icon can then be rendered into a pixbuf +-- using 'iconInfoLoadIcon'. ('iconThemeLoadIcon' combines these two steps if +-- all you need is the pixbuf.) +-- +iconThemeLookupIcon :: IconThemeClass self => self + -> String -- ^ @iconName@ - the name of the icon to lookup + -> Int -- ^ @size@ - desired icon size + -> IconLookupFlags -- ^ @flags@ - flags modifying the behavior of the + -- icon lookup + -> IO (Maybe IconInfo) -- ^ returns a 'IconInfo' + -- structure containing information about the icon, or + -- 'Nothing' if the icon wasn't found. [_$_] +iconThemeLookupIcon self iconName size flags = + withUTFString iconName $ \iconNamePtr -> do + iiPtr <- {# call gtk_icon_theme_lookup_icon #} + (toIconTheme self) + iconNamePtr + (fromIntegral size) + ((fromIntegral . fromEnum) flags) + if iiPtr == nullPtr [_$_] + then return Nothing + else liftM Just (mkIconInfo (castPtr iiPtr)) + +#if GTK_CHECK_VERSION(2,12,0) +-- | Looks up a named icon and returns a structure containing information such +-- as the filename of the icon. The icon can then be rendered into a pixbuf +-- using 'iconInfoLoadIcon'. ('iconThemeLoadIcon' combines these two steps if +-- all you need is the pixbuf.) +-- +-- If @iconNames@ contains more than one name, this function tries them all +-- in the given order before falling back to inherited icon themes. +-- +-- * Available since Gtk+ version 2.12 +-- +iconThemeChooseIcon :: IconThemeClass self => self + -> [String] -- ^ @iconNames@ terminated list of icon names to lookup + -> Int -- ^ @size@ - desired icon size + -> IconLookupFlags -- ^ @flags@ - flags modifying the behavior of the + -- icon lookup + -> IO (Maybe IconInfo) -- ^ returns a 'IconInfo' + -- structure containing information about the icon, or + -- 'Nothing' if the icon wasn't found. [_$_] +iconThemeChooseIcon self iconNames size flags = + withUTFStringArray0 iconNames $ \iconNamesPtr -> do + iiPtr <- {# call gtk_icon_theme_choose_icon #} + (toIconTheme self) + iconNamesPtr + (fromIntegral size) + ((fromIntegral . fromEnum) flags) + if iiPtr == nullPtr [_$_] + then return Nothing + else liftM Just (mkIconInfo (castPtr iiPtr)) + +#ifdef ENABLE_GIO +#if GTK_CHECK_VERSION(2,14,0) +-- | Looks up an icon and returns a structure containing information such as +-- the filename of the icon. The icon can then be rendered into a pixbuf using +-- 'iconInfoLoadIcon'. +-- +-- * Available since Gtk+ version 2.14 +-- +iconThemeLookupByGicon :: (IconThemeClass self, IconClass icon) => self + -> icon -- ^ @icon@ - the 'Icon' to look up + -> Int -- ^ @size@ - desired icon size + -> IconLookupFlags -- ^ @flags@ - flags modifying the behavior of the + -- icon lookup + -> IO (Maybe IconInfo) -- ^ returns a 'IconInfo' + -- structure containing information about the icon, or + -- 'Nothing' if the icon wasn't found. [_$_] +iconThemeLookupByGicon self icon size flags = do + iiPtr <- {# call gtk_icon_theme_lookup_by_gicon #} + (toIconTheme self) + (toIcon icon) + (fromIntegral size) + ((fromIntegral . fromEnum) flags) + if iiPtr == nullPtr [_$_] + then return Nothing + else liftM Just (mkIconInfo (castPtr iiPtr)) +#endif +#endif +#endif + +-- | Looks up an icon in an icon theme, scales it to the given size and +-- renders it into a pixbuf. This is a convenience function; if more details +-- about the icon are needed, use 'iconThemeLookupIcon' followed by +-- 'iconInfoLoadIcon'. +-- +-- Note that you probably want to listen for icon theme changes and update +-- the icon. This is usually done by connecting to the 'Widget'::style-set +-- signal. If for some reason you do not want to update the icon when the icon +-- theme changes, you should consider using 'pixbufCopy' to make a private copy +-- of the pixbuf returned by this function. Otherwise Gtk+ may need to keep the +-- old icon theme loaded, which would be a waste of memory. +-- +iconThemeLoadIcon :: IconThemeClass self => self + -> String -- ^ @iconName@ - the name of the icon to lookup + -> Int -- ^ @size@ - the desired icon size. The resulting icon + -- may not be exactly this size; see 'iconInfoLoadIcon'. + -> IconLookupFlags -- ^ @flags@ - flags modifying the behavior of the icon + -- lookup + -> IO (Maybe Pixbuf) -- ^ returns the rendered icon; this may be a newly + -- created icon or a new reference to an internal icon, + -- so you must not modify the icon. [_$_] + -- `Nothing` if the icon isn't found. +iconThemeLoadIcon self iconName size flags = + maybeNull (makeNewGObject mkPixbuf) $ + propagateGError $ \errorPtr -> + withUTFString iconName $ \iconNamePtr -> + {# call gtk_icon_theme_load_icon #} + (toIconTheme self) + iconNamePtr + (fromIntegral size) + ((fromIntegral . fromEnum) flags) + errorPtr + +#if GTK_CHECK_VERSION(2,12,0) +-- | Gets the list of contexts available within the current hierarchy of icon +-- themes +-- +-- * Available since Gtk+ version 2.12 +-- +iconThemeListContexts :: IconThemeClass self => self + -> IO [String] -- ^ returns a String list + -- holding the names of all the contexts in the + -- theme. [_$_] +iconThemeListContexts self = do + glistPtr <- {# call gtk_icon_theme_list_contexts #} (toIconTheme self) + list <- fromGList glistPtr + result <- mapM readUTFString list [_$_] + {#call unsafe g_list_free #} (castPtr glistPtr) + return result +#endif + +-- | Lists the icons in the current icon theme. Only a subset of the icons can +-- be listed by providing a context string. The set of values for the context +-- string is system dependent, but will typically include such values as +-- \"Applications\" and \"MimeTypes\". +-- +iconThemeListIcons :: IconThemeClass self => self + -> (Maybe String) -- ^ @context@ a string identifying a particular type of icon, or 'Nothing' to list all icons. + -> IO [String] -- ^ returns a String list + -- holding the names of all the icons in the theme. +iconThemeListIcons self context = + maybeWith withUTFString context $ \contextPtr -> do + glistPtr <- {# call gtk_icon_theme_list_icons #} + (toIconTheme self) + contextPtr + list <- fromGList glistPtr + result <- mapM readUTFString list [_$_] + {#call unsafe g_list_free#} (castPtr glistPtr) + return result + +#if GTK_CHECK_VERSION(2,6,0) +-- | Returns an list of integers describing the sizes at which the icon is +-- available without scaling. A size of -1 means that the icon is available in +-- a scalable format. The list is zero-terminated. +-- +-- * Available since Gtk+ version 2.6 +-- +iconThemeGetIconSizes :: IconThemeClass self => self + -> String -- ^ @iconName@ - the name of an icon + -> IO [Int] -- ^ returns An newly allocated list describing the sizes at + -- which the icon is available. [_$_] +iconThemeGetIconSizes self iconName = + withUTFString iconName $ \iconNamePtr -> do + listPtr <- {# call gtk_icon_theme_get_icon_sizes #} + (toIconTheme self) + iconNamePtr + list <- peekArray 0 listPtr + {#call unsafe g_free #} (castPtr listPtr) + return (map fromIntegral list) +#endif + +-- | Gets the name of an icon that is representative of the current theme (for +-- instance, to use when presenting a list of themes to the user.) +-- +iconThemeGetExampleIconName :: IconThemeClass self => self + -> IO (Maybe String) -- ^ returns the name of an example icon or `Nothing' +iconThemeGetExampleIconName self = do + namePtr <- {# call gtk_icon_theme_get_example_icon_name #} (toIconTheme self) + if namePtr == nullPtr + then return Nothing + else liftM Just $ readUTFString namePtr + +-- | Checks to see if the icon theme has changed; if it has, any currently +-- cached information is discarded and will be reloaded next time @iconTheme@ +-- is accessed. +-- +iconThemeRescanIfNeeded :: IconThemeClass self => self + -> IO Bool -- ^ returns @True@ if the icon theme has changed and needed to be + -- reloaded. +iconThemeRescanIfNeeded self = + liftM toBool $ + {# call gtk_icon_theme_rescan_if_needed #} + (toIconTheme self) + +-- | Registers a built-in icon for icon theme lookups. The idea of built-in +-- icons is to allow an application or library that uses themed icons to +-- function requiring files to be present in the file system. For instance, the +-- default images for all of Gtk+'s stock icons are registered as built-icons. +-- +-- In general, if you use 'iconThemeAddBuiltinIcon' you should also install +-- the icon in the icon theme, so that the icon is generally available. +-- +-- This function will generally be used with pixbufs loaded via +-- 'pixbufNewFromInline'. +-- +iconThemeAddBuiltinIcon :: + String -- ^ @iconName@ - the name of the icon to register + -> Int -- ^ @size@ - the size at which to register the icon (different + -- images can be registered for the same icon name at different + -- sizes.) + -> Pixbuf -- ^ @pixbuf@ - 'Pixbuf' that contains the image to use for + -- @iconName@. + -> IO () +iconThemeAddBuiltinIcon iconName size pixbuf = + withUTFString iconName $ \iconNamePtr -> + {# call gtk_icon_theme_add_builtin_icon #} + iconNamePtr + (fromIntegral size) + pixbuf + +-- | +-- +iconThemeErrorQuark :: IO Quark +iconThemeErrorQuark = + {# call gtk_icon_theme_error_quark #} + +-------------------- +-- Types +{#pointer *IconInfo foreign newtype#} + +foreign import ccall unsafe ">k_icon_info_free" + icon_info_free :: FinalizerPtr IconInfo + +-- | Helper function for build 'IconInfo' +mkIconInfo :: Ptr IconInfo -> IO IconInfo +mkIconInfo infoPtr = [_$_] + liftM IconInfo $ newForeignPtr infoPtr icon_info_free + +-------------------- +-- Constructors + +#if GTK_CHECK_VERSION(2,14,0) +-- | +-- +iconInfoNewForPixbuf :: IconThemeClass iconTheme => iconTheme -> Pixbuf -> IO IconInfo +iconInfoNewForPixbuf iconTheme pixbuf = [_$_] + {# call gtk_icon_info_new_for_pixbuf #} + (toIconTheme iconTheme) + pixbuf + >>= mkIconInfo +#endif + +-------------------- +-- Methods + +-- | +-- +iconInfoCopy :: IconInfo -> IO IconInfo +iconInfoCopy self = [_$_] + {# call gtk_icon_info_copy #} self + >>= mkIconInfo + +-- | Fetches the set of attach points for an icon. An attach point is a location in the icon that can be +-- used as anchor points for attaching emblems or overlays to the icon. +iconInfoGetAttachPoints :: IconInfo -> IO (Maybe [Point]) +iconInfoGetAttachPoints self = + alloca $ \arrPtrPtr -> [_$_] + alloca $ \nPointsPtr -> do + success <- liftM toBool $ [_$_] + {# call gtk_icon_info_get_attach_points #} + self + (castPtr arrPtrPtr) + nPointsPtr + if success [_$_] + then do + arrPtr <- peek arrPtrPtr + nPoints <- peek nPointsPtr + pointList <- peekArray (fromIntegral nPoints) arrPtr + {#call unsafe g_free#} (castPtr arrPtr) + return $ Just pointList + else return Nothing + +-- | Gets the base size for the icon. The base size is a size for the icon that was specified by the icon +-- theme creator. This may be different than the actual size of image; an example of this is small +-- emblem icons that can be attached to a larger icon. These icons will be given the same base size as +-- the larger icons to which they are attached. +-- [_$_] +iconInfoGetBaseSize :: IconInfo -> IO Int +iconInfoGetBaseSize self = [_$_] + liftM fromIntegral $ + {# call gtk_icon_info_get_base_size #} self + +-- | Gets the built-in image for this icon, if any. To allow GTK+ to use built in icon images, you must +-- pass the ''IconLookupUseBuiltin'' to 'iconThemeLookupIcon'. +iconInfoGetBuiltinPixbuf :: IconInfo [_$_] + -> IO (Maybe Pixbuf) -- ^ returns the built-in image pixbuf, or 'Nothing'. [_$_] +iconInfoGetBuiltinPixbuf self = do + pixbufPtr <- {# call gtk_icon_info_get_builtin_pixbuf #} self + if pixbufPtr == nullPtr + then return Nothing + else liftM Just $ makeNewGObject mkPixbuf (return pixbufPtr) + +-- | Gets the display name for an icon. A display name is a string to be used in place of the icon name +-- in a user visible context like a list of icons. +iconInfoGetDisplayName :: IconInfo [_$_] + -> IO (Maybe String) -- ^ returns the display name for the icon or 'Nothing', if the icon doesn't have a specified display name. [_$_] +iconInfoGetDisplayName self = do + strPtr <- {# call gtk_icon_info_get_display_name #} self + if strPtr == nullPtr [_$_] + then return Nothing + else liftM Just $ peekUTFString strPtr + +-- | Gets the coordinates of a rectangle within the icon that can be used for display of information such +-- as a preview of the contents of a text file. See 'iconInfoSetRawCoordinates' for further +-- information about the coordinate system. +iconInfoGetEmbeddedRect :: IconInfo [_$_] + -> Rectangle -- ^ @rectangle@ 'Rectangle' in which to store embedded [_$_] + -- rectangle coordinates; coordinates are only stored when this function [_$_] + -> IO Bool -- ^ returns 'True' if the icon has an embedded rectangle +iconInfoGetEmbeddedRect self rectangle = + liftM toBool $ + with rectangle $ \ rectanglePtr -> [_$_] + {# call gtk_icon_info_get_embedded_rect #} + self + (castPtr rectanglePtr) + +-- | Gets the filename for the icon. If the ''IconLookupUseBuiltin'' flag was passed to +-- 'iconThemeLookupIcon', there may be no filename if a builtin icon is returned; in this case, +-- you should use 'iconInfoGetBuiltinPixbuf'. +iconInfoGetFilename :: IconInfo [_$_] + -> IO (Maybe String) -- ^ returns the filename for the icon, [_$_] + -- or 'Nothing' if 'iconInfoGetBuiltinPixbuf' should be used instead. [_$_] +iconInfoGetFilename self = do + namePtr <- {# call gtk_icon_info_get_filename #} self + if namePtr == nullPtr + then return Nothing [_$_] + else liftM Just $ peekUTFString namePtr + +-- | Looks up an icon in an icon theme, scales it to the given size and renders it into a pixbuf. This is +-- a convenience function; if more details about the icon are needed, use 'iconThemeLookupIcon' +-- followed by 'iconInfoLoadIcon'. +-- [_$_] +-- Note that you probably want to listen for icon theme changes and update the icon. This is usually +-- done by connecting to the 'styleSet' signal. If for some reason you do not want to update +-- the icon when the icon theme changes, you should consider using 'pixbufCopy' to make a private +-- copy of the pixbuf returned by this function. Otherwise GTK+ may need to keep the old icon theme +-- loaded, which would be a waste of memory. +iconInfoLoadIcon :: IconInfo -> IO Pixbuf +iconInfoLoadIcon self = + makeNewGObject mkPixbuf $ + propagateGError $ \errorPtr -> + {# call gtk_icon_info_load_icon #} + self + errorPtr + +-- | Sets whether the coordinates returned by 'iconInfoGetEmbeddedRect' and +-- 'iconInfoGetAttachPoints' should be returned in their original form as specified in the icon +-- theme, instead of scaled appropriately for the pixbuf returned by 'iconInfoLoadIcon'. +-- [_$_] +-- Raw coordinates are somewhat strange; they are specified to be with respect to the unscaled pixmap +-- for PNG and XPM icons, but for SVG icons, they are in a 1000x1000 coordinate space that is scaled to +-- the final size of the icon. You can determine if the icon is an SVG icon by using +-- 'iconInfoGetFilename', and seeing if it is non-'Nothing' and ends in '.svg'. +-- [_$_] +-- This function is provided primarily to allow compatibility wrappers for older API's, and is not +-- expected to be useful for applications. +iconInfoSetRawCoordinates :: IconInfo [_$_] + -> Bool -- ^ @rawCoordinates@ whether the coordinates of [_$_] + -- embedded rectangles and attached points should be returned in their original [_$_] + -> IO () +iconInfoSetRawCoordinates self rawCoordinates = + {# call gtk_icon_info_set_raw_coordinates #} + self + (fromBool rawCoordinates) + +-------------------- +-- Signals + +-- | Emitted when the current icon theme is switched or Gtk+ detects that a +-- change has occurred in the contents of the current icon theme. +-- +iconThemeChanged :: IconThemeClass self => Signal self (IO ()) +iconThemeChanged = Signal (connect_NONE__NONE "changed") + +#endif + hunk ./gtk/Graphics/UI/Gtk/General/Structs.hsc 1 -{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE ScopedTypeVariables, TypeSynonymInstances #-} hunk ./gtk/Graphics/UI/Gtk/General/Structs.hsc 6 +#include <gdk/gdk.h> [_$_] hunk ./gtk/Graphics/UI/Gtk/General/Structs.hsc 127 + [_$_] +instance Storable Point where [_$_] + sizeOf _ = #{const sizeof(GdkPoint)} + alignment _ = alignment (undefined:: #gtk2hs_type gint) + peek ptr = do + (x_ ::#gtk2hs_type gint) <- #{peek GdkPoint, x} ptr + (y_ ::#gtk2hs_type gint) <- #{peek GdkPoint, y} ptr + return $ (fromIntegral x_, fromIntegral y_) [_$_] + poke ptr (x, y) = do + #{poke GdkPoint, x} ptr ((fromIntegral x)::#gtk2hs_type gint) + #{poke GdkPoint, y} ptr ((fromIntegral y)::#gtk2hs_type gint) hunk ./gtk/gtk.cabal 109 + Graphics.UI.Gtk.General.IconTheme hunk ./tools/hierarchyGen/hierarchy.list 195 + GtkIconTheme |