Skip to content

Conversation

noiioiu
Copy link

@noiioiu noiioiu commented Jul 10, 2025

Regina is a software package for low-dimensional topology.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@nix-owners nix-owners bot requested a review from natsukium July 10, 2025 04:31
@nixpkgs-ci nixpkgs-ci bot added 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! labels Jul 10, 2025
Copy link
Contributor

@acid-bong acid-bong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of notes btw

Comment on lines 82 to 77
NIX_CFLAGS_COMPILE = "-I${graphviz}/include/graphviz";
NIX_LDFLAGS = "-L${graphviz}/lib -lgvc";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, stdenv is already aware of graphviz

Copy link
Author

@noiioiu noiioiu Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without NIX_CFLAGS_COMPILE, compilation fails:

/build/source/qtui/src/packets/facetgraphtab.cpp:63:10: fatal error: gvc.h: No such file or directory
   63 | #include "gvc.h"
      |          ^~~~~~~
compilation terminated.
make[2]: *** [qtui/src/CMakeFiles/regina-gui.dir/build.make:393: qtui/src/CMakeFiles/regina-gui.dir/packets/facetgraphtab.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Comment on lines 60 to 52
perl
python3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are they supposed to be run by the final program or during build? if the latter, they belong to nativeBuildInputs instead

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regina-python requires both perl and python.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this script supposed to be executed at runtime or at compiletime?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is installed in result/bin.

@noiioiu noiioiu force-pushed the regina-normal branch 4 times, most recently from 84dad7b to 74015d9 Compare July 10, 2025 13:39
@noiioiu noiioiu requested a review from acid-bong July 10, 2025 13:39
@noiioiu noiioiu force-pushed the regina-normal branch 4 times, most recently from d78ce34 to 9957ff8 Compare July 16, 2025 18:22
@noiioiu noiioiu changed the title regina-normal: init at 7.3-unstable-2025-07-09 regina-normal: init at 7.3.1 Jul 16, 2025
@noiioiu noiioiu force-pushed the regina-normal branch 4 times, most recently from 8fea194 to 232d47b Compare July 25, 2025 12:57
@noiioiu noiioiu force-pushed the regina-normal branch 4 times, most recently from 96ab76d to f2c66f0 Compare August 18, 2025 17:56
Copy link
Contributor

@alejo7797 alejo7797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello again! It's nice to find someone with an interest both in low-dimensional topology and Nixpkgs. Thank you for putting in the effort to open this PR.

Just a few suggestions which I hope can help get this merged.

Comment on lines 39 to 48
databaseLibrary
doxygen
gmp
jansson
libxml2
libxslt
pkg-config
popt
qt6.qtbase
qt6.qtsvg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
databaseLibrary
doxygen
gmp
jansson
libxml2
libxslt
pkg-config
popt
qt6.qtbase
qt6.qtsvg
doxygen
libxslt
pkg-config

I think these belong in buildInputs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I moved them, it still seems to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops you'll want to keep qt6.wrapQtAppsHook in nativeBuildInputs.

'';

env = {
NIX_CFLAGS_COMPILE = "-I${graphviz}/include/graphviz";
Copy link
Contributor

@alejo7797 alejo7797 Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NIX_CFLAGS_COMPILE = "-I${graphviz}/include/graphviz";

Does the build still fail if you remove this? It works for me. stdenv should take care of this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works now without it.

@noiioiu noiioiu force-pushed the regina-normal branch 3 times, most recently from fbe8516 to 47f0ec6 Compare August 19, 2025 18:27
Copy link
Contributor

@alejo7797 alejo7797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another small change that reduces boilerplate.

@noiioiu noiioiu force-pushed the regina-normal branch 3 times, most recently from 878fdb6 to ce03ca7 Compare August 20, 2025 01:27
--replace-fail "my \$python_lib_dir = '''" \
"my \$python_lib_dir = '${placeholder "out"}/${python3.sitePackages}'"
patchShebangs utils/testsuite/*.{in,test,sh} python/testsuite/test*.in python/regina-python.in
'';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'';
''
+ lib.optionalString stdenv.buildPlatform.isDarwin ''
substituteInPlace utils/testsuite/runtest.sh \
--replace-fail "\`locale charmap 2>/dev/null\`" "UTF-8"
'';

One of the tests was failing on Darwin, hopefully this fixes that?

Copy link
Contributor

@alejo7797 alejo7797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another suggestion: setting REGINA_PYLIBDIR in a wrapper is probably a more robust way of getting Regina to find its Python module, and depends less on how regina-python.in looks than patching that manually.

Comment on lines +62 to +64
substituteInPlace python/regina-python.in \
--replace-fail "my \$python_lib_dir = '''" \
"my \$python_lib_dir = '${placeholder "out"}/${python3.sitePackages}'"
Copy link
Contributor

@alejo7797 alejo7797 Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
substituteInPlace python/regina-python.in \
--replace-fail "my \$python_lib_dir = '''" \
"my \$python_lib_dir = '${placeholder "out"}/${python3.sitePackages}'"

"-DCMAKE_POLICY_DEFAULT_CMP0153=OLD"
]
++ lib.optionals highDim [ "-DHIGHDIM=1" ];

Copy link
Contributor

@alejo7797 alejo7797 Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
preFixup = ''
qtWrapperArgs+=(--set-default REGINA_PYLIBDIR "$out/${python3.sitePackages}")
'';
postFixup = ''
# wrapQtAppsHook ignores files that are non-ELF executables
wrapProgram $out/bin/regina-python \
--set-default REGINA_PYLIBDIR $out/${python3.sitePackages}
'';

Copy link
Contributor

@alejo7797 alejo7797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can clean up some CMake flags and environment variables.

Comment on lines +75 to +76
"-DPython_EXECUTABLE=${python3.interpreter}"
"-DPython_SITELIB=${python3.sitePackages}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"-DPython_EXECUTABLE=${python3.interpreter}"
"-DPython_SITELIB=${python3.sitePackages}"

From my understanding, CMake sets these by itself when looking for Python.

Comment on lines +68 to +72
env = {
PERL_PYLIBDIR = "${placeholder "out"}/${python3.sitePackages}";
BASH_CMAKE_SOURCE_DIR = "${finalAttrs.src}";
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
env = {
PERL_PYLIBDIR = "${placeholder "out"}/${python3.sitePackages}";
BASH_CMAKE_SOURCE_DIR = "${finalAttrs.src}";
};

I don't think we need to set these. They get taken care of here and here using macros from this file.

stdenv.mkDerivation (finalAttrs: {
pname = "regina-normal";
version = "7.3.1";

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants