diff --git a/pkgs/applications/misc/termite/add_errno_header.patch b/pkgs/applications/misc/termite/add_errno_header.patch new file mode 100644 index 000000000000..81283f86a21d --- /dev/null +++ b/pkgs/applications/misc/termite/add_errno_header.patch @@ -0,0 +1,24 @@ +From 95c90f302c384f410dc92e64468ac7061b57fe2d Mon Sep 17 00:00:00 2001 +From: Michael Hoang +Date: Fri, 13 Jul 2018 19:03:09 +1000 +Subject: [PATCH] Add errno.h header which isn't always included automatically. + +--- + termite.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/termite.cc b/termite.cc +index 160fe82..13e2572 100644 +--- a/termite.cc ++++ b/termite.cc +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +2.17.1 + diff --git a/pkgs/applications/misc/termite/default.nix b/pkgs/applications/misc/termite/default.nix index 46276bbb03fb..560dff594275 100644 --- a/pkgs/applications/misc/termite/default.nix +++ b/pkgs/applications/misc/termite/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, pkgconfig, vte, gtk3, ncurses, makeWrapper, wrapGAppsHook, symlinkJoin +{ stdenv, fetchFromGitHub, lib, pkgconfig, vte, gtk3, ncurses, makeWrapper, wrapGAppsHook, symlinkJoin , configFile ? null }: @@ -7,16 +7,17 @@ let termite = stdenv.mkDerivation { name = "termite-${version}"; - src = fetchgit { - url = "https://github.com/thestinger/termite"; - rev = "refs/tags/v${version}"; + src = fetchFromGitHub { + owner = "thestinger"; + repo = "termite"; + rev = "v${version}"; sha256 = "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj"; + fetchSubmodules = true; }; # https://github.com/thestinger/termite/pull/516 - patches = [ ./url_regexp_trailing.patch ]; - - postPatch = "sed '1i#include ' -i termite.cc"; + patches = [ ./url_regexp_trailing.patch ./add_errno_header.patch + ] ++ lib.optional stdenv.isDarwin ./remove_ldflags_macos.patch; makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ]; diff --git a/pkgs/applications/misc/termite/remove_ldflags_macos.patch b/pkgs/applications/misc/termite/remove_ldflags_macos.patch new file mode 100644 index 000000000000..f8c68518bb4d --- /dev/null +++ b/pkgs/applications/misc/termite/remove_ldflags_macos.patch @@ -0,0 +1,25 @@ +From 1b5a6934635c55472eb7949bd87ab3f45fa1b2f3 Mon Sep 17 00:00:00 2001 +From: Michael Hoang +Date: Fri, 13 Jul 2018 19:01:51 +1000 +Subject: [PATCH] Remove --as-needed flag from ld to fix compilation on macOS. + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index b115f42..ab301ba 100644 +--- a/Makefile ++++ b/Makefile +@@ -29,7 +29,7 @@ ifeq (${CXX}, clang++) + CXXFLAGS += -Wimplicit-fallthrough + endif + +-LDFLAGS := -s -Wl,--as-needed ${LDFLAGS} ++LDFLAGS := -s -Wl ${LDFLAGS} + LDLIBS := ${shell pkg-config --libs ${GTK} ${VTE}} + + termite: termite.cc url_regex.hh util/clamp.hh util/maybe.hh util/memory.hh +-- +2.17.1 +