about summary refs log tree commit diff
path: root/pkgs/by-name/pu/pupdate/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/pu/pupdate/package.nix')
-rw-r--r--pkgs/by-name/pu/pupdate/package.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/by-name/pu/pupdate/package.nix b/pkgs/by-name/pu/pupdate/package.nix
new file mode 100644
index 000000000000..00e61e9f0140
--- /dev/null
+++ b/pkgs/by-name/pu/pupdate/package.nix
@@ -0,0 +1,64 @@
+{ pkgs
+, stdenv
+, lib
+, fetchFromGitHub
+, buildDotnetModule
+, dotnetCorePackages
+, openssl
+, zlib
+, hostPlatform
+, nix-update-script
+}:
+
+buildDotnetModule rec {
+  pname = "pupdate";
+  version = "3.0.0";
+
+  src = fetchFromGitHub {
+    owner = "mattpannella";
+    repo = "${pname}";
+    rev = "${version}";
+    hash = "sha256-Lr3orYOSzFQCLduBhp2MtGbgiKtFB1CgP/iMMySSvEk=";
+  };
+
+  buildInputs = [
+    stdenv.cc.cc.lib
+    zlib
+    openssl
+  ];
+
+  # See https://github.com/NixOS/nixpkgs/pull/196648/commits/0fb17c04fe34ac45247d35a1e4e0521652d9c494
+  patches = [ ./add-runtime-identifier.patch ];
+  postPatch = ''
+    substituteInPlace pupdate.csproj \
+      --replace @RuntimeIdentifier@ "${dotnetCorePackages.systemToDotnetRid hostPlatform.system}"
+  '';
+
+  projectFile = "pupdate.csproj";
+
+  nugetDeps = ./deps.nix;
+
+  selfContainedBuild = true;
+
+  executables = [ "pupdate" ];
+
+  dotnetFlags = [
+    "-p:PackageRuntime=${dotnetCorePackages.systemToDotnetRid stdenv.hostPlatform.system}"
+  ];
+
+  dotnet-sdk = dotnetCorePackages.sdk_6_0;
+  dotnet-runtime = dotnetCorePackages.runtime_6_0;
+
+  passthru = {
+    updateScript = nix-update-script { };
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/mattpannella/pupdate";
+    description = "Pupdate - A thing for updating your Analogue Pocket ";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ p-rintz ];
+    mainProgram = "pupdate";
+  };
+}