diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/cfitsio')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/cfitsio/darwin-rpath-universal.patch | 21 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/cfitsio/default.nix | 40 |
2 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/cfitsio/darwin-rpath-universal.patch b/nixpkgs/pkgs/development/libraries/cfitsio/darwin-rpath-universal.patch new file mode 100644 index 000000000000..af38abf329ea --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/cfitsio/darwin-rpath-universal.patch @@ -0,0 +1,21 @@ +diff -ruN cfitsio/configure cfitsio-rpath-universal/configure +--- cfitsio/configure 2018-05-09 21:16:00.000000000 +0200 ++++ cfitsio-rpath-universal/configure 2018-05-31 12:02:25.000000000 +0200 +@@ -4727,16 +4727,7 @@ + SHLIB_SUFFIX=".dylib" + CFITSIO_SHLIB="lib\${PACKAGE}.\${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}\${SHLIB_SUFFIX}" + CFITSIO_SHLIB_SONAME="lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX}" +- case $host in +- *darwin[56789]*) +- SHLIB_LD="$CC -dynamiclib -install_name lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}" +- ;; +- *) +- # Build 'Universal' binaries (i386 & x86_64 architectures) and +- # use rpath token on Darwin 10.x or newer: +- 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}" +- ;; +- esac ++ 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}" + + lhea_shlib_cflags="-fPIC -fno-common" + ;; diff --git a/nixpkgs/pkgs/development/libraries/cfitsio/default.nix b/nixpkgs/pkgs/development/libraries/cfitsio/default.nix new file mode 100644 index 000000000000..a430bc317930 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/cfitsio/default.nix @@ -0,0 +1,40 @@ +{ fetchurl, lib, stdenv, bzip2 }: +stdenv.mkDerivation rec { + pname = "cfitsio"; + version = "3.49"; + + src = fetchurl { + url = "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-${version}.tar.gz"; + sha256 = "1cyl1qksnkl3cq1fzl4dmjvkd6329b57y9iqyv44wjakbh6s4rav"; + }; + + buildInputs = [ bzip2 ]; + + patches = [ ./darwin-rpath-universal.patch ]; + + configureFlags = "--with-bzip2=${bzip2.out}"; + + hardeningDisable = [ "format" ]; + + # Shared-only build + buildFlags = [ "shared" ]; + postPatch = '' sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in + ''; + + meta = with lib; { + homepage = "https://heasarc.gsfc.nasa.gov/fitsio/"; + description = "Library for reading and writing FITS data files"; + longDescription = + '' CFITSIO is a library of C and Fortran subroutines for reading and + writing data files in FITS (Flexible Image Transport System) data + format. CFITSIO provides simple high-level routines for reading and + writing FITS files that insulate the programmer from the internal + complexities of the FITS format. CFITSIO also provides many + advanced features for manipulating and filtering the information in + FITS files. + ''; + license = licenses.mit; + maintainers = [ maintainers.xbreak ]; + platforms = with platforms; linux ++ darwin; + }; +} |