summary refs log tree commit diff
path: root/pkgs/development/libraries/libLAS
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2018-04-16 23:08:17 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2018-04-17 09:29:01 +0100
commit406e20b8329b51887801879bad0896aed693aef6 (patch)
treed783ef62ce5c8e4339cbd3d5750600883f539a0c /pkgs/development/libraries/libLAS
parent985cd571f390fd9f68de6c99916effe284d89f2c (diff)
downloadnixpkgs-406e20b8329b51887801879bad0896aed693aef6.tar
nixpkgs-406e20b8329b51887801879bad0896aed693aef6.tar.gz
nixpkgs-406e20b8329b51887801879bad0896aed693aef6.tar.bz2
nixpkgs-406e20b8329b51887801879bad0896aed693aef6.tar.lz
nixpkgs-406e20b8329b51887801879bad0896aed693aef6.tar.xz
nixpkgs-406e20b8329b51887801879bad0896aed693aef6.tar.zst
nixpkgs-406e20b8329b51887801879bad0896aed693aef6.zip
Fix libLAS darwin build
Diffstat (limited to 'pkgs/development/libraries/libLAS')
-rw-r--r--pkgs/development/libraries/libLAS/default.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgs/development/libraries/libLAS/default.nix b/pkgs/development/libraries/libLAS/default.nix
index 20531adcd1c..aafcf86e4a6 100644
--- a/pkgs/development/libraries/libLAS/default.nix
+++ b/pkgs/development/libraries/libLAS/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, cmake, gdal, libgeotiff, libtiff, LASzip }:
+{ stdenv, fetchurl, boost, cmake, gdal, libgeotiff, libtiff, LASzip, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
   name = "libLAS-1.8.1";
@@ -9,14 +9,22 @@ stdenv.mkDerivation rec {
     sha256 = "0xjfxb3ydvr2258ji3spzyf81g9caap19ql2pk91wiivqsc4mnws";
   };
 
-  buildInputs = [ boost cmake gdal libgeotiff libtiff LASzip ];
+  buildInputs = [ boost cmake gdal libgeotiff libtiff LASzip ]
+                ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
+  cmakeFlags = [
+    "-DGDAL_CONFIG=${gdal}/bin/gdal-config"
+  ];
+
+  postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change "@rpath/liblas.3.dylib" "$out/lib/liblas.3.dylib" $out/lib/liblas_c.dylib
+  '';
 
   meta = {
     description = "LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset";
     homepage = http://www.liblas.org;
     license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.michelk ];
   };
 }