Commit 57f9f086 authored by aleksana's avatar aleksana
Browse files

nvi: fix darwin build

parent 92a65c64
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
let
  url = "https://github.com/macports/macports-ports/raw/abae7e550897dc13b7a48763a7a022b709d8793f/editors/nvi/files";
  hashes = {
    "dynamic_lookup-11.patch" = "sha256-eXLSMUtslSXLYd1HZRD6pfqcYMIA3EtixWL1yvx4ook=";
    "patch-common_key.h.diff" = "sha256-AAO/2lHpmFJMYb9fyQrWnGPaJYLdwhrp87tbHu5hr/k=";
    "patch-dist_port.h.in.diff" = "sha256-GPKgIm9pDGtN6CNqbX3+hANkZbYFql5K5JyjCr5TIKI=";
    "patch-ex_script.c.diff" = "sha256-IUuJ7b6A5O3q6qQCwZsrc9Bt1LpjU3DgxHTwtMp16Qc=";
    "patch-includes.diff" = "sha256-j3V4LmcJEFqnTlTHFZFd8NtycEa+GKM+ZIUwZHjq15w=";
  };
in
builtins.attrValues (
  builtins.mapAttrs (n: v: {
    url = "${url}/${n}";
    hash = v;
    extraPrefix = "";
  }) hashes
)
+12 −3
Original line number Diff line number Diff line
@@ -2,8 +2,10 @@
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  ncurses,
  db,
  libiconv,
}:

stdenv.mkDerivation rec {
@@ -17,12 +19,18 @@ stdenv.mkDerivation rec {

  patches =
    # Apply patches from debian package
    map fetchurl (import ./debian-patches.nix);
    (map fetchurl (import ./debian-patches.nix))
    ++
      # Also select patches from macports
      # They don't interfere with Linux build
      # https://github.com/macports/macports-ports/tree/master/editors/nvi/files
      (map fetchpatch (import ./macports-patches.nix));

  buildInputs = [
    ncurses
    db
  ];
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];

  preConfigure = ''
    cd build.unix
@@ -35,6 +43,8 @@ stdenv.mkDerivation rec {
    "--enable-widechar"
  ];

  env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-liconv";

  meta = {
    description = "Berkeley Vi Editor";
    longDescription = ''
@@ -53,6 +63,5 @@ stdenv.mkDerivation rec {
      suominen
      aleksana
    ];
    broken = stdenv.hostPlatform.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/nvi.x86_64-darwin
  };
}