Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib2geom: Move gtest back to check inputs #367171

Merged
merged 4 commits into from
Dec 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions pkgs/by-name/li/lib2geom/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
double-conversion,
gtest,
lib,
inkscape,
pkgsCross,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "lib2geom";
version = "1.4";

Expand All @@ -25,7 +27,7 @@ stdenv.mkDerivation rec {
src = fetchFromGitLab {
owner = "inkscape";
repo = "lib2geom";
rev = "refs/tags/${version}";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-kbcnefzNhUj/ZKZaB9r19bpI68vxUKOLVAwUXSr/zz0=";
};

Expand All @@ -41,14 +43,19 @@ stdenv.mkDerivation rec {
gsl
cairo
double-conversion
];

nativeCheckInputs = [
gtest
];

cmakeFlags = [
"-D2GEOM_BUILD_SHARED=ON"
# For cross compilation.
(lib.cmakeBool "2GEOM_TESTING" finalAttrs.doCheck)
];

doCheck = true;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

# TODO: Update cmake hook to make it simpler to selectively disable cmake tests: #113829
checkPhase =
Expand Down Expand Up @@ -82,6 +89,17 @@ stdenv.mkDerivation rec {
runHook postCheck
'';

passthru = {
tests =
{
inherit inkscape;
}
# Make sure x86_64-linux -> aarch64-linux cross compilation works
// lib.optionalAttrs (stdenv.buildPlatform.system == "x86_64-linux") {
aarch64-cross = pkgsCross.aarch64-multiplatform.lib2geom;
};
};

meta = with lib; {
description = "Easy to use 2D geometry library in C++";
homepage = "https://gitlab.com/inkscape/lib2geom";
Expand All @@ -92,4 +110,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.unix;
};
}
})
Loading