Re: [arch-haskell] Creating binary and doc from the same PKGBUILD

Matthew William Cox wrote:
On Thu, Aug 06, 2009 at 12:07:35PM +0100, Magnus Therning wrote:
I think it'd be worthwhile to provide packages with haddock-generated documentation for all haskell packages. However, I'm not convinced that the docs should be packaged with the binary components of the package.
Generally, Arch users expect docs to come with the package as provided by upstream, and not as some separate package.
Historically Arch stripped docs out of the packages, but that policy was reversed over a year ago. See the hue and cry over here: http://www.archlinux.org/pipermail/arch-dev-public/2008-April/005574.html
All right. Then I'll instead try to modify cabal2arch to build docs as well. The one thing that I _really_ want input on is the location of the docs - GHC ships with docs located in /usr/share/doc/ghc/libraries/ - In that directory there's also a script (gen_contents_index) that will rebuild the index of all haddock docs located in subdirectories (it searches for */*.haddock). So, is that location an acceptable location for docs of other haskell packages? /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

magnus:
Matthew William Cox wrote:
On Thu, Aug 06, 2009 at 12:07:35PM +0100, Magnus Therning wrote:
I think it'd be worthwhile to provide packages with haddock-generated documentation for all haskell packages. However, I'm not convinced that the docs should be packaged with the binary components of the package.
Generally, Arch users expect docs to come with the package as provided by upstream, and not as some separate package.
Historically Arch stripped docs out of the packages, but that policy was reversed over a year ago. See the hue and cry over here: http://www.archlinux.org/pipermail/arch-dev-public/2008-April/005574.html
All right. Then I'll instead try to modify cabal2arch to build docs as well.
The one thing that I _really_ want input on is the location of the docs
- GHC ships with docs located in /usr/share/doc/ghc/libraries/ - In that directory there's also a script (gen_contents_index) that will rebuild the index of all haddock docs located in subdirectories (it searches for */*.haddock).
So, is that location an acceptable location for docs of other haskell packages?
If you can come up with a policy-compliant doc patch, I'm happy to proceed with that. Go for it! -- Don

Don Stewart wrote:
magnus:
Matthew William Cox wrote:
On Thu, Aug 06, 2009 at 12:07:35PM +0100, Magnus Therning wrote:
I think it'd be worthwhile to provide packages with haddock-generated documentation for all haskell packages. However, I'm not convinced that the docs should be packaged with the binary components of the package. Generally, Arch users expect docs to come with the package as provided by upstream, and not as some separate package.
Historically Arch stripped docs out of the packages, but that policy was reversed over a year ago. See the hue and cry over here: http://www.archlinux.org/pipermail/arch-dev-public/2008-April/005574.html All right. Then I'll instead try to modify cabal2arch to build docs as well.
The one thing that I _really_ want input on is the location of the docs
- GHC ships with docs located in /usr/share/doc/ghc/libraries/ - In that directory there's also a script (gen_contents_index) that will rebuild the index of all haddock docs located in subdirectories (it searches for */*.haddock).
So, is that location an acceptable location for docs of other haskell packages?
If you can come up with a policy-compliant doc patch, I'm happy to proceed with that.
I assume that statement indicates that putting haskell-dataenc documentation in /usr/share/doc/ghc/libraries/dataenc isn't policy compliant? The only problem is generating the index. It seems that haddock generates an index with links like this: http://therning.org/magnus identi.ca|twitter: magthe

2009/8/7 Magnus Therning
I assume that statement indicates that putting haskell-dataenc documentation in /usr/share/doc/ghc/libraries/dataenc isn't policy compliant? [snip]
According to http://wiki.archlinux.org/index.php/Arch_Packaging_Standards: /usr/share/doc/{pkg} Application documentation So haskell-dataenc documentation should go into /usr/share/doc/haskell-datenc; some packages install version names as well in the folder name, but that would cause the folder name to change on every upgrade. While it is fine to ship the documentation with the package itself, quite a bit of space would be wasted if/when someone sets up a binary repository of the haskell packages. I do not know how much the standard space requirements for haddock-generated documentation is, though. In Arch, the convention is to include small documentation in the package itself and for larger documentation split it out into a -doc package (example: python-docs). -- Abhishek

Abhishek Dasgupta wrote:
2009/8/7 Magnus Therning
: I assume that statement indicates that putting haskell-dataenc documentation in /usr/share/doc/ghc/libraries/dataenc isn't policy compliant? [snip]
According to http://wiki.archlinux.org/index.php/Arch_Packaging_Standards: /usr/share/doc/{pkg} Application documentation
So haskell-dataenc documentation should go into /usr/share/doc/haskell-datenc; some packages install version names as well in the folder name, but that would cause the folder name to change on every upgrade.
The PKGBUILD and .install generated by cabal2arch already results in packages that prevent multiple versions of the same library to be installed at the same time, so I'll put the documentation in /usr/share/doc/${pkgname}.
While it is fine to ship the documentation with the package itself, quite a bit of space would be wasted if/when someone sets up a binary repository of the haskell packages. I do not know how much the standard space requirements for haddock-generated documentation is, though. In Arch, the convention is to include small documentation in the package itself and for larger documentation split it out into a -doc package (example: python-docs).
What size is "big"? I suspect that the only haskell package containing enough docs to warrant a separate -doc package is GHC itself. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

Fri Aug 7 06:53:21 BST 2009 magnus@therning.org * Building haddock sources Emit code in PKGBUILD and .install to build documentation with haddock and regenerate the documentation index.

Do we also need to add haddock as a required makedepends (build time only dependency on everything) ? -- Don magnus:
Fri Aug 7 06:53:21 BST 2009 magnus@therning.org * Building haddock sources Emit code in PKGBUILD and .install to build documentation with haddock and regenerate the documentation index.
Content-Description: A darcs patch for your repository!
New patches:
[Building haddock sources magnus@therning.org**20090807055321 Ignore-this: a13e8cce33fd8fd0d3cb26827a660d80 Emit code in PKGBUILD and .install to build documentation with haddock and regenerate the documentation index. ] { hunk ./Main.hs 545
, arch_build = [ "cd ${srcdir}/" > display name <-> display vers - , "runhaskell Setup configure --prefix=/usr || return 1" + , "runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} || return 1" , "runhaskell Setup build || return 1" ] ++
hunk ./Main.hs 552 -- Only needed for libraries: (if hasLibrary then - ["runhaskell Setup register --gen-script || return 1" - ,"runhaskell Setup unregister --gen-script || return 1" - ,"install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh" + [ "runhaskell Setup haddock || return 1" + , "runhaskell Setup register --gen-script || return 1" + , "runhaskell Setup unregister --gen-script || return 1" + , "install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh" , "install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh" hunk ./Main.hs 557 + , "install -d -m755 $pkgdir/usr/share/doc/ghc/libraries" + , "ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/libraries/" ++ (display name) ] else []) ++ hunk ./Main.hs 565 ["runhaskell Setup copy --destdir=${pkgdir} || return 1"] ++ (if not (null (licenseFile cabal)) && license cabal `notElem` [GPL,LGPL] - then ["install -D -m644 " ++ licenseFile cabal ++ - " ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1" ] + then + [ "install -D -m644 " ++ licenseFile cabal ++ " ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1" + , "rm -f ${pkgdir}/usr/share/doc/${pkgname}/LICENSE" + ] else [])
-- if its a library: hunk ./Main.hs 622 [ "HS_DIR=/usr/share/haskell/" ++ pkgname , "post_install() {" , " ${HS_DIR}/register.sh" + , " (cd /usr/share/doc/ghc/libraries; ./gen_contents_index)" , "}" , "pre_upgrade() {" , " ${HS_DIR}/unregister.sh" hunk ./Main.hs 629 , "}" , "post_upgrade() {" , " ${HS_DIR}/register.sh" + , " (cd /usr/share/doc/ghc/libraries; ./gen_contents_index)" , "}" , "pre_remove() {" , " ${HS_DIR}/unregister.sh" hunk ./Main.hs 634 , "}" + , "post_remove() {" + , " (cd /usr/share/doc/ghc/libraries; ./gen_contents_index)" + , "}" , "op=$1" , "shift" , "$op $*" ] }
Context:
[Support building with new base Don Stewart
**20090731202831 Ignore-this: a95a3444a88bb2eaca59b0685b0008cf ] [Add more libs Don Stewart **20090731202822 Ignore-this: 30cfbfc63d55f773ebf7e2d6218973ce ] [Use Control.OldException explicitly magnus@therning.org**20090530093351 Ignore-this: 89ac5a923e7bb3d072adc8f39bfad4c9 ] [Replacing all occurances of $startdir/{pkg,src} magnus@therning.org**20090530091323 Ignore-this: aa69185376663346b3710c7a80a8d388 $startdir should never be used in PKGBUILD, instead $pkgdir and $srcdir should be used instead. Apparently there is no guarantee that $startdir/{pkg,src}==${pkg,src}dir. ] [Handle empty synopsis Don Stewart **20090722204954 Ignore-this: f8d559bd4a242b3c19aac1925be4574e ] [Add more apps Don Stewart **20090722204949 Ignore-this: a7fb099fcfe371596dce469caa04cc83 ] [More libs. Bump version Don Stewart **20090716232512 Ignore-this: e221b428fb338e7848a954fbad4d4105 ] [Makedepends should not duplicate depends array in PKGBUILD Adam Vogt **20090715000131 Ignore-this: 4bdeae96c131df5252c8e347f0866992 This stops yaourt from trying to build dependencies twice when building from AUR. ] [Bump ghc version (probably harmless) Adam Vogt
**20090715000058 Ignore-this: 86f29532fff673cf0aa6c61c6fb7f7b9 ] [Remove trailing whitespace Adam Vogt **20090715000040 Ignore-this: 30cc7fd89b7e99e317b096694315c5a ] [Update versions for 6.10.2 Don Stewart **20090503220339 Ignore-this: 9c7065402eb4b0fa40cb98d78257b1e8 ] [Don't die on meta packages Don Stewart **20090503220326 Ignore-this: 865718094cb482a99e6d218eaffe8bca ] [bump Don Stewart **20090120060802] [more stuff Don Stewart **20090118204158] [tweaks Don Stewart **20090115012123] [Update list to match ghc 6.10 Don Stewart **20090115012027] [Fix type errors Don Stewart **20081211003027 Ignore-this: b04864e1a4ef3f82d14d84a36f8159d9 ] [Bump Don Stewart **20081211002459 Ignore-this: 68ee33c3a389cd2b4be843078c2a2363 ] [Changes for compatability with Cabal>=1.6 Asgaroth **20081210181517] [Bump Don Stewart **20080912223231] [Typo correction in String Constant Matthew William Cox **20080824050628] [more notes Don Stewart **20080819003802] [require cabal > 1.4.0.0 Don Stewart **20080816214330] [typo Don Stewart **20080809221828] [typo Don Stewart **20080809221819] [Add Cabal as always required Don Stewart **20080809221600] [libraries have a "runtime" dep on other libraires Don Stewart **20080731043213] [more tewaks Don Stewart **20080710232737] [bump Don Stewart **20080704172433] [more apps Don Stewart **20080704172421] [Add mozembed Don Stewart **20080624224843] [more stuf Don Stewart **20080622182333] [Add C dependencies support Don Stewart **20080621231902] [more stuff Don Stewart **20080621192207] [more stuff Don Stewart **20080619214200] [bump Don Stewart **20080619154829] [bump version Don Stewart **20080619005235] [more libs Don Stewart **20080619005042] [titles, fftw Don Stewart **20080619001858] [nub Don Stewart **20080618055140] [more stuff Don Stewart **20080618014217] [incorrect bump Don Stewart **20080618002208] [more libraries Don Stewart **20080618001954] [Handle missing LICENSE files Don Stewart **20080617214806] [fix bug with quoting in pkgdesc. Don Stewart **20080617210705] [more libs Don Stewart **20080617001133] [more libs, new env var Don Stewart **20080616215343] [bump version Don Stewart **20080616180921] [add gtk2hs support Don Stewart **20080616180845] [Enough to build 250 libraries Don Stewart **20080616075512] [Add more rules for C libraries Don Stewart **20080616013917] [some more libraries Don Stewart **20080616001949] [depend on new puremd5 Don Stewart **20080613235859] [Determine canonical name for C libraries Don Stewart **20080613211325] [always use hackage url Don Stewart **20080613053013] [0.3.1 Don Stewart **20080613045331] [depend on stable pureMD5 Don Stewart **20080613045238] [add missing libraries and bump version Don Stewart **20080613041415] [bump version Don Stewart **20080613010106] [lowercase Don Stewart **20080613000828] [typo Don Stewart **20080613000354] [tweaks Don Stewart **20080613000100] [Bump version, now produces valid libraries Don Stewart **20080612232452] [Finish off beta version Don Stewart **20080612224944] [more notes Don Stewart **20080612063850] [add build() generation and correct version dep printing Don Stewart **20080612043420] [Initial stab at cabal2arch Don Stewart **20080612012022] Patch bundle hash: b64a61e7e772f75e13b26b9164ad561bea8b2506

Don Stewart wrote:
Do we also need to add haddock as a required makedepends (build time only dependency on everything) ?
I'm not sure why the version shipped with GHC wouldn't be enough. My only experience with haddock problems was on Debian. They managed to get into the situation where haddock couldn't handle some language constructs that the current version of GHC was perfectly happy with (old version of haddock, compiled with old version of GHC). The solution for them was to wait for GHC 6.10 because haddock would then be distributed with GHC. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

magnus:
Don Stewart wrote:
Do we also need to add haddock as a required makedepends (build time only dependency on everything) ?
I'm not sure why the version shipped with GHC wouldn't be enough.
Oh, GHC is shipping with haddock now? $ pacman -Ql ghc | grep haddock | head -3 ghc /usr/bin/haddock ghc /usr/lib/ghc-6.10.4/haddock ghc /usr/lib/ghc-6.10.4/haddock-2.4.2/ Ah, so it is. Good! -- Don

Ok. Is this signed off then? Shall I apply it and we'll start generating haddock docs? magnus:
Fri Aug 7 06:53:21 BST 2009 magnus@therning.org * Building haddock sources Emit code in PKGBUILD and .install to build documentation with haddock and regenerate the documentation index.
Content-Description: A darcs patch for your repository!
New patches:
[Building haddock sources magnus@therning.org**20090807055321 Ignore-this: a13e8cce33fd8fd0d3cb26827a660d80 Emit code in PKGBUILD and .install to build documentation with haddock and regenerate the documentation index. ] { hunk ./Main.hs 545
, arch_build = [ "cd ${srcdir}/" > display name <-> display vers - , "runhaskell Setup configure --prefix=/usr || return 1" + , "runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} || return 1" , "runhaskell Setup build || return 1" ] ++
hunk ./Main.hs 552 -- Only needed for libraries: (if hasLibrary then - ["runhaskell Setup register --gen-script || return 1" - ,"runhaskell Setup unregister --gen-script || return 1" - ,"install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh" + [ "runhaskell Setup haddock || return 1" + , "runhaskell Setup register --gen-script || return 1" + , "runhaskell Setup unregister --gen-script || return 1" + , "install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh" , "install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh" hunk ./Main.hs 557 + , "install -d -m755 $pkgdir/usr/share/doc/ghc/libraries" + , "ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/libraries/" ++ (display name) ] else []) ++ hunk ./Main.hs 565 ["runhaskell Setup copy --destdir=${pkgdir} || return 1"] ++ (if not (null (licenseFile cabal)) && license cabal `notElem` [GPL,LGPL] - then ["install -D -m644 " ++ licenseFile cabal ++ - " ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1" ] + then + [ "install -D -m644 " ++ licenseFile cabal ++ " ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1" + , "rm -f ${pkgdir}/usr/share/doc/${pkgname}/LICENSE" + ] else [])
-- if its a library: hunk ./Main.hs 622 [ "HS_DIR=/usr/share/haskell/" ++ pkgname , "post_install() {" , " ${HS_DIR}/register.sh" + , " (cd /usr/share/doc/ghc/libraries; ./gen_contents_index)" , "}" , "pre_upgrade() {" , " ${HS_DIR}/unregister.sh" hunk ./Main.hs 629 , "}" , "post_upgrade() {" , " ${HS_DIR}/register.sh" + , " (cd /usr/share/doc/ghc/libraries; ./gen_contents_index)" , "}" , "pre_remove() {" , " ${HS_DIR}/unregister.sh" hunk ./Main.hs 634 , "}" + , "post_remove() {" + , " (cd /usr/share/doc/ghc/libraries; ./gen_contents_index)" + , "}" , "op=$1" , "shift" , "$op $*" ] }
Context:
[Support building with new base Don Stewart
**20090731202831 Ignore-this: a95a3444a88bb2eaca59b0685b0008cf ] [Add more libs Don Stewart **20090731202822 Ignore-this: 30cfbfc63d55f773ebf7e2d6218973ce ] [Use Control.OldException explicitly magnus@therning.org**20090530093351 Ignore-this: 89ac5a923e7bb3d072adc8f39bfad4c9 ] [Replacing all occurances of $startdir/{pkg,src} magnus@therning.org**20090530091323 Ignore-this: aa69185376663346b3710c7a80a8d388 $startdir should never be used in PKGBUILD, instead $pkgdir and $srcdir should be used instead. Apparently there is no guarantee that $startdir/{pkg,src}==${pkg,src}dir. ] [Handle empty synopsis Don Stewart **20090722204954 Ignore-this: f8d559bd4a242b3c19aac1925be4574e ] [Add more apps Don Stewart **20090722204949 Ignore-this: a7fb099fcfe371596dce469caa04cc83 ] [More libs. Bump version Don Stewart **20090716232512 Ignore-this: e221b428fb338e7848a954fbad4d4105 ] [Makedepends should not duplicate depends array in PKGBUILD Adam Vogt **20090715000131 Ignore-this: 4bdeae96c131df5252c8e347f0866992 This stops yaourt from trying to build dependencies twice when building from AUR. ] [Bump ghc version (probably harmless) Adam Vogt
**20090715000058 Ignore-this: 86f29532fff673cf0aa6c61c6fb7f7b9 ] [Remove trailing whitespace Adam Vogt **20090715000040 Ignore-this: 30cc7fd89b7e99e317b096694315c5a ] [Update versions for 6.10.2 Don Stewart **20090503220339 Ignore-this: 9c7065402eb4b0fa40cb98d78257b1e8 ] [Don't die on meta packages Don Stewart **20090503220326 Ignore-this: 865718094cb482a99e6d218eaffe8bca ] [bump Don Stewart **20090120060802] [more stuff Don Stewart **20090118204158] [tweaks Don Stewart **20090115012123] [Update list to match ghc 6.10 Don Stewart **20090115012027] [Fix type errors Don Stewart **20081211003027 Ignore-this: b04864e1a4ef3f82d14d84a36f8159d9 ] [Bump Don Stewart **20081211002459 Ignore-this: 68ee33c3a389cd2b4be843078c2a2363 ] [Changes for compatability with Cabal>=1.6 Asgaroth **20081210181517] [Bump Don Stewart **20080912223231] [Typo correction in String Constant Matthew William Cox **20080824050628] [more notes Don Stewart **20080819003802] [require cabal > 1.4.0.0 Don Stewart **20080816214330] [typo Don Stewart **20080809221828] [typo Don Stewart **20080809221819] [Add Cabal as always required Don Stewart **20080809221600] [libraries have a "runtime" dep on other libraires Don Stewart **20080731043213] [more tewaks Don Stewart **20080710232737] [bump Don Stewart **20080704172433] [more apps Don Stewart **20080704172421] [Add mozembed Don Stewart **20080624224843] [more stuf Don Stewart **20080622182333] [Add C dependencies support Don Stewart **20080621231902] [more stuff Don Stewart **20080621192207] [more stuff Don Stewart **20080619214200] [bump Don Stewart **20080619154829] [bump version Don Stewart **20080619005235] [more libs Don Stewart **20080619005042] [titles, fftw Don Stewart **20080619001858] [nub Don Stewart **20080618055140] [more stuff Don Stewart **20080618014217] [incorrect bump Don Stewart **20080618002208] [more libraries Don Stewart **20080618001954] [Handle missing LICENSE files Don Stewart **20080617214806] [fix bug with quoting in pkgdesc. Don Stewart **20080617210705] [more libs Don Stewart **20080617001133] [more libs, new env var Don Stewart **20080616215343] [bump version Don Stewart **20080616180921] [add gtk2hs support Don Stewart **20080616180845] [Enough to build 250 libraries Don Stewart **20080616075512] [Add more rules for C libraries Don Stewart **20080616013917] [some more libraries Don Stewart **20080616001949] [depend on new puremd5 Don Stewart **20080613235859] [Determine canonical name for C libraries Don Stewart **20080613211325] [always use hackage url Don Stewart **20080613053013] [0.3.1 Don Stewart **20080613045331] [depend on stable pureMD5 Don Stewart **20080613045238] [add missing libraries and bump version Don Stewart **20080613041415] [bump version Don Stewart **20080613010106] [lowercase Don Stewart **20080613000828] [typo Don Stewart **20080613000354] [tweaks Don Stewart **20080613000100] [Bump version, now produces valid libraries Don Stewart **20080612232452] [Finish off beta version Don Stewart **20080612224944] [more notes Don Stewart **20080612063850] [add build() generation and correct version dep printing Don Stewart **20080612043420] [Initial stab at cabal2arch Don Stewart **20080612012022] Patch bundle hash: b64a61e7e772f75e13b26b9164ad561bea8b2506
participants (3)
-
Abhishek Dasgupta
-
Don Stewart
-
Magnus Therning