about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gcr
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gcr')
-rw-r--r--nixpkgs/pkgs/development/libraries/gcr/4.nix114
-rw-r--r--nixpkgs/pkgs/development/libraries/gcr/default.nix122
2 files changed, 236 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gcr/4.nix b/nixpkgs/pkgs/development/libraries/gcr/4.nix
new file mode 100644
index 000000000000..243663e430d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcr/4.nix
@@ -0,0 +1,114 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, gettext
+, gnupg
+, p11-kit
+, glib
+, libgcrypt
+, libtasn1
+, gtk4
+, pango
+, libsecret
+, openssh
+, systemd
+, gobject-introspection
+, wrapGAppsHook4
+, vala
+, gi-docgen
+, gnome
+, python3
+, shared-mime-info
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gcr";
+  version = "4.1.0";
+
+  outputs = [ "out" "bin" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "nOqtKShLqRm5IW4oiMGOxnJAwsk7OkhWvFSIu8Hzo4M=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    gettext
+    gobject-introspection
+    gi-docgen
+    wrapGAppsHook4
+    vala
+    gi-docgen
+    shared-mime-info
+  ];
+
+  buildInputs = [
+    gnupg
+    libgcrypt
+    libtasn1
+    pango
+    libsecret
+    openssh
+    systemd
+    gtk4
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    p11-kit
+  ];
+
+  nativeCheckInputs = [
+    python3
+  ];
+
+  mesonFlags = [
+    # We are still using ssh-agent from gnome-keyring.
+    # https://github.com/NixOS/nixpkgs/issues/140824
+    "-Dssh_agent=false"
+  ];
+
+  doCheck = false; # fails 21 out of 603 tests, needs dbus daemon
+
+  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
+
+  postPatch = ''
+    patchShebangs gcr/fixtures/
+  '';
+
+  postFixup = ''
+    # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
+    moveToOutput "share/doc" "$devdoc"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      attrPath = "gcr_4";
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+    description = "GNOME crypto services (daemon and tools)";
+    mainProgram = "gcr-viewer-gtk4";
+    homepage = "https://gitlab.gnome.org/GNOME/gcr";
+    license = licenses.lgpl2Plus;
+
+    longDescription = ''
+      GCR is a library for displaying certificates, and crypto UI, accessing
+      key stores. It also provides the viewer for crypto files on the GNOME
+      desktop.
+
+      GCK is a library for accessing PKCS#11 modules like smart cards, in a
+      (G)object oriented way.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gcr/default.nix b/nixpkgs/pkgs/development/libraries/gcr/default.nix
new file mode 100644
index 000000000000..5a388246c154
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcr/default.nix
@@ -0,0 +1,122 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, gettext
+, gnupg
+, p11-kit
+, glib
+, libgcrypt
+, libtasn1
+, gtk3
+, pango
+, libsecret
+, openssh
+, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
+, gobject-introspection
+, wrapGAppsHook
+, gi-docgen
+, vala
+, gnome
+, python3
+, shared-mime-info
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gcr";
+  version = "3.41.2";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "utEPPFU6DhhUZJq1nFskNNoiyhpUrmE48fU5YVZ+Grc=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    python3
+    ninja
+    gettext
+    gobject-introspection
+    gi-docgen
+    wrapGAppsHook
+    vala
+    shared-mime-info
+    gnupg
+    openssh
+  ];
+
+  buildInputs = [
+    libgcrypt
+    libtasn1
+    pango
+    libsecret
+    openssh
+  ] ++ lib.optionals (systemdSupport) [
+    systemd
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gtk3
+    p11-kit
+  ];
+
+  nativeCheckInputs = [
+    python3
+  ];
+
+  mesonFlags = [
+    # We are still using ssh-agent from gnome-keyring.
+    # https://github.com/NixOS/nixpkgs/issues/140824
+    "-Dssh_agent=false"
+  ] ++ lib.optionals (!systemdSupport) [
+    "-Dsystemd=disabled"
+  ];
+
+  doCheck = false; # fails 21 out of 603 tests, needs dbus daemon
+
+  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
+
+  postPatch = ''
+    patchShebangs gcr/fixtures/
+
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+    substituteInPlace meson_post_install.py --replace ".so" "${stdenv.hostPlatform.extensions.sharedLibrary}"
+  '';
+
+  postFixup = ''
+    # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
+    moveToOutput "share/doc" "$devdoc"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      freeze = true;
+    };
+  };
+
+  meta = with lib; {
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+    description = "GNOME crypto services (daemon and tools)";
+    mainProgram = "gcr-viewer";
+    homepage = "https://gitlab.gnome.org/GNOME/gcr";
+    license = licenses.lgpl2Plus;
+
+    longDescription = ''
+      GCR is a library for displaying certificates, and crypto UI, accessing
+      key stores. It also provides the viewer for crypto files on the GNOME
+      desktop.
+
+      GCK is a library for accessing PKCS#11 modules like smart cards, in a
+      (G)object oriented way.
+    '';
+  };
+}