-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
libpq: fix pg_config --libdir #382380
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
libpq: fix pg_config --libdir #382380
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 | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |||||||||||||||||||||||
| # build dependencies | ||||||||||||||||||||||||
| bison, | ||||||||||||||||||||||||
| flex, | ||||||||||||||||||||||||
| makeWrapper, | ||||||||||||||||||||||||
| perl, | ||||||||||||||||||||||||
| pkg-config, | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -62,6 +63,7 @@ stdenv.mkDerivation (finalAttrs: { | |||||||||||||||||||||||
| nativeBuildInputs = [ | ||||||||||||||||||||||||
| bison | ||||||||||||||||||||||||
| flex | ||||||||||||||||||||||||
| makeWrapper | ||||||||||||||||||||||||
| perl | ||||||||||||||||||||||||
| pkg-config | ||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||
|
|
@@ -111,7 +113,20 @@ stdenv.mkDerivation (finalAttrs: { | |||||||||||||||||||||||
| make -C src/interfaces/libpq install | ||||||||||||||||||||||||
| make -C src/port install | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # Pretend pg_config is located in $out/bin to return correct paths, but | ||||||||||||||||||||||||
| # actually have it in -dev to avoid pulling in all other outputs. | ||||||||||||||||||||||||
| moveToOutput bin/pg_config "$dev" | ||||||||||||||||||||||||
| wrapProgram "$dev/bin/pg_config" --argv0 "$out/bin/pg_config" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # To prevent a "pg_config: could not find own program executable" error, we fake | ||||||||||||||||||||||||
| # pg_config in the default output. | ||||||||||||||||||||||||
| mkdir -p "$out/bin" | ||||||||||||||||||||||||
| cat << EOF > "$out/bin/pg_config" && chmod +x "$out/bin/pg_config" | ||||||||||||||||||||||||
| #!${stdenv.shell} | ||||||||||||||||||||||||
| echo The real pg_config can be found in the -dev output. | ||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||
| EOF | ||||||||||||||||||||||||
|
Comment on lines
+124
to
+128
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| moveToOutput "lib/*.a" "$dev" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| rm -rfv $out/share | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -636,7 +636,6 @@ lib.makeScope pkgs.newScope ( | |
| { | ||
| name = "pdo_pgsql"; | ||
| internalDeps = [ php.extensions.pdo ]; | ||
| buildInputs = [ libpq ]; | ||
| configureFlags = [ "--with-pdo-pgsql=${lib.getDev libpq}" ]; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ma27 we added libpq as a buildInput here as a last fix in #359659 (comment), even though we had it via This explains why - it now builds fine without passing it as extra buildInput again, because pg_config returns the right values. |
||
| doCheck = false; | ||
| } | ||
|
|
@@ -651,7 +650,6 @@ lib.makeScope pkgs.newScope ( | |
| name = "pgsql"; | ||
| buildInputs = [ | ||
| pcre2 | ||
| libpq | ||
| ]; | ||
| configureFlags = [ "--with-pgsql=${lib.getDev libpq}" ]; | ||
| doCheck = false; | ||
|
|
||
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.
How about using
makeBinaryWrapperinstead?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'd like to understand why one or the other would be better. I just looked up the nixpkgs manual, which reads:
I don't get what a shebang has to do with it.
pg_configis surely not used as a shebang.Why do you think
makeBinaryWrapperis better?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 just would simply use
makeBinaryWrapperby default everywhere, since if offers better compatibility with Darwin systems. That's the only reason for me. Also, why do you usemakeWrapperinstead ofmakeBinaryWrapper?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.
Here? Just because
generic.nixdoes the same.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.
Fair enough. My comment was not a blocker so, feel free to implement what you prefer.