Not really critical for anything we have in <nixpkgs> I guess, but
skipping lines three times really was a workaround and we're better off
just appending the lines ending with backslash to the pattern space so
we can accumulate all the crap until the last line of crap (crap, that
is "broken lines").
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
The bazaar package is still broken even with 5f01cc7, because __future__
imports need to be the first imports before anything else. So this time
I'm going to make the sed expression with explicit branching so we can
properly match all the occasions we want to skip and insert the line
modifying sys.argv[0] only _once_ and leave the command block after
that one substitution. So no ugly swaps between hold and pattern space.
The label which is resonsible for not escaping the command block is "r"
and we jump to it as long as we need to skip something from the start of
the file.
While at it, I'm not only skipping every line with __future__ in it but
also backslashes at the end of the line, so for example:
```python
from __future__ import shiny_feature1, \
shiny_feature2, \
shiny_feature3
```
... will now be properly skipped as well.
Tested against bazaar and nixops.
Thanks to @edolstra for reporting this.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Fixes issues introduced by 24ef871e6a.
The problem here is that "import sys; sys.argv[0] = ..." is just
appended after the first "#!", which in turn breaks things such as
encoding specifications. A second problem - although not very common -
is when there's another #! within the script.
This should take care of both cases.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Before we used `easy_install` command to handle installation
in one shot, now this is split into two phases:
- buildPhase: python setup.py build
- installPhase: python setup.py install
Each of those commands have the ability to pass extra
parameters through buildPythonPackage parameters as
`setupPyInstallFlags` and `setupPyBuildFlags`.
Phases now correctly execute post/pre hooks.
In configurePhase we inject setuptools dependency before distutils
is imported to apply monkeypatching by setuptools that is needed
for special features to apply.
We don't have to reorder default phases anymore, as test
phase comes after build and that works.
I rewrote offineDistutils into distutils-cfg with a bit cleaner
syntax and ability to specify extraCfg to the config file.
Plone packages are failing and garbas said he will adopt them to
the new functions. The rest of the packages I fixed and these commits
shouldn't break any package (according to my testings) and they introduce
16 new jobs and fix 38 that were broken before.
This reverts commit edd160452e.
If we propagate it, derivations that use a python package will also
get the recursivePthLoader needed to process the pth files of the
package.
if they are really needed they will be in pth file created by
easy_install. If that does not work, they need to be put into
propagatedBuildInputs or the setup.py fixed.
see #210
setuptools site.py can't resolve recursively which is needed for nix,
as each package has its own directory. A different solution than
putting the loader into every package output needs to be found.
see also #209