about summary refs log tree commit diff
path: root/pkgs/development/tools/wxformbuilder/default.nix
blob: 9e4d2caabc309e586d0b9cfcf5ff9a772f753af5 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ lib
, stdenv
, fetchFromGitHub
, cmake
, makeWrapper
, shared-mime-info
, wxGTK32
, boost
, Cocoa
}:

stdenv.mkDerivation {
  pname = "wxFormBuilder";
  version = "unstable-2022-09-26";

  src = fetchFromGitHub {
    owner = "wxFormBuilder";
    repo = "wxFormBuilder";
    rev = "e2e4764f1f4961c654733287c6e84d7738b4ba2b";
    fetchSubmodules = true;
    sha256 = "sha256-DLdwQH3s/ZNVq+A/qtZRy7dA/Ctp2qkOmi6M+rSb4MM=";
  };

  nativeBuildInputs = [
    cmake
  ] ++ lib.optionals stdenv.isDarwin [
    makeWrapper
  ] ++ lib.optionals stdenv.isLinux [
    shared-mime-info
  ];

  buildInputs = [
    wxGTK32
    boost
  ] ++ lib.optionals stdenv.isDarwin [
    Cocoa
  ];

  preConfigure = ''
    sed -i 's/FATAL_ERROR/WARNING/' cmake/revision-git*.cmake
    sed -i '/fixup_bundle/d;/codesign/d' cmake/macros.cmake
  '';

  postInstall = lib.optionalString stdenv.isDarwin ''
    mkdir -p $out/{Applications,bin}
    mv $out/wxFormBuilder.app $out/Applications
    makeWrapper $out/{Applications/wxFormBuilder.app/Contents/MacOS,bin}/wxFormBuilder
  '';

  meta = with lib; {
    description = "RAD tool for wxWidgets GUI design";
    homepage = "https://github.com/wxFormBuilder/wxFormBuilder";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ matthuszagh wegank ];
    platforms = platforms.unix;
  };
}