Changes between Initial Version and Version 1 of Building/Hoogle


Ignore:
Timestamp:
May 2, 2012 7:24:45 AM (3 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/Hoogle

    v1 v1  
     1= Making GHC's source code searchable with Hoogle = 
     2 
     3Hoogle is a great way to find the function you want, and it's easy to make Hoogle search your own GHC source code base. 
     4 
     5 * Build GHC from source. IIRC you just need to get it to build with the HADDOCK options on.) When done, it produces the following file: 
     6{{{ 
     7$(TOP)/compiler/stage2/doc/html/ghc/ghc.txt 
     8}}} 
     9  The `ghc.txt` is the hoogle database.  
     10 
     11 * Hoist the file out somewhere: 
     12{{{ 
     13cp ghc.txt ~/ 
     14}}} 
     15 
     16 * If you want the search results to link to the standard GHC docs    rather than the files you built from, then change the line at the top of ghc.txt to something like 
     17{{{ 
     18@url http://www.haskell.org/ghc/docs/7.4.1/html/libraries/ghc-7.4.1/ 
     19}}} 
     20 
     21 * Install hoogle 
     22{{{ 
     23cabal install hoogle  
     24}}} 
     25 and populate its default database: 
     26{{{ 
     27./cabal/bin/hoogle data 
     28}}} 
     29 
     30 * Convert the hoogle database into .hoo 
     31{{{ 
     32cd ~/ 
     33./cabal/bin/hoogle convert ghc.txt 
     34}}} 
     35 This should produce a file `ghc.hoo` 
     36 
     37 * Copy the .hoo file into the hoogle directory: 
     38{{{ 
     39cp ~/ghc.hoo ~/.cabal/share/hoogle-4.2.2/databases/default.hoo 
     40}}} 
     41 (The above is odd -- it "blows out" the default hoogleDB file and replaces it with the GHC database) 
     42 
     43 * Fire up a hoogle server: 
     44{{{ 
     45        sudo .cabal/bin/hoogle server --port=80  
     46}}} 
     47 
     48 * Point your browser to `localhost:80` and you're off!