From d727b87f5a56d04ed11b9d68f4cb4efa93444457 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Tue, 2 Mar 2021 22:22:06 +0700 Subject: [PATCH 1/2] cwebbin: fix build on darwin and fix cross-compilation --- pkgs/development/tools/misc/cwebbin/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/cwebbin/default.nix b/pkgs/development/tools/misc/cwebbin/default.nix index 3ab8800f3c4..055a24f3fe0 100644 --- a/pkgs/development/tools/misc/cwebbin/default.nix +++ b/pkgs/development/tools/misc/cwebbin/default.nix @@ -16,7 +16,15 @@ stdenv.mkDerivation rec { sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj"; }; - buildInputs = [ tie ]; + # Remove references to __DATE__ and __TIME__ + postPatch = '' + substituteInPlace wmerg-patch.ch --replace ' ("__DATE__", "__TIME__")' "" + substituteInPlace ctang-patch.ch --replace ' ("__DATE__", "__TIME__")' "" + substituteInPlace ctangle.cxx --replace ' ("__DATE__", "__TIME__")' "" + substituteInPlace cweav-patch.ch --replace ' ("__DATE__", "__TIME__")' "" + ''; + + nativeBuildInputs = [ tie ]; makeFlags = [ "MACROSDIR=$(out)/share/texmf/tex/generic/cweb" @@ -27,7 +35,7 @@ stdenv.mkDerivation rec { "CP=cp" "RM=rm" "PDFTEX=echo" - "CC=c++" + "CC=${stdenv.cc.targetPrefix}c++" ]; buildPhase = '' From dda5a4ebfd2dbf8c42a1e2f2d6757c4089519424 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Tue, 2 Mar 2021 22:22:20 +0700 Subject: [PATCH 2/2] edit: 20160425 -> 20180228 - Fix compilation on darwin - Fix buildInputs specification --- pkgs/applications/editors/edit/default.nix | 27 ++++++++-------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/editors/edit/default.nix b/pkgs/applications/editors/edit/default.nix index 25e620c51e4..cc8d184a3a0 100644 --- a/pkgs/applications/editors/edit/default.nix +++ b/pkgs/applications/editors/edit/default.nix @@ -2,39 +2,30 @@ stdenv.mkDerivation { pname = "edit-nightly"; - version = "20160425"; + version = "20180228"; src = fetchgit { url = "git://c9x.me/ed.git"; - rev = "323d49b68c5e804ed3b8cada0e2274f1589b3484"; - sha256 = "0wv8i3ii7cd9bqhjpahwp2g5fcmyk365nc7ncmvl79cxbz3f7y8v"; + rev = "77d96145b163d79186c722a7ffccfff57601157c"; + sha256 = "0rsmp7ydmrq3xx5q19566is9a2v2w5yfsphivfc7j4ljp32jlyyy"; }; - buildInputs = [ - unzip - pkg-config - ncurses - libX11 - libXft - cwebbin - ]; + nativeBuildInputs = [ unzip pkg-config cwebbin ]; + buildInputs = [ ncurses libX11 libXft ]; - buildPhase = '' + preBuild = '' ctangle *.w - make ''; installPhase = '' - mkdir -p $out/bin/ - cp obj/edit $out/bin/edit + install -Dm755 obj/edit -t $out/bin ''; meta = with lib; { description = "A relaxing mix of Vi and ACME"; - homepage = "http://c9x.me/edit"; + homepage = "https://c9x.me/edit"; license = licenses.publicDomain; maintainers = [ maintainers.vrthra ]; - platforms = platforms.linux; + platforms = platforms.all; }; } -