diff options
author | pcasaretto <pcasaretto@gmail.com> | 2024-02-23 10:47:12 -0300 |
---|---|---|
committer | pcasaretto <pcasaretto@gmail.com> | 2024-03-15 09:21:17 -0300 |
commit | ef812dcaac6dc9bda4f903ad1929c6230fbf2237 (patch) | |
tree | 576e3cd42ccc1eb5a5a842b77ce5259b1b1b67d4 /pkgs/by-name/im | |
parent | 51e92056dbcd2ac53f87b9f3c4043ac126040949 (diff) |
immersed-vr: add support for darwin
Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
Diffstat (limited to 'pkgs/by-name/im')
-rw-r--r-- | pkgs/by-name/im/immersed-vr/darwin.nix | 24 | ||||
-rw-r--r-- | pkgs/by-name/im/immersed-vr/linux.nix | 15 | ||||
-rw-r--r-- | pkgs/by-name/im/immersed-vr/package.nix | 29 |
3 files changed, 59 insertions, 9 deletions
diff --git a/pkgs/by-name/im/immersed-vr/darwin.nix b/pkgs/by-name/im/immersed-vr/darwin.nix new file mode 100644 index 0000000000000..68d3cfb1d712f --- /dev/null +++ b/pkgs/by-name/im/immersed-vr/darwin.nix @@ -0,0 +1,24 @@ +{ stdenv +, pname +, version +, src +, meta +, unzip +, undmg +}: + +stdenv.mkDerivation { + inherit pname version src meta; + + nativeBuildInputs = [ undmg ]; + + sourceRoot = "."; + + installPhase = '' + mkdir -p $out/Applications + cp -r *.app $out/Applications + ''; + + # Immersed is notarized. + dontFixup = true; +} diff --git a/pkgs/by-name/im/immersed-vr/linux.nix b/pkgs/by-name/im/immersed-vr/linux.nix new file mode 100644 index 0000000000000..c5c4ef8cef90f --- /dev/null +++ b/pkgs/by-name/im/immersed-vr/linux.nix @@ -0,0 +1,15 @@ +{ stdenv +, pname +, version +, src +, meta +, appimageTools +}: +appimageTools.wrapType2 rec { + inherit pname version src meta; + name = "${pname}-${version}"; + + extraInstallCommands = '' + mv $out/bin/{${name},${pname}} + ''; +} diff --git a/pkgs/by-name/im/immersed-vr/package.nix b/pkgs/by-name/im/immersed-vr/package.nix index 985c7cc38b4ce..ae85f3ac22728 100644 --- a/pkgs/by-name/im/immersed-vr/package.nix +++ b/pkgs/by-name/im/immersed-vr/package.nix @@ -1,27 +1,38 @@ { lib , appimageTools +, callPackage , fetchurl +, stdenv }: -appimageTools.wrapType2 rec { +let pname = "immersed-vr"; version = "9.10"; name = "${pname}-${version}"; - src = fetchurl { - url = "https://web.archive.org/web/20240210075929/https://static.immersed.com/dl/Immersed-x86_64.AppImage"; - hash = "sha256-Mx8UnV4fZSebj9ah650ZqsL/EIJpM6jl8tYmXJZiJpA="; + sources = rec { + x86_64-linux = { + url = "https://web.archive.org/web/20240210075929/https://static.immersed.com/dl/Immersed-x86_64.AppImage"; + hash = "sha256-Mx8UnV4fZSebj9ah650ZqsL/EIJpM6jl8tYmXJZiJpA="; + }; + aarch64-linux = x86_64-linux; + x86_64-darwin = { + url = "https://web.archive.org/web/20240210075929/https://static.immersed.com/dl/Immersed.dmg"; + hash = "sha256-CR2KylovlS7zerZIEScnadm4+ENNhib5QnS6z5Ihv1Y="; + }; + aarch64-darwin = x86_64-darwin; }; - extraInstallCommands = '' - mv $out/bin/{${name},${pname}} - ''; + src = fetchurl (sources.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}")); meta = with lib; { description = "A VR coworking platform"; homepage = "https://immersed.com"; license = licenses.unfree; maintainers = with maintainers; [ haruki7049 ]; - platforms = [ "x86_64-linux" ]; + platforms = builtins.attrNames sources; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; }; -} + +in if stdenv.isDarwin +then callPackage ./darwin.nix { inherit pname version src meta; } +else callPackage ./linux.nix { inherit pname version src meta; } |