From 5fd449df4162fd1f17fffd42be51230305769603 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 11 Feb 2023 09:21:55 -0500 Subject: [PATCH] glew: Add `meta.pkgConfigModules` and test --- pkgs/development/libraries/glew/1.10.nix | 10 +++++++--- pkgs/development/libraries/glew/default.nix | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/glew/1.10.nix b/pkgs/development/libraries/glew/1.10.nix index 8fa77013e105..3f355deb33b9 100644 --- a/pkgs/development/libraries/glew/1.10.nix +++ b/pkgs/development/libraries/glew/1.10.nix @@ -1,13 +1,14 @@ { lib, stdenv, fetchurl, libGLU, libXmu, libXi, libXext , AGL, OpenGL +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "glew"; version = "1.10.0"; src = fetchurl { - url = "mirror://sourceforge/glew/glew-${version}.tgz"; + url = "mirror://sourceforge/glew/${finalAttrs.pname}-${finalAttrs.version}.tgz"; sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r"; }; @@ -41,11 +42,14 @@ stdenv.mkDerivation rec { "SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}" ]; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "An OpenGL extension loading library for C(++)"; homepage = "https://glew.sourceforge.net/"; license = licenses.free; # different files under different licenses #["BSD" "GLX" "SGI-B" "GPL2"] + pkgConfigModules = [ "glew" ]; platforms = platforms.mesaPlatforms; }; -} +}) diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix index 1e30eb744ba8..4cbd85e7a04c 100644 --- a/pkgs/development/libraries/glew/default.nix +++ b/pkgs/development/libraries/glew/default.nix @@ -1,14 +1,15 @@ { lib, stdenv, fetchurl, fetchpatch, cmake, libGLU, libXmu, libXi, libXext , OpenGL , enableEGL ? false +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "glew"; version = "2.2.0"; src = fetchurl { - url = "mirror://sourceforge/glew/${pname}-${version}.tgz"; + url = "mirror://sourceforge/glew/${finalAttrs.pname}-${finalAttrs.version}.tgz"; sha256 = "1qak8f7g1iswgswrgkzc7idk7jmqgwrs58fhg2ai007v7j4q5z6l"; }; @@ -44,14 +45,17 @@ stdenv.mkDerivation rec { EOF ''; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "An OpenGL extension loading library for C/C++"; homepage = "https://glew.sourceforge.net/"; license = with licenses; [ /* modified bsd */ free mit gpl2Only ]; # For full details, see https://github.com/nigels-com/glew#copyright-and-licensing + pkgConfigModules = [ "glew" ]; platforms = with platforms; if enableEGL then subtractLists darwin mesaPlatforms else mesaPlatforms; }; -} +})