summary refs log tree commit diff
path: root/pkgs/stdenv/freebsd/default.nix
diff options
context:
space:
mode:
authorjanus <janus@xn--kn-1ia.guru>2015-11-26 02:35:12 +0000
committerjanus <janus@xn--kn-1ia.guru>2016-01-01 17:01:13 +0000
commitf351aaaf85c6b6323660db6ce638f057947a333f (patch)
treed6202c827b8a46d35c4a5d2c601af7dee3f1e248 /pkgs/stdenv/freebsd/default.nix
parent2d00f27230764ed8be9ddff575d64e773ea84d62 (diff)
downloadnixpkgs-f351aaaf85c6b6323660db6ce638f057947a333f.tar
nixpkgs-f351aaaf85c6b6323660db6ce638f057947a333f.tar.gz
nixpkgs-f351aaaf85c6b6323660db6ce638f057947a333f.tar.bz2
nixpkgs-f351aaaf85c6b6323660db6ce638f057947a333f.tar.lz
nixpkgs-f351aaaf85c6b6323660db6ce638f057947a333f.tar.xz
nixpkgs-f351aaaf85c6b6323660db6ce638f057947a333f.tar.zst
nixpkgs-f351aaaf85c6b6323660db6ce638f057947a333f.zip
FreeBSD: use own stdenv, do not run libtiff tests, use PIC for zlib
Diffstat (limited to 'pkgs/stdenv/freebsd/default.nix')
-rw-r--r--pkgs/stdenv/freebsd/default.nix131
1 files changed, 131 insertions, 0 deletions
diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix
new file mode 100644
index 00000000000..de39e79102f
--- /dev/null
+++ b/pkgs/stdenv/freebsd/default.nix
@@ -0,0 +1,131 @@
+{ system      ? builtins.currentSystem
+, allPackages ? import ../../top-level/all-packages.nix
+, platform    ? null
+, config      ? {}
+}:
+
+rec {
+  allPackages = import ../../top-level/all-packages.nix;
+
+  bootstrapTools = derivation {
+    inherit system;
+
+    name    = "trivial-bootstrap-tools";
+    builder = "/bin/sh";
+    args    = [ ./trivial-bootstrap.sh ];
+
+    mkdir   = "/bin/mkdir";
+    ln      = "/bin/ln";
+  };
+
+  stage0 = rec {
+    fetchurl = import ../../build-support/fetchurl {
+      inherit stdenv;
+      curl = bootstrapTools;
+    };
+
+    stdenv = import ../generic {
+      inherit system config;
+      name         = "stdenv-freebsd-boot-0";
+      shell        = "/usr/local/bin/bash";
+      initialPath  = [ bootstrapTools ];
+      fetchurlBoot = fetchurl;
+      cc           = null;
+    };
+  };
+
+  buildTools = { #import ../../os-specific/freebsd/command-line-tools
+    inherit (stage0) stdenv fetchurl;
+    xar  = bootstrapTools;
+    gzip = bootstrapTools;
+    cpio = bootstrapTools;
+  };
+
+  preHook = ''
+    export NIX_IGNORE_LD_THROUGH_GCC=1
+    export NIX_DONT_SET_RPATH=1
+    export NIX_NO_SELF_RPATH=1
+    dontFixLibtool=1
+    stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
+    xargsFlags=" "
+  '';
+
+  stage1 = rec {
+    nativePrefix = "/usr";
+
+    stdenv = import ../generic {
+      name = "stdenv-freebsd-boot-1";
+
+      inherit system config;
+      inherit (stage0.stdenv) shell fetchurlBoot;
+
+      initialPath = stage0.stdenv.initialPath ++ [ nativePrefix ];
+
+      preHook = preHook + "\n" + ''
+        export NIX_LDFLAGS_AFTER+=" -L/usr/lib"
+        export NIX_ENFORCE_PURITY=
+        export NIX_CFLAGS_COMPILE+=" -isystem ${nativePrefix}/include/c++/v1"
+        export NIX_CFLAGS_LINK+=" -Wl,-rpath,${nativePrefix}/lib"
+      '';
+
+      cc = import ../../build-support/cc-wrapper {
+        nativeTools  = true;
+        nativePrefix = nativePrefix;
+        nativeLibc   = true;
+        stdenv       = stage0.stdenv;
+        shell        = "/usr/local/bin/bash";
+        cc           = {
+          name    = "clang-9.9.9";
+          cc      = "/usr";
+          outPath = nativePrefix;
+        };
+        isClang      = true;
+      };
+    };
+    pkgs = allPackages {
+      inherit system platform;
+      bootStdenv = stdenv;
+    };
+  };
+
+  stage2 = rec {
+    stdenv = import ../generic {
+      name = "stdenv-freebsd-boot-2";
+
+      inherit system config;
+      inherit (stage1.stdenv) shell fetchurlBoot preHook cc;
+
+      initialPath = [ "/usr/local/bin" ] ++ stage1.stdenv.initialPath;
+    };
+    pkgs = allPackages {
+      inherit system platform;
+      bootStdenv = stdenv;
+    };
+  };
+
+  stage3 = with stage2; import ../generic {
+    name = "stdenv-freebsd-boot-3";
+
+    inherit system config;
+    inherit (stdenv) fetchurlBoot;
+
+    initialPath = [ bootstrapTools ];
+
+    preHook = preHook + "\n" + ''
+      export NIX_ENFORCE_PURITY=1
+    '';
+
+    cc = import ../../build-support/cc-wrapper {
+      inherit stdenv;
+      nativeTools   = true;
+      nativePrefix  = "/usr/local/bin";
+      nativeLibc    = true;
+      cc            = stage2.stdenv.cc; #pkgs.llvmPackages.clang-unwrapped; 
+      isClang       = true;
+    };
+
+    shell = "/usr/local/bin/bash";
+  };
+
+  stdenvFreeBSD = stage3;
+}