Skip to content

Commit 5693e0e

Browse files
authored
Use lowercase lib for StdLib dir name on non-Windows systems (#1514)
* Use lowercase lib for StdLib dir name on non-Windows systems * Fix build on Linux * Use lowercase lib on Windows
1 parent df2e4d5 commit 5693e0e

File tree

12 files changed

+23
-20
lines changed

12 files changed

+23
-20
lines changed

Build.proj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<PackageVersion Condition="'$(ReleaseLevel)' != 'final' or '$(ReleaseSerial)' != '0'">$(MajorVersion).$(MinorVersion).$(MicroVersion)-$(ReleaseLevel)$(ReleaseSerial)</PackageVersion>
2424
<StageDir>$(RootDir)Package\$(Configuration)\Stage\IronPython-$(PackageVersion)</StageDir>
2525
<PackageDir>$(RootDir)Package\$(Configuration)\Packages\IronPython-$(PackageVersion)</PackageDir>
26+
<StdLibDirName>lib</StdLibDirName>
2627
</PropertyGroup>
2728

2829
<PropertyGroup>
@@ -105,7 +106,7 @@
105106

106107
<Target Name="_CopyStdLib" DependsOnTargets="_MakeStageDir">
107108
<MSBuild Projects="$(RootDir)\Src\StdLib\StdLib.pyproj"
108-
Properties="OutputPath=$(StageDir)"
109+
Properties="OutputPath=$(StageDir);StdLibDirName=$(StdLibDirName)"
109110
Targets="Stage" />
110111
</Target>
111112

Package/choco/IronPython.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<files>
2222
<file src="$STAGEDIR$\net462\*.dll;$STAGEDIR$\net462\*.exe" exclude="**\rowantest*.dll;**\IronPythonTest.dll" />
2323
<file src="$STAGEDIR$\net462\DLLs\**" target="DLLs" exclude="**\*.xml" />
24-
<file src="$STAGEDIR$\Lib\**" target="Lib" />
24+
<file src="$STAGEDIR$\lib\**" target="lib" />
2525
<file src="$STAGEDIR$\LICENSE;$STAGEDIR$\README.md" />
2626
<file src="tools\*" target="tools" />
2727
</files>

Package/deb/Deb.Packaging.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<StdLibFiles Include="$(StageDir)/Lib/**/*.*" />
11+
<StdLibFiles Include="$(StageDir)/$(StdLibDirName)/**/*.*" />
1212
</ItemGroup>
1313

1414
<ItemGroup>
@@ -31,7 +31,7 @@
3131
Replacement="$(PackageVersion)" />
3232

3333
<ItemGroup>
34-
<StdLibOutputFiles Include="$(StageDir)/Lib/**/*.py" />
34+
<StdLibOutputFiles Include="$(StageDir)/$(StdLibDirName)/**/*.py" />
3535
</ItemGroup>
3636
<Exec Command="dos2unix %(StdLibOutputFiles.Identity)" />
3737
<Exec Command="dos2unix $(PackageTempFolder)/DEBIAN/control"/>

Package/msi/IronPython.Installer.wixproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<Value>$(BuildDir)</Value>
3636
</WixConstant>
3737
<WixConstant Include="StdLibDir">
38-
<Value>$(BindInputPaths)\Lib</Value>
38+
<Value>$(BindInputPaths)\lib</Value>
3939
</WixConstant>
4040
<WixConstant Include="PlatformDir">
4141
<Value>$(BindInputPaths)\net462</Value>

Package/nuget/IronPython.StdLib.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</metadata>
2323
<files>
2424
<file src="StdLib.License.txt" />
25-
<file src="Lib\**" target="contentFiles\any\any\Lib" />
26-
<file src="Lib\**" target="content\Lib" />
25+
<file src="lib\**" target="contentFiles\any\any\lib" />
26+
<file src="lib\**" target="content\lib" />
2727
</files>
2828
</package>

Package/pkg/Pkg.Packaging.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<StdLibFiles Include="$(StageDir)/Lib/**/*.*" />
14+
<StdLibFiles Include="$(StageDir)/$(StdLibDirName)/**/*.*" />
1515
</ItemGroup>
1616

1717
<ItemGroup>
@@ -28,7 +28,7 @@
2828
<Exec Command="mkdir -p $(PackageTempFolder)" />
2929

3030
<ItemGroup>
31-
<StdLibOutputFiles Include="$(StageDir)/Lib/**/*.py" />
31+
<StdLibOutputFiles Include="$(StageDir)/$(StdLibDirName)/**/*.py" />
3232
</ItemGroup>
3333

3434
<!-- Change line endings of the .py files -->

Package/zip/Zip.Packaging.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<Zip Files="@(ZipFiles)" ZipFileName="$(PackageDir)\IronPython.$(PackageVersion).zip" WorkingDirectory="$(StageDir)" />
1010

1111
<ItemGroup>
12-
<StdLibFiles Include="$(StageDir)\Lib\**\*.*" />
12+
<StdLibFiles Include="$(StageDir)\$(StdLibDirName)\**\*.*" />
1313
</ItemGroup>
14-
<Zip Files="@(StdLibFiles)" ZipFileName="$(PackageDir)\IronPython.StdLib.$(PackageVersion).zip" WorkingDirectory="$(StageDir)\Lib"/>
14+
<Zip Files="@(StdLibFiles)" ZipFileName="$(PackageDir)\IronPython.StdLib.$(PackageVersion).zip" WorkingDirectory="$(StageDir)\$(StdLibDirName)"/>
1515
</Target>
1616
</Project>

Src/IronPython/Hosting/PythonCommandLine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ private void InitializeModules() {
296296
}
297297

298298
prefix = pyvenv_prefix ?? prefix;
299-
// Make sure there an IronPython Lib directory, and if not keep looking up
300-
while (prefix != null && !File.Exists(Path.Combine(prefix, "Lib/os.py"))) {
299+
// Make sure there an IronPython lib directory, and if not keep looking up
300+
while (prefix != null && !File.Exists(Path.Combine(prefix, "lib", "os.py"))) {
301301
prefix = Path.GetDirectoryName(prefix);
302302
}
303303
}

Src/IronPython/IronPython.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38-
<None Update="Lib\**\*.py">
38+
<None Include="Lib\**\*.py" Link="lib\%(RecursiveDir)%(Filename)%(Extension)">
3939
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4040
</None>
41-
<None Include="..\StdLib\Lib\os.py" Link="Lib\os.py">
41+
<None Include="..\StdLib\Lib\os.py" Link="lib\os.py">
4242
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4343
</None>
4444
</ItemGroup>

Src/IronPython/Runtime/PythonContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public PythonContext(ScriptDomainManager/*!*/ manager, IDictionary<string, objec
220220
// Can be null if called from unmanaged code (VS integration scenario)
221221
// or in self-contained single file scenarios
222222
if (entry != null) {
223-
string lib = Path.Combine(entry, "Lib");
223+
string lib = Path.Combine(entry, "lib");
224224
path.append(lib);
225225

226226
// add DLLs directory for user-defined extention modules
@@ -1767,7 +1767,7 @@ internal void SetHostVariables(string prefix, string executable, string versionS
17671767
_initialExecutable = executable ?? "";
17681768
InitialPrefix = prefix;
17691769

1770-
AddToPath(Path.Combine(prefix, "Lib"), 0);
1770+
AddToPath(Path.Combine(prefix, "lib"), 0);
17711771

17721772
SetHostVariables(SystemState.__dict__);
17731773
}

0 commit comments

Comments
 (0)