switched to mono continued fork
This commit is contained in:
73
tasks/download_mono_from_nuget.sh
Normal file
73
tasks/download_mono_from_nuget.sh
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
package_version="$TASK_ARGS"
|
||||
if [ -z "$package_version" ]; then
|
||||
package_version="8.0.15"
|
||||
myprint "${YELLOW}You can choose package version manually: cbuild get_mono_files_from=x.y.z"
|
||||
fi
|
||||
myprint "${BLUE}package_version: ${CYAN}$package_version"
|
||||
|
||||
if [ -z $ARCH ]; then
|
||||
ARCH='x64'
|
||||
fi
|
||||
|
||||
case "$OS" in
|
||||
LINUX)
|
||||
package_platform="linux-$ARCH"
|
||||
;;
|
||||
WINDOWS)
|
||||
package_platform="win-$ARCH"
|
||||
;;
|
||||
esac
|
||||
|
||||
package_name="Microsoft.NETCore.App.Runtime.Mono.$package_platform"
|
||||
package_dir="$package_name.$package_version"
|
||||
package_file="$package_name.$package_version.nupkg"
|
||||
package_url="https://www.nuget.org/api/v2/package/$package_name/$package_version"
|
||||
|
||||
mkdir -p "$OBJDIR/downloads"
|
||||
myprint "${BLUE}downloading nuget package: ${WHITE}$package_name ${BLUE}to $OBJDIR/downloads"
|
||||
cd "$OBJDIR/downloads"
|
||||
wget -q $package_url -O $package_file
|
||||
clean_dir $package_dir
|
||||
cd $package_dir
|
||||
|
||||
myprint "${BLUE}extracting nuget package"
|
||||
unzip -oq "../$package_file"
|
||||
|
||||
# copy headers
|
||||
myprint "${BLUE}copying headers"
|
||||
mkdir -p "../../../dependencies/include"
|
||||
delete_dir "../../../dependencies/include/mono"
|
||||
cp -r "runtimes/$package_platform/native/include/mono-2.0/mono" "../../../dependencies/include/"
|
||||
|
||||
precompiled_dir="../../../dependencies/precompiled/$OS-$ARCH"
|
||||
mkdir -p "$precompiled_dir"
|
||||
clean_dir "$precompiled_dir/mono-libs"
|
||||
|
||||
# copy mono native libraries
|
||||
myprint "${BLUE}copying mono native libraries"
|
||||
shared_libs=$(find "runtimes/$package_platform/native" -maxdepth 1 \( -not -name "System.Private.CoreLib.dll" -a \( -name '*.so*' -o -name '*.dll' \) \) -type f)
|
||||
if [ -z "$shared_libs" ]; then
|
||||
error "can't find mono shared libraries"
|
||||
fi
|
||||
for l in $shared_libs ; do
|
||||
cp -v "$l" "$precompiled_dir"
|
||||
done
|
||||
|
||||
# copy mono c# libraries
|
||||
myprint "${BLUE}copying mono managed libraries"
|
||||
managed_libraries="runtimes/$package_platform/native/System.Private.CoreLib.dll"
|
||||
|
||||
_subdirs=(runtimes/$package_platform/lib/*)
|
||||
_managed_lib_dir="${_subdirs[0]}"
|
||||
for l in $(find $_managed_lib_dir -type f); do
|
||||
managed_libraries+=" $l"
|
||||
done
|
||||
|
||||
for l in $managed_libraries; do
|
||||
cp -v "$l" "$precompiled_dir/mono-libs"
|
||||
done
|
||||
|
||||
myprint "${GREEN}mono files have been copied successfully!"
|
||||
cd ../../..
|
||||
clean_dir "$OBJDIR/downloads"
|
||||
Reference in New Issue
Block a user