summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-12 15:03:19 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-13 10:21:07 -0500
commitee2fd1e5108433cc5bba3d0bc9d7667ed1346014 (patch)
treea91c3547ef1a6397d0f413c2dbc40a40ebc96050
parent3f8b15788f73b33ca1d08cd3a4e6eca8f8a9e283 (diff)
downloadnixpkgs-ee2fd1e5108433cc5bba3d0bc9d7667ed1346014.tar
nixpkgs-ee2fd1e5108433cc5bba3d0bc9d7667ed1346014.tar.gz
nixpkgs-ee2fd1e5108433cc5bba3d0bc9d7667ed1346014.tar.bz2
nixpkgs-ee2fd1e5108433cc5bba3d0bc9d7667ed1346014.tar.lz
nixpkgs-ee2fd1e5108433cc5bba3d0bc9d7667ed1346014.tar.xz
nixpkgs-ee2fd1e5108433cc5bba3d0bc9d7667ed1346014.tar.zst
nixpkgs-ee2fd1e5108433cc5bba3d0bc9d7667ed1346014.zip
R: Add `meta.pkgConfigModules` and test
-rw-r--r--pkgs/applications/science/math/R/default.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 83acfcfe9c3..580de87bdb2 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -8,15 +8,18 @@
 # R as of writing does not support outputting both .so and .a files; it outputs:
 #     --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
 , static ? false
+, testers
 }:
 
 assert (!blas.isILP64) && (!lapack.isILP64);
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "R";
   version = "4.2.2";
 
-  src = fetchurl {
+  src = let
+    inherit (finalAttrs) pname version;
+  in fetchurl {
     url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz";
     sha256 = "sha256-D/YrQuxRr6VxPK7nxP3noMRZQLo5vvjFyUh/7wyVPfU=";
   };
@@ -97,6 +100,8 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
+  passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+
   meta = with lib; {
     homepage = "http://www.r-project.org/";
     description = "Free software environment for statistical computing and graphics";
@@ -121,8 +126,9 @@ stdenv.mkDerivation rec {
       user-defined recursive functions and input and output facilities.
     '';
 
+    pkgConfigModules = [ "libR" ];
     platforms = platforms.all;
 
     maintainers = with maintainers; [ jbedo ] ++ teams.sage.members;
   };
-}
+})