From bdc67dec2470d793cc021cb85c6b73f56a188f5c Mon Sep 17 00:00:00 2001 From: Ulysses Zhan Date: Fri, 25 Oct 2024 00:05:18 -0700 Subject: [PATCH] spotlight-downloader: init at 1.5.0 --- .../sp/spotlight-downloader/package.nix | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pkgs/by-name/sp/spotlight-downloader/package.nix diff --git a/pkgs/by-name/sp/spotlight-downloader/package.nix b/pkgs/by-name/sp/spotlight-downloader/package.nix new file mode 100644 index 0000000000000..96e8d8b89b462 --- /dev/null +++ b/pkgs/by-name/sp/spotlight-downloader/package.nix @@ -0,0 +1,56 @@ +{ + lib, + fetchFromGitHub, + stdenv, + msbuild, + mono, + makeWrapper, +}: + +let + pname = "spotlight-downloader"; + version = "1.5.0"; +in +stdenv.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "ORelio"; + repo = "Spotlight-Downloader"; + tag = "v${version}"; + hash = "sha256-wGblbLBfH/sjUsz+hcg7OOWFavJ0k4piU/ypBEodvpY="; + }; + + nativeBuildInputs = [ + msbuild + makeWrapper + ]; + + buildPhase = '' + runHook preBuild + + msbuild /p:Configuration=Release SpotlightDownloader/SpotlightDownloader.csproj + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/share + cp -r SpotlightDownloader/bin/Release $out/share/SpotlightDownloader + makeWrapper ${lib.getExe mono} $out/bin/SpotlightDownloader \ + --add-flags "$out/share/SpotlightDownloader/SpotlightDownloader.exe" + + runHook postInstall + ''; + + meta = { + description = "Retrieve Windows Spotlight images from the Microsoft Spotlight API"; + license = lib.licenses.cddl; + maintainers = with lib.maintainers; [ ulysseszhan ]; + homepage = "https://github.com/ORelio/Spotlight-Downloader"; + platforms = lib.platforms.unix; + mainProgram = "SpotlightDownloader"; + }; +}