Compare commits

...

6 Commits

6 changed files with 75 additions and 46 deletions

View File

@ -1,14 +1,14 @@
{ {
stdenv, stdenv,
callPackage,
lib, lib,
pkgs, cmake,
aja-src,
buildApps ? true, buildApps ? true,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ajantv2-dev"; name = "ajantv2-dev";
src = callPackage ./src.nix {}; src = aja-src;
nativeBuildInputs = [pkgs.cmake]; nativeBuildInputs = [cmake];
cmakeFlags = cmakeFlags =
[ [

View File

@ -1,12 +1,12 @@
{ {
callPackage,
stdenv, stdenv,
nukeReferences, nukeReferences,
kernel, kernel,
aja-src,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ajantv2-driver-${kernel.version}"; name = "ajantv2-driver-${kernel.version}";
src = callPackage ./src.nix {}; src = aja-src;
patches = [./lol.patch ./newkernels.patch]; patches = [./lol.patch ./newkernels.patch];
nativeBuildInputs = kernel.moduleBuildDependencies; nativeBuildInputs = kernel.moduleBuildDependencies;
buildInputs = [nukeReferences]; buildInputs = [nukeReferences];

View File

@ -1,6 +0,0 @@
{ pkgs }: pkgs.fetchFromGitHub {
owner = "aja-video";
repo = "ntv2";
rev = "refs/heads/main";
hash = "sha256-rXjKDhQcZwAxsMjCoL21gpWeLWyIXyK/1y+78mhKgeo=";
}

View File

@ -1,5 +1,38 @@
{ {
"nodes": { "nodes": {
"aja-ntv2": {
"flake": false,
"locked": {
"lastModified": 1662565853,
"narHash": "sha256-rXjKDhQcZwAxsMjCoL21gpWeLWyIXyK/1y+78mhKgeo=",
"owner": "aja-video",
"repo": "ntv2",
"rev": "3a1e91f740e36e43a1ec74ff446a097330e87220",
"type": "github"
},
"original": {
"owner": "aja-video",
"repo": "ntv2",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1694499547, "lastModified": 1694499547,
@ -15,8 +48,9 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "aja-ntv2": "aja-ntv2",
"utils": "utils" "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
} }
}, },
"systems": { "systems": {
@ -33,24 +67,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -1,27 +1,42 @@
{ {
description = "AJA video card software"; description = "AJA video card software";
inputs.utils.url = "github:numtide/flake-utils"; inputs.aja-ntv2 = {
url = "github:aja-video/ntv2";
flake = false;
};
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
utils, flake-utils,
}: ( aja-ntv2,
utils.lib.eachSystem ["x86_64-linux"] (system: let }:
(
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs {
inherit system;
};
in {
packages.aja-ntv2-gst = pkgs.callPackage ./ntv2-gst.nix {
ajantv2 = pkgs.callPackage ./aja-ntv2/default.nix {
aja-src = aja-ntv2;
buildApps = false;
};
};
})
)
// flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
in { in {
packages.aja-ntv2-gst = pkgs.callPackage ./ntv2-gst.nix {
ajantv2 = pkgs.callPackage ./aja-ntv2/default.nix { buildApps = false; };
};
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
}) })
) // { // {
overlays.default = (final: prev: { overlays.default = final: prev: {
ajantv-utils = final.callPackage ./aja-ntv2/default.nix {}; ajantv-utils = final.callPackage ./aja-ntv2/default.nix {aja-src = aja-ntv2;};
ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {}; ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {aja-src = aja-ntv2;};
aja-ntv2-gst = self.packages.${prev.system}.aja-ntv2-gst; aja-ntv2-gst = self.packages.${prev.system}.aja-ntv2-gst;
}); };
}; };
} }

View File

@ -1,7 +1,11 @@
{ {
stdenv, stdenv,
pkgs,
fetchFromGitHub, fetchFromGitHub,
autoconf,
automake,
pkgconfig,
libtool,
gst_all_1,
ajantv2, ajantv2,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
@ -15,7 +19,7 @@ stdenv.mkDerivation {
sourceRoot = "source/gst-plugin"; sourceRoot = "source/gst-plugin";
patches = [./no.patch]; patches = [./no.patch];
nativeBuildInputs = with pkgs; [autoconf automake pkgconfig libtool gst_all_1.gst-plugins-base ajantv2]; nativeBuildInputs = [autoconf automake pkgconfig libtool gst_all_1.gst-plugins-base ajantv2];
GST_NTV2 = "${ajantv2}/include"; GST_NTV2 = "${ajantv2}/include";
preConfigure = '' preConfigure = ''
./autogen.sh ./autogen.sh