diff options
author | Michael Hoang <Enzime@users.noreply.github.com> | 2018-07-14 09:00:39 +1000 |
---|---|---|
committer | xeji <36407913+xeji@users.noreply.github.com> | 2018-07-14 01:00:39 +0200 |
commit | d73fac6b102ae6a77d0e07647f87f00e09d100b9 (patch) | |
tree | a3f80f369971fb1d6426c6aab140be656e59dfc9 /pkgs/applications/misc | |
parent | 1e4cd7a81014b2dce0f7590e90bbb42ab9e74fc2 (diff) | |
download | nixlib-d73fac6b102ae6a77d0e07647f87f00e09d100b9.tar nixlib-d73fac6b102ae6a77d0e07647f87f00e09d100b9.tar.gz nixlib-d73fac6b102ae6a77d0e07647f87f00e09d100b9.tar.bz2 nixlib-d73fac6b102ae6a77d0e07647f87f00e09d100b9.tar.lz nixlib-d73fac6b102ae6a77d0e07647f87f00e09d100b9.tar.xz nixlib-d73fac6b102ae6a77d0e07647f87f00e09d100b9.tar.zst nixlib-d73fac6b102ae6a77d0e07647f87f00e09d100b9.zip |
termite: Add support for macOS (#43415)
Replace fetchgit with fetchFromGitHub now that it supports fetching submodules. Remove unnecessary postPatch to add <math.h> as termite already includes <cmath>. Add a patch to include <errno.h> on all platforms and remove the --as-needed flag from ld on macOS.
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r-- | pkgs/applications/misc/termite/add_errno_header.patch | 24 | ||||
-rw-r--r-- | pkgs/applications/misc/termite/default.nix | 15 | ||||
-rw-r--r-- | pkgs/applications/misc/termite/remove_ldflags_macos.patch | 25 |
3 files changed, 57 insertions, 7 deletions
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 <enzime@users.noreply.github.com> +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 <cstdlib> + #include <cstring> + #include <cmath> ++#include <errno.h> + #include <functional> + #include <limits> + #include <map> +-- +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 <math.h>' -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 <enzime@users.noreply.github.com> +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 + |