gdevelop: add darwin support, add maintainer (#403164)

This commit is contained in:
Austin Horstman
2025-04-30 18:29:05 -05:00
committed by GitHub
3 changed files with 98 additions and 32 deletions
+33
View File
@@ -0,0 +1,33 @@
{
stdenvNoCC,
fetchurl,
unzip,
pname,
version,
meta,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
inherit pname version meta;
src = fetchurl {
url = "https://github.com/4ian/GDevelop/releases/download/v${version}/GDevelop-5-${version}-universal-mac.zip";
hash = "sha256-0FT4JHGJKy6UapuV2tXKzWm0Esr6DPqu38PllUbUtrY=";
};
sourceRoot = ".";
nativeBuildInputs = [ unzip ];
dontPatch = true;
dontConfigure = true;
dontBuild = true;
dontFixup = true;
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r "GDevelop 5.app" $out/Applications/
runHook postInstall
'';
})
+41
View File
@@ -0,0 +1,41 @@
{
stdenv,
fetchurl,
appimageTools,
version,
pname,
meta,
}:
let
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "https://github.com/4ian/GDevelop/releases/download/v${version}/GDevelop-5-${version}.AppImage";
hash = "sha256-KV6gzPiu/45ibdzMG707vd10F6qLcm+afwJWa6WlywU=";
}
else
throw "${pname}-${version} is not supported on ${stdenv.hostPlatform.system}";
appimageContents = appimageTools.extractType2 {
inherit pname version src;
postExtract = ''
substituteInPlace $out/gdevelop.desktop --replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=gdevelop'
'';
};
in
appimageTools.wrapType2 {
inherit
pname
version
src
meta
;
extraInstallCommands = ''
mkdir -p $out/share/applications
cp ${appimageContents}/gdevelop.desktop $out/share/applications
mkdir -p $out/share/icons
cp -r ${appimageContents}/usr/share/icons/hicolor $out/share/icons
'';
}
+24 -32
View File
@@ -1,47 +1,39 @@
{
lib,
stdenv,
fetchurl,
appimageTools,
callPackage,
...
}:
let
version = "5.5.229";
pname = "gdevelop";
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "https://github.com/4ian/GDevelop/releases/download/v${version}/GDevelop-5-${version}.AppImage";
sha256 = "sha256-KV6gzPiu/45ibdzMG707vd10F6qLcm+afwJWa6WlywU=";
}
else
throw "${pname}-${version} is not supported on ${stdenv.hostPlatform.system}";
appimageContents = appimageTools.extractType2 {
inherit pname version src;
postExtract = ''
substituteInPlace $out/gdevelop.desktop --replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=gdevelop'
'';
};
dontPatchELF = true;
in
appimageTools.wrapType2 {
inherit pname version src;
extraInstallCommands = ''
mkdir -p $out/share/applications
cp ${appimageContents}/gdevelop.desktop $out/share/applications
mkdir -p $out/share/icons
cp -r ${appimageContents}/usr/share/icons/hicolor $out/share/icons
'';
meta = {
description = "Graphical Game Development Studio";
homepage = "https://gdevelop.io/";
downloadPage = "https://github.com/4ian/GDevelop/releases";
license = lib.licenses.mit;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ tombert ];
maintainers = with lib.maintainers; [
tombert
matteopacini
];
mainProgram = "gdevelop";
platforms = [ "x86_64-linux" ];
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
};
}
in
if stdenv.hostPlatform.isDarwin then
callPackage ./darwin.nix {
inherit
pname
version
meta
;
}
else
callPackage ./linux.nix {
inherit
pname
version
meta
;
}