Skip to content

Instantly share code, notes, and snippets.

@fire
Forked from AlainODea/install-git-annex.sh
Last active August 29, 2015 14:02
Show Gist options
  • Save fire/5a5236653f4ad5099321 to your computer and use it in GitHub Desktop.
Save fire/5a5236653f4ad5099321 to your computer and use it in GitHub Desktop.
git clone https://github.com/jystic/network-info.git
curl https://gist.githubusercontent.com/fire/5a5236653f4ad5099321/raw/db7518eef55a37ed57811716811c553fec701ac9/network-info.patch > network-info.patch
patch network-info/cbits/network-unix.c network-info.patch
mkdir test
cd test/
cabal sandbox init
cabal sandbox add-source ../network-info
cabal install git-annex --bindir=$HOME/bin -f"-assistant -webapp -webdav -pairing -xmpp -dns"
From caae700742aa22e6b09035f38776ab42a2c10eab Mon Sep 17 00:00:00 2001
From: Robert Mustacchi <rm@joyent.com>
Date: Sat, 7 Jun 2014 06:43:46 +0000
Subject: [PATCH] fix illumos build
---
cbits/network-unix.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cbits/network-unix.c b/cbits/network-unix.c
index eb6310c..be0770c 100644
--- a/cbits/network-unix.c
+++ b/cbits/network-unix.c
@@ -13,8 +13,10 @@
# include <sys/socket.h>
# include <net/if.h>
# include <net/if_dl.h>
+#ifndef __sun__
# define AF_PACKET AF_LINK
#endif
+#endif
#ifdef __FreeBSD__
# include <net/pfvar.h>
@@ -26,7 +28,7 @@
void maccopy(unsigned char *dst, struct sockaddr *addr)
{
-#ifdef __linux__
+#if defined(__linux__) || defined(__sun__)
/* TODO check that sll_halen is equal to 6 (MAC_SIZE) */
memcpy(dst, ((struct sockaddr_ll *)addr)->sll_addr, MAC_SIZE);
#else
--
1.8.4
cabal update
cabal install cabal-install
PATH=~/.cabal/bin:$PATH`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment