Ticket #57: haskell-platform-2010.1.0.0-optional-opengl.patch

File haskell-platform-2010.1.0.0-optional-opengl.patch, 3.7 kB (added by j3h, 4 years ago)

Patch to add an --enable-opengl flag for the Haskell Platform Unix tarball

  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 3fba3c9..5573a4b 100644
    a b  
    9393  [ENABLE_PROFILING=YES] 
    9494) 
    9595 
     96AC_ARG_ENABLE(opengl, 
     97[AC_HELP_STRING([--enable-opengl], 
     98                [Enable building of OpenGL packages. (default=enable)])], 
     99  [case "${enableval}" in 
     100     yes) 
     101       ENABLE_OPENGL=YES 
     102       ;; 
     103     no) 
     104       ENABLE_OPENGL=NO 
     105       ;; 
     106     *) 
     107       AC_MSG_ERROR([The --enable-opengl value should be "yes" or "no"]) 
     108       ;; 
     109   esac 
     110  ], 
     111  [ENABLE_OPENGL=YES] 
     112) 
    96113 
    97114AC_ARG_ENABLE(unsupported-ghc-version, 
    98115[AC_HELP_STRING([--enable-unsupported-ghc-version], 
     
    214231 
    215232 
    216233# Check for OpenGL and GLUT 
    217 if test "$OSX" != "yes"; then 
     234if test \( "$OSX" != "yes" \) -a \( "$ENABLE_OPENGL" == "YES" \); then 
    218235  AC_CHECK_HEADER([GL/gl.h], [], 
    219236    [AC_MSG_ERROR(The OpenGL C library is required)]) 
    220237  AC_SEARCH_LIBS([glEnd], [GL opengl32], [], 
     
    231248    [AC_MSG_ERROR(The GLUT C library is required)]) 
    232249fi 
    233250 
    234  
    235251AC_SUBST([GHC]) 
    236252AC_SUBST([GHC_PKG]) 
    237253AC_SUBST([HSC2HS]) 
     
    239255 
    240256AC_SUBST([USER_INSTALL]) 
    241257AC_SUBST([ENABLE_PROFILING]) 
     258AC_SUBST([ENABLE_OPENGL]) 
    242259AC_SUBST([ALLOW_UNSUPPORTED_GHC]) 
    243260 
    244261AC_OUTPUT 
     
    260277echo '*   use --prefix= and/or --enable-user-install    ' 
    261278fi 
    262279echo '*                                                 ' 
     280if test "${ENABLE_OPENGL}" != "YES"; then 
     281echo '*   OpenGL will NOT be built                      ' 
     282echo '*                                                 ' 
     283echo '*   You will not get a haskell-platform package   ' 
     284echo '*   because some compliant codebases will not     ' 
     285echo '*   build.                                        ' 
     286echo '*                                                 ' 
     287fi 
    263288if test "${USER_INSTALL}" = "YES"; then 
    264289echo '* Now do "make" followed by "make install"        ' 
    265290else 
  • scripts/build.sh

    diff --git a/scripts/build.sh b/scripts/build.sh
    index 9534af7..863fd1d 100755
    a b  
    9999 
    100100# Actually do something! 
    101101for pkg in `cat packages/platform.packages`; do 
    102   if is_pkg_installed "${pkg}"; then 
     102  if skip_pkg "${pkg}"; then 
     103    echo "Skipping ${pkg} because of configuration." 
     104  elif is_pkg_installed "${pkg}"; then 
    103105    echo "Platform package ${pkg} is already installed. Skipping..." 
    104106  else 
    105107    echo "Building ${PKG}" 
  • scripts/common.sh

    diff --git a/scripts/common.sh b/scripts/common.sh
    index 8e1f018..1b8f6a1 100755
    a b  
    2121  PKG_VER=$1 
    2222  grep " ${PKG_VER} " packages/installed.packages > /dev/null 2>&1 
    2323} 
     24 
     25skip_pkg() { 
     26  PKG=$1 
     27  test \( "$ENABLE_OPENGL" == "NO" \) && gl_pkg $PKG 
     28} 
     29 
     30gl_pkg() { 
     31  PKG=$1 
     32  case `echo $PKG | sed 's/-[.0-9]\+$//'` in 
     33    haskell-platform|OpenGL|GLUT) 
     34      true 
     35      ;; 
     36    *) 
     37      false 
     38      ;; 
     39  esac 
     40} 
  • scripts/config.in

    diff --git a/scripts/config.in b/scripts/config.in
    index 6eeb798..e35ceb0 100644
    a b  
    1717ALLOW_UNSUPPORTED_GHC=@ALLOW_UNSUPPORTED_GHC@ 
    1818USER_INSTALL=@USER_INSTALL@ 
    1919ENABLE_PROFILING=@ENABLE_PROFILING@ 
     20ENABLE_OPENGL=@ENABLE_OPENGL@ 
  • scripts/install.sh

    diff --git a/scripts/install.sh b/scripts/install.sh
    index 6911879..0284dab 100755
    a b  
    4242 
    4343# Actually do something! 
    4444for pkg in `cat packages/platform.packages`; do 
    45   if is_pkg_installed "${pkg}"; then 
     45  if skip_pkg "${pkg}"; then 
     46    echo "Skipping ${pkg} because of configuration." 
     47  elif is_pkg_installed "${pkg}"; then 
    4648    echo "Platform package ${pkg} is already installed. Skipping..." 
    4749  else 
    4850    echo "Installing ${pkg}..."