Skip to content
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

xephem: init at 4.2.0 #294622

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

EstebanMacanek
Copy link

@EstebanMacanek EstebanMacanek commented Mar 10, 2024

Description of changes

Add xephem to nixpkgs.
The Serious Interactive Astronomical Software Ephemeris
https://xephem.github.io/XEphem/Site/xephem.html

Things done

  • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (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.

Add a 👍 reaction to pull requests you find important.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Mar 10, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-linux: 1-10 10.rebuild-linux: 1 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Mar 10, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Mar 10, 2024
@rafameou
Copy link
Member

rafameou commented Mar 13, 2024

Please squash your commits: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions
Next time you need to fix something, you should patch+ammend your "init" commit instead of creating new ones, check section 7: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#how-to-create-pull-requests

Comment on lines 56 to 79
meta = with lib; {
description = "The Serious Interactive Astronomical Software Ephemeris";
mainProgram = "xephem";
homepage = "https://xephem.github.io/XEphem/Site/xephem.html";
license = licenses.mit;
maintainers = with maintainers; [ EstebanMacanek ];
platforms = platforms.unix;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
meta = with lib; {
description = "The Serious Interactive Astronomical Software Ephemeris";
mainProgram = "xephem";
homepage = "https://xephem.github.io/XEphem/Site/xephem.html";
license = licenses.mit;
maintainers = with maintainers; [ EstebanMacanek ];
platforms = platforms.unix;
meta = {
description = "The Serious Interactive Astronomical Software Ephemeris";
mainProgram = "xephem";
homepage = "https://xephem.github.io/XEphem/Site/xephem.html";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ EstebanMacanek ];
platforms = lib.platforms.unix;

@@ -39617,6 +39617,7 @@ with pkgs;
vite = libsForQt5.callPackage ../applications/science/misc/vite { };

xearth = callPackage ../applications/science/astronomy/xearth { };

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

pkgs/by-name/xe/xephem/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/xe/xephem/package.nix Show resolved Hide resolved
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 9, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 2, 2025
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 20, 2025
@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Jan 20, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 20, 2025
@EstebanMacanek EstebanMacanek force-pushed the add-xephem branch 2 times, most recently from 49ccb55 to 8b23aab Compare January 20, 2025 21:04
hash = "sha256-TuzXrWoJOAHg31DrJObPcHBXgtqR/KWKFRsqddPzL4c=";
};

sourceRoot = "${src.name}/GUI/xephem";
Copy link
Member

Choose a reason for hiding this comment

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

Seems to cause errors when building

Assembler messages:
Fatal error: can't create aa_hadec.o: Permission denied

Copy link
Author

Choose a reason for hiding this comment

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

Do you know where the source code for sourceRoot is? I tried searching for it in NixOS/nix but couldn't find the definition. I think the error might be that sourceRoot changes the mode bits of the parents directories.

Copy link
Member

Choose a reason for hiding this comment

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

sourceRoot is not a formal parameter. It is set as environment variable and used in pkgs/stdenv/generic/setup.sh (line 1300+).

Probably the problem is that the mode bit of parent directories is not changed to allow writing, when using sourceRoot.


sourceRoot = "${src.name}/GUI/xephem";
postPatch = ''
sed -i "s|/etc/XEphem|$out/etc/XEphem|" xephem.c
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sed -i "s|/etc/XEphem|$out/etc/XEphem|" xephem.c
substituteInPlace xephem.c --replace-fail '/etc/XEphem' '${placeholder "out"}/etc/XEphem'

@EstebanMacanek EstebanMacanek force-pushed the add-xephem branch 2 times, most recently from fb0b9d6 to 2d446b1 Compare January 22, 2025 02:04
@EstebanMacanek EstebanMacanek force-pushed the add-xephem branch 4 times, most recently from c107ce7 to 1f4537c Compare January 25, 2025 00:18
@EstebanMacanek EstebanMacanek force-pushed the add-xephem branch 2 times, most recently from f41063b to c80eaa3 Compare January 25, 2025 20:24
}:

stdenv.mkDerivation rec {
pname = "xephen";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pname = "xephen";
pname = "xephem";

pkgs/by-name/xe/xephem/package.nix Show resolved Hide resolved
Comment on lines 26 to 38
nativeBuildInputs = [
motif
openssl
groff
xorg.libXmu
xorg.libXext
xorg.libXt
copyDesktopItems
installShellFiles
];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
nativeBuildInputs = [
motif
openssl
groff
xorg.libXmu
xorg.libXext
xorg.libXt
copyDesktopItems
installShellFiles
];
nativeBuildInputs = [
copyDesktopItems
installShellFiles
groff # nroff
];
buildInputs = [
motif
openssl
xorg.libXmu
xorg.libXext
xorg.libXt
];

Runtime dependencies go in buildInputs.

homepage = "https://xephem.github.io/XEphem/Site/xephem.html";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ EstebanMacanek ];
platforms = lib.platforms.unix;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
platforms = lib.platforms.unix;
platforms = lib.platforms.unix;
# Makefiles hardcode unprefixed tools everywhere
broken = stdenv.buildPlatform != stdenv.hostPlatform;

Currently the package does not cross-compile, so we should mark it as such.

Copy link
Author

@EstebanMacanek EstebanMacanek Jan 26, 2025

Choose a reason for hiding this comment

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

is there any way i can patch this?
would this help: https://nixos.org/manual/nixpkgs/stable/#cross-qa-fails-to-find-binutils?

Copy link
Member

Choose a reason for hiding this comment

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

No, you would need to replace all occurences of cc / ar / ranlib manually, since some Makefiles do not use the CC variables etc.

https://github.com/XEphem/XEphem/blob/main/libz/Makefile

];

meta = {
description = "The Serious Interactive Astronomical Software Ephemeris";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description = "The Serious Interactive Astronomical Software Ephemeris";
description = "Serious Interactive Astronomical Software Ephemeris";

Usually description does not start with an article

@FliegendeWurst
Copy link
Member

Will merge after you take care of my last round of suggestions.

@EstebanMacanek EstebanMacanek force-pushed the add-xephem branch 3 times, most recently from 6ed8efc to 3264898 Compare January 26, 2025 18:24
checkTarget = "run-test";

makeFlags = [
"GCC=${stdenv.gcc.targetPrefix}gcc"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"GCC=${stdenv.gcc.targetPrefix}gcc"
"GCC=${stdenv.cc.targetPrefix}gcc"

The targetPrefix is actually the same for all tools and accessed via cc

"CC=${stdenv.cc.targetPrefix}cc"
"XLC=${stdenv.xlc.targetPrefix}xlc"
"NROFF=${stdenv.nroff.targetPrefix}nroff"
"CD=${stdenv.cd.targetPrefix}cd"
Copy link
Member

Choose a reason for hiding this comment

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

I would guess you can drop CD and RM, these do not have cross versions.

"RM=${stdenv.rm.targetPrefix}rm"
"AR=${stdenv.ar.targetPrefix}ar"
"RANLIB=${stdenv.ranlib.targetPrefix}ranlib"
"TOUCH=${stdenv.touch.targetPrefix}touch"
Copy link
Member

Choose a reason for hiding this comment

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

And touch too, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes 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.

6 participants