about summary refs log tree commit diff
path: root/pkgs/by-name/pw/pw3270/package.nix
blob: 657a218069506d0614a692860f56c8bc39e2ab2b (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ lib
, stdenv
, fetchFromGitHub
, which
, pkg-config
, automake
, autoconf
, m4
, libtool
, gtk3
, libv3270
, lib3270
, openssl
, gettext
, desktop-file-utils
, glib
, wrapGAppsHook3
}:

stdenv.mkDerivation rec {
  pname = "pw3270";
  version = "5.4";

  src = fetchFromGitHub {
    owner = "PerryWerneck";
    repo = pname;
    rev = version;
    hash = "sha256-Nk/OUqrWngKgb1D1Wi8q5ygKtvuRKUPhPQaLvWi1Z4g=";
  };

  nativeBuildInputs = [
    which
    pkg-config
    autoconf
    automake
    libtool
    desktop-file-utils
    wrapGAppsHook3
  ];

  buildInputs = [
    gtk3
    gettext
    libv3270
    lib3270
    openssl
  ];

  postPatch = ''
    # lib3270_build_data_filename is relative to lib3270's share - not ours.
    for f in $(find . -type f -iname "*.c"); do
      sed -i -e "s@lib3270_build_data_filename(@g_build_filename(\"$out/share/pw3270\", @" "$f"
    done
  '';

  preConfigure = ''
    NOCONFIGURE=1 sh autogen.sh
  '';

  postFixup = ''
    # Schemas get installed to wrong directory.
    mkdir -p $out/share/glib-2.0
    mv $out/share/gsettings-schemas/${pname}-${version}/glib-2.0/schemas $out/share/glib-2.0/
    rm -rf $out/share/gsettings-schemas
  '';

  enableParallelBuilds = true;

  meta = with lib; {
    description = "3270 Emulator for gtk";
    homepage = "https://softwarepublico.gov.br/social/pw3270/";
    license = licenses.lgpl3Plus;
    maintainers = [ maintainers.vifino ];
    mainProgram = "pw3270";
  };
}