about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPaul Meyer <49727155+katexochen@users.noreply.github.com>2024-05-02 14:47:33 +0200
committerGitHub <noreply@github.com>2024-05-02 14:47:33 +0200
commit206669c7aa8138cdb56b1a815e38ff68c9b910f5 (patch)
tree76fa0a5e4f83b2a57763543d495fd1aaeb04273f /pkgs
parentd944b34b97fb50ad72472f0417805756e6381534 (diff)
parent5e7025bb2eabef6ececd00cc91daef87758b55d5 (diff)
Merge pull request #307698 from malt3/tdnf-init
tdnf: init at 3.5.6
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/td/tdnf/package.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/by-name/td/tdnf/package.nix b/pkgs/by-name/td/tdnf/package.nix
new file mode 100644
index 0000000000000..e6c339d1e1d2a
--- /dev/null
+++ b/pkgs/by-name/td/tdnf/package.nix
@@ -0,0 +1,77 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, curl
+, gpgme
+, libsolv
+, libxml2
+, pkg-config
+, python3
+, rpm
+, sqlite
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "tdnf";
+  version = "3.5.6";
+
+  src = fetchFromGitHub {
+    owner = "vmware";
+    repo = "tdnf";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-gj0IW0EwWBXi2s7xFdghop8f1lMhkUJVAkns5nnl7sg=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    curl.dev
+    gpgme.dev
+    libsolv
+    libxml2.dev
+    sqlite.dev
+  ];
+
+  propagatedBuildInputs = [
+    rpm
+  ];
+
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_PREFIX=$out"
+    "-DCMAKE_INSTALL_FULL_SYSCONDIR=$out/etc"
+    "-DCMAKE_INSTALL_SYSCONFDIR=$out/etc"
+    "-DSYSTEMD_DIR=$out/lib/systemd/system"
+  ];
+
+  # error: format not a string literal and no format arguments [-Werror=format-security]
+  hardeningDisable = [ "format" ];
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace-fail 'SYSCONFDIR /etc' 'SYSCONFDIR $out/etc' \
+      --replace-fail '/etc/motdgen.d' '$out/etc/motdgen.d'
+    substituteInPlace client/tdnf.pc.in \
+      --replace-fail 'libdir=''${prefix}/@CMAKE_INSTALL_LIBDIR@' 'libdir=@CMAKE_INSTALL_FULL_LIBDIR@'
+    substituteInPlace tools/cli/lib/tdnf-cli-libs.pc.in \
+      --replace-fail 'libdir=''${prefix}/@CMAKE_INSTALL_LIBDIR@' 'libdir=@CMAKE_INSTALL_FULL_LIBDIR@'
+  '';
+
+  # remove binaries used for testing from the final output
+  postInstall = "rm $out/bin/*test";
+
+  meta = {
+    description = "Tiny Dandified Yum";
+    homepage = "https://github.com/vmware/tdnf";
+    changelog = "https://github.com/vmware/tdnf/releases/tag/v${finalAttrs.version}";
+    license = with lib.licenses; [ gpl2 lgpl21 ];
+    maintainers = [ lib.maintainers.malt3 ];
+    mainProgram = "tdnf";
+    # rpm only supports linux
+    platforms = lib.platforms.linux;
+  };
+})