Skip to content

Devel-env is aimed to set the development environment up on Linux server WITHOUT root privileges.

Notifications You must be signed in to change notification settings

adonis0147/devel-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devel-env

Devel-env is aimed to set the development environment up on Linux server WITHOUT root privileges.

It provides the following stuffs:

  1. Portable GCC toolchain (GCC 14.2 + GLIBC 2.39) - relocated by patchelf
  2. Toolset - built from source manually

TIPS: The GCC toolchain can be used standalone.


Portable GCC Toolchain

Prerequisites

  • Linux (x86_64 or aarch64)
  • Bash
  • XZ

Use Prebuilt GCC Toolchain

  1. Go to the release page to download the all-in-one script or use the following command.
curl -LO "$(curl -L https://api.github.com/repos/adonis0147/devel-env/releases/latest |
    sed -n 's|[[:space:]]*"browser_download_url": "\(.*\)\"|\1|p' |
    grep "$(uname -m | sed 's/arm64/aarch64/')")"
  1. Run the all-in-one script to set the portable GCC toolchain up.
# The toolchain will be extracted to /some/path/compiler
bash "install_toolchain_$(uname -m | sed 's/arm64/aarch64/').sh" /some/path
  1. Optionally, export the PATH environment variable to access the toolchain.
export PATH="/some/path/compiler/bin:${PATH}"
  1. Now gcc --version should work!

Examples

Alpine Linux

$ docker run -it alpine:latest


# In container

apk add bash libc6-compat

bash install_toolchain_x86_64.sh /root

export PATH="/root/compiler/bin:${PATH}"

Ubuntu

apt install xz-utils

bash install_toolchain_x86_64.sh /root

export PATH="/root/compiler/bin:${PATH}"

CentOS

bash install_toolchain_x86_64.sh /root

export PATH="/root/compiler/bin:${PATH}"

Build GCC Toolchain Yourself (Advanced)

  1. Build the docker image. CAVEAT: It may take TOO TOO LONG time to finish on ARM64 platform (e.g. macOS with Apple Silicon). It is recommended to download it from the release page.
cd toolchain
docker build --platform=linux/x86-64 -t toolchain .
  1. Generate the toolchain.
mkdir output
docker run --platform=linux/x86-64 --rm --mount type=bind,source="$(pwd)/output",target=/output toolchain
  1. Usage
# Copy the output/install_toolchain.sh to the target server and run the following commands.

bash install_toolchain.sh /some/path

export PATH="/some/path/compiler/bin:${PATH}"

Optional Toolset

The project provides scripts to install some softwares built by the GCC toolchain.

Prerequisites

  • Linux (x86_64 or aarch64)
  • Bash
  • XZ
  • install_toolchain.sh (provided)

Usage

git clone https://github.com/adonis0147/devel-env

cd devel-env

# Download packages
devel/downloads/download_packages.sh

# Download the latest GCC toolchain
curl -L "$(curl -L https://api.github.com/repos/adonis0147/devel-env/releases/latest |
    sed -n 's|[[:space:]]*"browser_download_url": "\(.*\)\"|\1|p' |
    grep "$(uname -m | sed 's/arm64/aarch64/')")" -o devel/scripts/install_toolchain.sh
chmod a+x devel/scripts/install_toolchain.sh

# Optional: DEVEL_HOME_PATH="${HOME}/.local/share/devel" by default.
# The toolchain will be extracted to /some/path/compiler and the softwares will be installed in /some/path
export DEVEL_HOME_PATH=/some/path

devel/scripts/install.sh

# Set some environment variables and useful functions up
source devel/scripts/env_vars.sh

Examples

Alpine Linux

$ docker run -it alpine:latest


# In container

apk add bash libc6-compat git curl

git clone https://github.com/adonis0147/devel-env

cd devel-env

devel/downloads/download_packages.sh

curl -L "$(curl -L https://api.github.com/repos/adonis0147/devel-env/releases/latest |
    sed -n 's|[[:space:]]*"browser_download_url": "\(.*\)\"|\1|p' |
    grep "$(uname -m | sed 's/arm64/aarch64/')")" -o devel/scripts/install_toolchain.sh
chmod a+x devel/scripts/install_toolchain.sh

# The toolchain will be extracted to /root/devel/compiler and the softwares will be installed in /root/devel
export DEVEL_HOME_PATH=/root/devel

devel/scripts/install.sh

source devel/scripts/env_vars.sh

Ubuntu

apt install xz-utils git curl

...

CentOS

yum install git curl

...

About

Devel-env is aimed to set the development environment up on Linux server WITHOUT root privileges.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published