From 9cbf81e11b12e3799fe35b039d93caead6083ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Sat, 25 Nov 2017 23:03:36 +0100 Subject: [PATCH] initial kernel modules for TBS devices --- pkgs/os-specific/linux/tbs/default.nix | 50 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 52 insertions(+) create mode 100644 pkgs/os-specific/linux/tbs/default.nix diff --git a/pkgs/os-specific/linux/tbs/default.nix b/pkgs/os-specific/linux/tbs/default.nix new file mode 100644 index 000000000000..e4b954d4dbf5 --- /dev/null +++ b/pkgs/os-specific/linux/tbs/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchFromGitHub, kernel, kmod, perl, patchutils, perlPackages }: +let + media = fetchFromGitHub { + owner = "tbsdtv"; + repo = "linux_media"; + rev = "14ebbec91f2cd0423aaf859fc6e6d5d986397cd4"; + sha256 = "1cmqj3kby8sxfcpvslbxywr95529vjxzbn800fdp35lka1fv962h"; + }; + build = fetchFromGitHub { + owner = "tbsdtv"; + repo = "media_build"; + rev = "c340e29a4047e43f7ea7ebf19e1e28c1f2112d05"; + sha256 = "0hfn1j9qk8lh30z3ywj22qky480nsf8z2iag2bqhrhy4375vjlbl"; + }; +in stdenv.mkDerivation { + name = "tbs-2017-11-05-${kernel.version}"; + + srcs = [ media build ]; + sourceRoot = "${build.name}"; + + preConfigure = '' + make dir DIR=../${media.name} + ''; + + postPatch = '' + patchShebangs . + + sed -i v4l/Makefile \ + -i v4l/scripts/make_makefile.pl \ + -e 's,/sbin/depmod,${kmod}/bin/depmod,g' \ + -e 's,/sbin/lsmod,${kmod}/bin/lsmod,g' + + sed -i v4l/Makefile \ + -e 's,^OUTDIR ?= /lib/modules,OUTDIR ?= ${kernel.dev}/lib/modules,' \ + -e 's,^SRCDIR ?= /lib/modules,SRCDIR ?= ${kernel.dev}/lib/modules,' + ''; + + buildFlags = [ "VER=${kernel.modDirVersion}" ]; + installFlags = [ "DESTDIR=$(out)" ]; + + hardeningDisable = [ "pic" "format" ]; + nativeBuildInputs = [ patchutils kmod perl perlPackages.ProcProcessTable ]; + + meta = with stdenv.lib; { + homepage = https://www.tbsdtv.com/; + license = licenses.gpl2; + maintainers = with maintainers; [ ck3d ]; + priority = 20; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c9bbbbf396c5..5da5087c46bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13522,6 +13522,8 @@ with pkgs; broadcom_sta = callPackage ../os-specific/linux/broadcom-sta/default.nix { }; + tbs = callPackage ../os-specific/linux/tbs { }; + nvidiabl = callPackage ../os-specific/linux/nvidiabl { }; nvidiaPackages = callPackage ../os-specific/linux/nvidia-x11 { };