Skip to content

Instantly share code, notes, and snippets.

@Buom01
Last active May 27, 2020 17:31
Show Gist options
  • Save Buom01/c8e332bc56e9076c29645af8aa532875 to your computer and use it in GitHub Desktop.
Save Buom01/c8e332bc56e9076c29645af8aa532875 to your computer and use it in GitHub Desktop.
#!/bin/sh
# One-paste-install:
# sh -c "$(curl -fsSL https://gist.githubusercontent.com/Buom01/c8e332bc56e9076c29645af8aa532875/raw/minilibx-linux-installer.sh)"
function install_failed()
{
echo "Installation failed!"
exit 1
}
cd /tmp
if [ -d minilibx-linux ]; then
rm -Rf minilibx-linux
fi
git clone https://github.com/42Paris/minilibx-linux || install_failed
cd minilibx-linux
make re || install_failed
echo "Root access may be required ..."
sudo -s -- <<EOF
cp libmlx.a /usr/lib
cp mlx.h /usr/include
mkdir -p /usr/local/man/man1
cp -R man/man1/* /usr/local/man/man1
# Gzipping may be required
gzip --force /usr/local/man/man1/mlx.1
gzip --force /usr/local/man/man1/mlx_loop.1
gzip --force /usr/local/man/man1/mlx_new_image.1
gzip --force /usr/local/man/man1/mlx_new_window.1
gzip --force /usr/local/man/man1/mlx_pixel_put.1
echo "MiniLibX were successfully installed/updated!"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment