-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
plutosvg: init at 0.0.7 #410666
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
plutosvg: init at 0.0.7 #410666
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| From 31e8aae418a1af681e389f27d3ad57b5fd7e1ba8 Mon Sep 17 00:00:00 2001 | ||
| From: Marcin Serwin <marcin@serwin.dev> | ||
| Date: Sun, 25 May 2025 01:16:37 +0200 | ||
| Subject: [PATCH] Emit correct pkg-config file if paths are absolute | ||
|
|
||
| CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_LIBDIR may be defined to be | ||
| absolute paths. In this situation they should not be appended to the | ||
| prefix. | ||
|
|
||
| Signed-off-by: Marcin Serwin <marcin@serwin.dev> | ||
| --- | ||
| CMakeLists.txt | 15 +++++++++++++-- | ||
| 1 file changed, 13 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 2e84761..f2219e0 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -107,6 +107,17 @@ file(RELATIVE_PATH plutosvg_pc_prefix_relative | ||
| set(plutosvg_pc_cflags "") | ||
| set(plutosvg_pc_libs_private "") | ||
| set(plutosvg_pc_requires "") | ||
| +set(plutosvg_pc_requires "") | ||
| +if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") | ||
| + set(plutosvg_pc_includedir "${CMAKE_INSTALL_INCLUDEDIR}") | ||
| +else() | ||
| + set(plutosvg_pc_includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") | ||
| +endif() | ||
| +if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") | ||
| + set(plutosvg_pc_libdir "${CMAKE_INSTALL_LIBDIR}") | ||
| +else() | ||
| + set(plutosvg_pc_libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") | ||
| +endif() | ||
|
|
||
| if(MATH_LIBRARY) | ||
| string(APPEND plutosvg_pc_libs_private " -lm") | ||
| @@ -123,8 +134,8 @@ endif() | ||
|
|
||
| string(CONFIGURE [[ | ||
| prefix=${pcfiledir}/@plutosvg_pc_prefix_relative@ | ||
| -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ | ||
| -libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
| +includedir=@plutosvg_pc_includedir@ | ||
| +libdir=@plutosvg_pc_libdir@ | ||
|
|
||
| Name: PlutoSVG | ||
| Description: Tiny SVG rendering library in C | ||
| -- | ||
| 2.49.0 | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| fetchFromGitHub, | ||
| nix-update-script, | ||
| validatePkgConfig, | ||
| testers, | ||
| cmake, | ||
| ninja, | ||
| plutovg, | ||
| }: | ||
| stdenv.mkDerivation (finalAttrs: { | ||
| pname = "plutosvg"; | ||
| version = "0.0.7"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "sammycage"; | ||
| repo = "plutosvg"; | ||
| tag = "v${finalAttrs.version}"; | ||
| hash = "sha256-4JLk4+O9Tf8CGxMP0aDN70ak/8teZH3GWBWlrIkPQm4="; | ||
| }; | ||
|
|
||
| outputs = [ | ||
| "out" | ||
| "dev" | ||
| ]; | ||
|
|
||
| patches = [ | ||
| # https://github.com/sammycage/plutosvg/pull/29 | ||
| ./0001-Emit-correct-pkg-config-file-if-paths-are-absolute.patch | ||
| ]; | ||
|
|
||
| nativeBuildInputs = [ | ||
| cmake | ||
| ninja | ||
| validatePkgConfig | ||
| ]; | ||
| propagatedBuildInputs = [ | ||
| plutovg | ||
| ]; | ||
|
|
||
| cmakeFlags = [ (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) ]; | ||
|
|
||
| passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; | ||
|
||
|
|
||
| passthru.updateScript = nix-update-script { }; | ||
|
|
||
| meta = { | ||
| homepage = "https://github.com/sammycage/plutosvg"; | ||
| changelog = "https://github.com/sammycage/plutosvg/releases/tag/${finalAttrs.src.tag}"; | ||
| description = "Tiny SVG rendering library in C"; | ||
| license = lib.licenses.mit; | ||
| maintainers = with lib.maintainers; [ marcin-serwin ]; | ||
| pkgConfigModules = [ "plutosvg" ]; | ||
| }; | ||
| }) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize for not seeing this before, trying to use it I get:
in that output, there is only one file:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also noticed this issue, it is already fixed upstream with sammycage/plutosvg#31. I was planning to add it as a patch with the PR updating pcsx2 but I can create a separate PR earlier if you need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need @marcin-serwin, I've added a postInstall fix. Good work!