From 09ffa76ed9b700ec14f0594047c278b5974bf1fa Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Tue, 23 Jun 2015 18:12:15 -0400 Subject: [PATCH] Add fish-dev port. --- shells/fish-dev/Portfile | 58 +++++++++++++++++++ .../files/patch-ambiguous-overload.diff | 12 ++++ shells/fish-dev/files/patch-c++11-tr1.diff | 24 ++++++++ shells/fish-dev/files/patch-proc_c.diff | 11 ++++ .../files/patch-share_config_fish.diff | 23 ++++++++ 5 files changed, 128 insertions(+) create mode 100644 shells/fish-dev/Portfile create mode 100644 shells/fish-dev/files/patch-ambiguous-overload.diff create mode 100644 shells/fish-dev/files/patch-c++11-tr1.diff create mode 100644 shells/fish-dev/files/patch-proc_c.diff create mode 100644 shells/fish-dev/files/patch-share_config_fish.diff diff --git a/shells/fish-dev/Portfile b/shells/fish-dev/Portfile new file mode 100644 index 0000000..482700a --- /dev/null +++ b/shells/fish-dev/Portfile @@ -0,0 +1,58 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id: Portfile 134857 2015-04-08 22:34:36Z ryandesign@macports.org $ + +PortSystem 1.0 +PortGroup github 1.0 + +github.setup fish-shell fish-shell 4621e763b63dd764bc96cc5fe36613b4e0404e6b +name fish-dev +license GPL-2 +categories shells +platforms darwin +maintainers nomaintainer + +description A command line shell for the 90s +long_description fish is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family + +conflicts fish + +homepage http://fishshell.com/ +#github.tarball_from releases +distname ${name}-${version} + +#checksums rmd160 109e3fbb07e36a6cf2b651b148d3a60eca9f8930 \ +# sha256 c6c20d5ca3a2a0168461de8abfe85f9e6b255132698ea0109998d4ab68f9f6dd +checksum {} +depends_build port:doxygen \ + port:autoconf \ + path:bin/dot:graphviz +depends_lib port:libiconv \ + port:ncurses \ + port:gettext + +patchfiles patch-share_config_fish.diff + +post-patch { + reinplace "s|@@PREFIX@@|${prefix}/bin|g" "${worksrcpath}/share/config.fish" + reinplace "s|DEF_VER=2.0.GIT|DEF_VER=${version}|" ${worksrcpath}/build_tools/git_version_gen.sh +} + +use_autoconf yes +#pre-configure { +# exec {autoconf} +#} + +notes " +To set MacPorts' ${name} as default login shell, run: + + sudo chpass -s ${prefix}/bin/${name} \${USER} + +To be able to switch default shells to or from ${name} without superuser\ +privileges, add it to /etc/shells: + + sudo sh -c 'echo ${prefix}/bin/${name} >> /etc/shells' + +For X clipboard integration, install the xsel port: + + sudo port install xsel +" diff --git a/shells/fish-dev/files/patch-ambiguous-overload.diff b/shells/fish-dev/files/patch-ambiguous-overload.diff new file mode 100644 index 0000000..8b8f1fb --- /dev/null +++ b/shells/fish-dev/files/patch-ambiguous-overload.diff @@ -0,0 +1,12 @@ +Upstream: https://github.com/fish-shell/fish-shell/commit/a8af97489549ef737b1518888545c9fedcf380ef +--- exec.cpp ++++ exec.cpp +@@ -376,7 +376,7 @@ static void launch_process_nofork(process_t *p) + */ + static int has_fd(const io_chain_t &d, int fd) + { +- return io_chain_get(d, fd) != NULL; ++ return io_chain_get(d, fd).get() != NULL; + } + + /** diff --git a/shells/fish-dev/files/patch-c++11-tr1.diff b/shells/fish-dev/files/patch-c++11-tr1.diff new file mode 100644 index 0000000..3f632f8 --- /dev/null +++ b/shells/fish-dev/files/patch-c++11-tr1.diff @@ -0,0 +1,24 @@ +Upstream: https://github.com/fish-shell/fish-shell/issues/968 +Upstream: https://github.com/fish-shell/fish-shell/commit/7541fac245b47cce023ba4b12b4216e671508780 +--- io.h ++++ io.h +@@ -2,12 +2,16 @@ + #define FISH_IO_H + + #include +-#if __cplusplus > 199711L +-// C++11 ++ ++// Note that we have to include something to get any _LIBCPP_VERSION defined so we can detect libc++ ++// So it's key that vector go above. If we didn't need vector for other reasons, we might include ciso646, which does nothing ++ ++#if defined(_LIBCPP_VERSION) || __cplusplus > 199711L ++// C++11 or libc++ (which is a C++11-only library, but the memory header works OK in C++03) + #include + using std::shared_ptr; + #else +-// C++03 ++// C++03 or libstdc++ + #include + using std::tr1::shared_ptr; + #endif diff --git a/shells/fish-dev/files/patch-proc_c.diff b/shells/fish-dev/files/patch-proc_c.diff new file mode 100644 index 0000000..e186f36 --- /dev/null +++ b/shells/fish-dev/files/patch-proc_c.diff @@ -0,0 +1,11 @@ +--- proc.c.orig 2012-11-07 17:28:40.000000000 +0100 ++++ proc.c 2012-11-07 17:29:19.000000000 +0100 +@@ -931,7 +931,7 @@ + static int terminal_return_from_job( job_t *j) + { + +- if( tcsetpgrp (0, getpid()) ) ++ if( tcsetpgrp (0, getpgrp()) ) + { + debug( 1, _( L"Could not return shell to foreground" ) ); + wperror( L"tcsetpgrp" ); diff --git a/shells/fish-dev/files/patch-share_config_fish.diff b/shells/fish-dev/files/patch-share_config_fish.diff new file mode 100644 index 0000000..d43191f --- /dev/null +++ b/shells/fish-dev/files/patch-share_config_fish.diff @@ -0,0 +1,23 @@ +--- share/config.fish.orig 2013-07-03 12:24:07.000000000 +0200 ++++ share/config.fish 2013-07-03 12:24:36.000000000 +0200 +@@ -91,6 +91,20 @@ + for pathfile in /etc/paths.d/* ; __fish_load_path_helper_paths < $pathfile ; end + functions -e __fish_load_path_helper_paths + ++# MacPorts specific PATH setting, move ${prefix}/bin at PATH's head ++set MP_PREFIX /opt/local/bin ++if contains $MP_PREFIX $PATH ++ set -e MP_PATH ++ for path_component in $PATH ++ if test $path_component != /opt/local/bin ++ set MP_PATH $MP_PATH $path_component ++ end ++ end ++ set MP_PATH $MP_PREFIX $MP_PATH ++ set PATH $MP_PATH ++ set -e MP_PATH ++end ++set -e MP_PREFIX + + # + # Launch debugger on SIGTRAP