From 9baeb63482c91e7ee1ff5d5be86deea1c14fab34 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 12 Nov 2018 01:01:52 +0100 Subject: [PATCH] lib2geom: init at 1.0.0 --- .../libraries/lib2geom/default.nix | 72 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 74 insertions(+) create mode 100644 pkgs/development/libraries/lib2geom/default.nix diff --git a/pkgs/development/libraries/lib2geom/default.nix b/pkgs/development/libraries/lib2geom/default.nix new file mode 100644 index 000000000000..ce494e4b68ad --- /dev/null +++ b/pkgs/development/libraries/lib2geom/default.nix @@ -0,0 +1,72 @@ +{ stdenv +, fetchFromGitLab +, fetchpatch +, cmake +, ninja +, pkg-config +, boost +, glib +, gsl +, cairo +, double-conversion +, gtest +}: + +stdenv.mkDerivation rec { + pname = "lib2geom-unstable"; + version = "2020-03-12"; + + outputs = [ "out" "dev" ]; + + src = fetchFromGitLab { + owner = "inkscape"; + repo = "lib2geom"; + rev = "226eb8c60f2af639d74a0229c0ba90e649e6451d"; + sha256 = "BSuqasBfig6HiKY/xtJm7CjbSaV8cW45ip59iEO5Es4="; + }; + + patches = [ + # Re-enable assertions for tests to work + # https://gitlab.com/inkscape/lib2geom/issues/5 + # https://gitlab.com/inkscape/lib2geom/merge_requests/17 + (fetchpatch { + url = "https://gitlab.com/inkscape/lib2geom/commit/4aa78f52232682b353eb15c219171e466987bac7.patch"; + sha256 = "XsX8SPft0RwDemJujc8lierBe4s3iw8YkW4CSlY5LsY="; + }) + ]; + + nativeBuildInputs = [ + cmake + ninja + pkg-config + ]; + + buildInputs = [ + boost + glib + gsl + cairo + double-conversion + ]; + + checkInputs = [ + gtest + ]; + + cmakeBuildType = "RelWithDebugInfo"; # needed to keep assertions for tests working + + cmakeFlags = [ + "-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests + "-DBUILD_SHARED_LIBS=ON" + ]; + + doCheck = true; + + meta = with stdenv.lib; { + description = "Easy to use 2D geometry library in C++"; + homepage = "https://gitlab.com/inkscape/lib2geom"; + license = [ licenses.lgpl21 licenses.mpl11 ]; + maintainers = with maintainers; [ jtojnar ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e4f1a3d25583..dbf22e2deccd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15635,6 +15635,8 @@ in leptonica = callPackage ../development/libraries/leptonica { }; + lib2geom = callPackage ../development/libraries/lib2geom { }; + lib3ds = callPackage ../development/libraries/lib3ds { }; lib3mf = callPackage ../development/libraries/lib3mf { };