Skip to content

Commit

Permalink
Add fish-dev port.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raimondi committed Jun 23, 2015
1 parent b543e0a commit 09ffa76
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 0 deletions.
58 changes: 58 additions & 0 deletions 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
"
12 changes: 12 additions & 0 deletions 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;
}

/**
24 changes: 24 additions & 0 deletions 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 <vector>
-#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 <memory>
using std::shared_ptr;
#else
-// C++03
+// C++03 or libstdc++
#include <tr1/memory>
using std::tr1::shared_ptr;
#endif
11 changes: 11 additions & 0 deletions 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" );
23 changes: 23 additions & 0 deletions 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

0 comments on commit 09ffa76

Please sign in to comment.