aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/lz4/.yandex_meta/__init__.py
blob: d4f3f8e62a86cd7f3385487fcfbb53a482e9a521 (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
import os

from devtools.yamaker.project import GNUMakeNixProject


def post_install(self):
    with self.yamakes["."] as lz4:
        # Unbundle xxhash.
        lz4.PEERDIR.add("contrib/libs/xxhash")
        lz4.ADDINCL.add("contrib/libs/xxhash")
        lz4.SRCS.remove("xxhash.c")
        lz4.CFLAGS = [x for x in lz4.CFLAGS if x != "-DXXH_NAMESPACE=LZ4_"]
        os.remove(f"{self.dstdir}/xxhash.h")
        os.remove(f"{self.dstdir}/xxhash.c")

        # Ensure no warnings.
        lz4.NO_COMPILER_WARNINGS = False


lz4 = GNUMakeNixProject(
    arcdir="contrib/libs/lz4",
    nixattr="lz4",
    nixsrcdir="source/lib",
    makeflags=["liblz4.a"],
    post_install=post_install,
)