Skip to content

Commit

Permalink
red-star-os-rgjanggi: fix evaluation error on aarch64-linux
Browse files Browse the repository at this point in the history
  • Loading branch information
xddxdd committed Dec 6, 2024
1 parent b4e607c commit 133e127
Showing 1 changed file with 44 additions and 29 deletions.
73 changes: 44 additions & 29 deletions pkgs/uncategorized/red-star-os-rgjanggi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@
stdenv,
p7zip,
rpmextract,
makeWrapper,
bubblewrap,
pkgsi686Linux,
}:
let
pname = "red-star-os-rgjanggi";
version = "3.0";
meta = {
maintainers = with lib.maintainers; [ xddxdd ];
description = "Rgjanggi game from DPRK Red Star OS 3.0, heavily sandboxed. Use at your own risk";
homepage = "https://archive.org/details/RedStarOS";
license = lib.licenses.unfree;
platforms = [
"x86_64-linux"
"i686-linux"
];
};

src = stdenv.mkDerivation {
inherit pname version;
src = fetchurl {
Expand Down Expand Up @@ -41,35 +54,48 @@ let
runHook postInstall
'';

meta = {
maintainers = with lib.maintainers; [ xddxdd ];
description = "Wallpapers from DPRK Red Star OS 3.0";
homepage = "https://archive.org/details/RedStarOS";
license = lib.licenses.unfree;
};
inherit meta;
};

wxGTK2 = pkgsi686Linux.callPackage ./wxgtk2.nix { unicode = false; };

additionalPath = lib.makeBinPath [
pkgsi686Linux.alsa-utils
];

package = pkgsi686Linux.stdenv.mkDerivation {
inherit pname version src;

nativeBuildInputs = with pkgsi686Linux; [
autoPatchelfHook
];

buildInputs = [ wxGTK2 ];

installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/opt $out/lib
cp -r $src/Applications $out/opt/Applications
runHook postInstall
'';

inherit meta;
};
in
pkgsi686Linux.stdenv.mkDerivation {
inherit pname version src;
stdenv.mkDerivation rec {
inherit pname version;
dontUnpack = true;

nativeBuildInputs = with pkgsi686Linux; [
autoPatchelfHook
nativeBuildInputs = [
makeWrapper
];

buildInputs = [ wxGTK2 ];

installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/opt $out/lib
cp -r $src/Applications $out/opt/Applications
mkdir -p $out/bin
cat <<EOF >$out/bin/rgjanggi
#!/usr/bin/env bash
Expand All @@ -93,21 +119,21 @@ pkgsi686Linux.stdenv.mkDerivation {
x11_args+=(--ro-bind-try "\$XAUTHORITY" "\$XAUTHORITY")
fi
exec ${pkgsi686Linux.bubblewrap}/bin/bwrap \
exec ${bubblewrap}/bin/bwrap \
--unshare-all \
--tmpfs / \
--dev-bind /dev /dev \
--proc /proc \
--die-with-parent \
--ro-bind /etc /etc \
--ro-bind /nix /nix \
--ro-bind $out/opt/Applications /Applications \
--ro-bind ${package}/opt/Applications /Applications \
--bind /run /run \
--tmpfs /tmp \
--tmpfs /home/\$USER \
"\''${x11_args[@]}" \
--chdir / \
$out/opt/Applications/rgjanggi.app/Contents/RedStar/rgjanggi
${package}/opt/Applications/rgjanggi.app/Contents/RedStar/rgjanggi
EOF
chmod +x $out/bin/rgjanggi
Expand All @@ -117,16 +143,5 @@ pkgsi686Linux.stdenv.mkDerivation {
runHook postInstall
'';

passthru = { inherit wxGTK2; };

meta = {
maintainers = with lib.maintainers; [ xddxdd ];
description = "Rgjanggi game from DPRK Red Star OS 3.0, heavily sandboxed. Use at your own risk";
homepage = "https://archive.org/details/RedStarOS";
license = lib.licenses.unfree;
platforms = [
"x86_64-linux"
"i686-linux"
];
};
inherit meta;
}

0 comments on commit 133e127

Please sign in to comment.