Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-29 Thread Peter Schmitz
I have a question about finding the Gtk2Hs demos (the demos written in
Haskell).

To summarize what I have done so far:

I'm a new Cabal user; need to use Cabal in a Windows XP environment, where
it and the Haskell Platform are located on a network drive (H:) instead of
C:. (Need to be able to do development on any of several PCs, using a single
tools dir.)

I want to write Haskell code that uses Gtk2Hs (and Glade).

I have edited Cabal's config and placed it on H:, and so I have set up:

H:\proc\tools\Haskell Platform
H:\proc\tools\gtk
H:\proc\tools\cabal
etc.

My edited Cabal config is listed at the end below.

I modified my PATH, etc. as follows:

SET P_TOOLS=H:\proc\tools
SET HASK_PLAT=%P_TOOLS%\Haskell Platform\2010.1.0.0
PATH
%HASK_PLAT%\bin;%P_TOOLS%\cabal\bin;%P_TOOLS%\gtk\bin;%HASK_PLAT%\lib\extralibs\bin;%HASK_PLAT%\mingw\bin


REM This is so Cabal will get its config from the Haskell Platform,
REM rather than C:\Documents and Settings\pschmitz\Application Data\cabal
SET CABAL_CONFIG=%P_TOOLS%\cabal\config

I had to add the mingw\bin dir to PATH to get cpp (needed during cabal
install gtk), and the extralibs dir to get alex (for cabal install
gtk2hs-buildtools).



I download the GTK+ All-in-one bundle 2.20.0 (current maintained branch),
and ran gtk-demo; it works.

The following commands then completed okay, with various warnings, but no
fatal errors:

cabal install cabal-install

cabal update

cabal install gtk2hs-buildtools

cabal install gtk



(There seems to be no cabal install gtk2hs.)


*** At this point I am trying to find the Gtk2Hs demos, so I can compile and
run them. I cannot find them anywhere in my H:\proc\tools\ tree. If anyone
can help me see what I am missing, I would appreciate it.


http://code.haskell.org/gtk2hs/INSTALL says:
To get started, you can compile and run one of the programs that reside in
the demo/ directory in the respective packages. For example:
~/gtk2hs/gtk/demo/hello:$ make.
But I don't see a gtk2hs/ dir anywhere.

I tried looking for the sources directly (google gtk2hs demos, etc.) but
didn't have any luck.

Thanks very much,

-- Peter



-

My Cabal config follows. The email may remove indentation, but I was careful
to maintain the original indentation when editing. It seems to work fine.

-- This is the configuration file for the 'cabal' command line tool.

-- The available configuration options are listed below.
-- Some of them have default values listed.

-- Lines (like this one) beginning with '--' are comments.
-- Be careful with spaces and indentation because they are
-- used to indicate layout for nested sections.


remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
remote-repo-cache: H:\proc\tools\cabal\packages
-- local-repo:
-- verbose: 1
-- compiler: ghc
-- with-compiler:
-- with-hc-pkg:
-- scratchdir:
-- program-prefix:
-- program-suffix:
-- library-vanilla: True
-- library-profiling: False
-- shared: False
-- executable-profiling: False
-- optimization: True
-- library-for-ghci: True
-- split-objs: False
-- executable-stripping: True
-- user-install: True
-- package-db:
-- flags:
-- extra-include-dirs:
-- extra-lib-dirs:
-- constraint:
-- cabal-lib-version:
-- preference:
-- documentation: False
-- doc-index-file: $datadir\doc\index.html
-- root-cmd:
-- symlink-bindir:
build-summary: H:\proc\tools\cabal\logs\build.log
-- build-log:
remote-build-reporting: anonymous
-- username:
-- password:

install-dirs user
prefix: H:\\proc\\tools\\cabal
-- bindir: $prefix\bin
-- libdir: $prefix
-- libsubdir: $pkgid\$compiler
-- libexecdir: $prefix\$pkgid
datadir: H:\\proc\\tools\\Haskell Platform\\2010.1.0.0
-- datasubdir: $pkgid
-- docdir: $prefix\doc\$pkgid
-- htmldir: $docdir\html
-- haddockdir: $htmldir

install-dirs global
prefix: H:\\proc\\tools\\Haskell Platform\\2010.1.0.0
-- bindir: $prefix\bin
-- libdir: $prefix
-- libsubdir: $pkgid\$compiler
-- libexecdir: $prefix\$pkgid
datadir: H:\\proc\\tools\\Haskell Platform\\2010.1.0.0
-- datasubdir: $pkgid
-- docdir: $prefix\doc\$pkgid
-- htmldir: $docdir\html
-- haddockdir: $htmldir


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-29 Thread Ivan Miljenovic
On 30 July 2010 13:32, Peter Schmitz ps.hask...@gmail.com wrote:
 I have a question about finding the Gtk2Hs demos (the demos written in
 Haskell).

They're not there:
http://osdir.com/ml/haskell-cafe@haskell.org/2010-07/msg00724.html

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-28 Thread Peter Schmitz
Rogan:

Again, thanks very much for your reply.

My situation is that I need to be able to use Cabal (and the Haskell
Platform, Gtk2Hs, etc.) at any of several PCs in a (Windows XP) LAN, each of
which has access to the network drive H:.

So, I am using:
H:\proc\tools\Haskell Platform
H:\proc\tools\gtk
H:\proc\tools\cabal(hopefully)
etc.

So I need to not use C: for anything related to Haskell tools (although temp
files would be okay I guess), and have everything in the H: tools tree, so
that new versions of Cabal, Haskell libraries, etc. get installed to the
appropriate dir on H:.

I will try experimenting with editing the config file and using that hidden
option you mentioned.



** Cabal experts:

If anyone knows how to do this sort of thing in a better way, I would
appreciate a word.

Thanks much,
-- Peter
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-28 Thread Duncan Coutts
On 28 July 2010 23:46, Peter Schmitz ps.hask...@gmail.com wrote:

 I will try experimenting with editing the config file and using that hidden
 option you mentioned.

 ** Cabal experts:

 If anyone knows how to do this sort of thing in a better way, I would
 appreciate a word.

Rogan is right. You just need to edit the cabal config file to point
to locations on your other drive.

I would suggest not relocating the config file itself. If you really
must do so then you can use the --config-file flag or the environment
variable CABAL_CONFIG.

Duncan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-28 Thread Peter Schmitz

 Rogan is right. You just need to edit the cabal config file to point
 to locations on your other drive.

 I would suggest not relocating the config file itself. If you really
 must do so then you can use the --config-file flag or the environment
 variable CABAL_CONFIG.

 Duncan


I will try that.
Thanks very much guys. Great help.
-- Peter
(and sorry about getting the reply address wrong the first time Duncan)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-27 Thread Peter Schmitz
Rogan:

Thanks very much.

I began by downloading the latest gtk+ bundle from
http://www.gtk.org/download-windows.html

The instructions there said to just copy the files to any dir and add its
...\gtk\bin dir to my PATH, which I did, so that worked okay without admin
privs.

Given that I need to use these tools on a network drive (H:), and not C:,
I have installed the Platform and gtk to:
H:\proc\tools\Haskell Platform and
H:\proc\tools\gtk

(My H: is a hdd, not usb; and I am trying to do all this without admin
privs, which is working fine so far.)

The gtk tests: pkg-config --cflags gtk+-2.0 and gtk-demo run fine. Great!



 Anyone: 

So, I am trying to use cabal (for the first time), on a Windows XP
system/network.

I need to keep everything on H:, and not use C:.

The only copy of cabal I have is what came with the Platform:
H:\proc\tools\Haskell Platform\2010.1.0.0\lib\extralibs\bin\cabal.exe.

I placed that bin dir in my PATH and tried a cabal update.

(Does is matter what my current dir is, when I use cabal?)

It said:
H:\proc\dev\cmdcabal update
Config file path source is default config file.
Config file C:\Documents and Settings\pschmitz\Application Data\cabal\config

not found.
Writing default configuration to C:\Documents and
Settings\pschmitz\Application Data\cabal\config
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install

So, by default, cabal wants to put its config and updates on C:.

I looked at C:\Documents and Settings\pschmitz\Application Data\cabal\config

It has various references to C:, some commented out. E.g.:

remote-repo-cache: C:\Documents and Settings\pschmitz\Application
Data\cabal\packages

build-summary: C:\Documents and Settings\pschmitz\Application
Data\cabal\logs\build.log

install-dirs user
-- prefix: C:\\Documents and Settings\\pschmitz\\Application Data\\cabal

etc.

I also reviewed the Cabal User's Guide, including section
4.1.2.2 Paths in the simple build system
which has a table with command line switches and pathname defaults for
Windows including:
--prefix (global installs with the --global flag)
C:\ProgramFiles\Haskell
and
--prefix (per-user installs with the --user flag)
C:\DocumentsAndSettings\user\ApplicationData\cabal

Given that I want to keep everything on H:,
and assuming that I don't want to place the Cabal configs and updates in the
Platform tree (H:\proc\tools\Haskell Platform),
I would _like_ to create a dir such as
H:\proc\tools\cabal
to hold everything that Cabal would normally put on C:.

*** I'm afraid I'm having trouble figuring out how to accomplish this.

Is there (hopefully) a combination of cabal command line switches that will
create a new config file over on H: for me,
or must I edit the config file directly and move it to H:?

And then, how do I invoke cabal each time, to get it to use its tree on H:
(and ignore C:) ?

Thanks (very much) in advance.
-- Peter Schmitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-27 Thread Rogan Creswick
On Tue, Jul 27, 2010 at 2:43 PM, Peter Schmitz ps.hask...@gmail.com wrote:
 So, by default, cabal wants to put its config and updates on C:.

 I looked at C:\Documents and Settings\pschmitz\Application Data\cabal\config

 It has various references to C:, some commented out. E.g.:

 remote-repo-cache: C:\Documents and Settings\pschmitz\Application
 Data\cabal\packages

 build-summary: C:\Documents and Settings\pschmitz\Application
 Data\cabal\logs\build.log

 install-dirs user
 -- prefix: C:\\Documents and Settings\\pschmitz\\Application Data\\cabal

You can change these to whatever you want, and cabal should just start
using those locations, if that helps.

 Given that I want to keep everything on H:,
 and assuming that I don't want to place the Cabal configs and updates in the
 Platform tree (H:\proc\tools\Haskell Platform),
 I would _like_ to create a dir such as
 H:\proc\tools\cabal
 to hold everything that Cabal would normally put on C:.

 *** I'm afraid I'm having trouble figuring out how to accomplish this.

 Is there (hopefully) a combination of cabal command line switches that will
 create a new config file over on H: for me,
 or must I edit the config file directly and move it to H:?

There are others on this list that know cabal much better than I, but
I have been working with it a bit recently, so I'll take a stab..

I don't believe you can configure *cabal* to look on H: for the cabal
config, without specifying .  I believe it uses the windows
Application Data directory for your current user to locate the cabal
config (there is a windows system (?) call that returns something akin
to c:\Documents and Settings\username\Application Data\ ).  You *can*
change the location of your Application Data directory by hacking the
windows registry, but that is likely to cause more pain than it is
worth.

I think you will be best served by just editing the entries in your
cabal config (if that, even) unless you have a very good reason to
relocate the cabal config itself.

(Ok, so I think I lied a little -- iirc, there is an undocumented
cabal flag that will let you specify the path to the cabal config file
to use.  I think it has to be the first parameter to cabal, and I
think it's --cabal-config=file, but I've only used it once and I
don't think it's really worth the trouble in your case. Application
Data is a pretty standard place for things like this.)

--Rogan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-26 Thread Peter Schmitz
I have recently installed the Haskell Platform (for the first time) to a MS
Windows network drive; e.g.:

H:\aaa\bbb\Haskell Platform\2010.1.0.0\

I did so without admin privs.

It has ghc-6.12.1

I need to not install to C:.

I would like to install and use Gtk2Hs and Glade on the Platform also.

I have used Gtk2Hs and Glade in Haskell (with just ghc, not the Platform),
but I have never used Cabal or the Haskell Platform.

I see at http://www.haskell.org/gtk2hs/ that Gtk2Hs now comes in a Cabal
package (Gtk2Hs 0.11.0 released).

The info there says you can just install the Gtk+ libraries, and then do:
cabal install gtk2hs-buildtools
cabal install gtk

I interpret the Gtk+ libraries to mean gtk: the base GUI library package
listed at
http://www.haskell.org/gtk2hs/download/
(is that correct?).

That is a link to http://hackage.haskell.org/package/gtk
which has gtk-0.11.0.tar.gz (Cabal source package),
which I downloaded and unpacked to a temp directory which now contains
gtk-0.11.0.

I've reviewed the Cabal documentation (that came with the Platform) and I'm
having a little trouble determining exactly what to do next -- the exact
commands to use for my non-C: / network drive installation. (I have not used
Cabal before.)

I would prefer to do this without admin privs, if possible.

** If anyone could help me out here with a step-by-step, I would appreciate
it.

Hopefully the procedure for glade will then be similar.

Thanks (very much) in advance.
-- Peter Schmitz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-26 Thread Rogan Creswick
On Mon, Jul 26, 2010 at 2:06 PM, Peter Schmitz ps.hask...@gmail.com wrote:
 I have recently installed the Haskell Platform (for the first time) to a MS
 Windows network drive; e.g.:

 H:\aaa\bbb\Haskell Platform\2010.1.0.0\

 I did so without admin privs.

 It has ghc-6.12.1

 I need to not install to C:.

 I would like to install and use Gtk2Hs and Glade on the Platform also.

There are instructions in the INSTALL doc here:

 * http://code.haskell.org/gtk2hs/INSTALL

Generally, you don't need to (explicitly) download anything when using
cabal-install, cabal install does that for you.  However, when
libraries implemented in other languages are used, such as with
gtk2hs, you will need to manually install something.  That's where the
windows gtk+ libraries come in.  You can download them from here:

http://www.gtk.org/download-windows.html

That url is mentioned in the INSTALL document linked to above, and the
document also describes what you need to download and install.  I
don't know if it is possible to do that without admin access though
(I've never tried).

Once you have the gtk+ libraries installed it should just be a matter
of running 'cabal update' (to get the latest updates from hackage) and
then running a handfull of 'cabal install foo' commands.

--Rogan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe