[mapguide-commits] r10274 - in branches/4.0/MgDev: . Bindings Bindings/src/Bindings/DotNet/Portable Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/contentFiles
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Nov 6 04:44:47 PST 2026
Author: jng
Date: 2026-11-06 04:44:46 -0800 (Fri, 06 Nov 2026)
New Revision: 10274
Modified:
branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd
branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/PortableApi.vcxproj
branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/
branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/OSGeo.MapGuide.Portable.csproj
branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets
branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/contentFiles/README.txt
branches/4.0/MgDev/clean.bat
Log:
#2897: Update MgPortable nuget package preparation to take the new linux portable tarball content
Modified: branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd
===================================================================
--- branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd 2026-11-06 12:33:00 UTC (rev 10273)
+++ branches/4.0/MgDev/Bindings/setup_linux_native_libs.cmd 2026-11-06 12:44:46 UTC (rev 10274)
@@ -1,11 +1,17 @@
SET TARBALL=%1
SET PORTABLE_TARBALL=%2
SET SOVER=4.0.0
+SET "SEVENZIP=%~dp0..\BuildTools\WebTools\7-Zip\7z.exe"
+SET "LINUX_TAR=%TEMP%\mapguide-linux-native.tar"
if "%TARBALL%"=="" goto :NoTarball
if not exist "%TARBALL%" goto :NoTarball
rem You may see "errors" around symlink files being extracted. That's okay because we don't need these symlink files. Our SWIG
rem glue library is already an unversioned .so file that has dependencies to versioned .so files and not their symlinked copies
-"%CD%\..\BuildTools\WebTools\7-Zip\7z.exe" x %TARBALL% -so | "%CD%\..\BuildTools\WebTools\7-Zip\7z.exe" 7z x -aoa -si -ttar -o"%~p0\linux-x64"
+rem The bundled 7-Zip cannot read a tar stream from stdin, so the gzip member is expanded to a temporary
+rem tar file and that file is then expanded into linux-x64.
+"%SEVENZIP%" x %TARBALL% -so > "%LINUX_TAR%"
+"%SEVENZIP%" x "%LINUX_TAR%" -y -o"%~p0\linux-x64"
+del /Q "%LINUX_TAR%"
rem Foundation setup
copy /Y /L "%~p0\linux-x64\lib64\libFoundationUnmanagedApi.so" "%~p0\src\Managed\DotNet\OSGeo.MapGuide.Foundation\runtimes\linux-x64\native"
copy /Y /L "%~p0\linux-x64\lib64\libMgFoundation-%SOVER%.so" "%~p0\src\Managed\DotNet\OSGeo.MapGuide.Foundation\runtimes\linux-x64\native"
@@ -28,45 +34,59 @@
copy /Y /L "%~p0\linux-x64\lib64\libMgWebSupport-%SOVER%.so" "%~p0\src\Managed\DotNet\OSGeo.MapGuide.Web\runtimes\linux-x64\native"
copy /Y /L "%~p0\linux-x64\lib64\libMgHttpHandler-%SOVER%.so" "%~p0\src\Managed\DotNet\OSGeo.MapGuide.Web\runtimes\linux-x64\native"
copy /Y /L "%~p0\linux-x64\lib64\liblib_json.so" "%~p0\src\Managed\DotNet\OSGeo.MapGuide.Web\runtimes\linux-x64\native"
-rem MgPortable setup. The portable tarball is optional; it carries MgPortable, its SWIG glue and
-rem the GWS/Renderers/Stylization/Security libraries the portable API needs.
+rem MgPortable setup. The portable tarball is optional; it carries MgPortable, its SWIG glue,
+rem the GWS/Renderers/Stylization libraries the portable API needs, the FDO install MgPortable
+rem loads at runtime, and a Platform.ini prepared for Linux.
if "%PORTABLE_TARBALL%"=="" goto :Done
if not exist "%PORTABLE_TARBALL%" goto :NoPortableTarball
-"%CD%\..\BuildTools\WebTools\7-Zip\7z.exe" x %PORTABLE_TARBALL% -so | "%CD%\..\BuildTools\WebTools\7-Zip\7z.exe" 7z x -aoa -si -ttar -o"%~p0\linux-x64"
-set PORTABLE_NATIVE=%~p0\src\Managed\DotNet\OSGeo.MapGuide.Portable\runtimes\linux-x64\native
-copy /Y /L "%~p0\linux-x64\lib64\libPortableUnmanagedApi.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgPortable-%SOVER%.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgMdfModel-%SOVER%.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgMdfParser-%SOVER%.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgRenderers-%SOVER%.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgStylization-%SOVER%.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgGwsCommon-%SOVER%.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgGwsQueryEngine-%SOVER%.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%~p0\linux-x64\lib64\libMgGwsResource-%SOVER%.so" "%PORTABLE_NATIVE%"
-rem FDO. The tarball keeps the whole FDO install in a top-level fdo subtree; MgPortable links
-rem libFDO and libExpressionEngine, and the connection manager loads a provider from the
-rem directory of the providers.xml it read, so the FDO libraries, the providers and
-rem providers.xml are all flattened into the same native directory here. Only the versioned
-rem library files are copied: the runtime needs the SONAMEs the providers link against, not the
-rem -lFDO style symlinks.
-set FDO_LINUX=%~p0\linux-x64\fdo\lib64
-copy /Y /L "%FDO_LINUX%\libFDO-*.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%FDO_LINUX%\libExpressionEngine-*.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%FDO_LINUX%\lib*Provider-*.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%FDO_LINUX%\lib*Overrides-*.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%FDO_LINUX%\libOWS-*.so" "%PORTABLE_NATIVE%"
-copy /Y /L "%FDO_LINUX%\providers.xml" "%PORTABLE_NATIVE%"
-rem The generic FDO SDK bundles the gdal/xerces/xalan it was built against; a distro build links
-rem the system copies and has none of these, so their absence is not an error.
-if exist "%FDO_LINUX%\libgdal.so.*.*" copy /Y /L "%FDO_LINUX%\libgdal.so.*.*" "%PORTABLE_NATIVE%"
-if exist "%FDO_LINUX%\libxerces-c-*.so" copy /Y /L "%FDO_LINUX%\libxerces-c-*.so" "%PORTABLE_NATIVE%"
-if exist "%FDO_LINUX%\libxalan-c.so.*.*" copy /Y /L "%FDO_LINUX%\libxalan-c.so.*.*" "%PORTABLE_NATIVE%"
-if exist "%FDO_LINUX%\libxalanMsg.so.*.*" copy /Y /L "%FDO_LINUX%\libxalanMsg.so.*.*" "%PORTABLE_NATIVE%"
-rem com/ holds the RDBMS MetaSchema creation scripts and the coordinate system catalogue, which
-rem the providers find as the "com" sub-directory of the directory they were loaded from.
-if exist "%FDO_LINUX%\com" xcopy /E /I /Y "%FDO_LINUX%\com" "%PORTABLE_NATIVE%\com" >nul
-rem nls/ holds the message catalogues; a consumer points NLSPATH at it to get localised text.
-if exist "%~p0\linux-x64\fdo\nls" xcopy /E /I /Y "%~p0\linux-x64\fdo\nls" "%PORTABLE_NATIVE%\nls" >nul
+"%SEVENZIP%" x %PORTABLE_TARBALL% -so > "%LINUX_TAR%"
+"%SEVENZIP%" x "%LINUX_TAR%" -y -o"%~p0\linux-x64"
+del /Q "%LINUX_TAR%"
+set "MG_LINUX64=%~p0\linux-x64"
+set "PORTABLE_DIR=%~p0\src\Managed\DotNet\OSGeo.MapGuide.Portable"
+set "PORTABLE_NATIVE=%PORTABLE_DIR%\runtimes\linux-x64\native"
+rem 7-Zip cannot create the tarball's symlinks, so every unversioned library name in it arrives as
+rem a zero-length file. MgPortablePlatform::Initialize dlopens <FdoPath>libFDO.so and providers.xml
+rem names each provider by its bare library name, so each of those has to be replaced by a copy of
+rem the versioned library it stood for.
+for %%F in ("%MG_LINUX64%\lib64\*" "%MG_LINUX64%\fdo\lib64\*") do call :Materialize "%%~F"
+rem The package keeps the two platforms apart: FDO\windows holds the Windows providers the Windows
+rem build stages, and FDO\linux is where the FDO install of this tarball goes (lib64, its
+rem providers.xml and com data, and nls). Both are packed as plain package content, and the
+rem build\OSGeo.MapGuide.Portable.targets copies the one belonging to the consuming platform into
+rem FDO next to the application. The Platform.ini is not part of either: it is configuration, so it
+rem goes to config\linux (config\windows holds the Windows build's copy), and the same targets
+rem place the one for the consuming platform next to the application, with FdoPath rewritten to the
+rem FDO directory that platform's tree is staged into.
+if exist "%PORTABLE_DIR%\FDO\linux" rd /S /Q "%PORTABLE_DIR%\FDO\linux"
+mkdir "%PORTABLE_DIR%\FDO\linux"
+if exist "%MG_LINUX64%\fdo" xcopy /E /I /Y "%MG_LINUX64%\fdo" "%PORTABLE_DIR%\FDO\linux" >nul
+if not exist "%PORTABLE_DIR%\config\linux" mkdir "%PORTABLE_DIR%\config\linux"
+copy /Y /L "%MG_LINUX64%\Platform.ini" "%PORTABLE_DIR%\config\linux\Platform.ini"
+perl -i.bak -pe "s#^FdoPath\s*=.*#FdoPath = FDO/lib64/#" "%PORTABLE_DIR%\config\linux\Platform.ini"
+if exist "%PORTABLE_DIR%\config\linux\Platform.ini.bak" del /Q "%PORTABLE_DIR%\config\linux\Platform.ini.bak"
+rem The libraries MgPortable is linked against have to travel as runtime assets, because the
+rem loader resolves them through the $ORIGIN RUNPATH of PortableUnmanagedApi.so as soon as the
+rem first call binds that library - before MgPortablePlatform::Initialize can honour FdoPath. The
+rem staging that an earlier layout left behind is cleared first; a plain *.so delete would miss
+rem the versioned names, and a plain for loop does not visit directories. The README that is part
+rem of the package stays.
+for %%F in ("%PORTABLE_NATIVE%\*") do if /I not "%%~nxF"=="readme-linux-x64.txt" del /F /Q "%%~fF"
+for /d %%F in ("%PORTABLE_NATIVE%\*") do rd /S /Q "%%~fF"
+copy /Y /L "%MG_LINUX64%\lib64\libACE.so.6.2.6" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libxerces-c-3.1.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libPortableUnmanagedApi.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgPortable-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgFoundation-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgGeometry-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgPlatformBase-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgMdfModel-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgMdfParser-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgRenderers-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgStylization-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgGwsCommon-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgGwsQueryEngine-%SOVER%.so" "%PORTABLE_NATIVE%"
+copy /Y /L "%MG_LINUX64%\lib64\libMgGwsResource-%SOVER%.so" "%PORTABLE_NATIVE%"
goto :Done
:NoPortableTarball
echo No MgPortable linux native libs tarball specified or tarball does not exist.
@@ -73,4 +93,21 @@
goto :Done
:NoTarball
echo No linux native libs tarball specified or tarball does not exist.
-:Done
\ No newline at end of file
+:Done
+goto :eof
+
+rem Replaces a zero-length symlink placeholder with a copy of the versioned library it pointed at,
+rem matching either the "-4.2.0.so" or the ".so.111.0" naming the Linux build uses.
+:Materialize
+if not exist "%~1" goto :eof
+if not "%~z1"=="0" goto :eof
+rem The enumeration the caller uses cannot be *.so: a DOS wildcard matches only one extension, so
+rem libgdal.so.20 and libxalan-c.so.111 would never be visited. Filter here instead.
+set "MATERIALIZE_NAME=%~nx1"
+if "%MATERIALIZE_NAME:.so=%"=="%MATERIALIZE_NAME%" goto :eof
+set "MATERIALIZED="
+for %%G in ("%~dp1%~n1-*.so") do if exist "%%~G" if not "%%~zG"=="0" set "MATERIALIZED=%%~G"
+if not defined MATERIALIZED for %%G in ("%~dp1%~n1.*.*") do if exist "%%~G" if not "%%~zG"=="0" set "MATERIALIZED=%%~G"
+if not defined MATERIALIZED echo [warn]: no versioned library found for %~nx1
+if defined MATERIALIZED copy /Y /L "%MATERIALIZED%" "%~1" >nul
+goto :eof
\ No newline at end of file
Modified: branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/PortableApi.vcxproj
===================================================================
--- branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/PortableApi.vcxproj 2026-11-06 12:33:00 UTC (rev 10273)
+++ branches/4.0/MgDev/Bindings/src/Bindings/DotNet/Portable/PortableApi.vcxproj 2026-11-06 12:44:46 UTC (rev 10274)
@@ -72,11 +72,13 @@
copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\MgGws*.dll" "$(TargetDir)\native\"
copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\MgRenderers.dll" "$(TargetDir)\native\"
copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\MgStylization.dll" "$(TargetDir)\native\"
-copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Platform.ini" "$(TargetDir)\..\..\contentFiles"
-xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\com" "$(TargetDir)\..\..\FDO\com"
-copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\*.dll" "$(TargetDir)\..\..\FDO"
-del /q "$(TargetDir)\..\..\FDO\OSGeo.FDO.*"
-copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\providers.xml" "$(TargetDir)\..\..\FDO"
+if not exist "$(TargetDir)\..\..\FDO\windows" mkdir "$(TargetDir)\..\..\FDO\windows"
+if not exist "$(TargetDir)\..\..\config\windows" mkdir "$(TargetDir)\..\..\config\windows"
+copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Platform.ini" "$(TargetDir)\..\..\config\windows"
+xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\com" "$(TargetDir)\..\..\FDO\windows\com"
+copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\*.dll" "$(TargetDir)\..\..\FDO\windows"
+del /q "$(TargetDir)\..\..\FDO\windows\OSGeo.FDO.*"
+copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\providers.xml" "$(TargetDir)\..\..\FDO\windows"
xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Dictionaries" "$(TargetDir)\..\..\Dictionaries\"
xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Resources" "$(TargetDir)\..\..\Resources\"
xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Schema" "$(TargetDir)\..\..\Schema\"
@@ -126,11 +128,13 @@
copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\MgGws*.dll" "$(TargetDir)\native\"
copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\MgRenderers.dll" "$(TargetDir)\native\"
copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\MgStylization.dll" "$(TargetDir)\native\"
-copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Platform.ini" "$(TargetDir)\..\..\contentFiles"
-xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\com" "$(TargetDir)\..\..\FDO\com"
-copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\*.dll" "$(TargetDir)\..\..\FDO"
-del /q "$(TargetDir)\..\..\FDO\OSGeo.FDO.*"
-copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\providers.xml" "$(TargetDir)\..\..\FDO"
+if not exist "$(TargetDir)\..\..\FDO\windows" mkdir "$(TargetDir)\..\..\FDO\windows"
+if not exist "$(TargetDir)\..\..\config\windows" mkdir "$(TargetDir)\..\..\config\windows"
+copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Platform.ini" "$(TargetDir)\..\..\config\windows"
+xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\com" "$(TargetDir)\..\..\FDO\windows\com"
+copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\*.dll" "$(TargetDir)\..\..\FDO\windows"
+del /q "$(TargetDir)\..\..\FDO\windows\OSGeo.FDO.*"
+copy /Y "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\FDO\providers.xml" "$(TargetDir)\..\..\FDO\windows"
xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Dictionaries" "$(TargetDir)\..\..\Dictionaries\"
xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Resources" "$(TargetDir)\..\..\Resources\"
xcopy /S /Y /I "$(ProjectDir)..\..\..\..\..\Portable\bin\$(Configuration)64\Schema" "$(TargetDir)\..\..\Schema\"
Index: branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable
===================================================================
--- branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable 2026-11-06 12:33:00 UTC (rev 10273)
+++ branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable 2026-11-06 12:44:46 UTC (rev 10274)
Property changes on: branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable
___________________________________________________________________
Modified: svn:ignore
## -2,6 +2,7 ##
*.cs
Dictionaries
FDO
+config
Resources
Schema
bin
Modified: branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/OSGeo.MapGuide.Portable.csproj
===================================================================
--- branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/OSGeo.MapGuide.Portable.csproj 2026-11-06 12:33:00 UTC (rev 10273)
+++ branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/OSGeo.MapGuide.Portable.csproj 2026-11-06 12:44:46 UTC (rev 10274)
@@ -31,9 +31,10 @@
<ItemGroup>
<Content Include="build/**" PackagePath="%(Identity)" />
- <Content Include="runtimes/**/*.dll" PackagePath="%(Identity)" />
- <Content Include="runtimes/**/*.pdb" PackagePath="%(Identity)" />
- <Content Include="runtimes/**/*.so*" PackagePath="%(Identity)" />
+ <!-- Everything staged under runtimes/ is a runtime asset: the Linux tree carries the tarball's
+ own layout (lib64/, fdo/lib64/, fdo/nls/ and Platform.ini), and the message catalogues it
+ holds are .cat files, so the glob cannot be limited to the library extensions. -->
+ <Content Include="runtimes/**/*" PackagePath="%(Identity)" />
</ItemGroup>
<!--
@@ -43,11 +44,6 @@
Visual Studio
-->
<ItemGroup>
- <None Update="contentFiles\Platform.ini" Pack="true" PackagePath="contentFiles\any\any\Platform.ini">
- <PackageCopyToOutput>true</PackageCopyToOutput>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- <CopyToPublishDirectory>Always</CopyToPublishDirectory>
- </None>
<None Include="README.md" Pack="true" PackagePath="" />
<None Update="Dictionaries\*" Pack="true" PackagePath="contentFiles\any\any">
<PackageCopyToOutput>true</PackageCopyToOutput>
@@ -54,11 +50,16 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
</None>
- <None Update="FDO\**\*" Pack="true" PackagePath="contentFiles\any\any">
- <PackageCopyToOutput>true</PackageCopyToOutput>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- <CopyToPublishDirectory>Always</CopyToPublishDirectory>
- </None>
+ <!-- The two FDO installs and the two platform-specific Platform.ini copies are packed as plain
+ package content rather than as content files: content files cannot be restricted to a
+ platform, and NuGet copies a runtime asset into the output directory root, which would
+ collapse their platform directory. The build/OSGeo.MapGuide.Portable.targets that ships
+ with the package copies the ones that belong to the consuming platform next to the
+ application. -->
+ <None Update="FDO\windows\**\*" Pack="true" PackagePath="tools" />
+ <None Update="FDO\linux\**\*" Pack="true" PackagePath="tools" />
+ <None Update="config\windows\**\*" Pack="true" PackagePath="tools" />
+ <None Update="config\linux\**\*" Pack="true" PackagePath="tools" />
<None Update="Resources\*" Pack="true" PackagePath="contentFiles\any\any">
<PackageCopyToOutput>true</PackageCopyToOutput>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Modified: branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets
===================================================================
--- branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets 2026-11-06 12:33:00 UTC (rev 10273)
+++ branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/build/OSGeo.MapGuide.Portable.targets 2026-11-06 12:44:46 UTC (rev 10274)
@@ -13,4 +13,51 @@
</None>
</ItemGroup>
+ <ItemGroup Condition=" '$(OS)' != 'Windows_NT' ">
+ <MgPortableLinuxPlatformIni Include="$(MSBuildThisFileDirectory)..\tools\config\linux\Platform.ini" />
+ <MgPortableLinuxFdoFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\linux\**\*" />
+ <MgPortableLinuxFdoLibFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\linux\lib64\*.*" />
+ <MgPortableLinuxFdoComFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\linux\lib64\com\**\*" />
+ </ItemGroup>
+
+ <ItemGroup Condition=" '$(OS)' == 'Windows_NT' ">
+ <MgPortableWindowsPlatformIni Include="$(MSBuildThisFileDirectory)..\tools\config\windows\Platform.ini" />
+ <MgPortableWindowsFdoFile Include="$(MSBuildThisFileDirectory)..\tools\FDO\windows\**\*" />
+ </ItemGroup>
+
+ <!--
+ NuGet copies a runtime asset into the output directory root and cannot restrict content files to
+ a platform, so neither of the two FDO installs the package carries can be declared as one: each
+ is packed as plain package content and the one belonging to the consuming platform is staged
+ here. Both land in FDO next to the application, and the platform's Platform.ini is placed beside
+ the application as well, so the platform split exists only inside the package. On Linux the
+ libraries are staged into the output root too, with the com directory beside them: the loader
+ resolves libFDO and libExpressionEngine through the $ORIGIN RUNPATH of PortableUnmanagedApi.so
+ as soon as the first call binds that library, before MgPortablePlatform::Initialize honours
+ FdoPath, and FDO looks for providers.xml and its providers beside the libFDO loaded that way.
+ -->
+ <Target Name="StageLinuxFdoForBuild" AfterTargets="Build" Condition=" '@(MgPortableLinuxFdoFile)' != '' ">
+ <Copy SourceFiles="@(MgPortableLinuxFdoFile)" DestinationFiles="@(MgPortableLinuxFdoFile->'$(OutDir)FDO/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableLinuxFdoLibFile)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableLinuxFdoComFile)" DestinationFiles="@(MgPortableLinuxFdoComFile->'$(OutDir)com/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableLinuxPlatformIni)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
+ </Target>
+
+ <Target Name="StageLinuxFdoForPublish" AfterTargets="Publish" Condition=" '@(MgPortableLinuxFdoFile)' != '' ">
+ <Copy SourceFiles="@(MgPortableLinuxFdoFile)" DestinationFiles="@(MgPortableLinuxFdoFile->'$(PublishDir)FDO/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableLinuxFdoLibFile)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableLinuxFdoComFile)" DestinationFiles="@(MgPortableLinuxFdoComFile->'$(PublishDir)com/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableLinuxPlatformIni)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
+ </Target>
+
+ <Target Name="StageWindowsFdoForBuild" AfterTargets="Build" Condition=" '@(MgPortableWindowsFdoFile)' != '' ">
+ <Copy SourceFiles="@(MgPortableWindowsFdoFile)" DestinationFiles="@(MgPortableWindowsFdoFile->'$(OutDir)FDO\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableWindowsPlatformIni)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
+ </Target>
+
+ <Target Name="StageWindowsFdoForPublish" AfterTargets="Publish" Condition=" '@(MgPortableWindowsFdoFile)' != '' ">
+ <Copy SourceFiles="@(MgPortableWindowsFdoFile)" DestinationFiles="@(MgPortableWindowsFdoFile->'$(PublishDir)FDO\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
+ <Copy SourceFiles="@(MgPortableWindowsPlatformIni)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
+ </Target>
+
</Project>
\ No newline at end of file
Modified: branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/contentFiles/README.txt
===================================================================
--- branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/contentFiles/README.txt 2026-11-06 12:33:00 UTC (rev 10273)
+++ branches/4.0/MgDev/Bindings/src/Managed/DotNet/OSGeo.MapGuide.Portable/contentFiles/README.txt 2026-11-06 12:44:46 UTC (rev 10274)
@@ -1,3 +1,6 @@
-Content files for OSGeo.MapGuide.Portable go here. This currently should include:
+Content files for OSGeo.MapGuide.Portable go here. These are the data directories the portable
+platform reads from its working directory.
- - Platform.ini
\ No newline at end of file
+Platform.ini is not one of them: it carries a platform-specific FdoPath, so each platform's copy
+is staged into config\windows or config\linux, and the targets the package ships copy the right
+one next to the application.
Modified: branches/4.0/MgDev/clean.bat
===================================================================
--- branches/4.0/MgDev/clean.bat 2026-11-06 12:33:00 UTC (rev 10273)
+++ branches/4.0/MgDev/clean.bat 2026-11-06 12:44:46 UTC (rev 10274)
@@ -11,7 +11,12 @@
if exist Bindings\src\Managed\DotNet\OSGeo.MapGuide.Geometry\runtimes\linux-x64\native\*.so* del /F Bindings\src\Managed\DotNet\OSGeo.MapGuide.Geometry\runtimes\linux-x64\native\*.so*
if exist Bindings\src\Managed\DotNet\OSGeo.MapGuide.MapGuideCommon\runtimes\linux-x64\native\*.so* del /F Bindings\src\Managed\DotNet\OSGeo.MapGuide.MapGuideCommon\runtimes\linux-x64\native\*.so*
if exist Bindings\src\Managed\DotNet\OSGeo.MapGuide.PlatformBase\runtimes\linux-x64\native\*.so* del /F Bindings\src\Managed\DotNet\OSGeo.MapGuide.PlatformBase\runtimes\linux-x64\native\*.so*
-if exist Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\runtimes\linux-x64\native\*.so* del /F Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\runtimes\linux-x64\native\*.so*
+rem The portable package stages the tarball's own shape - Platform.ini, lib64/ and the fdo/ subtree -
+rem so it is cleared as a whole. The README that is part of the package stays.
+for %%F in (Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\runtimes\linux-x64\native\*) do if /I not "%%~nxF"=="readme-linux-x64.txt" del /F /Q "%%~fF"
+for /d %%F in (Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\runtimes\linux-x64\native\*) do rd /S /Q "%%~fF"
+if exist Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\FDO\linux rd /S /Q Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\FDO\linux
+if exist Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\config\linux rd /S /Q Bindings\src\Managed\DotNet\OSGeo.MapGuide.Portable\config\linux
if exist Bindings\src\Managed\DotNet\OSGeo.MapGuide.Web\runtimes\linux-x64\native\*.so* del /F Bindings\src\Managed\DotNet\OSGeo.MapGuide.Web\runtimes\linux-x64\native\*.so*
if exist Bindings\packages rd /S /Q Bindings\packages
if exist Bindings\src\lib rd /S /Q Bindings\src\lib
More information about the mapguide-commits
mailing list