Skip to content

Commit

Permalink
Revert "simplify dev setup scripts (#2)"
Browse files Browse the repository at this point in the history
This reverts commit d2a2fc9.
  • Loading branch information
nkysg committed Mar 2, 2023
1 parent 9b54576 commit bcd7b1b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,4 @@ Contributions in the following are welcome:
3. Add a spec test [spectests](../spectests), such as: `test_my_module.move`.
4. Run the spec test `mpm spectest test_my_module.move `

If you are not sure that the module belongs to starcoin-framework, please submit it to [starcoin-framework-commons](https://github.com/starcoinorg/starcoin-framework-commons) first.

You can view our [Code of Conduct](./CODE_OF_CONDUCT.md).
44 changes: 44 additions & 0 deletions scripts/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,29 @@ function update_path_and_profile {
fi
}

function install_build_essentials {
PACKAGE_MANAGER=$1
#Differently named packages for pkg-config
if [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then
install_pkg build-essential "$PACKAGE_MANAGER"
fi
if [[ "$PACKAGE_MANAGER" == "pacman" ]]; then
install_pkg base-devel "$PACKAGE_MANAGER"
fi
if [[ "$PACKAGE_MANAGER" == "apk" ]]; then
install_pkg alpine-sdk "$PACKAGE_MANAGER"
install_pkg coreutils "$PACKAGE_MANAGER"
fi
if [[ "$PACKAGE_MANAGER" == "yum" ]] || [[ "$PACKAGE_MANAGER" == "dnf" ]]; then
install_pkg gcc "$PACKAGE_MANAGER"
install_pkg gcc-c++ "$PACKAGE_MANAGER"
install_pkg make "$PACKAGE_MANAGER"
fi
#if [[ "$PACKAGE_MANAGER" == "brew" ]]; then
# install_pkg pkgconfig "$PACKAGE_MANAGER"
#fi
}

function install_rustup {
echo installing rust.
BATCH_MODE=$1
Expand Down Expand Up @@ -138,6 +161,21 @@ function install_pkg {
fi
}

function install_pkg_config {
PACKAGE_MANAGER=$1
#Differently named packages for pkg-config
if [[ "$PACKAGE_MANAGER" == "apt-get" ]] || [[ "$PACKAGE_MANAGER" == "dnf" ]]; then
install_pkg pkg-config "$PACKAGE_MANAGER"
fi
if [[ "$PACKAGE_MANAGER" == "pacman" ]]; then
install_pkg pkgconf "$PACKAGE_MANAGER"
fi
if [[ "$PACKAGE_MANAGER" == "brew" ]] || [[ "$PACKAGE_MANAGER" == "apk" ]] || [[ "$PACKAGE_MANAGER" == "yum" ]]; then
install_pkg pkgconfig "$PACKAGE_MANAGER"
fi
}


function install_toolchain {
version=$1
FOUND=$(rustup show | grep -c "$version" || true )
Expand Down Expand Up @@ -437,6 +475,12 @@ install_pkg curl "$PACKAGE_MANAGER"


if [[ "$INSTALL_BUILD_TOOLS" == "true" ]]; then
install_build_essentials "$PACKAGE_MANAGER"
install_pkg cmake "$PACKAGE_MANAGER"
install_pkg clang "$PACKAGE_MANAGER"
install_pkg llvm "$PACKAGE_MANAGER"

install_pkg_config "$PACKAGE_MANAGER"

install_rustup "$BATCH_MODE"
# Add all the components that we need
Expand Down

0 comments on commit bcd7b1b

Please sign in to comment.