ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #02350
Re: Patch for setup.py
Much nicer than before!
--
Anders
On Fri, Mar 27, 2009 at 09:21:56AM +0100, Johannes Ring wrote:
> Hi,
>
> please apply the attached patch for setup.py (Windows fix).
>
> Johannes
> # HG changeset patch
> # User Johannes Ring <johannr@xxxxxxxxx>
> # Date 1238141408 -3600
> # Node ID 6ff16575e6303395ce5ea524a65d0234cecf7f88
> # Parent de77c75d92150de0dae9480dc189bd7ad493f6cb
> Fix in setup.py for Windows.
>
> diff -r de77c75d9215 -r 6ff16575e630 setup.py
> --- a/setup.py Thu Mar 26 17:15:55 2009 +0100
> +++ b/setup.py Fri Mar 27 09:10:08 2009 +0100
> @@ -3,36 +3,22 @@
> import sys, platform
> from distutils.core import setup
> from os import chdir
> -from os.path import join, splitext
> +from os.path import join, split
>
> scripts = [join("scripts", "ffc"), join("scripts", "ffc-clean")]
>
> if platform.system() == "Windows" or "bdist_wininst" in sys.argv:
> -
> # In the Windows command prompt we can't execute Python scripts
> - # without the .py extension. A solution is to create batch files
> + # without a .py extension. A solution is to create batch files
> # that runs the different scripts.
> -
> - # Try to determine the installation prefix
> - if platform.system() == "Windows":
> - prefix = sys.prefix
> - else:
> - # We are running bdist_wininst on a non-Windows platform
> - pymajor, pyminor = sysconfig.get_python_version().split(".")
> - prefix = "C:\\Python%s%s" % (pymajor, pyminor)
> -
> - # If --prefix is specified we use this instead of the default:
> - for arg in sys.argv:
> - if "--prefix" in arg:
> - prefix = arg.split("=")[1]
> - break
> -
> - # Create batch files for Windows
> - for batch_file in ["ffc.bat", "ffc-clean.bat"]:
> + batch_files = []
> + for script in scripts:
> + batch_file = script + ".bat"
> f = open(batch_file, "w")
> - f.write("@python %s %%*" % join(prefix, "Scripts", splitext(batch_file)[0]))
> + f.write('python "%%~dp0\%s" %%*\n' % split(script)[1])
> f.close()
> - scripts.append(batch_file)
> + batch_files.append(batch_file)
> + scripts.extend(batch_files)
>
> setup(name = "FFC",
> version = "0.6.1",
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev
Attachment:
signature.asc
Description: Digital signature
References