Skip to content

liblqr1: fix build with gcc15, cleanup - #446163

Merged
fabianhjr merged 2 commits into
NixOS:stagingfrom
ghpzin:pr-liblqr1-gcc15
Dec 1, 2025
Merged

fabianhjr merged 2 commits into
NixOS:stagingfrom
ghpzin:pr-liblqr1-gcc15

Conversation

@ghpzin

@ghpzin ghpzin commented Sep 25, 2025 •

Copy link
Copy Markdown
Contributor

liblqr1: fix build with gcc15

  • add "-std=gnu17" to env.NIX_CFLAGS_COMPILE, most updates upstream
    were in 2017 or before.

Fixes build failure with gcc15:

lqr_energy.c:452:1: error: conflicting types for
'lqr_carver_generate_rcache_bright'; have 'gdouble *(LqrCarver *)'
{aka 'double *(struct _LqrCarver *)'}
  452 | lqr_carver_generate_rcache_bright(LqrCarver *r)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../lqr/lqr_energy.h:27,
                 from lqr_energy.c:32:
../lqr/lqr_energy_priv.h:59:10: note: previous declaration of
'lqr_carver_generate_rcache_bright' with type 'gdouble *(void)'
{aka 'double *(void)'}
   59 | gdouble *lqr_carver_generate_rcache_bright();
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lqr_energy.c:471:1: error: conflicting types for
'lqr_carver_generate_rcache_luma'; have 'gdouble *(LqrCarver *)'
{aka 'double *(struct _LqrCarver *)'}
  471 | lqr_carver_generate_rcache_luma(LqrCarver *r)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

liblqr1: cleanup

  • replace rec with finalAttrs
  • remove with lib; from meta
  • replace sha256 with hash
    nix hash to-sri --type sha256 "10mrl5k3l2hxjhz4w93n50xwywp6y890rw2vsjcgai8627x5f1df"
    sha256-rgVX+hEGRfWY1FvwDBLy5nLPOyh2JE4+lB0KOmahuYI=

Tested build with:

nix-build --expr 'with import ./. {}; liblqr1.override { stdenv = gcc15Stdenv; }'

Part of fixes for gcc15 update:
#440456


Upstream is not very active, most updates were before 2017 and
other distros also fixed gcc15 issues by adding -std=gnu17 or -std=gnu11:
https://gitlab.archlinux.org/archlinux/packaging/packages/liblqr/-/commit/5c2eb2a39389c874f2c019cad255b25db29a52c7
https://src.fedoraproject.org/rpms/liblqr-1/c/6f74801f26aee9c7030aca920813fcfeb4d856a4
https://build.opensuse.org/requests/1267258/changes

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. labels Sep 25, 2025
@ghpzin
ghpzin changed the base branch from master to staging September 25, 2025 21:38
@nixpkgs-ci nixpkgs-ci Bot closed this Sep 25, 2025
@nixpkgs-ci nixpkgs-ci Bot reopened this Sep 25, 2025
- add "-std=gnu17" to `env.NIX_CFLAGS_COMPILE`, most updates upstream
were in 2017 or before.

Fixes build failure with gcc15:
```
lqr_energy.c:452:1: error: conflicting types for
'lqr_carver_generate_rcache_bright'; have 'gdouble *(LqrCarver *)'
{aka 'double *(struct _LqrCarver *)'}
  452 | lqr_carver_generate_rcache_bright(LqrCarver *r)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../lqr/lqr_energy.h:27,
                 from lqr_energy.c:32:
../lqr/lqr_energy_priv.h:59:10: note: previous declaration of
'lqr_carver_generate_rcache_bright' with type 'gdouble *(void)'
{aka 'double *(void)'}
   59 | gdouble *lqr_carver_generate_rcache_bright();
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lqr_energy.c:471:1: error: conflicting types for
'lqr_carver_generate_rcache_luma'; have 'gdouble *(LqrCarver *)'
{aka 'double *(struct _LqrCarver *)'}
  471 | lqr_carver_generate_rcache_luma(LqrCarver *r)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
```
- replace `rec` with `finalAttrs`
- remove `with lib;` from `meta`
- replace `sha256` with `hash`
nix hash to-sri --type sha256 "10mrl5k3l2hxjhz4w93n50xwywp6y890rw2vsjcgai8627x5f1df"
sha256-rgVX+hEGRfWY1FvwDBLy5nLPOyh2JE4+lB0KOmahuYI=
github-actions[bot]

This comment was marked as resolved.

@github-actions
github-actions Bot dismissed their stale review September 25, 2025 21:40

All good now, thank you!

@ghpzin
ghpzin marked this pull request as ready for review September 25, 2025 21:45
@nixpkgs-ci nixpkgs-ci Bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Sep 25, 2025
@fabianhjr
fabianhjr added this pull request to the merge queue Dec 1, 2025
@fabianhjr fabianhjr mentioned this pull request Dec 1, 2025
4 of 13 tasks
Merged via the queue into NixOS:staging with commit d307094 Dec 1, 2025
@ghpzin
ghpzin deleted the pr-liblqr1-gcc15 branch December 1, 2025 05:23
@ghpzin ghpzin mentioned this pull request Dec 22, 2025
4 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

9.needs: reviewer This PR currently has no reviewers requested and needs attention. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants