Commit 3fe3b055 authored by John Ericson's avatar John Ericson
Browse files

bsd treewide: Run RFC formatter

parent 56590dd7
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
{ lib, stdenv, linuxHeaders, freebsd, runCommandCC, buildPackages }:
{
  lib,
  stdenv,
  linuxHeaders,
  freebsd,
  runCommandCC,
  buildPackages,
}:

stdenv.mkDerivation {
  pname = "evdev-proto";
+10 −8
Original line number Diff line number Diff line
@@ -3,14 +3,16 @@
{
  inherit version;

  mkBsdArch = stdenv':  {
  mkBsdArch =
    stdenv':
    {
      x86_64 = "amd64";
      aarch64 = "arm64";
      i486 = "i386";
      i586 = "i386";
      i686 = "i386";
  }.${stdenv'.hostPlatform.parsed.cpu.name}
    or stdenv'.hostPlatform.parsed.cpu.name;
    }
    .${stdenv'.hostPlatform.parsed.cpu.name} or stdenv'.hostPlatform.parsed.cpu.name;

  install-wrapper = builtins.readFile ./install-wrapper.sh;
}
+28 −17
Original line number Diff line number Diff line
{ stdenv, lib, stdenvNoCC
, fetchzip
, sourceData, versionData, buildFreebsd, patchesRoot
{
  stdenv,
  lib,
  stdenvNoCC,
  fetchzip,
  sourceData,
  versionData,
  buildFreebsd,
  patchesRoot,
}:

self:
@@ -8,7 +14,8 @@ self:
lib.packagesFromDirectoryRecursive {
  callPackage = self.callPackage;
  directory = ./pkgs;
} // {
}
// {
  inherit sourceData patchesRoot versionData;

  # Keep the crawled portion of Nixpkgs finite.
@@ -21,11 +28,15 @@ lib.packagesFromDirectoryRecursive {

  compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isFreeBSD) self.compat;
  freebsd-lib = import ./lib {
    version = lib.concatStringsSep "." (map toString (lib.filter (x: x != null) [
    version = lib.concatStringsSep "." (
      map toString (
        lib.filter (x: x != null) [
          self.versionData.major
          self.versionData.minor
          self.versionData.patch or null
    ]));
        ]
      )
    );
  };

  # The manual callPackages below should in principle be unnecessary, but are
@@ -51,21 +62,21 @@ lib.packagesFromDirectoryRecursive {
  };

  libc = self.callPackage ./pkgs/libc/package.nix {
    inherit (buildFreebsd) makeMinimal install gencat rpcgen;
    inherit (buildFreebsd)
      makeMinimal
      install
      gencat
      rpcgen
      ;
    inherit (self) csu include;
  };

  libnetbsd = self.callPackage ./pkgs/libnetbsd/package.nix {
    inherit (buildFreebsd) makeMinimal;
  };
  libnetbsd = self.callPackage ./pkgs/libnetbsd/package.nix { inherit (buildFreebsd) makeMinimal; };

  mkDerivation = self.callPackage ./pkgs/mkDerivation.nix {
    inherit stdenv;
    inherit (buildFreebsd) makeMinimal install tsort;
  };

  makeMinimal = self.callPackage ./pkgs/makeMinimal.nix {
    inherit (self) make;
  };

  makeMinimal = self.callPackage ./pkgs/makeMinimal.nix { inherit (self) make; };
}
+6 −3
Original line number Diff line number Diff line
{ buildPackages, freebsd-lib }:

# Wrap NetBSD's install
buildPackages.writeShellScriptBin "boot-install" (freebsd-lib.install-wrapper + ''
buildPackages.writeShellScriptBin "boot-install" (
  freebsd-lib.install-wrapper
  + ''

    ${buildPackages.netbsd.install}/bin/xinstall "''${args[@]}"
'')
  ''
)
+112 −93
Original line number Diff line number Diff line
{ lib, stdenv, mkDerivation, patchesRoot
, bsdSetupHook, freebsdSetupHook
, makeMinimal, boot-install
, which
, freebsd-lib
, expat, zlib,
{
  lib,
  stdenv,
  mkDerivation,
  patchesRoot,
  bsdSetupHook,
  freebsdSetupHook,
  makeMinimal,
  boot-install,
  which,
  freebsd-lib,
  expat,
  zlib,
}:

let
@@ -13,15 +20,18 @@ in
mkDerivation rec {
  pname = "compat";
  path = "tools/build";
  extraPaths = [
  extraPaths =
    [
      "lib/libc/db"
      "lib/libc/stdlib" # getopt
      "lib/libc/gen" # getcap
      "lib/libc/locale" # rpmatch
  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
    ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [
      "lib/libc/string" # strlcpy
      "lib/libutil"
  ] ++ [
    ]
    ++ [
      "contrib/libc-pwcache"
      "contrib/libc-vis"
      "sys/libkern"
@@ -59,9 +69,9 @@ mkDerivation rec {
      "sys/sys/elf_common.h"
      "sys/sys/elf_generic.h"
      "sys/${mkBsdArch stdenv}/include"
  ] ++ lib.optionals stdenv.hostPlatform.isx86 [
    "sys/x86/include"
  ] ++ [
    ]
    ++ lib.optionals stdenv.hostPlatform.isx86 [ "sys/x86/include" ]
    ++ [

      "sys/sys/queue.h"
      "sys/sys/md5.h"
@@ -89,12 +99,14 @@ mkDerivation rec {
    /${patchesRoot}/compat-fix-typedefs-locations.patch
  ];

  preBuild = ''
  preBuild =
    ''
      NIX_CFLAGS_COMPILE+=' -I../../include -I../../sys'

      cp ../../sys/${mkBsdArch stdenv}/include/elf.h ../../sys/sys
      cp ../../sys/${mkBsdArch stdenv}/include/elf.h ../../sys/sys/${mkBsdArch stdenv}
  '' + lib.optionalString stdenv.hostPlatform.isx86 ''
    ''
    + lib.optionalString stdenv.hostPlatform.isx86 ''
      cp ../../sys/x86/include/elf.h ../../sys/x86
    '';

@@ -109,13 +121,17 @@ mkDerivation rec {
  '';

  nativeBuildInputs = [
    bsdSetupHook freebsdSetupHook
    bsdSetupHook
    freebsdSetupHook
    makeMinimal
    boot-install

    which
  ];
  buildInputs = [ expat zlib ];
  buildInputs = [
    expat
    zlib
  ];

  makeFlags = [
    "STRIP=-s" # flag to install, not command
@@ -124,12 +140,15 @@ mkDerivation rec {
    "INSTALL=boot-install"
  ];

  preIncludes = ''
  preIncludes =
    ''
      mkdir -p $out/{0,1}-include
      cp --no-preserve=mode -r cross-build/include/common/* $out/0-include
  '' + lib.optionalString stdenv.hostPlatform.isLinux ''
    ''
    + lib.optionalString stdenv.hostPlatform.isLinux ''
      cp --no-preserve=mode -r cross-build/include/linux/* $out/1-include
  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
    ''
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
      cp --no-preserve=mode -r cross-build/include/darwin/* $out/1-include
    '';
}
Loading