about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libe57format
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-10 07:13:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-12 14:07:16 +0000
commite2698550456abba83c6dcd5d5e5a9990a0b96f8a (patch)
tree79a56f0df3fa55e470d84b4dff6059fbf487ec18 /nixpkgs/pkgs/development/libraries/libe57format
parent1cdc42df888dc98c347e03bd942ed9825a55bcb3 (diff)
parent84d74ae9c9cbed73274b8e4e00be14688ffc93fe (diff)
downloadnixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.gz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.bz2
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.lz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.xz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.zst
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.zip
Merge commit '84d74ae9c9cbed73274b8e4e00be14688ffc93fe'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libe57format')
-rw-r--r--nixpkgs/pkgs/development/libraries/libe57format/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libe57format/default.nix b/nixpkgs/pkgs/development/libraries/libe57format/default.nix
new file mode 100644
index 000000000000..6bb48c9530c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libe57format/default.nix
@@ -0,0 +1,55 @@
+{
+  stdenv,
+  cmake,
+  fetchFromGitHub,
+  boost,
+  xercesc,
+  icu,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libe57format";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "asmaloney";
+    repo = "libE57Format";
+    rev = "v${version}";
+    sha256 = "05z955q68wjbd9gc5fw32nqg69xc82n2x75j5vchxzkgnn3adcpi";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    boost
+    icu
+    xercesc
+  ];
+
+  # The build system by default builds ONLY static libraries, and with
+  # `-DE57_BUILD_SHARED=ON` builds ONLY shared libraries, see:
+  #     https://github.com/asmaloney/libE57Format/issues/48
+  #     https://github.com/asmaloney/libE57Format/blob/f657d470da5f0d185fe371c4c011683f6e30f0cb/CMakeLists.txt#L82-L89
+  # We support building both by building statically and then
+  # building an .so file here manually.
+  # The way this is written makes this Linux-only for now.
+  postInstall = ''
+    cd $out/lib
+    g++ -Wl,--no-undefined -shared -o libE57FormatShared.so -L. -Wl,-whole-archive -lE57Format -Wl,-no-whole-archive -lxerces-c
+    mv libE57FormatShared.so libE57Format.so
+
+    if [ "$dontDisableStatic" -ne "1" ]; then
+      rm libE57Format.a
+    fi
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Library for reading & writing the E57 file format (fork of E57RefImpl)";
+    homepage = "https://github.com/asmaloney/libE57Format";
+    license = licenses.boost;
+    maintainers = with maintainers; [ chpatrick nh2 ];
+    platforms = platforms.linux; # because of the .so buiding in `postInstall` above
+  };
+}