From c01dbc4932955a8c1fa2f28a135aafaa4111ef81 Mon Sep 17 00:00:00 2001 From: janus Date: Tue, 24 Nov 2015 12:00:19 +0000 Subject: [PATCH] FreeBSD patches for GNU m4, stdenv, miniupnpc --- pkgs/development/tools/misc/gnum4/default.nix | 3 +- pkgs/stdenv/native/default.nix | 94 +++++++++++++++++++ pkgs/tools/networking/miniupnpc/default.nix | 17 ++-- pkgs/tools/networking/miniupnpc/freebsd.patch | 11 +++ 4 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 pkgs/tools/networking/miniupnpc/freebsd.patch diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix index 7174f4b41c3c..7216e1e169d0 100644 --- a/pkgs/development/tools/misc/gnum4/default.nix +++ b/pkgs/development/tools/misc/gnum4/default.nix @@ -10,7 +10,8 @@ stdenv.mkDerivation rec { doCheck = !stdenv.isDarwin && !stdenv.isCygwin # XXX: `test-dup2' fails on Cygwin - && !stdenv.isSunOS; # XXX: `test-setlocale2.sh' fails + && !stdenv.isSunOS # XXX: `test-setlocale2.sh' fails + && !stdenv.isFreeBSD; # XXX: test 084 fails configureFlags = "--with-syscmd-shell=${stdenv.shell}"; diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index bd90d580d3f5..93d1c7e971c2 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -24,6 +24,100 @@ rec { alias make=gmake alias tar=gtar alias sed=gsed + + alias patch=gpatch # pcre relied on this for patching binary files + + # we need GNU cp for --reflink, need to alias all of coreutils + alias basename=gbasename + alias cat=gcat + alias chgrp=gchgrp + alias chmod=gchmod + alias chown=gchown + alias chroot=gchroot + alias cksum=gcksum + alias comm=gcomm + alias cp=gcp + alias csplit=gcsplit + alias cut=gcut + alias date=gdate + alias dd=gdd + alias df=gdf + alias dir=gdir + alias dircolors=gdircolors + alias dirname=gdirname + alias du=gdu + alias echo=gecho + alias env=genv + alias expand=gexpand + alias expr=gexpr + alias factor=gfactor + alias false=gfalse + alias fmt=gfmt + alias fold=gfold + alias groups=ggroups + alias head=ghead + alias hostid=ghostid + alias hostname=ghostname + alias id=gid + alias install=ginstall + alias join=gjoin + alias kill=gkill + alias link=glink + alias ln=gln + alias logname=glogname + alias ls=gls + alias md5sum=gmd5sum + alias mkdir=gmkdir + alias mkfifo=gmkfifo + alias mknod=gmknod + alias mv=gmv + alias nice=gnice + alias nl=gnl + alias nohup=gnohup + alias od=god + alias paste=gpaste + alias pathchk=gpathchk + alias pinky=gpinky + alias pr=gpr + alias printenv=gprintenv + alias printf=gprintf + alias ptx=gptx + alias pwd=gpwd + alias readlink=greadlink + alias rm=grm + alias rmdir=grmdir + alias seq=gseq + alias sha1sum=gsha1sum + alias shred=gshred + alias sleep=gsleep + alias sort=gsort + alias split=gsplit + alias stat=gstat + alias stty=gstty + alias su=gsu + alias sum=gsum + alias sync=gsync + alias tac=gtac + #alias tail=gtail # this breaks xz XXX + alias tee=gtee + alias test=gtest + alias touch=gtouch + alias tr=gtr + alias true=gtrue + alias tsort=gtsort + alias tty=gtty + alias uname=guname + alias unexpand=gunexpand + alias uniq=guniq + alias unlink=gunlink + alias uptime=guptime + alias users=gusers + alias vdir=gvdir + alias wc=gwc + alias who=gwho + alias whoami=gwhoami + alias yes=gyes + export MAKE=gmake shopt -s expand_aliases ''; diff --git a/pkgs/tools/networking/miniupnpc/default.nix b/pkgs/tools/networking/miniupnpc/default.nix index ac68b55ad17f..644045800d4e 100644 --- a/pkgs/tools/networking/miniupnpc/default.nix +++ b/pkgs/tools/networking/miniupnpc/default.nix @@ -1,17 +1,18 @@ -{ stdenv, fetchFromGitHub }: +{ stdenv, fetchurl }: -let version = "24d54ba13af4e53aba19c23898a373feecb41bd0"; in +let version = "1.9.20150430"; in stdenv.mkDerivation rec { name = "miniupnpc-${version}"; - src = fetchFromGitHub { - owner = "miniupnp"; - repo = "miniupnp"; - sha256 = "0j78dvlfh1a3a27zhvv001cb1d7vcgyv33bd1zr36drg64b6hrgw"; - rev = version; + src = fetchurl { + url = "http://miniupnp.free.fr/files/download.php?file=${name}.tar.gz"; + sha256 = "0ivnvzla0l2pzmy8s0j8ss0fnpsii7z9scvyl4a13g9k911hgmvn"; + name = "${name}.tar.gz"; }; - doCheck = true; + patches = stdenv.lib.optional stdenv.isFreeBSD [ ./freebsd.patch ]; + + doCheck = !stdenv.isFreeBSD; installFlags = "PREFIX=$(out) INSTALLPREFIX=$(out)"; diff --git a/pkgs/tools/networking/miniupnpc/freebsd.patch b/pkgs/tools/networking/miniupnpc/freebsd.patch new file mode 100644 index 000000000000..42ae85a8e6b1 --- /dev/null +++ b/pkgs/tools/networking/miniupnpc/freebsd.patch @@ -0,0 +1,11 @@ +diff --git a/minihttptestserver.c b/minihttptestserver.c +index bbfdac3..a43999d 100644 +--- a/minihttptestserver.c ++++ b/minihttptestserver.c +@@ -1,3 +1,6 @@ ++#ifndef INADDR_LOOPBACK ++#define INADDR_LOOPBACK 0x7f000001 ++#endif + /* $Id: minihttptestserver.c,v 1.17 2015/02/06 10:31:19 nanard Exp $ */ + /* Project : miniUPnP + * Author : Thomas Bernard