From 27a775dd8fe0231e24345aee742d5e802cf5a840 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Mon, 31 Mar 2025 20:03:04 -0400 Subject: scotty: init at 0.4.1 (cherry picked from commit 2d40122e73e724d3880076c28ae6e7d43de955aa) --- pkgs/by-name/sc/scotty/package.nix | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 pkgs/by-name/sc/scotty/package.nix diff --git a/pkgs/by-name/sc/scotty/package.nix b/pkgs/by-name/sc/scotty/package.nix new file mode 100644 index 000000000000..4b9fa3a0ac09 --- /dev/null +++ b/pkgs/by-name/sc/scotty/package.nix @@ -0,0 +1,54 @@ +{ + lib, + stdenv, + buildGoModule, + fetchFromSourcehut, + nix-update-script, + testers, +}: + +buildGoModule (finalAttrs: { + pname = "scotty"; + version = "0.4.1"; + + src = fetchFromSourcehut { + owner = "~phw"; + repo = "scotty"; + rev = "v${finalAttrs.version}"; + hash = "sha256-R9MgX5Am//9ULNKWqfH/JthMhqg4FFitOds7wU5iDSU="; + }; + + # Otherwise checks fail with `panic: open /etc/protocols: operation not permitted` when sandboxing is enabled on Darwin + # https://github.com/NixOS/nixpkgs/pull/381645#issuecomment-2656211797 + modPostBuild = '' + substituteInPlace vendor/modernc.org/libc/honnef.co/go/netdb/netdb.go \ + --replace-fail '!os.IsNotExist(err)' '!os.IsNotExist(err) && !os.IsPermission(err)' + ''; + + vendorHash = "sha256-DxtouPfysXsr436YwK9V88rff1hf9Ga7EYytZxxLd/g="; + + env = { + # *Some* locale is required to be set + # https://git.sr.ht/~phw/scotty/tree/04eddfda33cc6f0b87dc0fcea43d5c4f50923ddc/item/internal/i18n/i18n.go#L30 + LC_ALL = "C.UTF-8"; + }; + + passthru = { + tests.version = testers.testVersion { + # See above + command = "LC_ALL='C.UTF-8' scotty --version"; + package = finalAttrs.finalPackage; + }; + + updateScript = nix-update-script { }; + }; + + meta = { + description = "Transfers your listens between various music listen tracking and streaming services"; + homepage = "https://git.sr.ht/~phw/scotty"; + changelog = "https://git.sr.ht/~phw/scotty/refs/v${finalAttrs.version}"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ getchoo ]; + mainProgram = "scotty"; + }; +}) -- cgit v1.2.3