Gphoto2 fails to build for x86_64-darwin

I’ve just done a fresh install of the nix package manager on a mac mini, and I’m attempting to open a nix-shell with gphoto2 but getting a make error:

Configuration (gphoto2 2.5.28):

  Build
    Source code location:          .
    Compiler:                      clang

  Features
    Use translations:              yes
    pthread support:               yes (-lpthread)
    Interactive config support:    no (http://dickey.his.com/cdk/cdk.html)
    JPEG support:                  yes
    Text preview support:          no (http://www.sourceforge.net/projects/aa-project)
    Readline support:              yes (doesn't require explicit -lncurses)

You may run "make" and "make install" now.
Running phase: buildPhase
build flags: SHELL=/nix/store/4ia9i014ajl2l2cj75wzv5m463cisn4z-bash-5.2p26/bin/bash
make  all-recursive
make[1]: Entering directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source'
Making all in gphoto-m4
make[2]: Entering directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/gphoto-m4'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/gphoto-m4'
Making all in contrib
make[2]: Entering directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/contrib'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/contrib'
Making all in doc
make[2]: Entering directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/doc'
Making all in gphoto2
make[2]: Entering directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/gphoto2'
clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-actions.o `test -f 'actions.c' || echo './'`actions.c
clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-foreach.o `test -f 'foreach.c' || echo './'`foreach.c
clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-gp-params.o `test -f 'gp-params.c' || echo './'`gp-params.c
clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-spawnve.o `test -f 'spawnve.c' || echo './'`spawnve.c
clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-main.o `test -f 'main.c' || echo './'`main.c
main.c:1218:9: error: incompatible pointer to integer conversion returning 'pthread_t' (aka 'struct _opaque_pthread_t *') from a function with result type 'unsigned int' [-Wint-conversion]
        return (tid);
               ^~~~~
main.c:1225:12: error: incompatible integer to pointer conversion initializing 'pthread_t' (aka 'struct _opaque_pthread_t *') with an expression of type 'unsigned int' [-Wint-conversion]
        pthread_t tid = id;
                  ^     ~~
2 errors generated.
make[2]: *** [Makefile:867: gphoto2-main.o] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/gphoto2'
make[1]: *** [Makefile:463: all-recursive] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source'
make: *** [Makefile:395: all] Error 2
error: builder for '/nix/store/d9iw0cn7sznxiwbk9r8y1y349m702v9k-gphoto2-2.5.28.drv' failed with exit code 2;
       last 25 log lines:
       > make[2]: Nothing to be done for 'all'.
       > make[2]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/contrib'
       > Making all in doc
       > make[2]: Entering directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/doc'
       > make[2]: Nothing to be done for 'all'.
       > make[2]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/doc'
       > Making all in gphoto2
       > make[2]: Entering directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/gphoto2'
       > clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-actions.o `test -f 'actions.c' || echo './'`actions.c
       > clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-foreach.o `test -f 'foreach.c' || echo './'`foreach.c
       > clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-gp-params.o `test -f 'gp-params.c' || echo './'`gp-params.c
       > clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-spawnve.o `test -f 'spawnve.c' || echo './'`spawnve.c
       > clang -DHAVE_CONFIG_H -I. -I..  -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I.. -I../gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include -I/nix/store/56ji3sbazfim7mw7mm9gjni2ay0pxkzg-libgphoto2-2.5.31/include/gphoto2 -DLOCALEDIR=\"/nix/store/lcd70g3c6szyj631xiav1qb6zwsl9inj-gphoto2-2.5.28/share/locale\" -D_GPHOTO2_INTERNAL_CODE    -I/nix/store/91lakc9bymgspvhjgnfrd27jcn2lpcg7-libexif-0.6.24/include  -I/nix/store/8pnz42dm7y0c6gqgq2646nfnj9rg67cb-popt-1.19/include -g -O2 -Wall -Wmissing-declarations -Wmissing-prototypes -g -c -o gphoto2-main.o `test -f 'main.c' || echo './'`main.c
       > main.c:1218:9: error: incompatible pointer to integer conversion returning 'pthread_t' (aka 'struct _opaque_pthread_t *') from a function with result type 'unsigned int' [-Wint-conversion]
       >         return (tid);
       >                ^~~~~
       > main.c:1225:12: error: incompatible integer to pointer conversion initializing 'pthread_t' (aka 'struct _opaque_pthread_t *') with an expression of type 'unsigned int' [-Wint-conversion]
       >         pthread_t tid = id;
       >                   ^     ~~
       > 2 errors generated.
       > make[2]: *** [Makefile:867: gphoto2-main.o] Error 1
       > make[2]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source/gphoto2'
       > make[1]: *** [Makefile:463: all-recursive] Error 1
       > make[1]: Leaving directory '/private/tmp/nix-build-gphoto2-2.5.28.drv-0/source'
       > make: *** [Makefile:395: all] Error 2
       For full logs, run 'nix-store -l /nix/store/d9iw0cn7sznxiwbk9r8y1y349m702v9k-gphoto2-2.5.28.drv'.

Any idea what the cause is? Should I open an issue on the nixpkgs repo?