nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 62 lines 1.5 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 fetchpatch, 6 nix-update-script, 7 validatePkgConfig, 8 testers, 9 cmake, 10 ninja, 11 plutovg, 12}: 13stdenv.mkDerivation (finalAttrs: { 14 pname = "plutosvg"; 15 version = "0.0.7"; 16 17 src = fetchFromGitHub { 18 owner = "sammycage"; 19 repo = "plutosvg"; 20 tag = "v${finalAttrs.version}"; 21 hash = "sha256-4JLk4+O9Tf8CGxMP0aDN70ak/8teZH3GWBWlrIkPQm4="; 22 }; 23 24 outputs = [ 25 "out" 26 "dev" 27 ]; 28 29 patches = [ 30 # https://github.com/sammycage/plutosvg/pull/29 31 ./0001-Emit-correct-pkg-config-file-if-paths-are-absolute.patch 32 # https://github.com/sammycage/plutosvg/pull/31 33 (fetchpatch { 34 url = "https://github.com/sammycage/plutosvg/commit/17d60020e0b24299fae0e7df37637448b3b51488.patch"; 35 hash = "sha256-hY25ttsLQwvtQmDeOGSoCVDy34GUA0tNai/L3wpmPUo="; 36 }) 37 ]; 38 39 nativeBuildInputs = [ 40 cmake 41 ninja 42 validatePkgConfig 43 ]; 44 propagatedBuildInputs = [ 45 plutovg 46 ]; 47 48 cmakeFlags = [ (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) ]; 49 50 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 51 52 passthru.updateScript = nix-update-script { }; 53 54 meta = { 55 homepage = "https://github.com/sammycage/plutosvg"; 56 changelog = "https://github.com/sammycage/plutosvg/releases/tag/${finalAttrs.src.tag}"; 57 description = "Tiny SVG rendering library in C"; 58 license = lib.licenses.mit; 59 maintainers = with lib.maintainers; [ marcin-serwin ]; 60 pkgConfigModules = [ "plutosvg" ]; 61 }; 62})