Skip to content

Commit

Permalink
Additional fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Feb 10, 2025
1 parent 196abb7 commit 6639f7e
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-matlab/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ runs:
Invoke-WebRequest https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/win64/run-matlab-command.exe -OutFile C:\Windows\System32\run-matlab-command.exe
echo "MATLAB_COMMAND=C:\Windows\System32\run-matlab-command.exe" >> $env:GITHUB_ENV
shell: powershell
if: runner.os == 'Windows' && matrix.config == 'matlab'
if: runner.os == 'Windows'
4 changes: 3 additions & 1 deletion .github/workflows/build-matlab-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
use_matlab: true

- name: Build MATLAB ToolBox
run: make -C matlab toolbox
run: |
make -C cpp srcs
make -C matlab toolbox
if: runner.os == 'Linux'

- name: Build MATLAB ToolBox
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ jobs:
working-directory: ice/js

- name: Pack npm
run: npm pack
run: |
if [ ! -f "$GITHUB_WORKSPACE/ice/cpp/bin/slice2js" ]; then
echo "Error: slice2js binary is missing in cpp/bin"
exit 1
fi
npm pack
working-directory: ice/js

- name: Upload NPM Packages
Expand Down
1 change: 1 addition & 0 deletions js/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function slice2js(options) {
defaults.jsbundle = opts.jsbundle;
defaults.tsbundle = opts.tsbundle;
defaults.jsbundleFormat = opts.jsbundleFormat;
console.log("Running iceBuilder with defaults", defaults);
return iceBuilder(defaults);
}

Expand Down
6 changes: 6 additions & 0 deletions matlab/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,15 @@ $(icetoolbox_file):: $(icethunk_target) $(slice2matlab_path) $(lang_srcdir)/lib/
cp -rf $(cpp_bindir)/slice2matlab $(lang_srcdir)/toolbox/build/
# Doc files
cp -rf $(lang_srcdir)/toolbox/doc $(lang_srcdir)/toolbox/build
ifneq (,$(MATLAB_COMMAND))
cd $(lang_srcdir)/toolbox && $(MATLAB_COMMAND) "addFolderToPath '`realpath build`'"
cd $(lang_srcdir)/toolbox && $(MATLAB_COMMAND) "buildToolbox '$(version)'"
cd $(lang_srcdir)/toolbox && $(MATLAB_COMMAND) "removeFolderFromPath '`realpath build`'"
else
cd $(lang_srcdir)/toolbox && $(MATLAB_HOME)/bin/matlab -nodisplay -r "addFolderToPath '`realpath build`'"
cd $(lang_srcdir)/toolbox && $(MATLAB_HOME)/bin/matlab -nodisplay -r "buildToolbox '$(version)'"
cd $(lang_srcdir)/toolbox && $(MATLAB_HOME)/bin/matlab -nodisplay -r "removeFolderFromPath '`realpath build`'"
endif

clean::
rm -rf $(icetoolbox_file)
Expand Down
54 changes: 24 additions & 30 deletions matlab/msbuild/ice.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,30 @@
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<RootDir>$([System.IO.Path]::GetFullPath( $(MSBuildThisFileDirectory)..\msbuild ))</RootDir>
<ToolboxDir>$(MSBuildThisFileDirectory)..\toolbox\build</ToolboxDir>
<MatlabVersion Condition="'$(MatlabVersion)' == ''">R2024a</MatlabVersion>
<MatlabHome Condition="'$(MatlabHome)' == ''">C:\Program Files\MATLAB\$(MatlabVersion)</MatlabHome>
<!-- Override with the env settings -->
<MatlabVersion Condition="'$(MATLAB_VERSION)' != ''">$(MATLAB_VERSION)</MatlabVersion>
<MatlabHome Condition="'$(MATLAB_HOME)' != ''">$(MATLAB_HOME)</MatlabHome>
</PropertyGroup>

<Choose>
<When Condition="'$(MATLAB_COMMAND)' != ''">
<PropertyGroup>
<MatlabCommand>$(MATLAB_COMMAND)</MatlabCommand>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<MatlabCommand>&quot;$(MatlabHome)\bin\matlab.exe&quot; -nodesktop -nosplash -wait -log -minimize</MatlabCommand>
</PropertyGroup>
</Otherwise>
</Choose>

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(MSBuildThisFileDirectory)..\..\config\icebuilder.props"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\config\ice.common.targets"/>

<Target Name="MatlabHome" Condition="'$(MatlabHome)' == ''">
<Exec Command="where matlab" ConsoleToMSBuild="true" EchoOff="yes">
<Output TaskParameter="ConsoleOutput" PropertyName="MatlabExe" />
</Exec>
<PropertyGroup>
<MatlabExe>$(MatlabExe.Split(';')[0])</MatlabExe>
</PropertyGroup>
<Error Text="Cannot detect a valid MATLAB installation" Condition="!Exists('$(MatlabExe)')"/>
<CreateProperty Value="$([System.IO.Path]::GetFullPath( '$(MatlabExe)\..\..' ))">
<Output TaskParameter="Value" PropertyName="MatlabHome" />
</CreateProperty>
</Target>

<Target Name="MatlabVersion" Condition="'$(MatlabVersion)' == ''" DependsOnTargets="MatlabHome">
<Exec Command="&quot;$(MatlabHome)\bin\matlab.exe&quot; -nodesktop -nosplash -wait -log -minimize -r &quot;fprintf(2, '%%s', version('-release'));exit(0);&quot;"
EchoOff="yes"
ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="MatlabOut"/>
</Exec>
<CreateProperty Value="$(MatlabOut.Substring($(MatlabOut.LastIndexOf(';'))).Replace(';',''))">
<Output TaskParameter="Value" PropertyName="MatlabVersion" />
</CreateProperty>
</Target>

<Target Name="NuGetRestore" DependsOnTargets="GetNuGet">
<Exec Command="$(NuGetExe) restore $(MSBuildThisFileDirectory)..\..\cpp\msbuild\ice.sln" />
</Target>
Expand All @@ -47,7 +41,7 @@
Properties="Platform=$(Platform);Configuration=$(Configuration)" />
</Target>

<Target Name="BuildDist" DependsOnTargets="BuildCppDist;NuGetRestore;MatlabHome">
<Target Name="BuildDist" DependsOnTargets="BuildCppDist;NuGetRestore">
<MSBuild Projects="$(MSBuildThisFileDirectory)ice.sln"
BuildInParallel="true"
Properties="Platform=$(Platform);Configuration=$(Configuration);MatlabHome=$(MatlabHome)" />
Expand Down Expand Up @@ -105,7 +99,7 @@
</Task>
</UsingTask>

<Target Name="Package" DependsOnTargets="BuildDist;MatlabHome;MatlabVersion">
<Target Name="Package" DependsOnTargets="BuildDist">
<RemoveDir Directories="$(ToolboxDir)" />
<MakeDir Directories="$(ToolboxDir);$(ToolboxDir)\doc" />

Expand All @@ -124,14 +118,14 @@
<WriteFileWithReplacements InputFile="$(MSBuildThisFileDirectory)..\toolbox\info.template.xml"
OutputFile="$(MSBuildThisFileDirectory)..\toolbox\info.xml"
Tokens="@MatlabVersion@"
Replacements="R$(MatlabVersion)"/>
Replacements="$(MatlabVersion)"/>
<MSBuild Projects="ice.toolbox.targets"
Properties="Configuration=$(Configuration);Platform=x64" />
<Exec Command="&quot;$(MatlabHome)\bin\matlab.exe&quot; -nodesktop -nosplash -wait -log -minimize -r &quot;cd('$(MSBuildThisFileDirectory)..\toolbox');addFolderToPath '$(ToolboxDir)'&quot;"
<Exec Command="$(MatlabCommand) &quot;cd('$(MSBuildThisFileDirectory)..\toolbox');addFolderToPath '$(ToolboxDir)'&quot;"
WorkingDirectory="$(MSBuildThisFileDirectory)"/>
<Exec Command="&quot;$(MatlabHome)\bin\matlab.exe&quot; -nodesktop -nosplash -wait -log -minimize -r &quot;cd('$(MSBuildThisFileDirectory)..\toolbox');buildToolbox '3.8a0'&quot;"
<Exec Command="$(MatlabCommand) &quot;cd('$(MSBuildThisFileDirectory)..\toolbox');buildToolbox '3.8a0'&quot;"
WorkingDirectory="$(MSBuildThisFileDirectory)"/>
<Exec Command="&quot;$(MatlabHome)\bin\matlab.exe&quot; -nodesktop -nosplash -wait -log -minimize -r &quot;cd('$(MSBuildThisFileDirectory)..\toolbox');removeFolderFromPath '$(ToolboxDir)'&quot;"
<Exec Command="$(MatlabCommand) &quot;cd('$(MSBuildThisFileDirectory)..\toolbox');removeFolderFromPath '$(ToolboxDir)'&quot;"
WorkingDirectory="$(MSBuildThisFileDirectory)"/>
<Delete Files="toolbox.prj"/>
</Target>
Expand Down
8 changes: 5 additions & 3 deletions packaging/rpm/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ if [[ -z "${TARGET_ARCH:-}" || ! " ${VALID_ARCHS[@]} " =~ " ${TARGET_ARCH} " ]];
fi

# Define common RPM macros
RPM_MACROS="-D '_topdir $RPM_BUILD_ROOT' -D 'vendor ZeroC, Inc.'"
RPM_MACROS=()
RPM_MACROS+=(-D "_topdir $RPM_BUILD_ROOT")
RPM_MACROS+=(-D "vendor ZeroC, Inc.")

# Download sources
cd "$RPM_BUILD_ROOT/SOURCES"
spectool -g "$ICE_SPEC_DEST" || { echo "Error: Failed to download sources."; exit 1; }

# Build source RPM
rpmbuild -bs "$ICE_SPEC_DEST" $RPM_MACROS --target="$TARGET_ARCH"
rpmbuild -bs "$ICE_SPEC_DEST" "${RPM_MACROS[@]}" --target="$TARGET_ARCH"

# Build binary RPM
rpmbuild -bb "$ICE_SPEC_DEST" $RPM_MACROS --target="$TARGET_ARCH"
rpmbuild -bb "$ICE_SPEC_DEST" "${RPM_MACROS[@]}" --target="$TARGET_ARCH"
51 changes: 26 additions & 25 deletions packaging/rpm/ice.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
%define archive_dir_suffix main
%endif

%define rpmbuildfiles ice-%{archive_dir_suffix}/packaging/rpm

%define shadow shadow-utils
%define javapackagestools javapackages-tools
# Unfortunately bzip2-devel does not provide pkgconfig(bzip2) as of EL7
Expand Down Expand Up @@ -393,29 +391,30 @@ export LDFLAGS="%{?__global_ldflags}"
# php ice.ini
#
mkdir -p %{buildroot}%{_sysconfdir}/php.d
cp -p %{rpmbuildfiles}/ice.ini %{buildroot}%{_sysconfdir}/php.d
cp -p packaging/rpm/ice.ini %{buildroot}%{_sysconfdir}/php.d

#
# systemd files (for servers)
#
mkdir -p %{buildroot}%{_sysconfdir}
for i in icegridregistry icegridnode glacier2router
do
cp %{rpmbuildfiles}/$i.conf %{buildroot}%{_sysconfdir}
install -m 644 -p -D %{rpmbuildfiles}/$i.service %{buildroot}%{_unitdir}/$i.service
cp packaging/rpm/$i.conf %{buildroot}%{_sysconfdir}
install -m 644 -p -D packaging/rpm/$i.service %{buildroot}%{_unitdir}/$i.service
done

#
# IceGridGUI
#
mkdir -p %{buildroot}%{_bindir}
cp -p %{rpmbuildfiles}/icegridgui %{buildroot}%{_bindir}/icegridgui
cp -p packaging/rpm/icegridgui %{buildroot}%{_bindir}/icegridgui

%else

# These directories and files aren't needed in the x86 build.
rm -f %{buildroot}%{_libdir}/libGlacier2CryptPermissionsVerifier.so*
rm -f %{buildroot}%{_bindir}/slice2*
rm -f %{buildroot}%{_bindir}/ice2slice*
rm -rf %{buildroot}%{_includedir}
rm -rf %{buildroot}%{_mandir}
rm -rf %{buildroot}%{_datadir}/ice
Expand All @@ -431,15 +430,15 @@ rm -rf %{buildroot}%{_datadir}/ice
%files -n %{?nameprefix}ice-slice
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%dir %{_datadir}/ice
%{_datadir}/ice/slice

%files -n %{?nameprefix}icegridgui
%license LICENSE
%license ICE_LICENSE
%license %{rpmbuildfiles}/JGOODIES_LICENSE
%doc %{rpmbuildfiles}/README
%license packaging/rpm/JGOODIES_LICENSE
%doc packaging/rpm/README
%attr(755,root,root) %{_bindir}/icegridgui
%{_javadir}/icegridgui.jar

Expand All @@ -455,25 +454,25 @@ rm -rf %{buildroot}%{_datadir}/ice
%files -n %{?nameprefix}ice-all-runtime
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README

#
# Generate "ice-all-devel" meta package as arch-specific
#
%files -n %{?nameprefix}ice-all-devel
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README

#
# libice-Mm-c++ package
#
%files -n lib%{?nameprefix}ice3.8-c++
%license LICENSE
%license ICE_LICENSE
%license %{rpmbuildfiles}/LMDB_LICENSE
%license %{rpmbuildfiles}/MCPP_LICENSE
%doc %{rpmbuildfiles}/README
%license packaging/rpm/LMDB_LICENSE
%license packaging/rpm/MCPP_LICENSE
%doc packaging/rpm/README
%{_libdir}/libGlacier2.so.*
%{_libdir}/libIce.so.*
%{_libdir}/libIceBox.so.*
Expand All @@ -496,7 +495,7 @@ exit 0
%files -n %{?nameprefix}icebox
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%ifarch %{_host_cpu}
%{_bindir}/icebox
%{_mandir}/man1/icebox.1*
Expand All @@ -516,7 +515,7 @@ exit 0
%files -n lib%{?nameprefix}ice-c++-devel
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{_libdir}/libGlacier2.so
%{_libdir}/libIce.so
%{_libdir}/libIceBox.so
Expand All @@ -538,7 +537,7 @@ exit 0
%files -n lib%{?nameprefix}icestorm3.8
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{_libdir}/libIceStormService.so.*
%post -n lib%{?nameprefix}icestorm3.8 -p /sbin/ldconfig
%postun -n lib%{?nameprefix}icestorm3.8
Expand All @@ -553,8 +552,8 @@ exit 0
%files -n %{?nameprefix}ice-compilers
%license LICENSE
%license ICE_LICENSE
%license %{rpmbuildfiles}/MCPP_LICENSE
%doc %{rpmbuildfiles}/README
%license packaging/rpm/MCPP_LICENSE
%doc packaging/rpm/README
%{_bindir}/slice2cpp
%{_mandir}/man1/slice2cpp.1*
%{_bindir}/slice2cs
Expand All @@ -573,14 +572,16 @@ exit 0
%{_mandir}/man1/slice2rb.1*
%{_bindir}/slice2swift
%{_mandir}/man1/slice2swift.1*
%{_bindir}/ice2slice
%{_mandir}/man1/ice2slice.1*

#
# ice-utils package
#
%files -n %{?nameprefix}ice-utils
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{_bindir}/iceboxadmin
%{_mandir}/man1/iceboxadmin.1*
%{_bindir}/icestormadmin
Expand All @@ -602,7 +603,7 @@ exit 0
%files -n %{?nameprefix}icegrid
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{_bindir}/icegridnode
%{_mandir}/man1/icegridnode.1*
%{_bindir}/icegridregistry
Expand Down Expand Up @@ -653,7 +654,7 @@ exit 0
%files -n %{?nameprefix}glacier2
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{_bindir}/glacier2router
%{_mandir}/man1/glacier2router.1*
%attr(644,root,root) %{_unitdir}/glacier2router.service
Expand Down Expand Up @@ -692,7 +693,7 @@ exit 0
%files -n %{?nameprefix}icebridge
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{_bindir}/icebridge
%{_mandir}/man1/icebridge.1*
%post -n %{?nameprefix}icebridge -p /sbin/ldconfig
Expand All @@ -706,7 +707,7 @@ exit 0
%files -n php-%{?nameprefix}ice
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{phpdir}
%{phplibdir}/ice.so
%config(noreplace) %{_sysconfdir}/php.d/ice.ini
Expand All @@ -717,7 +718,7 @@ exit 0
%files -n python3-%{?nameprefix}ice
%license LICENSE
%license ICE_LICENSE
%doc %{rpmbuildfiles}/README
%doc packaging/rpm/README
%{python3_sitearch}/*

%endif #%{_host_cpu}
Expand Down

0 comments on commit 6639f7e

Please sign in to comment.