Merge pull request #41254 from smaret/cfitsio

cfitsio: add Darwin support

authored by Daiderd Jordan and committed by GitHub e126a8c8 a8925a21

+50 -2
+25
pkgs/development/libraries/cfitsio/darwin-curl-config.patch
··· 1 + diff -ruN cfitsio/configure cfitsio-curl-config/configure 2 + --- cfitsio/configure 2018-05-09 21:16:00.000000000 +0200 3 + +++ cfitsio-curl-config/configure 2018-05-30 13:28:58.000000000 +0200 4 + @@ -4783,13 +4783,6 @@ 5 + CURL_LIB="" 6 + CURL_INC="" 7 + # Use curl-config to get compiler & linker flags, if available. 8 + -# On Macs, prefer XCode curl-config, and reject MacPorts version 9 + -# until further notice to prevent build errors: 10 + -if test "x$EXT" = xdarwin -a -x /usr/bin/curl-config; then 11 + - CURLCONFIG="/usr/bin/curl-config" 12 + - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for curl-config... choosing /usr/bin/curl-config on Mac" >&5 13 + -$as_echo "checking for curl-config... choosing /usr/bin/curl-config on Mac" >&6; } 14 + -else 15 + # Extract the first word of "curl-config", so it can be a program name with args. 16 + set dummy curl-config; ac_word=$2 17 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 18 + @@ -4833,7 +4826,6 @@ 19 + fi 20 + fi 21 + fi 22 + -fi 23 + CURLCONFIG=$ac_cv_prog_CURLCONFIG 24 + if test -n "$CURLCONFIG"; then 25 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURLCONFIG" >&5
+21
pkgs/development/libraries/cfitsio/darwin-rpath-universal.patch
··· 1 + diff -ruN cfitsio/configure cfitsio-rpath-universal/configure 2 + --- cfitsio/configure 2018-05-09 21:16:00.000000000 +0200 3 + +++ cfitsio-rpath-universal/configure 2018-05-31 12:02:25.000000000 +0200 4 + @@ -4727,16 +4727,7 @@ 5 + SHLIB_SUFFIX=".dylib" 6 + CFITSIO_SHLIB="lib\${PACKAGE}.\${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}\${SHLIB_SUFFIX}" 7 + CFITSIO_SHLIB_SONAME="lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX}" 8 + - case $host in 9 + - *darwin[56789]*) 10 + - SHLIB_LD="$CC -dynamiclib -install_name lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}" 11 + - ;; 12 + - *) 13 + - # Build 'Universal' binaries (i386 & x86_64 architectures) and 14 + - # use rpath token on Darwin 10.x or newer: 15 + - SHLIB_LD="$CC -dynamiclib $C_UNIV_SWITCH -headerpad_max_install_names -install_name @rpath/lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}" 16 + - ;; 17 + - esac 18 + + SHLIB_LD="$CC -dynamiclib -install_name ${out}/lib/lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}" 19 + 20 + lhea_shlib_cflags="-fPIC -fno-common" 21 + ;;
+4 -2
pkgs/development/libraries/cfitsio/default.nix
··· 8 8 sha256 = "07fghxh5fl8nqk3q0dh8rvc83npnm0hisxzcj16a6r7gj5pmp40l"; 9 9 }; 10 10 11 + patches = [ ./darwin-curl-config.patch ./darwin-rpath-universal.patch ]; 12 + 11 13 # Shared-only build 12 14 buildFlags = "shared"; 13 - patchPhase = '' sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in 15 + postPatch = '' sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in 14 16 ''; 15 17 16 18 meta = with stdenv.lib; { ··· 27 29 ''; 28 30 # Permissive BSD-style license. 29 31 license = "permissive"; 30 - platforms = platforms.linux; 32 + platforms = with platforms; linux ++ darwin; 31 33 }; 32 34 }