nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "flatcc";
11 version = "0.6.1";
12
13 src = fetchFromGitHub {
14 owner = "dvidelabs";
15 repo = "flatcc";
16 rev = "v${finalAttrs.version}";
17 sha256 = "sha256-0/IZ7eX6b4PTnlSSdoOH0FsORGK9hrLr1zlr/IHsJFQ=";
18 };
19
20 patches = [
21 # Fix builds on clang15. Remove post-0.6.1.
22 (fetchpatch {
23 name = "clang15fixes.patch";
24 url = "https://github.com/dvidelabs/flatcc/commit/5885e50f88248bc7ed398880c887ab23db89f05a.patch";
25 hash = "sha256-z2HSxNXerDFKtMGu6/vnzGRlqfz476bFMjg4DVfbObQ";
26 })
27 # Bump cmake to 2.8.12, required fox 3.16 patch
28 (fetchpatch {
29 name = "bump-cmake-version.patch";
30 url = "https://github.com/dvidelabs/flatcc/commit/5f07eda43caabd81a2bfa2857af0e3f26dc6d4ee.patch?full_index=1";
31 hash = "sha256-eRlkQw+YGRgCUjrlYB3I8w+/cPuJhgEfNUW/+TZhHlI=";
32 })
33 # Bump min. CMake to 3.16 and fix custom build rules
34 (fetchpatch {
35 name = "fix-cmake-version.patch";
36 url = "https://github.com/dvidelabs/flatcc/commit/385c27b23236dff7ad4fa35c59fd4f9143dcaae6.patch?full_index=1";
37 hash = "sha256-ORDby2LRRQdFrNc1owHKxo0TfMIxISj5SuD5oqvDFFo=";
38 excludes = [
39 "README.md"
40 "CHANGELOG.md"
41 "test/doublevec_test/CMakeLists.txt"
42 "test/monster_test_cpp/CMakeLists.txt"
43 ];
44 })
45 ];
46
47 nativeBuildInputs = [ cmake ];
48
49 cmakeFlags = [
50 "-DFLATCC_INSTALL=on"
51 ];
52
53 meta = {
54 description = "FlatBuffers Compiler and Library in C for C";
55 mainProgram = "flatcc";
56 homepage = "https://github.com/dvidelabs/flatcc";
57 license = [ lib.licenses.asl20 ];
58 maintainers = with lib.maintainers; [ onny ];
59 };
60})