geogebra6: use wayland instead of x11 when NIXOS_OZONE_WL=1

Added a flag to `makeWrapper` so that wayland is used instead of
xwayland when NIXOS_OZONE_WL=1
This commit is contained in:
LilleAila 2024-07-03 13:26:00 +02:00
parent 2137ecc63e
commit 8ae99325a8
No known key found for this signature in database
GPG Key ID: D1ACCDCF2B9B9799

View File

@ -1,4 +1,12 @@
{ lib, stdenv, unzip, fetchurl, electron, makeWrapper, geogebra }:
{
lib,
stdenv,
unzip,
fetchurl,
electron,
makeWrapper,
geogebra,
}:
let
pname = "geogebra";
version = "6-0-794-0";
@ -14,14 +22,17 @@ let
calculus in one easy-to-use package.
'';
homepage = "https://www.geogebra.org/";
maintainers = with maintainers; [ voidless sikmir ];
maintainers = with maintainers; [
voidless
sikmir
];
license = licenses.geogebra;
sourceProvenance = with sourceTypes; [
binaryBytecode
binaryNativeCode # some jars include native binaries
binaryNativeCode # some jars include native binaries
];
platforms = with platforms; linux ++ darwin;
hydraPlatforms = [];
hydraPlatforms = [ ];
};
linuxPkg = stdenv.mkDerivation {
@ -50,7 +61,9 @@ let
installPhase = ''
mkdir -p $out/libexec/geogebra/ $out/bin
cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra \
--add-flags "$out/resources/app" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
install -Dm644 "${desktopItem}/share/applications/"* \
-t $out/share/applications/
@ -84,6 +97,4 @@ let
};
};
in
if stdenv.isDarwin
then darwinPkg
else linuxPkg
if stdenv.isDarwin then darwinPkg else linuxPkg