Last active
December 1, 2023 17:57
-
-
Save eggplants/f26827d55d39216f62ef899d67d541e1 to your computer and use it in GitHub Desktop.
Install Apache Flex 4.16.1 on Ubuntu 23.10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
flex_home="$HOME/.flex" | |
if [[ -v FLEX_HOME && "$FLEX_HOME" != "$flex_home" ]]; then | |
echo '"$FLEX_HOME" (global) != "$flex_home": '"\"${FLEX_HOME}\" and \"${flex_home}\"" >& 2 | |
exit 1 | |
fi | |
if ! command -v curl &>/dev/null; then | |
sudo apt install curl --no-install-recommends -y | |
fi | |
if [[ -d "$flex_home" ]]; then | |
echo "Already installed: ${flex_home}" >& 2 | |
exit 1 | |
fi | |
mkdir -p "$flex_home" | |
curl -fL 'https://dlcdn.apache.org/flex/4.16.1/binaries/apache-flex-sdk-4.16.1-bin.tar.gz' | tar zx -C "$flex_home" --strip-components 1 | |
mkdir -p "${flex_home}/frameworks/libs/player/32.0" | |
curl -sfL 'https://fpdownload.macromedia.com/get/flashplayer/updaters/32/playerglobal32_0.swc' -o "${flex_home}/frameworks/libs/player/32.0/playerglobal.swc" | |
mkdir -p "$HOME/.local/bin" | |
curl -sfL 'https://github.com/ruffle-rs/ruffle/releases/download/nightly-2023-12-01/ruffle-nightly-2023_12_01-linux-x86_64.tar.gz' | tar zx -C "$HOME/.local/bin" ruffle | |
sed '/<target-player>/s/27\.0/32.0/' "${flex_home}/frameworks/flex-config.xml" > _ | |
mv _ "${flex_home}/frameworks/flex-config.xml" | |
export FLEX_HOME="$flex_home" | |
export PATH="$PATH:${FLEX_HOME}/bin" | |
export PLAYERGLOBAL_HOME="$FLEX_HOME/frameworks/libs/player" | |
cat <<EOS | |
Done! | |
You should add below commands into your *shrc file. | |
echo 'export FLEX_HOME="$flex_home"' >> ~/.*shrc | |
EOS | |
cat <<'EOS' | |
echo 'export PATH="$PATH:$FLEX_HOME/bin"' >> ~/.*shrc | |
echo 'export PLAYERGLOBAL_HOME="$FLEX_HOME/frameworks/libs/player"' >> ~/.*shrc | |
EOS |
Author
eggplants
commented
Dec 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment