1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 sfml_2,
6 libffcall,
7 libusb-compat-0_1,
8 libudev-zero,
9}:
10
11stdenv.mkDerivation {
12 pname = "liblapin";
13 version = "0-unstable-2024-05-20";
14
15 src = fetchFromGitHub {
16 owner = "Damdoshi";
17 repo = "LibLapin";
18 rev = "27955d24f3efd10fe4f556a4f292d731813d3de3";
19 hash = "sha256-h8LuhTgFOFnyDeFeoEanD64/nmDyLeh6R9tw9X6GP8g=";
20 };
21
22 prePatch = ''
23 # camera module fails to build with opencv, due to missing V4L2 support
24 rm -rf src/camera
25
26 substituteInPlace Makefile \
27 --replace-fail "/bin/echo" "echo"
28 '';
29
30 enableParallelBuilding = true;
31
32 installPhase = ''
33 runHook preInstall
34
35 install -Dm644 liblapin.a $out/lib/liblapin.a
36
37 rm -rf include/private
38 cp -r include $out
39
40 runHook postInstall
41 '';
42
43 buildInputs = [
44 sfml_2
45 libffcall
46 libusb-compat-0_1
47 libudev-zero
48 ];
49
50 outputs = [
51 "out"
52 "dev"
53 ];
54
55 meta = {
56 description = "Multimedia library for rookies and prototyping";
57 homepage = "https://liblapin.org?lan=en";
58 platforms = lib.platforms.unix;
59 license = lib.licenses.bsd3;
60 maintainers = with lib.maintainers; [ sigmanificient ];
61 };
62}