Skip to content

Commit

Permalink
shottr: init at 1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DontEatOreo committed Jan 19, 2025
1 parent 3715e88 commit f774853
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions pkgs/by-name/sh/shottr/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
lib,
stdenvNoCC,
fetchurl,
writeShellApplication,
cacert,
curl,
common-updater-scripts,
pup,
undmg,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
pname = "shottr";
version = "1.8.1";

src = fetchurl {
url = "https://shottr.cc/dl/Shottr-${finalAttrs.version}.dmg";
hash = "sha256-I3LNLuhIRdjKDn79HWRK2B/tVsV+1aGt/aY442y3r2I=";
};

nativeBuildInputs = [ undmg ];

sourceRoot = "Shottr.app";

installPhase = ''
runHook preInstall
mkdir -p "$out/Applications/Shottr.app"
cp -R . "$out/Applications/Shottr.app"
runHook postInstall
'';

passthru.updateScript = lib.getExe (writeShellApplication {
name = "shottr-update-script";
runtimeInputs = [
cacert
common-updater-scripts
curl
pup
];
text = ''
version="$(curl -s https://shottr.cc/newversion.html \
| pup 'a[href*="Shottr-"] attr{href}' \
| sed -E 's|/dl/Shottr-||' \
| sed -E 's|\.dmg||')"
update-source-version shottr "$version"
'';
});

meta = {
changelog = "https://shottr.cc/newversion.html";
description = "MacOS screenshot app with scrolling screenshots, OCR, annotation and measurement instruments";
homepage = "https://shottr.cc/";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ donteatoreo ];
platforms = lib.platforms.darwin;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})

0 comments on commit f774853

Please sign in to comment.