Skip to content

nvi: Fix build by applying Debian patches and enabling wide chars - #410629

Closed
suominen wants to merge 1 commit into
NixOS:masterfrom
suominen:nvi-deb-patches
Closed

suominen wants to merge 1 commit into
NixOS:masterfrom
suominen:nvi-deb-patches

Conversation

@suominen

@suominen suominen commented May 24, 2025 •

Copy link
Copy Markdown
Contributor

Instead of fetching a couple of patches from Fedora, apply all the Debian patches. Also use the same configure options as Debian, most importantly enabling wide chars. This makes it build again.

Resolves #382978.

Side notes:

  • nvi is my daily editor and I want to make sure it is usable in NixOS.
  • I will need to learn the backport part to get this into 25.05 so I can continue editing.

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 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 24.11 and 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.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions Bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 24, 2025
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5513

@Prince213

Copy link
Copy Markdown
Member

@tnias tnias mentioned this pull request May 30, 2025
3 tasks done

@tnias tnias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thaks for your effort to fix nvi in nixpkgs. :)

Comment thread pkgs/by-name/nv/nvi/package.nix Resolved
Comment thread pkgs/by-name/nv/nvi/package.nix Resolved
Comment thread pkgs/by-name/nv/nvi/package.nix Resolved
@Sigmanificient Sigmanificient mentioned this pull request May 25, 2025
27 of 28 tasks
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. labels Sep 15, 2025
@ddz

ddz commented Sep 15, 2025

Copy link
Copy Markdown
Contributor

I discovered this PR after authoring and opening this one: #442968

The notable difference is in how the debian patches are applied. My PR uses the in-tree script at maintainers/scripts/debian-patches.sh to create the debian-patches.nix file vs. downloading the debian-extras as yours does. I also tried to maintain the existing nixpkgs configure flags vs. adopting all of the Debian package's configure flags. I don't see a strong reason to favor one approach over the other, just that debian-patches.nix is already used in a number of other places in the tree.

It appears that you are a heavier user of nvi than I am, I'm happy to combine the approaches in these two PRs. I mostly want nvi to work again as a lightweight editor in my system packages.

@suominen

suominen commented Oct 2, 2025 •

Copy link
Copy Markdown
Contributor Author

I'm using nvi daily: it is my primary editor. It would be nice to get this merged, so that I don't need to maintain a forked version of it.

@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5909

Comment on lines +15 to +20
base_url = "mirror://debian/pool/main/n/${pname}/${pname}_${version}";

debian-extras = fetchzip {
url = "${base_url}-${deb_version}.debian.tar.xz";
hash = "sha256-dR7vZtCV5PjUDlNTWxubxH7eucizkPRaMlyNdziud84=";
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
base_url = "mirror://debian/pool/main/n/${pname}/${pname}_${version}";
debian-extras = fetchzip {
url = "${base_url}-${deb_version}.debian.tar.xz";
hash = "sha256-dR7vZtCV5PjUDlNTWxubxH7eucizkPRaMlyNdziud84=";
};
debian-extras = fetchzip {
url = "mirror://debian/pool/main/n/nvi/nvi_${version}-${deb_version}.debian.tar.xz";
hash = "sha256-dR7vZtCV5PjUDlNTWxubxH7eucizkPRaMlyNdziud84=";
};

Comment on lines +23 to +24
inherit pname;
inherit version;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
inherit pname;
inherit version;
inherit pname version;


src = fetchurl {
url = "https://deb.debian.org/debian/pool/main/n/nvi/nvi_${version}.orig.tar.gz";
url = "${base_url}.orig.tar.gz";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
url = "${base_url}.orig.tar.gz";
url = "mirror://debian/pool/main/n/nvi/nvi_${version}.orig.tar.gz";


preConfigure = ''
cd build.unix
# mkdir -p /var/tmp/vi.recover

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# mkdir -p /var/tmp/vi.recover

Comment on lines +47 to +67
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Commented out entries without other comments are commented out due to
# request by @tnias in PR #410629 due to no difference when examined with
# diffoscope.
#
# Keeping as comments to make tracking Debian easier.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# "--disable-curses"
# "--disable-shared"
# "--enable-static"
"--enable-widechar"
# "--disable-threads"
# "--without-x"
# "--with-gnu-ld=yes"
# XXX: TODO: Integrate with a sendmail facility for recover file notifications
# "ac_cv_path_vi_cv_path_sendmail=sendmail"
# XXX: TODO: This should auto-detect /var/tmp/vi.recover instead
"vi_cv_path_preserve=/var/tmp"
# Let autoconf select shell from stdenv
# "vi_cv_path_shell=/bin/sh"
# "vi_cv_revoke=no"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Commented out entries without other comments are commented out due to
# request by @tnias in PR #410629 due to no difference when examined with
# diffoscope.
#
# Keeping as comments to make tracking Debian easier.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# "--disable-curses"
# "--disable-shared"
# "--enable-static"
"--enable-widechar"
# "--disable-threads"
# "--without-x"
# "--with-gnu-ld=yes"
# XXX: TODO: Integrate with a sendmail facility for recover file notifications
# "ac_cv_path_vi_cv_path_sendmail=sendmail"
# XXX: TODO: This should auto-detect /var/tmp/vi.recover instead
"vi_cv_path_preserve=/var/tmp"
# Let autoconf select shell from stdenv
# "vi_cv_path_shell=/bin/sh"
# "vi_cv_revoke=no"
"--enable-widechar"
# XXX: TODO: Integrate with a sendmail facility for recover file notifications
# "ac_cv_path_vi_cv_path_sendmail=sendmail"
# XXX: TODO: This should auto-detect /var/tmp/vi.recover instead
"vi_cv_path_preserve=/var/tmp"

version = "1.81.6";
deb_version = "23";

base_url = "mirror://debian/pool/main/n/${pname}/${pname}_${version}";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Substituting pname like this is an anti pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: nvi

7 participants