aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/libedit
diff options
context:
space:
mode:
authorDomen Kozar <domen@dev.si>2013-10-31 00:43:32 +0100
committerDomen Kožar <domen@dev.si>2013-10-31 00:47:33 +0100
commitd9ba4378751f32f6ab5b31640cf3967a5efb43aa (patch)
tree91ec321ac0d9d57d7ed1a6a1703cb9ec53df1333 /pkgs/development/libraries/libedit
parent92e3206c2ae8219415978dbf1bfc6d35604d17ae (diff)
libedit: add FreeBSD support
Diffstat (limited to 'pkgs/development/libraries/libedit')
-rw-r--r--pkgs/development/libraries/libedit/default.nix3
-rw-r--r--pkgs/development/libraries/libedit/freebsd.patch13
-rw-r--r--pkgs/development/libraries/libedit/freebsd_weak_ref.patch20
3 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix
index cc5cd0beee92..1382af16484c 100644
--- a/pkgs/development/libraries/libedit/default.nix
+++ b/pkgs/development/libraries/libedit/default.nix
@@ -15,6 +15,9 @@ stdenv.mkDerivation rec {
sed -i s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc
'';
+ # taken from gentoo http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libedit/files/
+ patches = [ ./freebsd.patch ./freebsd_weak_ref.patch ];
+
configureFlags = "--enable-widec";
propagatedBuildInputs = [ ncurses ];
diff --git a/pkgs/development/libraries/libedit/freebsd.patch b/pkgs/development/libraries/libedit/freebsd.patch
new file mode 100644
index 000000000000..e230a76d709f
--- /dev/null
+++ b/pkgs/development/libraries/libedit/freebsd.patch
@@ -0,0 +1,13 @@
+diff --git a/src/chartype.h b/src/chartype.h
+index c35825c..be5aac0 100644
+--- a/src/chartype.h
++++ b/src/chartype.h
+@@ -44,7 +44,7 @@
+ * supports non-BMP code points without requiring UTF-16, but nothing
+ * seems to actually advertise this properly, despite Unicode 3.1 having
+ * been around since 2001... */
+-#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__))
++#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__DragonFly__) && !defined(__FreeBSD__)
+ #ifndef __STDC_ISO_10646__
+ /* In many places it is assumed that the first 127 code points are ASCII
+ * compatible, so ensure wchar_t indeed does ISO 10646 and not some other
diff --git a/pkgs/development/libraries/libedit/freebsd_weak_ref.patch b/pkgs/development/libraries/libedit/freebsd_weak_ref.patch
new file mode 100644
index 000000000000..a4399593d636
--- /dev/null
+++ b/pkgs/development/libraries/libedit/freebsd_weak_ref.patch
@@ -0,0 +1,20 @@
+--- libedit-20110709-3.0/src/vi.c.old 2011-07-11 18:21:16.000000000 +0000
++++ libedit-20110709-3.0/src/vi.c 2011-07-11 18:24:29.000000000 +0000
+@@ -918,7 +918,7 @@
+ * NB: posix implies that we should enter insert mode, however
+ * this is against historical precedent...
+ */
+-#ifdef __weak_reference
++#if defined(__weak_reference) && defined(__NetBSD__)
+ __weakref_visible char *my_get_alias_text(const char *)
+ __weak_reference(get_alias_text);
+ #endif
+@@ -926,7 +926,7 @@
+ /*ARGSUSED*/
+ vi_alias(EditLine *el, Int c)
+ {
+-#ifdef __weak_reference
++#if defined(__weak_reference) && defined(__NetBSD__)
+ char alias_name[3];
+ char *alias_text;
+