about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/fortify-headers/default.nix
blob: 1f418af7ae9628f54e62138cd1fd150937c881f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib
, stdenv
, fetchurl
}:

stdenv.mkDerivation {
  pname = "fortify-headers";
  version = "1.1alpine3";

  # upstream only accessible via git - unusable during bootstrap, hence
  # extract from the alpine package
  src = fetchurl {
    url = "https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/fortify-headers-1.1-r3.apk";
    name = "fortify-headers.tar.gz";  # ensure it's extracted as a .tar.gz
    hash = "sha256-8A8JcKHIBgXpUuIP4zs3Q1yBs5jCGd5F3H2E8UN/S2g=";
  };

  patches = [
    ./wchar-imports-skip.patch
    ./restore-macros.patch
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -r include/fortify $out/include

    runHook postInstall
  '';

  meta = {
    description = "Standalone header-based fortify-source implementation";
    homepage = "https://git.2f30.org/fortify-headers";
    license = lib.licenses.bsd0;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ ris ];
  };
}