File tree Expand file tree Collapse file tree 3 files changed +38
-31
lines changed
src/linux/Packaging.Linux Expand file tree Collapse file tree 3 files changed +38
-31
lines changed Original file line number Diff line number Diff line change @@ -49,28 +49,10 @@ if [ ! -d "$INSTALL_PREFIX" ]; then
4949 mkdir -p " $INSTALL_PREFIX "
5050fi
5151
52- # Fall back to host architecture if no explicit runtime is given.
53- if test -z " $RUNTIME " ; then
54- HOST_ARCH=" ` dpkg-architecture -q DEB_HOST_ARCH` "
55-
56- case $HOST_ARCH in
57- amd64)
58- RUNTIME=" linux-x64"
59- ;;
60- arm64)
61- RUNTIME=" linux-arm64"
62- ;;
63- armhf)
64- RUNTIME=" linux-arm"
65- ;;
66- * )
67- die " Could not determine host architecture!"
68- ;;
69- esac
52+ if [ ! -z " $RUNTIME " ]; then
53+ echo " Building for runtime ${RUNTIME} "
7054fi
7155
72- echo " Building for runtime ${RUNTIME} "
73-
7456# Perform pre-execution checks
7557CONFIGURATION=" ${CONFIGURATION:= Debug} "
7658if [ -z " $VERSION " ]; then
Original file line number Diff line number Diff line change @@ -44,10 +44,6 @@ PROJ_OUT="$OUT/linux/Packaging.Linux"
4444# Build parameters
4545FRAMEWORK=net8.0
4646
47- if [ -z " $RUNTIME " ]; then
48- die " --runtime was not set"
49- fi
50-
5147# Perform pre-execution checks
5248CONFIGURATION=" ${CONFIGURATION:= Debug} "
5349
7672
7773# Publish core application executables
7874echo " Publishing core application..."
79- $DOTNET_ROOT /dotnet publish " $GCM_SRC " \
80- --configuration=" $CONFIGURATION " \
81- --framework=" $FRAMEWORK " \
82- --runtime=" $RUNTIME " \
83- --self-contained \
84- -p:PublishSingleFile=true \
85- --output=" $( make_absolute " $PAYLOAD " ) " || exit 1
75+ if [ -z " $RUNTIME " ]; then
76+ $DOTNET_ROOT /dotnet publish " $GCM_SRC " \
77+ --configuration=" $CONFIGURATION " \
78+ --framework=" $FRAMEWORK " \
79+ --self-contained \
80+ -p:PublishSingleFile=true \
81+ --output=" $( make_absolute " $PAYLOAD " ) " || exit 1
82+ else
83+ $DOTNET_ROOT /dotnet publish " $GCM_SRC " \
84+ --configuration=" $CONFIGURATION " \
85+ --framework=" $FRAMEWORK " \
86+ --runtime=" $RUNTIME " \
87+ --self-contained \
88+ -p:PublishSingleFile=true \
89+ --output=" $( make_absolute " $PAYLOAD " ) " || exit 1
90+ fi
8691
8792# Collect symbols
8893echo " Collecting managed symbols..."
Original file line number Diff line number Diff line change @@ -100,6 +100,26 @@ INSTALL_TO="$DEBROOT/usr/local/share/gcm-core/"
100100LINK_TO=" $DEBROOT /usr/local/bin/"
101101mkdir -p " $DEBROOT /DEBIAN" " $INSTALL_TO " " $LINK_TO " || exit 1
102102
103+ # Fall back to host architecture if no explicit runtime is given.
104+ if test -z " $RUNTIME " ; then
105+ HOST_ARCH=" ` dpkg-architecture -q DEB_HOST_ARCH` "
106+
107+ case $HOST_ARCH in
108+ amd64)
109+ RUNTIME=" linux-x64"
110+ ;;
111+ arm64)
112+ RUNTIME=" linux-arm64"
113+ ;;
114+ armhf)
115+ RUNTIME=" linux-arm"
116+ ;;
117+ * )
118+ die " Could not determine host architecture!"
119+ ;;
120+ esac
121+ fi
122+
103123# Determine architecture for debian control file from the runtime architecture
104124case $RUNTIME in
105125 linux-x64)
You can’t perform that action at this time.
0 commit comments