1 # Build recipe for freeglut.
3 # Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
25 pkgcategory=xorg_extra
27 tarname=${program}-${version}.tar.gz
30 fetch=https://downloads.sourceforge.net/freeglut/$tarname
33 The Free OpenGL Utility Toolkit.
35 FreeGLUT is a free-software/open-source alternative to the OpenGL
36 Utility Toolkit (GLUT) library. GLUT was originally written by
37 Mark Kilgard to support the sample programs in the second edition
38 OpenGL 'RedBook'. Since then, GLUT has been used in a wide variety of
39 practical applications because it is simple, widely available and
43 homepage=https://freeglut.sourceforge.net
44 license="MIT X Consortium"
46 # Source documentation
47 docs="AUTHORS COPYING ChangeLog README.md"
48 docsdir="${docdir}/${program}-${version}"
52 unpack "${tardir}/$tarname"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
64 -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS" \
65 -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS" \
66 -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
67 -DCMAKE_INSTALL_PREFIX=/usr \
68 -DCMAKE_INSTALL_LIBDIR=lib${libSuffix} \
69 -DCMAKE_INSTALL_MANDIR=$mandir \
70 -DCMAKE_INSTALL_DOCDIR=$docsdir \
71 -DCMAKE_BUILD_TYPE=Release \
72 -DCMAKE_VERBOSE_MAKEFILE=ON \
73 -DFREEGLUT_BUILD_DEMOS=OFF \
74 -DFREEGLUT_BUILD_STATIC_LIBS=OFF \
78 DESTDIR="$destdir" ninja -j${jobs} install
82 # Compress and link man pages (if needed)
83 if test -d "${destdir}/$mandir"
86 cd "${destdir}/$mandir"
87 find . -type f -exec lzip -9 {} +
88 find . -type l | while read -r file
90 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
97 mkdir -p "${destdir}/$docsdir"
98 cp -p $docs "${destdir}/$docsdir"