btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libui-ng / package.nix
blobcc308d86c842feb59d0fd7bd00a28a5f554903ce
1 { lib
2 , stdenv
3 , cmocka
4 , darwin
5 , fetchFromGitHub
6 , gtk3
7 , meson
8 , ninja
9 , pkg-config
10 , unstableGitUpdater
13 stdenv.mkDerivation rec {
14   pname = "libui-ng";
15   version = "4.1-unstable-2024-05-19";
17   src = fetchFromGitHub {
18     owner = "libui-ng";
19     repo = "libui-ng";
20     rev = "49b04c4cf8ae4d3e38e389f446ef75170eb62762";
21     hash = "sha256-W9LnUBUKwx1x3+BEeUanisBGR2Q4dnbcMM5k8mCondM=";
22   };
24   postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
25     substituteInPlace meson.build --replace "'-arch', 'arm64'" ""
26   '';
28   nativeBuildInputs = [
29     cmocka
30     meson
31     ninja
32     pkg-config
33   ];
35   buildInputs =
36     if stdenv.hostPlatform.isDarwin then [
37       darwin.libobjc
38       darwin.apple_sdk_11_0.Libsystem
39       darwin.apple_sdk_11_0.frameworks.Cocoa
40       darwin.apple_sdk_11_0.frameworks.AppKit
41       darwin.apple_sdk_11_0.frameworks.CoreFoundation
42     ] else [
43       gtk3
44     ];
46   mesonFlags = [
47     (lib.mesonBool "examples" (!stdenv.hostPlatform.isDarwin))
48   ];
50   passthru.updateScript = unstableGitUpdater {
51     tagPrefix = "alpha";
52   };
54   meta = with lib; {
55     description = "Portable GUI library for C";
56     homepage = "https://github.com/libui-ng/libui-ng";
57     license = licenses.mit;
58     maintainers = [ ];
59     platforms = platforms.all;
60   };