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
fmtlib: add pkgconfig #48960
fmtlib: add pkgconfig #48960
Conversation
cd /build/source | ||
pc="fmt.pc" | ||
substituteInPlace "$pc" --replace "@out@" "$out" | ||
substituteInPlace "$pc" --replace "@version@" "${version}" |
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.
You can use substituteAll
here which does the '@variable@' substitution out of the box.
@@ -0,0 +1,30 @@ | |||
From 7ad56220fd23cfce7c1c3e3bc269fa88d34070eb Mon Sep 17 00:00:00 2001 |
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.
This looks like you have send this also upstream? Can you include a link to the pull request if that's the case?
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've now added it next to the patch line in default.nix
, if that's okay.)
I added a link to an upstream PR. I'm not sure it's good though, it has NixOS-isms in it still. I am not very experienced in this area to know how to best have a cmake project spit out a proper pkgconfig file? |
@colemickens I made a suggestion in the pull request. |
@@ -9,6 +9,10 @@ stdenv.mkDerivation rec { | |||
rev = "${version}"; | |||
sha256 = "1cd8yq8va457iir1hlf17ksx11fx2hlb8i4jml8gj1875pizm0pk"; | |||
}; | |||
patches = [ | |||
# https://github.com/fmtlib/fmt/pull/916 |
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.
Might use something like the following then:
patches = [
(fetchPatch {
name = "0001-add-fmt";
url = "https://github.com/fmtlib/fmt/pull/916.patch";
sha256 = "xxxxxxxxxxxxxxxxxxxxxxxxx";
})
];
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.
Instead of the pull request please create a dedicated branch in this case, so the patch never changes, if upstreams wants you to change the pull request.
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.
Could do https://github.com/fmtlib/fmt/pull/916/commits/0dbf735fe3a54b78b2e35122baa5a9c0e7216445.patch
in that case
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.
Ah github even ensures those are not deleted: https://stackoverflow.com/questions/15261880/does-github-garbage-collect-dangling-commits-referenced-in-pull-requests
53a9fad
to
8b44b12
Compare
Thanks for the review and suggestions @Synthetica9 @Mic92. I've made the suggestion change upstream, tested it with this PR and For additional verification, and/or in case it's of interest, I have this and some related things in an overlay (built for |
|
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec { | |||
rev = "${version}"; | |||
sha256 = "1cd8yq8va457iir1hlf17ksx11fx2hlb8i4jml8gj1875pizm0pk"; | |||
}; | |||
patches = [ | |||
pkgs.fetchpatch { |
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.
You need parentheses here, otherwise it is interpreted as being two elements of an array instead of a call.
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec { | |||
rev = "${version}"; | |||
sha256 = "1cd8yq8va457iir1hlf17ksx11fx2hlb8i4jml8gj1875pizm0pk"; | |||
}; | |||
patches = [ | |||
pkgs.fetchpatch { |
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.
pkgs.fetchpatch
is also not in scope, so you need to add it to your arguments (I'd reccomend removing the pkgs
, and adding fetchpatch
as an argument.)
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec { | |||
rev = "${version}"; | |||
sha256 = "1cd8yq8va457iir1hlf17ksx11fx2hlb8i4jml8gj1875pizm0pk"; | |||
}; | |||
patches = [ | |||
pkgs.fetchpatch { | |||
url = "https://github.com/fmtlib/fmt/pull/916/commits/57ae5189351665715c98b3b6ca8595b30d83033f.patch"; |
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.
Now that the patch is merged you can also pull from master.
Thanks again to all. I took a stab at it. It's pointing at the latest commit from What's the general nixpkgs guidance on something like with changes like this (aka, pinning to a non-tagged/released revision)? For example, in this case, especially with such a speedy upstream merge, I don't mind carrying this override in my fork/overlay; it feels almost hasty to do this here, now, especially since I won't be sending a PR for the dependent package yet due to there being no release. |
So basically you are waiting for the next release? |
@Mic92 I went ahead and already updated this PR to pull from |
Patch is adding pkgconfig support
@GrahamcOfBorg build fmt |
Success on aarch64-linux (full log) Attempted: fmt Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: fmt Partial log (click to expand)
|
Motivation for this change
This enables
fmt
to be usable with meson/pkgconfig.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
) (Indirectly, via a package in an overlay that uses it.)nix path-info -S
before and after)