forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glfw.sh
44 lines (41 loc) · 1.53 KB
/
glfw.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package: GLFW
version: "3.3.2"
tag: 3.3.2
source: https://github.com/glfw/glfw.git
build_requires:
- CMake
- "GCC-Toolchain:(?!osx)"
prefer_system: "(?!osx)"
prefer_system_check: |
printf "#if ! __has_include(<GLFW/glfw3.h>)\n#error \"GLFW not found, checking if we can build it.\"\n#endif\n" | cc -xc++ -std=c++17 - -c -o /dev/null
---
# FIXME: --debug-output somehow needed to get CMake 3.18.2 to work
cmake --debug-output $SOURCEDIR -DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
${CMAKE_GENERATOR:+-G "$CMAKE_GENERATOR"} \
-DBUILD_SHARED_LIBS=ON \
-DGLFW_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_LIBDIR=lib \
-DGLFW_BUILD_TESTS=OFF \
-DGLFW_BUILD_DOCS=OFF
cmake --build . -- ${JOBS+-j $JOBS} install
# Somehow the id is lib/libglfw.3.3.dylib rather than simply libglfw.3.3.dylib
case $ARCHITECTURE in
osx*) install_name_tool -id $INSTALLROOT/lib/libglfw.dylib $INSTALLROOT/lib/libglfw.3.*.dylib ;;
esac
# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
cat >"$MODULEFILE" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0
set GLFW_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path LD_LIBRARY_PATH \$GLFW_ROOT/lib
EoF