Subject: Re: Local package mods
To: None <>
From: D'Arcy J.M. Cain <>
List: tech-pkg
Date: 02/25/2000 22:07:05
Thus spake Hubert Feyrer
> On Fri, 25 Feb 2000, D'Arcy J.M. Cain wrote:
> > My question is this.  Is there a mechanism to include local modifications
> > to packages in the package system and if not, is there any interest in
> > setting something like that up?
> There's the concept of setting SITE_SPECIFIC_PKGS, HOST_SPECIFIC_PKGS,
> pkgsrc/Makefile. Just drop your pkg in pkgsrc/local/foo, and add all the
> pkgs you want to one of the variables, including local/foo.

I'm not sure if you misunderstood my question or I misunderstood your
answer.  I have no problem creating a specific collection of packages.
My problem is local mods within a package.  Let me illustrate with my
exact problem.

Python has a standard builtin module called crypt which does DES
encryption.  It's only function is defined as "crypt(word, salt)"
which basically mirrors the C function.  I find that it is silly
to keep writing the same randomizing functions each time I call
it so I modified the module so that the second option was optional
and when not present (or None, sort of the Python NULL) that I
would call srandom (once per instantiation of the program) to
and create a random salt.

Guido, Python's author and principal architect, originally accepted my
changes then backed them out because in an earlier version I was
calling srandom every time and he felt, rightly, that that might
change the behaviour of existing programs that did their own call
to srandom.  Although I have modified it so that it only calls srandom
if the program actually takes advantage of the new syntax, he still
hasn't put it back in.

So, the gist of the above is that I have a local mod to Python.  Right
now I just keep a copy of my version of cryptmodule.c around and when
I build Python I do make extract, replace that file and continue the
make as usual.

Naturally I can't just run make install in lang/python because it won't
make that copy.  I could make lang/mypython where I create an extra
patch but then I have to track changes to lang/python all the time.

So, now that I have totally overexplained (and probably patronized
everyone) what about a mechanism where I can add special instructions
in some local file (not sure if mk.conf would be the place for it)
for specific packages.  Something like this.

lang/python post-extract "cp ${PKGSRCDIR}/localfiles/cryptmodule.c ${WRKSRC}/Modules/cryptmodule.c"

Or some other mechanism.  Any interest or should I just go with the
lang/mypython idea?

Hmm.  On second though, that won't work anyway because every package
that depends on python would need to be changed as well.  Dang!  It's
either set up a new mechanism or keep doing it manually.

D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.