mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
hamrs: add darwin support
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
parent
057be5b68e
commit
ce11e7f719
2 changed files with 47 additions and 1 deletions
41
pkgs/by-name/ha/hamrs/darwin.nix
Normal file
41
pkgs/by-name/ha/hamrs/darwin.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
pname,
|
||||
version,
|
||||
meta,
|
||||
fetchurl,
|
||||
_7zz,
|
||||
undmg,
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
inherit pname version;
|
||||
|
||||
src =
|
||||
if stdenvNoCC.hostPlatform.isAarch64 then
|
||||
(fetchurl {
|
||||
url = "https://hamrs-releases.s3.us-east-2.amazonaws.com/${finalAttrs.version}/HAMRS-${finalAttrs.version}.dmg";
|
||||
hash = "sha256-IQ7r2OLwJW4auiNDddzZ99jXxrtPw3uYoGIUEHU1gtc=";
|
||||
})
|
||||
else
|
||||
(fetchurl {
|
||||
url = "https://hamrs-releases.s3.us-east-2.amazonaws.com/${finalAttrs.version}/HAMRS-${finalAttrs.version}-intel.dmg";
|
||||
hash = "sha256-bgWeIARE3gO5FA9MqidfXo1Wdn5wDUa/RNzZBxSKloM=";
|
||||
});
|
||||
|
||||
nativeBuildInputs = if stdenvNoCC.hostPlatform.isAarch64 then [ _7zz ] else [ undmg ];
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/Applications
|
||||
cp -r *.app $out/Applications
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
inherit meta;
|
||||
})
|
|
@ -20,9 +20,14 @@ let
|
|||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
"i686-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
mainProgram = "hamrs";
|
||||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
||||
};
|
||||
in
|
||||
callPackage ./linux.nix { inherit pname version meta; }
|
||||
if stdenvNoCC.hostPlatform.isDarwin then
|
||||
callPackage ./darwin.nix { inherit pname version meta; }
|
||||
else
|
||||
callPackage ./linux.nix { inherit pname version meta; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue