Skip to content

Commit fa9c81f

Browse files
author
Jude Taylor
committed
pure darwin stdenv
1 parent 5e63669 commit fa9c81f

File tree

19 files changed

+436
-133
lines changed

19 files changed

+436
-133
lines changed

pkgs/development/compilers/llvm/3.6/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ pkgs, newScope, stdenv, isl, fetchurl, overrideCC, wrapCC }:
22
let
3-
callPackage = newScope (self // { inherit isl version fetch; });
3+
callPackage = newScope (self // { inherit stdenv isl version fetch; });
44

55
version = "3.6.1";
66

pkgs/development/interpreters/perl/5.16/default.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ stdenv.mkDerivation rec {
2424
++ lib.optional stdenv.isSunOS ./ld-shared.patch
2525
++ lib.optional stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ;
2626

27+
# There's an annoying bug on sandboxed Darwin in Perl's Cwd.pm where it looks for pwd
28+
# in /bin/pwd and /usr/bin/pwd and then falls back on just "pwd" if it can't get them
29+
# while at the same time erasing the PATH environment variable so it unconditionally
30+
# fails. The code in question is guarded by a check for Mac OS, but the patch below
31+
# doesn't have any runtime effect on other platforms.
32+
postPatch = ''
33+
pwd="$(type -P pwd)"
34+
substituteInPlace dist/Cwd/Cwd.pm \
35+
--replace "pwd_cmd = 'pwd'" "pwd_cmd = '$pwd'"
36+
'';
37+
2738
# Build a thread-safe Perl with a dynamic libperls.o. We need the
2839
# "installstyle" option to ensure that modules are put under
2940
# $out/lib/perl5 - this is the general default, but because $out

pkgs/development/interpreters/perl/5.20/default.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ stdenv.mkDerivation rec {
3535
++ optional stdenv.isSunOS ./ld-shared.patch
3636
++ stdenv.lib.optional stdenv.isDarwin [ ./cpp-precomp.patch ./no-libutil.patch ] ;
3737

38+
# There's an annoying bug on sandboxed Darwin in Perl's Cwd.pm where it looks for pwd
39+
# in /bin/pwd and /usr/bin/pwd and then falls back on just "pwd" if it can't get them
40+
# while at the same time erasing the PATH environment variable so it unconditionally
41+
# fails. The code in question is guarded by a check for Mac OS, but the patch below
42+
# doesn't have any runtime effect on other platforms.
43+
postPatch = ''
44+
pwd="$(type -P pwd)"
45+
substituteInPlace dist/PathTools/Cwd.pm \
46+
--replace "pwd_cmd = 'pwd'" "pwd_cmd = '$pwd'"
47+
'';
48+
3849
# Build a thread-safe Perl with a dynamic libperls.o. We need the
3950
# "installstyle" option to ensure that modules are put under
4051
# $out/lib/perl5 - this is the general default, but because $out

pkgs/development/interpreters/python/2.7/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ let
6262
for i in Lib/plat-*/regen; do
6363
substituteInPlace $i --replace /usr/include/ ${stdenv.cc.libc}/include/
6464
done
65+
'' + optionalString stdenv.isDarwin ''
66+
substituteInPlace configure --replace '`/usr/bin/arch`' '"i386"'
6567
'';
6668

6769
configureFlags = [
@@ -72,6 +74,8 @@ let
7274
"--with-system-ffi"
7375
"--with-system-expat"
7476
"ac_cv_func_bind_textdomain_codeset=yes"
77+
] ++ optionals stdenv.isDarwin [
78+
"--disable-toolbox-glue"
7579
];
7680

7781
postConfigure = if stdenv.isCygwin then ''

pkgs/development/libraries/gettext/default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ stdenv.mkDerivation (rec {
1919
"--with-included-gettext"
2020
"--with-included-glib"
2121
"--with-included-libcroco"
22-
]);
22+
])
23+
# avoid retaining reference to CF during stdenv bootstrap
24+
++ (stdenv.lib.optionals stdenv.isDarwin [
25+
"gt_cv_func_CFPreferencesCopyAppValue=no"
26+
"gt_cv_func_CFLocaleCopyCurrent=no"
27+
]);
2328

2429
# On cross building, gettext supposes that the wchar.h from libc
2530
# does not fulfill gettext needs, so it tries to work with its

pkgs/development/libraries/icu/default.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ stdenv.mkDerivation {
3232
configureFlags = "--disable-debug" +
3333
stdenv.lib.optionalString stdenv.isDarwin " --enable-rpath";
3434

35+
# remove dependency on bootstrap-tools in early stdenv build
36+
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
37+
sed -i 's/INSTALL_CMD=.*install/INSTALL_CMD=install/' $out/lib/icu/${version}/pkgdata.inc
38+
'';
39+
3540
enableParallelBuilding = true;
3641

3742
meta = with stdenv.lib; {

pkgs/development/libraries/libedit/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
1616
] else null;
1717

1818
postInstall = ''
19-
sed -i ${stdenv.lib.optionalString (stdenv.isDarwin && stdenv.cc.nativeTools) "''"} s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc
19+
sed -i s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc
2020
'';
2121

2222
configureFlags = [ "--enable-widec" ];

pkgs/development/libraries/zlib/default.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ stdenv.mkDerivation (rec {
1313
sha256 = "039agw5rqvqny92cpkrfn243x2gd4xn13hs3xi6isk55d2vqqr9n";
1414
};
1515

16+
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
17+
substituteInPlace configure \
18+
--replace '/usr/bin/libtool' 'ar' \
19+
--replace 'AR="libtool"' 'AR="ar"' \
20+
--replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
21+
'';
22+
1623
configureFlags = if static then "" else "--shared";
1724

1825
preConfigure = ''

pkgs/development/tools/misc/binutils/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
, cross ? null, gold ? true, bison ? null
33
}:
44

5-
assert !stdenv.isDarwin;
6-
75
let basename = "binutils-2.23.1"; in
86

97
with { inherit (stdenv.lib) optional optionals optionalString; };
@@ -56,7 +54,9 @@ stdenv.mkDerivation rec {
5654

5755
# As binutils takes part in the stdenv building, we don't want references
5856
# to the bootstrap-tools libgcc (as uses to happen on arm/mips)
59-
NIX_CFLAGS_COMPILE = "-static-libgcc";
57+
NIX_CFLAGS_COMPILE = if stdenv.isDarwin
58+
then "-Wno-string-plus-int -Wno-deprecated-declarations"
59+
else "-static-libgcc";
6060

6161
configureFlags =
6262
[ "--enable-shared" "--enable-deterministic-archives" ]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{ stdenv, fetchurl }:
2+
3+
stdenv.mkDerivation rec {
4+
name = "locale-${version}";
5+
version = "153";
6+
7+
src = fetchurl {
8+
url = "http://opensource.apple.com/tarballs/adv_cmds/adv_cmds-${version}.tar.gz";
9+
sha256 = "174v6a4zkcm2pafzgdm6kvs48z5f911zl7k49hv7kjq6gm58w99v";
10+
};
11+
12+
buildPhase = ''
13+
cd locale
14+
c++ -Os -Wall -o locale locale.cc
15+
'';
16+
17+
installPhase = ''
18+
mkdir -p $out/bin $out/share/man/man1
19+
20+
cp locale $out/bin/locale
21+
cp locale.1 $out/share/man/man1
22+
'';
23+
24+
25+
meta = {
26+
platforms = stdenv.lib.platforms.darwin;
27+
maintainers = with stdenv.lib.maintainers; [ gridaphobe ];
28+
};
29+
}

0 commit comments

Comments
 (0)