diff options
author | Christopher Rzipa <christopher.rzipa@whizus.com> | 2023-09-30 19:31:26 +0200 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2023-10-05 02:41:51 +0300 |
commit | 2d97d78d9d55206063c5706545ead788f9a52b0a (patch) | |
tree | 8e46cd49e6f1b266645ce401eaf4cdd661cf9f90 /pkgs/applications/office | |
parent | 287354eb815a0acb6a905e68526efb86631412d5 (diff) | |
download | nixpkgs-2d97d78d9d55206063c5706545ead788f9a52b0a.tar nixpkgs-2d97d78d9d55206063c5706545ead788f9a52b0a.tar.gz nixpkgs-2d97d78d9d55206063c5706545ead788f9a52b0a.tar.bz2 nixpkgs-2d97d78d9d55206063c5706545ead788f9a52b0a.tar.lz nixpkgs-2d97d78d9d55206063c5706545ead788f9a52b0a.tar.xz nixpkgs-2d97d78d9d55206063c5706545ead788f9a52b0a.tar.zst nixpkgs-2d97d78d9d55206063c5706545ead788f9a52b0a.zip |
roam-research: add aarch64-darwin and x86_64-darwin support
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r-- | pkgs/applications/office/roam-research/common.nix | 22 | ||||
-rw-r--r-- | pkgs/applications/office/roam-research/darwin.nix | 34 | ||||
-rw-r--r-- | pkgs/applications/office/roam-research/default.nix | 87 | ||||
-rw-r--r-- | pkgs/applications/office/roam-research/linux.nix | 71 |
4 files changed, 134 insertions, 80 deletions
diff --git a/pkgs/applications/office/roam-research/common.nix b/pkgs/applications/office/roam-research/common.nix new file mode 100644 index 00000000000..8e63b111ad2 --- /dev/null +++ b/pkgs/applications/office/roam-research/common.nix @@ -0,0 +1,22 @@ +{ fetchurl }: +let + pname = "roam-research"; + version = "0.0.18"; +in +{ + inherit pname version; + sources = { + x86_64-darwin = fetchurl { + url = "https://roam-electron-deploy.s3.us-east-2.amazonaws.com/Roam+Research-${version}.dmg"; + hash = "sha256-jyFNH3qrgrsftExL/b2t8bY3W3fYVz+Gp11AuaIMxbg="; + }; + aarch64-darwin = fetchurl { + url = "https://roam-electron-deploy.s3.us-east-2.amazonaws.com/Roam+Research-${version}-arm64.dmg"; + hash = "sha256-AnyvFCbyUi6tcgxYQAj+zPLl4/kVh9ZeupetRhzH0PU="; + }; + x86_64-linux = fetchurl { + url = "https://roam-electron-deploy.s3.us-east-2.amazonaws.com/${pname}_${version}_amd64.deb"; + hash = "sha256-veDWBFZbODsdaO1UdfuC4w6oGCkeVBe+fqKn5XVHKDQ="; + }; + }; +} diff --git a/pkgs/applications/office/roam-research/darwin.nix b/pkgs/applications/office/roam-research/darwin.nix new file mode 100644 index 00000000000..2c736c0c1a7 --- /dev/null +++ b/pkgs/applications/office/roam-research/darwin.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, undmg, fetchurl }: +let + common = import ./common.nix { inherit fetchurl; }; + inherit (stdenv.hostPlatform) system; +in +stdenv.mkDerivation rec { + inherit (common) pname version; + src = common.sources.${system} or (throw "Source for ${pname} is not available for ${system}"); + + appName = "Roam Research"; + + sourceRoot = "."; + + nativeBuildInputs = [ undmg ]; + installPhase = '' + runHook preInstall + + mkdir -p "$out/Applications" + cp -R *.app "$out/Applications" + + mkdir -p $out/bin + ln -s "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${appName}" + runHook postInstall + ''; + + meta = with lib; { + description = "A note-taking tool for networked thought"; + homepage = "https://roamresearch.com/"; + maintainers = with lib.maintainers; [ dbalan ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.unfree; + platforms = [ "x86_64-darwin" "aarch64-darwin" ]; + }; +} diff --git a/pkgs/applications/office/roam-research/default.nix b/pkgs/applications/office/roam-research/default.nix index e1ca9bb47e8..408f026bc57 100644 --- a/pkgs/applications/office/roam-research/default.nix +++ b/pkgs/applications/office/roam-research/default.nix @@ -1,81 +1,8 @@ -{ stdenv, lib, fetchurl, alsa-lib, atk, cairo, cups, dbus, dpkg, expat -, gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor -, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, libdrm -, libpulseaudio, libxcb, libxkbcommon, libxshmfence, mesa, nspr, nss, pango -, udev, }: - +{ stdenv, callPackage, ... }@args: let - libPath = lib.makeLibraryPath [ - alsa-lib - atk - cairo - cups - dbus - expat - gdk-pixbuf - glib - gtk3 - libX11 - libXcomposite - libXdamage - libXext - libXfixes - libXi - libXrandr - libdrm - libxcb - libxkbcommon - libxshmfence - mesa - nspr - nss - pango - stdenv.cc.cc - libXScrnSaver - libXcursor - libXrender - libXtst - libpulseaudio - udev - ]; -in stdenv.mkDerivation rec { - pname = "roam-research"; - version = "0.0.18"; - - src = fetchurl { - url = - "https://roam-electron-deploy.s3.us-east-2.amazonaws.com/${pname}_${version}_amd64.deb"; - sha256 = "sha256-veDWBFZbODsdaO1UdfuC4w6oGCkeVBe+fqKn5XVHKDQ="; - }; - - nativeBuildInputs = [ dpkg ]; - - unpackPhase = '' - mkdir pkg - dpkg-deb -x $src pkg - sourceRoot=pkg - ''; - - installPhase = '' - mkdir -p "$out/bin" - mv opt "$out/" - - ln -s "$out/opt/Roam Research/roam-research" "$out/bin/roam-research" - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${libPath}:$out/opt/Roam Research:\$ORIGIN" "$out/opt/Roam Research/roam-research" - - mv usr/* "$out/" - - substituteInPlace $out/share/applications/roam-research.desktop \ - --replace "/opt/Roam Research/roam-research" "roam-research" - ''; - - dontPatchELF = true; - meta = with lib; { - description = "A note-taking tool for networked thought."; - homepage = "https://roamresearch.com/"; - maintainers = with lib.maintainers; [ dbalan ]; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.unfree; - platforms = [ "x86_64-linux" ]; - }; -} + extraArgs = removeAttrs args [ "callPackage" ]; +in +if stdenv.isDarwin then + callPackage ./darwin.nix (extraArgs // { }) +else + callPackage ./linux.nix (extraArgs // { }) diff --git a/pkgs/applications/office/roam-research/linux.nix b/pkgs/applications/office/roam-research/linux.nix new file mode 100644 index 00000000000..646ec762b2d --- /dev/null +++ b/pkgs/applications/office/roam-research/linux.nix @@ -0,0 +1,71 @@ +{ stdenv, lib, fetchurl, alsa-lib, atk, cairo, cups, dbus, dpkg, expat +, gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor +, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, libdrm +, libpulseaudio, libxcb, libxkbcommon, libxshmfence, mesa, nspr, nss, pango +, udev, }: + +let + common = import ./common.nix { inherit fetchurl; }; + inherit (stdenv.hostPlatform) system; + libPath = lib.makeLibraryPath [ + alsa-lib + atk + cairo + cups + dbus + expat + gdk-pixbuf + glib + gtk3 + libX11 + libXcomposite + libXdamage + libXext + libXfixes + libXi + libXrandr + libdrm + libxcb + libxkbcommon + libxshmfence + mesa + nspr + nss + pango + stdenv.cc.cc + libXScrnSaver + libXcursor + libXrender + libXtst + libpulseaudio + udev + ]; +in stdenv.mkDerivation rec { + inherit (common) pname version; + src = common.sources.${system} or (throw "Source for ${pname} is not available for ${system}"); + + nativeBuildInputs = [ dpkg ]; + + installPhase = '' + mkdir -p "$out/bin" + mv opt "$out/" + + ln -s "$out/opt/Roam Research/roam-research" "$out/bin/roam-research" + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${libPath}:$out/opt/Roam Research:\$ORIGIN" "$out/opt/Roam Research/roam-research" + + mv usr/* "$out/" + + substituteInPlace $out/share/applications/roam-research.desktop \ + --replace "/opt/Roam Research/roam-research" "roam-research" + ''; + + dontPatchELF = true; + meta = with lib; { + description = "A note-taking tool for networked thought"; + homepage = "https://roamresearch.com/"; + maintainers = with lib.maintainers; [ dbalan ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; + }; +} |