cfitsio: 4.4.1 -> 4.6.2

- Enabled testing and utility tools
- Split outputs
- Switched to cmake
- Removed obsolete darwin patch
- Added patch for pkg-config file fixing paths

xbreak b49ffade 7d04516f

+55 -35
+14
pkgs/by-name/cf/cfitsio/cfitsio-pc-cmake.patch
···
··· 1 + diff --git a/cfitsio.pc.cmake b/cfitsio.pc.cmake 2 + index 949b80e..6ffcaa6 100644 3 + --- a/cfitsio.pc.cmake 4 + +++ b/cfitsio.pc.cmake 5 + @@ -1,7 +1,7 @@ 6 + prefix=@CMAKE_INSTALL_PREFIX@ 7 + exec_prefix=${prefix} 8 + -libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ 9 + -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ 10 + +libdir="@CMAKE_INSTALL_FULL_LIBDIR@" 11 + +includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@" 12 + 13 + Name: cfitsio 14 + Description: FITS File Subroutine Library
-21
pkgs/by-name/cf/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 2021-10-27 12:02:25.000000000 +0200 4 - @@ -4829,16 +4829,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}.\${CFITSIO_MICRO}" 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}.\${CFITSIO_MICRO}" 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 - ;;
···
+41 -14
pkgs/by-name/cf/cfitsio/package.nix
··· 1 { 2 stdenv, 3 lib, 4 - fetchurl, 5 bzip2, 6 curl, 7 zlib, ··· 9 10 stdenv.mkDerivation (finalAttrs: { 11 pname = "cfitsio"; 12 - version = "4.4.1"; 13 14 - src = fetchurl { 15 - url = "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-${finalAttrs.version}.tar.gz"; 16 - hash = "sha256-ZqHcPyGAD57qvZ6sV3uR/N2aq7pnj7ujuFJzGRENHSU="; 17 }; 18 19 patches = [ 20 - ./darwin-rpath-universal.patch 21 ]; 22 23 buildInputs = [ ··· 26 zlib 27 ]; 28 29 - configureFlags = [ 30 - "--with-bzip2=${bzip2.out}" 31 - "--enable-reentrant" 32 ]; 33 34 env = lib.optionalAttrs stdenv.hostPlatform.isFreeBSD { ··· 36 # not showing us gethostbyname() 37 NIX_CFLAGS_COMPILE = "-D__BSD_VISIBLE=1"; 38 }; 39 - 40 hardeningDisable = [ "format" ]; 41 42 - # Shared-only build 43 - buildFlags = [ "shared" ]; 44 45 - postPatch = '' 46 - sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in 47 ''; 48 49 meta = {
··· 1 { 2 stdenv, 3 lib, 4 + fetchFromGitHub, 5 + cmake, 6 bzip2, 7 curl, 8 zlib, ··· 10 11 stdenv.mkDerivation (finalAttrs: { 12 pname = "cfitsio"; 13 + version = "4.6.2"; 14 15 + src = fetchFromGitHub { 16 + owner = "HEASARC"; 17 + repo = finalAttrs.pname; 18 + tag = "${finalAttrs.pname}-${finalAttrs.version}"; 19 + hash = "sha256-WLsX23hNhaITjCvMEV7NUEvyDfQiObSJt1qFC12z7wY="; 20 }; 21 22 + outputs = [ 23 + "bin" 24 + "dev" 25 + "out" 26 + "doc" 27 + ]; 28 + 29 patches = [ 30 + ./cfitsio-pc-cmake.patch 31 + ]; 32 + 33 + nativeBuildInputs = [ 34 + cmake 35 ]; 36 37 buildInputs = [ ··· 40 zlib 41 ]; 42 43 + cmakeFlags = [ 44 + "-DUSE_PTHREADS=ON" 45 + "-DTESTS=ON" 46 + "-DUTILS=ON" 47 + "-DUSE_BZIP2=ON" 48 ]; 49 50 env = lib.optionalAttrs stdenv.hostPlatform.isFreeBSD { ··· 52 # not showing us gethostbyname() 53 NIX_CFLAGS_COMPILE = "-D__BSD_VISIBLE=1"; 54 }; 55 hardeningDisable = [ "format" ]; 56 57 + doCheck = true; 58 + doInstallCheck = true; 59 + 60 + # On testing cfitsio: https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/README 61 + installCheckPhase = '' 62 + ./TestProg > testprog.lis 63 + diff -s testprog.lis ../testprog.out 64 + cmp testprog.fit ../testprog.std 65 + ''; 66 67 + # Fixup installation 68 + # Remove installed test tools and benchmark 69 + postInstall = '' 70 + install -Dm644 -t "$out/share/doc/${finalAttrs.pname}" ../docs/*.pdf 71 + rm "$out/bin/cookbook" 72 + rmdir "$out/bin" 73 + rm "$bin/bin/smem" "$bin/bin/speed" 74 ''; 75 76 meta = {