1 # Build recipe for freeglut.
3 # Copyright (c) 2018-2021 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 README"
48 docsdir="${docdir}/${program}-${version}"
52 unpack "${tardir}/$tarname"
56 # Thanks to "Beyond Linux From Scratch"
57 patch -p1 < "${worktree}/patches/freeglut/freeglut-3.2.1-gcc10_fix-1.patch"
59 # Set sane permissions
60 chmod -R u+w,go-w,a+rX-s .
66 -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS" \
67 -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS" \
68 -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
69 -DCMAKE_INSTALL_PREFIX=/usr \
70 -DCMAKE_INSTALL_LIBDIR=lib${libSuffix} \
71 -DCMAKE_INSTALL_MANDIR=$mandir \
72 -DCMAKE_INSTALL_DOCDIR=$docsdir \
73 -DCMAKE_BUILD_TYPE=Release \
74 -DCMAKE_VERBOSE_MAKEFILE=ON \
75 -DFREEGLUT_BUILD_DEMOS=OFF \
76 -DFREEGLUT_BUILD_STATIC_LIBS=OFF \
80 DESTDIR="$destdir" ninja -j${jobs} install
84 # Compress and link man pages (if needed)
85 if test -d "${destdir}/$mandir"
88 cd "${destdir}/$mandir"
89 find . -type f -exec lzip -9 {} +
90 find . -type l | while read -r file
92 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99 mkdir -p "${destdir}/$docsdir"
100 cp -p $docs "${destdir}/$docsdir"