Repository: spack/spack

Issue:
Installation issue: glib
---
`spack install glib` returns the following error:

```console
$ spack --debug install glib
[...]
==> Installing glib
==> '/cfs/gfs1/home/users/aryczkowski/tmp/spack/opt/spack/linux-scientific6-x86_64/gcc-8.1.0/python-2.7.15-75foq665ozrtk3pkbplymv74jik4gb4v/bin/python2.7' '-c' 'from distutils.sysconfig import get_config_var; print get_config_var('"'"'prefix'"'"')'
==> '/cfs/gfs1/home/users/aryczkowski/tmp/spack/opt/spack/linux-scientific6-x86_64/gcc-8.1.0/python-2.7.15-75foq665ozrtk3pkbplymv74jik4gb4v/bin/python2.7' '-c' 'from distutils.sysconfig import get_config_var; print get_config_var('"'"'prefix'"'"')'
==> Reading config file /home/users/aryczkowski/.spack/linux/mirrors.yaml
==> Using cached archive: /cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/cache/glib/glib-2.56.1.tar.xz
==> Staging archive: /cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/stage/glib-2.56.1-tcwirnxjk4q2jyso3247ggbjk3qyrw3x/glib-2.56.1.tar.xz
==> '/bin/tar' '-xf' '/cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/stage/glib-2.56.1-tcwirnxjk4q2jyso3247ggbjk3qyrw3x/glib-2.56.1.tar.xz'
==> Created stage in /cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/stage/glib-2.56.1-tcwirnxjk4q2jyso3247ggbjk3qyrw3x
==> '/usr/bin/patch' '-s' '-p' '1' '-i' '/cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch' '-d' '.'
==> Applied patch no-Werror=format-security.patch
==> Building glib [AutotoolsPackage]
==> WRITE LOCK: /cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/stage/.lock[1305062044753357495:1] [Acquiring]
==> WRITE LOCK: /cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/stage/.lock[1305062044753357495:1] [Acquired]
==> WRITE LOCK: /cfs/gfs1/home/users/aryczkowski/tmp/spack/opt/spack/.spack-db/prefix_lock[5500659154469753042:1] [Acquiring]
==> WRITE LOCK: /cfs/gfs1/home/users/aryczkowski/tmp/spack/opt/spack/.spack-db/prefix_lock[5500659154469753042:1] [Acquired]
==> Executing phase: 'autoreconf'
==> Executing phase: 'configure'
==> Executing phase: 'build'
==> WRITE LOCK: /cfs/gfs1/home/users/aryczkowski/tmp/spack/opt/spack/.spack-db/prefix_lock[5500659154469753042:1] [Released]
==> WRITE LOCK: /cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/stage/.lock[1305062044753357495:1] [Released]
==> Error: ProcessError: Command exited with status 2:
    'make' '-j4'

7 errors found in build log:
     818      CC       libgio_2_0_la-gemblemedicon.lo
     819      CC       libgio_2_0_la-gfile.lo
     820      CC       libgio_2_0_la-gfileattribute.lo
     821      CC       libgio_2_0_la-gfileenumerator.lo
     822      CC       libgio_2_0_la-gfileicon.lo
     823    gfile.c: In function ‘splice_stream_with_progress’:
  >> 824    gfile.c:3017:35: error: ‘F_SETPIPE_SZ’ undeclared (first use in this function); did you mean ‘F_SETLEASE’?
     825       buffer_size = fcntl (buffer[1], F_SETPIPE_SZ, 1024 * 1024);
     826                                       ^~~~~~~~~~~~
     827                                       F_SETLEASE
     828    gfile.c:3017:35: note: each undeclared identifier is reported only once for each function it appears in
  >> 829    gfile.c:3021:39: error: ‘F_GETPIPE_SZ’ undeclared (first use in this function); did you mean ‘F_GETLEASE’?
     830           buffer_size = fcntl (buffer[1], F_GETPIPE_SZ);
     831                                           ^~~~~~~~~~~~
     832                                           F_GETLEASE
  >> 833    make[4]: *** [libgio_2_0_la-gfile.lo] Error 1
     834    make[4]: *** Waiting for unfinished jobs....
     835    make[4]: Leaving directory `/tmp/aryczkowski/spack-stage/spack-stage-_FIR68/glib-2.56.1/gio'
  >> 836    make[3]: *** [all-recursive] Error 1
     837    make[3]: Leaving directory `/tmp/aryczkowski/spack-stage/spack-stage-_FIR68/glib-2.56.1/gio'
  >> 838    make[2]: *** [all] Error 2
     839    make[2]: Leaving directory `/tmp/aryczkowski/spack-stage/spack-stage-_FIR68/glib-2.56.1/gio'
  >> 840    make[1]: *** [all-recursive] Error 1
     841    make[1]: Leaving directory `/tmp/aryczkowski/spack-stage/spack-stage-_FIR68/glib-2.56.1'
  >> 842    make: *** [all] Error 2

See build log for details:
  /cfs/gfs1/home/users/aryczkowski/tmp/spack/var/spack/stage/glib-2.56.1-tcwirnxjk4q2jyso3247ggbjk3qyrw3x/glib-2.56.1/spack-build.out
Traceback (most recent call last):
  File "/cfs/gfs1/home/users/aryczkowski/tmp/spack/lib/spack/spack/build_environment.py", line 708, in child_process
    return_value = function()
  File "/cfs/gfs1/home/users/aryczkowski/tmp/spack/lib/spack/spack/package.py", line 1498, in build_process
    phase(self.spec, self.prefix)
  File "/cfs/gfs1/home/users/aryczkowski/tmp/spack/lib/spack/spack/package.py", line 119, in phase_wrapper
    phase(spec, prefix)
  File "/cfs/gfs1/home/users/aryczkowski/tmp/spack/lib/spack/spack/build_systems/autotools.py", line 282, in build
    inspect.getmodule(self).make(*self.build_targets)
  File "/cfs/gfs1/home/users/aryczkowski/tmp/spack/lib/spack/spack/build_environment.py", line 134, in __call__
    return super(MakeExecutable, self).__call__(*args, **kwargs)
  File "/cfs/gfs1/home/users/aryczkowski/tmp/spack/lib/spack/spack/util/executable.py", line 183, in __call__
    proc.returncode, cmd_line)
ProcessError: Command exited with status 2:
    'make' '-j4'
```

### Platform and user environment

Please report your OS here:
```commandline
$ uname -a 
Linux dn 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 08:24:23 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -d
Description:	Scientific Linux release 6.4 (Carbon)
``` 



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py
--- a/var/spack/repos/builtin/packages/glib/package.py
+++ b/var/spack/repos/builtin/packages/glib/package.py
@@ -40,6 +40,7 @@ class Glib(AutotoolsPackage):
     homepage = "https://developer.gnome.org/glib/"
     url      = "https://ftp.gnome.org/pub/gnome/sources/glib/2.53/glib-2.53.1.tar.xz"
 
+    version('2.56.2', 'd64abd16813501c956c4e123ae79f47f1b58de573df9fdd3b0795f1e2c1aa789')
     version('2.56.1', '40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d')
     version('2.56.0', 'f2b59392f2fb514bbe7791dda0c36da5')
     version('2.55.1', '9cbb6b3c7e75ba75575588497c7707b6')
@@ -73,9 +74,9 @@ class Glib(AutotoolsPackage):
     # around a legitimate usage.
     patch('no-Werror=format-security.patch')
     # Patch to prevent compiler errors in kernels older than 2.6.35
-    patch('old-kernels.patch', when='@2.56: os=rhel6')
-    patch('old-kernels.patch', when='@2.56: os=centos6')
-    patch('old-kernels.patch', when='@2.56: os=sl6')
+    patch('old-kernels.patch', when='@2.56.0:2.56.1 os=rhel6')
+    patch('old-kernels.patch', when='@2.56.0:2.56.1 os=centos6')
+    patch('old-kernels.patch', when='@2.56.0:2.56.1 os=scientific6')
 
     def url_for_version(self, version):
         """Handle glib's version-based custom URLs."""


Test patch: