mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-20 02:55:39 +00:00
proj: add package tests
Add simple package test by running proj CLI tool. This change also improves derivation overriding behavior by using `finalAttrs` function. Co-authored-by: Robert Scott <github@humanleg.org.uk>
This commit is contained in:
parent
ae11c6f4e5
commit
44daadff50
@ -5,6 +5,7 @@
|
|||||||
, cmake
|
, cmake
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, buildPackages
|
, buildPackages
|
||||||
|
, callPackage
|
||||||
, sqlite
|
, sqlite
|
||||||
, libtiff
|
, libtiff
|
||||||
, curl
|
, curl
|
||||||
@ -13,7 +14,7 @@
|
|||||||
, python3
|
, python3
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation (finalAttrs: rec {
|
||||||
pname = "proj";
|
pname = "proj";
|
||||||
version = "9.1.1";
|
version = "9.1.1";
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
python = python3.pkgs.pyproj;
|
python = python3.pkgs.pyproj;
|
||||||
|
proj = callPackage ./tests.nix { proj = finalAttrs.finalPackage; };
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
@ -71,4 +73,4 @@ stdenv.mkDerivation rec {
|
|||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = with maintainers; [ dotlambda ];
|
maintainers = with maintainers; [ dotlambda ];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
11
pkgs/development/libraries/proj/tests.nix
Normal file
11
pkgs/development/libraries/proj/tests.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ runCommand, proj }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (proj) pname;
|
||||||
|
in
|
||||||
|
runCommand "${pname}-tests" { meta.timeout = 60; }
|
||||||
|
''
|
||||||
|
${proj}/bin/projinfo EPSG:4326 \
|
||||||
|
| grep '+proj=longlat +datum=WGS84 +no_defs +type=crs'
|
||||||
|
touch $out
|
||||||
|
''
|
Loading…
Reference in New Issue
Block a user