Merge pull request #1 from streams-r-us/misc-nix-cleanup-20231013

Various minor nix refactoring
This commit is contained in:
Sam W 2023-10-13 20:39:40 +01:00 committed by GitHub
commit 2cbc0594f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 30 deletions

View File

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

View File

@ -1,4 +1,6 @@
{ pkgs }: pkgs.fetchFromGitHub { { fetchFromGitHub }:
fetchFromGitHub {
owner = "aja-video"; owner = "aja-video";
repo = "ntv2"; repo = "ntv2";
rev = "refs/heads/main"; rev = "refs/heads/main";

View File

@ -1,5 +1,22 @@
{ {
"nodes": { "nodes": {
"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 +32,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "flake-utils": "flake-utils",
"utils": "utils" "nixpkgs": "nixpkgs"
} }
}, },
"systems": { "systems": {
@ -33,24 +50,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,13 +1,12 @@
{ {
description = "AJA video card software"; description = "AJA video card software";
inputs.utils.url = "github:numtide/flake-utils";
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
utils, flake-utils,
}: ( }: (
utils.lib.eachSystem ["x86_64-linux"] (system: let flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
@ -18,10 +17,10 @@
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 {};
ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {}; ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {};
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