Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ar / arc-browser / package.nix
blobe9d5e81db5adb8def264a2cd4ea7da578d95e723
1 { lib
2 , stdenvNoCC
3 , fetchurl
4 , undmg
5 , writeShellApplication
6 , curl
7 , common-updater-scripts
8 }:
10 stdenvNoCC.mkDerivation (finalAttrs: {
11   pname = "arc-browser";
12   version = "1.52.0-51895";
14   src = fetchurl {
15     url = "https://releases.arc.net/release/Arc-${finalAttrs.version}.dmg";
16     hash = "sha256-IGUrU6J7xI0ay/ZQaC6xaI+Tl7ateAVOpGxtmR0yGIA=";
17   };
19   nativeBuildInputs = [ undmg ];
21   sourceRoot = "Arc.app";
23   installPhase = ''
24     runHook preInstall
26     mkdir -p $out/Applications/Arc.app
27     cp -R . $out/Applications/Arc.app
29     runHook postInstall
30   '';
32   dontFixup = true;
34   passthru.updateScript = lib.getExe (writeShellApplication {
35     name = "arc-browser-update-script";
36     runtimeInputs = [ curl common-updater-scripts ];
37     text = ''
38       set -euo pipefail
39       redirect_url="$(curl -s -L -f "https://releases.arc.net/release/Arc-latest.dmg" -o /dev/null -w '%{url_effective}')"
40       # The url scheme is: https://releases.arc.net/release/Arc-1.23.4-56789.dmg
41       # We strip everything before 'Arc-' and after '.dmg'
42       version="''${redirect_url##*/Arc-}"
43       version="''${version%.dmg}"
44       update-source-version arc-browser "$version" --file=./pkgs/by-name/ar/arc-browser/package.nix
45     '';
46   });
48   meta = {
49     description = "Arc from The Browser Company";
50     homepage = "https://arc.net/";
51     license = lib.licenses.unfree;
52     maintainers = with lib.maintainers; [ donteatoreo ];
53     platforms = [ "aarch64-darwin" "x86_64-darwin" ];
54     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
55   };