nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 writeText,
5 fetchFromGitHub,
6 cmake,
7 nix-update-script,
8}:
9let
10 # Requires an /etc/os-release file, so we override it with this.
11 osRelease = writeText "os-release" "ID=NixOS";
12in
13stdenv.mkDerivation (finalAttrs: {
14 pname = "openapv";
15 version = "0.2.0.4";
16
17 src = fetchFromGitHub {
18 owner = "AcademySoftwareFoundation";
19 repo = "openapv";
20 tag = "v${finalAttrs.version}";
21 hash = "sha256-IkzZnf2/JZJIwg9g/6SvWTAcUkAQ/C36xXC+t44VejU=";
22 };
23
24 postPatch = ''
25 substituteInPlace CMakeLists.txt \
26 --replace-fail "/etc/os-release" "${osRelease}"
27 '';
28
29 nativeBuildInputs = [ cmake ];
30
31 passthru.updateScript = nix-update-script { };
32
33 meta = {
34 changelog = "https://github.com/AcademySoftwareFoundation/openapv/releases/tag/v${finalAttrs.version}";
35 description = "Reference implementation of the APV codec";
36 homepage = "https://github.com/AcademySoftwareFoundation/openapv";
37 license = [ lib.licenses.bsd3 ];
38 maintainers = with lib.maintainers; [ pyrox0 ];
39 };
40})