diff options
author | Steven Knight <knight@baldmt.com> | 2001-09-20 16:08:01 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-09-20 16:08:01 (GMT) |
commit | 16a3b3c891ae3a04dfe50c2c6473b781c8194a15 (patch) | |
tree | 880cf81fe22fb1c32550069e5c0d7824d17bdeda | |
parent | e02616efd0158ecd07b6f6cdea564e7aa648ab99 (diff) | |
download | SCons-16a3b3c891ae3a04dfe50c2c6473b781c8194a15.zip SCons-16a3b3c891ae3a04dfe50c2c6473b781c8194a15.tar.gz SCons-16a3b3c891ae3a04dfe50c2c6473b781c8194a15.tar.bz2 |
Cygwin portability fixes for Windows NT builds.
-rw-r--r-- | Construct | 40 | ||||
-rw-r--r-- | doc/Conscript | 4 | ||||
-rw-r--r-- | src/engine/setup.py | 10 | ||||
-rw-r--r-- | src/script/setup.py | 10 |
4 files changed, 47 insertions, 17 deletions
@@ -60,7 +60,15 @@ pop @arr if $#arr >= 2; map {s/^[CD]//, s/^0*(\d\d)$/$1/} @arr; $version = join('.', @arr); -chomp($python_ver = `python -c 'import sys; print sys.version[0:3]'`); +chomp($python_ver = `python -c "import sys; print sys.version[0:3]"`); + +chomp($platform = `python -c "from distutils.util import get_platform; print get_platform()"`); + +if ($platform eq "win32") { + $archsuffix = "zip" +} else { + $archsuffix = "tar.gz" +} use Cwd; @@ -130,32 +138,35 @@ for $dir ('script', 'engine') { # # Use the Python distutils to generate the packages. # - my $tar_gz = "$build/dist/$pkg-$version.tar.gz"; + my $archive = "$build/dist/$pkg-$version.$archsuffix"; - push(@src_deps, $tar_gz); + push(@src_deps, $archive); my @setup_args = ('bdist sdist'); my @targets = ( - "$build/dist/$pkg-$version.linux-i686.tar.gz", - $tar_gz, + "$build/dist/$pkg-$version.$platform.$archsuffix", + $archive, ); if ($rpm) { push(@setup_args, 'bdist_rpm'); - # XXX "$build/build/bdist.linux-i686/rpm/SOURCES/$pkg-$version.tar.gz", - # XXX "$build/build/bdist.linux-i686/rpm/SPECS/$pkg.spec", + # XXX "$build/build/bdist.$platform/rpm/SOURCES/$pkg-$version.$archsuffix", + # XXX "$build/build/bdist.$platform/rpm/SPECS/$pkg.spec", push(@targets, "$build/dist/$pkg-$version-1.src.rpm", "$build/dist/$pkg-$version-1.noarch.rpm", ); }; + # We can get away with calling setup.py using a directory path + # like this because we put a preamble in it that will chdir() + # to the directory in which setup.py exists. $env->Command([@targets], map("$build/$_", @files), qq(rm -rf $build/build $build/dist/* - cd $build && python setup.py @setup_args) + python $build/setup.py @setup_args) ); $env->Depends([@targets], "$build/MANIFEST"); @@ -163,13 +174,13 @@ for $dir ('script', 'engine') { $env->Install("build/dist", @targets); # - # Unpack the .tar.gz created by the distutils into build/unpack. + # Unpack the archive created by the distutils into build/unpack. # my $unpack = "build/unpack"; my @unpack_files = map("$unpack/$pkg-$version/$_", @files); - Command $env [@unpack_files], $tar_gz, qq( + Command $env [@unpack_files], $archive, qq( rm -rf $unpack/$pkg-$version tar zxf %< -C $unpack ); @@ -188,9 +199,12 @@ for $dir ('script', 'engine') { @test_files = map(File::Spec->catfile($install, $_), grep($_ =~ /\.py$/ && ! $seen{$_}++, @files)); + # We can get away with calling setup.py using a directory path + # like this because we put a preamble in it that will chdir() + # to the directory in which setup.py exists. Command $env [@test_files], @unpack_files, qq( rm -rf $install - cd $unpack/$pkg-$version && python setup.py install --prefix=$test_dir + python $unpack/$pkg-$version/setup.py install --prefix=$test_dir ); } @@ -209,7 +223,7 @@ if ($jw) { # # If we're running in the actual Aegis project, pack up a complete -# source .tar.gz from the project files and files in the change, +# source archive from the project files and files in the change, # so we can share it with helpful developers who don't use Aegis. # # First, lie and say that we've seen any files removed by this @@ -242,7 +256,7 @@ if ($change) { rm -rf build/$project-src-$version cp -r build/$project-src build/$project-src-$version find build/$project-src-$version -name .consign -exec rm {} \\; - cd build && tar zcf dist/%>:f $project-src-$version + tar zcf %> -C build $project-src-$version )); } } diff --git a/doc/Conscript b/doc/Conscript index 8a5f15f..d8386d6 100644 --- a/doc/Conscript +++ b/doc/Conscript @@ -126,7 +126,7 @@ foreach $doc (keys %doc_dirs) { } push(@tar_deps, $html, $ps, $pdf); - push(@tar_list, "$htmldir/[A-Za-z]*", $ps, $pdf); + push(@tar_list, $htmldir, $ps, $pdf); } # @@ -135,4 +135,4 @@ foreach $doc (keys %doc_dirs) { # $env->Command($doc_tar_gz, @tar_deps, - qq(cd build/doc && tar zchvf ../dist/%>:f @tar_list)); + qq(tar zchv -f %> -C build/doc @tar_list)); diff --git a/src/engine/setup.py b/src/engine/setup.py index d926a03..c3e5e15 100644 --- a/src/engine/setup.py +++ b/src/engine/setup.py @@ -1,6 +1,14 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -from string import join, split +import os +import os.path +import sys + +(head, tail) = os.path.split(sys.argv[0]) + +if head: + os.chdir(head) + sys.argv[0] = tail from distutils.core import setup diff --git a/src/script/setup.py b/src/script/setup.py index 7fe4818..aa7b54d 100644 --- a/src/script/setup.py +++ b/src/script/setup.py @@ -1,6 +1,14 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -from string import join, split +import os +import os.path +import sys + +(head, tail) = os.path.split(sys.argv[0]) + +if head: + os.chdir(head) + sys.argv[0] = tail from distutils.core import setup |