Commit b344f6ce authored by Weijia Wang's avatar Weijia Wang
Browse files

rectangle: refactor

parent 5608f9db
Loading
Loading
Loading
Loading
+19 −5
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, cpio, xar, undmg, ... }:
{ lib
, stdenvNoCC
, fetchurl
, undmg
, gitUpdater
}:

stdenv.mkDerivation rec {
stdenvNoCC.mkDerivation rec {
  pname = "rectangle";
  version = "0.67";

@@ -9,15 +14,24 @@ stdenv.mkDerivation rec {
    hash = "sha256-tvxGDfpHu86tZt7M055ehEG/lDdmdPmZwrDc2F/yUjk=";
  };

  sourceRoot = "Rectangle.app";
  sourceRoot = ".";

  nativeBuildInputs = [ undmg ];

  installPhase = ''
    mkdir -p $out/Applications/Rectangle.app
    cp -R . $out/Applications/Rectangle.app
    runHook preInstall

    mkdir -p $out/Applications
    mv Rectangle.app $out/Applications

    runHook postInstall
  '';

  passthru.updateScript = gitUpdater {
    url = "https://github.com/rxhanson/Rectangle";
    rev-prefix = "v";
  };

  meta = with lib; {
    description = "Move and resize windows in macOS using keyboard shortcuts or snap areas";
    homepage = "https://rectangleapp.com/";