Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

install csfml on linux

#!/usr/bin/env bash

set -e

SFML_VERSION='2.2'
GLEW_VERSION='1.10.0'

get_file()
{
	local file_to_get="$1"
	local mirror="$2"
	local filename=$(echo $file_to_get | sed -e 's/.*///')

	if ! [[ -f $filename ]]; then
		if [[ -z $mirror ]]; then
			wget "$file_to_get"
		else
			wget "$file_to_get" || wget "$mirror"
		fi
	else
		echo "-------- $filename already exists locally, skipping..."
	fi

	extract_archive $filename
}

extract_archive()
{
	local file_to_extract="$1"
	echo "extracting $file_to_extract..."
	tar -xf $file_to_extract
}

cd /tmp
get_file "https://"{www,mirror2}".sfml-dev.org/files/CSFML-$SFML_VERSION-linux-gcc-64-bit.tar.bz2"
get_file "https://"{www,mirror2}".sfml-dev.org/files/SFML-$SFML_VERSION-linux-gcc-64-bit.tar.gz"
get_file "https://sourceforge.net/projects/glew/files/glew/$GLEW_VERSION/glew-$GLEW_VERSION.tgz"

sudo apt install libx11-dev libxmu-dev libxi-dev libgl-dev libopenal-dev
cd /tmp/"glew-$GLEW_VERSION"
make

sudo rm -rfv /usr/local/include/{SFML,GL} /usr/local/lib/lib{*sfml*,GLEW*}
sudo cp -vr /tmp/{"CSFML-$SFML_VERSION","SFML-$SFML_VERSION","glew-$GLEW_VERSION"}/{include,lib} /usr/local
sudo rm -v /usr/local/lib/libcsfml*".$SFML_VERSION" # Avoid ldconfig warning on identical files with different filenames (/sbin/ldconfig.real: /usr/local/lib/libcsfml-xxx.so.2.2 is not a symbolic link)
sudo ldconfig

echo -e "

"
echo "CSFML $SFML_VERSION has been installed"
echo "Please remember to add -lcsfml-graphics -lcsfml-audio -lcsfml-window -lcsfml-system -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system in your Makefile"
echo
echo "2017 - Paul Laffitte - Epitech Montpellier Promo 2021"
Comment

PREVIOUS NEXT
Code Example
Shell :: ansible inventory root password 
Shell :: wget mac robot 
Shell :: how to stop nohup process 
Shell :: git merge dev to local branch 
Shell :: how to git push in jenkins pipeline 
Shell :: Save changes in a new branch git 
Shell :: install minikube chocolatey 
Shell :: how to push to new branch in github 
Shell :: how to clone a private repo 
Shell :: nuxt 3 install 
Shell :: how to merge git 
Shell :: mkdir -p vs mkdir 
Shell :: add group docker compose 
Shell :: bash while 
Shell :: bash xargs 
Shell :: cli edit file 
Shell :: Files by size 
Shell :: kdiff3 download linux 
Shell :: store pass git 
Shell :: visual studio export installed nuget pacjkages 
Shell :: installing font awesome brand icons 
Shell :: gitlab gradle project 
Shell :: clone all github repos 
Shell :: git recover deleted file 
Shell :: materila ui 
Shell :: terminal show running processes tree mac os 
Shell :: exit branch git 
Shell :: echo to add line to file 
Shell :: how to install and connect to ftp on ubuntu 18 
Shell :: see file from previous commit git 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =