Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 18857 - Create ebuild for nhc98
Summary: Create ebuild for nhc98
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Andres Loeh (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 10155
Blocks:
  Show dependency tree
 
Reported: 2003-04-06 11:47 UTC by Peter Simons
Modified: 2003-10-13 04:04 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild (nhc98-1.16.ebuild,1.81 KB, text/plain)
2003-04-07 17:17 UTC, Andres Loeh (RETIRED)
Details
variant ebuild to fix path problem (nhc98-1.16-r1.ebuild,1.89 KB, text/plain)
2003-04-10 19:43 UTC, Andres Loeh (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Simons 2003-04-06 11:47:39 UTC
The latest release of the nhc Haskell compiler, nhc98 1.16, can be built and
installed just by executing:

    ./configure +docs
    make
    make install

It worked out of the box an my machine. (I should mention that I do have ghc
5.04.3 installed and used that to bootstrap the compiler. Supposedly, nhc98
should build with just gcc as well, but I didn't try that.)

It would be nice to have an ebuild for that package.

This report is related to bug report #10155.

Reproducible: Always
Steps to Reproduce:
1. ./configure +docs
2. make
3. make install
Comment 1 Andres Loeh (RETIRED) gentoo-dev 2003-04-07 17:17:54 UTC
Created attachment 10343 [details]
ebuild

I have updated the existing ebuild. Works for me on x86.

Modifications w.r.t. 1.12:
I changed the hmakerc hack. The update of hmakerc is
disabled in the configure script of the package when using
DISTFILE. One possibility would be to patch the configure
script, but I decided to copy the corresponding lines from
there and do the update manually. The advantage over the
1.12 hack is that all contents of hmakerc remain intact. The
final result will be the same as with a manual installation.

Furthermore, I simplified the installation of the documentation
somewhat.

The ebuild assumes the type synonym patch which is 
available from 
ftp://ftp.cs.york.ac.uk/pub/haskell/nhc98/patch-1.16-typesyn
in the /files directory. It would probably be better to let
it be downloaded by the ebuild as well.

Andres
Comment 2 George Shapovalov (RETIRED) gentoo-dev 2003-04-10 05:04:11 UTC
Hi Andres.

Thanks for an ebuild!
I have modified it to fetch the patch instead of just looking for it in ${FILESDIR}. The ebuild is committed, please test.

George
Comment 3 Peter Simons 2003-04-10 15:40:16 UTC
The config file "/usr/lib/hmake/ix86-Linux/hmakerc" contains all wrong paths for nhc98.
Comment 4 George Shapovalov (RETIRED) gentoo-dev 2003-04-10 19:22:34 UTC
Hi Peter.

Thanks for catching this!
I have added a sed instruction to correct the generated hmekerc file. The alternative might be to jst install some pregenerated hmakerc (but this will not catch ghc if installed or will have the converse problem).
Please test.

George
Comment 5 Andres Loeh (RETIRED) gentoo-dev 2003-04-10 19:43:36 UTC
Created attachment 10490 [details]
variant ebuild to fix path problem

Problem described by Peter was not detected by me because
the build worked if you already had nhc98 installed.

George's fix does the job, but then the lines between 
einfo "Adjusting ... hmakerc"
and 
#need to adjust paths in hmakerc 
are superfluous and should be removed.

Alternatively, one can do the stuff after merging. I do not
know whether that is a good thing, but it seems to work.
This is what the attached build does.

Best,
  Andres
Comment 6 Andres Loeh (RETIRED) gentoo-dev 2003-04-10 19:44:58 UTC
Reopening bug as requested by george on irc :) 
Comment 7 George Shapovalov (RETIRED) gentoo-dev 2003-04-15 02:48:41 UTC
Yup, that worked well (I wonder what I did differently, when I was trying the same approach before resorting to sed :)).
BTW, there is no need to issue a -r1 in this case - this is an "ebuild clean up" rather than fix to some problem. No need to force rebuild on everybody who has it already installed, as the end result did not change...

As for what is better: by doing sed in src_install we register this new version of hmakerc in the database, so it gets deleted if unmodified by user. While by doing configuration from pkg_postinst we pretty much guarantee that this config file will be left around, just like with the user-modified hmakerc. We can of cource delete it in pkg_postrm, but that's undesirable (well, plain wrong), as user might have modified it. 
But then I feel better about doing configuration during pkg_postinst, as it might pick up installed stuff in a more correct manner. Thus, effectively, pkg_postinst created hmakerc should be treated as almost "user-generated", alleviating the dilemma :).

Ok, now some organizational stuff:
Andres: I suppose you have studied
http://www.gentoo.org/doc/en/gentoo-howto.xml and
http://www.gentoo.org/doc/en/eclass-howto.xml ;)
now you can add this to the pool:
http://www.gentoo.org/doc/en/policy.xml
and eventually the "Release policy" as well, but the former one is more to the point right now.
Then just find me on irc and we can go about committing this to cvs tree, unless you want to go through some other stuff first..
Afterthat I'll create a dev-haskell category (this has been already approved) and I'll leave you in charge of filling it (but please CC me on few first ebuilds you will be processing). 
Actually I have a few bugs of relevance on me right now, mind if I reassign them to the right owner ;)?

George
Comment 8 Andres Loeh (RETIRED) gentoo-dev 2003-04-15 19:09:10 UTC
Hi George. 
 
I have read most of the material you pointed out. 
No, I don't mind if you reassign some of the bugs to me. 
 
Andres 
Comment 9 George Shapovalov (RETIRED) gentoo-dev 2003-04-16 03:55:17 UTC
Ok then, here you go :).
Sorry, I missed you on irc today. Lets try tomorrow then..

George
Comment 10 Andres Loeh (RETIRED) gentoo-dev 2003-04-25 06:07:28 UTC
The ebuild has been added now. The most recent version (which is marked 
testing, currently) does no longer include the "hmake" utility, which now has 
an own ebuild as dev-haskell/hmake. 
 
This should also prevent the problem with the wrong paths in hmakerc. 
 
Closing the bug, but, of course, you're all welcome to test! 
Comment 11 Peter Simons 2003-04-28 05:40:36 UTC
Are you sure it is a good idea to install nhc98 but not hmake? I like the idea of having hmake a separate package, so you can install it without installing nhc98, but my guess is that many packages using nhc98 will rely on hmake being packaged up with it. Hence, I'd say: When you install nhc98, you'll get hmake all the same.

Furthermore, this is consistent with the other stuff included in nhc98! Otherwise, we'd have to split Hood, GreenCard, etc. off of nhc98 as well!

Oh, by the way: Has anyone actually _used_ hood as it comes with nhc98? I see it's there, but requires Java to work ... So I cannot really test it. No Java on my machine as long as I can help it. ;-)
Comment 12 Andres Loeh (RETIRED) gentoo-dev 2003-04-28 15:19:02 UTC
The motivation I had for separating out hmake was the
following: I know and remember that hmake
sometimes is released as a separate tool in an improved
version, apart from nhc98. Apart from that, it certainly
is useful even without having nhc98, although it has become
less so since GHC comes with the --make option ...

Still, if people want to upgrade to such a more recent
version of hmake, then it also means that nhc98 should not have
hmake included, because otherwise a reinstall of nhc98 might
accidentially overwrite it.

I don't really see the dependency problem you mentioned,
because all packages that depend on hmake can be made dependent
on hmake in portage. One thing is worth consideration, however.
We can keep the separation of nhc98 and hmake and still force
installation of hmake on installation of nhc98 by making nhc98
PDEPEND on hmake. That means, nhc98 will depend on hmake, but
install it actually only _after_ it has installed nhc98.

I am not sure what's the best solution here. As long as I do not
see a reason that really keeps the current configuration from
working, I would be inclined to leave things as they are, for
now.

About the other tools that come with nhc98, it should be checked
whether they are shipped as separate packages as well, and whether
the specific versions of these tools shipped with nhc98 are usable
and useful in conjunction with GHC or Hugs as well. If they are,
it might be good to separate them out in a similar way to hmake.
If they are not, they can be seen as parts of nhc98 IMHO.

As to hood: no, I never used it. I did use hat, though, and I plan
to include an ebuild for that soon ...

Best,
  Andres
Comment 13 Heinrich Wendel (RETIRED) gentoo-dev 2003-10-12 09:32:35 UTC
can that be closed andres?
Comment 14 Andres Loeh (RETIRED) gentoo-dev 2003-10-13 02:29:29 UTC
Yes, you can close it. This bug (and all the others that you have modified)

had already been closed and have only been opened again due to information

loss in the bugzilla database.

Andres
Comment 15 Heinrich Wendel (RETIRED) gentoo-dev 2003-10-13 04:04:51 UTC
fine -> close ^^