Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogenerate environment.fish script for SDK #503

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 22 additions & 1 deletion linux/installer/bin/install-sgx-sdk.bin.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,33 @@ fi
EOF
}

generate_environment_script_fish()
{
cat > ${SGX_PACKAGES_PATH}/${SDK_PKG_NAME}/environment.fish <<EOF
set -x SGX_SDK ${SGX_PACKAGES_PATH}/${SDK_PKG_NAME}
set -x PATH \$PATH \$SGX_SDK/$(dirname ${BIN_DIR}) \$SGX_SDK/${BIN_DIR}
set -x PKG_CONFIG_PATH \$PKG_CONFIG_PATH \$SGX_SDK/pkgconfig
if test -z "\$LD_LIBRARY_PATH"
set -x LD_LIBRARY_PATH \$SGX_SDK/sdk_libs
else
set -x LD_LIBRARY_PATH \$LD_LIBRARY_PATH \$SGX_SDK/sdk_libs
end

EOF
}

export_the_simulation
generate_environment_script
generate_environment_script_fish

echo """
Please set the environment variables with below command:
(bash) Please set the environment variables with below command:
"
echo -e "\033[32;49;1msource ${SGX_PACKAGES_PATH}/${SDK_PKG_NAME}/environment\033[39;49;0m"

echo """
(fish) Please set the environment variables with below command:
"
echo -e "\033[32;49;1msource ${SGX_PACKAGES_PATH}/${SDK_PKG_NAME}/environment.fish\033[39;49;0m"

exit 0