Open b-rodrigues opened 5 days ago
--- a/pkgs/development/libraries/proj/default.nix
+++ b/pkgs/development/libraries/proj/default.nix
@@ -49,6 +49,12 @@ stdenv.mkDerivation (finalAttrs: {
"-include cstdint"
];
+ postPatch = ''
+ # These should be proper Requires, using the header needs their headers
+ substituteInPlace proj.pc.in \
+ --replace 'Requires.private' 'Requires'
+ '';
+
Might help.
Metadata
I can't run the below, because as explained above, I don't have the hardware.
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.[user@system:~]$ nix-shell -p nix-info --run "nix-info -m" output here
Add a 👍 reaction to issues you find important.
% nix-shell -p nix-info --run "nix-info -m"
these 2 paths will be fetched (0.01 MiB download, 0.03 MiB unpacked):
/nix/store/i17n43d9h64nzp5mjwd8zlj00i1zpab0-DarwinTools-1
/nix/store/g16nnzwy639cmbhcggrwniba70fympah-nix-info
copying path '/nix/store/i17n43d9h64nzp5mjwd8zlj00i1zpab0-DarwinTools-1' from 'https://cache.nixos.org'...
copying path '/nix/store/g16nnzwy639cmbhcggrwniba70fympah-nix-info' from 'https://cache.nixos.org'...
- system: `"x86_64-darwin"`
- host os: `Darwin 21.6.0, macOS 10.16`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.24.8`
- channels(root): `"nixpkgs"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
+ postPatch = '' + # These should be proper Requires, using the header needs their headers + substituteInPlace proj.pc.in \ + --replace 'Requires.private' 'Requires' + '';
Thanks for the pointer! Unfortunately that doesn’t seem to cut it. I’ve add the lines here: https://github.com/b-rodrigues/nixpkgs/blob/812fef336e2c1eacccba4e893e0338e65adb3e21/pkgs/development/libraries/proj/default.nix#L52
and tried to build the package from this branch, but still get the same error.
No sorry, that actually did the trick for rPackages.terra
! It now builds successfully on linux and macOS with this patch. I thought it didn’t work because I didn’t read the error message carefully enough: what fails now is another package: rPackages.sf
which is closely related to rPackages.terra
(I was trying to build them all instead of individually, my bad). I thought that sf
and terra
might need the same fix as they seemed to have the same issue related to proj
, but sf
seems to require another fix to build successfully on darwin on top of the patch for proj:
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
configure: error: libproj or sqlite3 not found in standard or given locations.
ERROR: configuration failed for package ‘sf’
* removing ‘/nix/store/090rqzxk9dlm3001ksvsnsrp6mh6nsvq-r-sf-1.0-16/library/sf’
error: builder for '/nix/store/80gp841mb76m9rx208l4nxcmppkqpknc-r-sf-1.0-16.drv' failed with exit code 1;
last 25 log lines:
> checking whether the compiler supports GNU C... yes
> checking whether clang accepts -g... yes
> checking for clang option to enable C11 features... none needed
> checking for stdio.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for strings.h... yes
> checking for sys/stat.h... yes
> checking for sys/types.h... yes
> checking for unistd.h... yes
> checking for gdal.h... yes
> checking GDAL: linking with --libs only... yes
> checking GDAL: /nix/store/vdl5cxnbm7n02kf9mn3417glarvik1r6-gdal-3.8.5/share/gdal/pcs.csv readable... no
> checking GDAL: checking whether PROJ is available for linking:... yes
> checking GDAL: checking whether PROJ is available for running:... yes
> configure: GDAL: 3.8.5
> configure: pkg-config proj exists, will use it
> configure: using proj.h.
> configure: PROJ: 9.4.1
> checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no
> configure: error: libproj or sqlite3 not found in standard or given locations.
> ERROR: configuration failed for package ‘sf’
> * removing ‘/nix/store/090rqzxk9dlm3001ksvsnsrp6mh6nsvq-r-sf-1.0-16/library/sf’
For full logs, run 'nix log /nix/store/80gp841mb76m9rx208l4nxcmppkqpknc-r-sf-1.0-16.drv'.
error: 1 dependencies of derivation '/nix/store/fnd6sjisbfzambjmnpwd3pc602b68cnz-nix-shell.drv' failed to build
could it be something with sqlite3
?
Scratch that, I think the culprit might be libgeotiff
. Am trying the fix for proj
on it as well: https://github.com/b-rodrigues/nixpkgs/blob/b1a7f21c1ecca85ac7dad0cc2f4d0f480f35968a/pkgs/development/libraries/libgeotiff/default.nix#L39
I’ll report the results once it’s done building.
Nope that wasn't it... so to summarize, for now the fix suggested by @tomberek works for rPackages.terra but rPackages.sf fails. Trying the same fix on libgeotiff, a dependency of rpackages.sf doesn't help
Steps To Reproduce
Try to build
rPackages.terra
on Darwin (also affects other packages, such asrPackages.sf
.Build log
Additional context
Build succeeds on Linux, and also succeeds on Darwin with following fix:
I PR'ed the fix, but it turns out that the issue is likely related to
pkg-config
, see, for context: https://github.com/NixOS/nixpkgs/pull/344498#pullrequestreview-2334701617I don't have Apple hardware, so it's difficult for me to work on this.
Notify maintainers
pkg-config
has no maintainers, so I'm pinging the last person to touch it @sevanspowellMetadata
I can't run the below, because as explained above, I don't have the hardware.
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.