2013-09-16 10:11:46 +08:00
|
|
|
#!/bin/bash
|
2013-08-29 18:10:12 +08:00
|
|
|
|
2016-06-30 02:28:55 +08:00
|
|
|
GLFW_VERSION="3.2"
|
|
|
|
GLFW_SOURCE="https://github.com/glfw/glfw/releases/download/${GLFW_VERSION}/glfw-${GLFW_VERSION}.zip"
|
|
|
|
GLFW_ZIP="glfw-${GLFW_VERSION}.zip"
|
2013-08-29 18:10:12 +08:00
|
|
|
GLFW_INSTALL="glfw_install"
|
|
|
|
GLFW_SRCDIR="glfw-${GLFW_VERSION}"
|
|
|
|
GLFW_DESTDIR="glfw_dest"
|
|
|
|
|
|
|
|
install_glfw_dep()
|
|
|
|
{
|
|
|
|
sudo apt-get install xorg-dev
|
|
|
|
sudo apt-get install libglu1-mesa-dev
|
|
|
|
sudo apt-get install cmake
|
2016-06-30 02:28:55 +08:00
|
|
|
sudo apt-get install wget
|
2013-08-29 18:10:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
clean_tmp_file()
|
|
|
|
{
|
|
|
|
rm -rf ${GLFW_INSTALL}
|
|
|
|
}
|
|
|
|
|
|
|
|
make_and_install()
|
|
|
|
{
|
|
|
|
mkdir $GLFW_DESTDIR
|
|
|
|
cd $GLFW_DESTDIR
|
|
|
|
cmake "../${GLFW_SRCDIR}" -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON
|
|
|
|
make
|
|
|
|
sudo make install
|
2013-09-16 10:11:46 +08:00
|
|
|
sudo ldconfig
|
2013-08-29 18:10:12 +08:00
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
2013-09-17 23:26:54 +08:00
|
|
|
install_glfw()
|
|
|
|
{
|
|
|
|
echo glw_version ${GLFW_VERSION}
|
|
|
|
echo glfw_download_size ${GLFW_SOURCE}
|
|
|
|
echo glfw_zip_file ${GLFW_ZIP}
|
|
|
|
install_glfw_dep
|
|
|
|
mkdir $GLFW_INSTALL
|
|
|
|
cd $GLFW_INSTALL
|
2016-06-30 02:28:55 +08:00
|
|
|
wget --passive -c -p -O $GLFW_ZIP $GLFW_SOURCE
|
|
|
|
unzip ${GLFW_ZIP}
|
2013-09-17 23:26:54 +08:00
|
|
|
make_and_install
|
|
|
|
cd ..
|
|
|
|
clean_tmp_file
|
|
|
|
}
|
|
|
|
|
2014-01-23 17:07:28 +08:00
|
|
|
|
|
|
|
install_glfw
|
|
|
|
|