Skip to content

Commit 4fa56ac

Browse files
authored
minivmac: init at 2024.06.08 (#343034)
2 parents 236815e + d88ea29 commit 4fa56ac

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
stdenv,
3+
lib,
4+
fetchFromGitHub,
5+
buildPackages,
6+
alsa-lib,
7+
xorg,
8+
}:
9+
10+
stdenv.mkDerivation rec {
11+
pname = "minivmac-erichelgeson";
12+
version = "2024.06.08";
13+
14+
src = fetchFromGitHub {
15+
owner = "erichelgeson";
16+
repo = "minivmac";
17+
rev = version;
18+
hash = "sha256-iiEE0ioXh3keKUPfAB+YcE1iggGLpxT9N8LSVFDhttE=";
19+
};
20+
21+
buildInputs = [ xorg.libX11 ];
22+
23+
makeFlags = [ "PREFIX=${placeholder "out"}" ];
24+
25+
configurePhase = ''
26+
${lib.getExe' buildPackages.stdenv.cc "cc"} setup/tool.c -o setup_t
27+
./setup_t -t lx64 > setup.sh
28+
29+
# Patch hardcoded references in setup.sh to cross-aware counterparts
30+
substituteInPlace setup.sh --replace 'gcc ' '${stdenv.cc.targetPrefix}cc '
31+
substituteInPlace setup.sh --replace 'strip --strip-unneeded' '${stdenv.cc.targetPrefix}strip --strip-unneeded'
32+
33+
sh < ./setup.sh
34+
'';
35+
36+
installPhase = ''
37+
install -Dm755 -t $out/bin ./minivmac
38+
'';
39+
40+
# ensure libasound can be dlopen()'ed
41+
postFixup = ''
42+
patchelf --add-rpath "${lib.getLib alsa-lib}/lib" $out/bin/minivmac
43+
'';
44+
45+
meta = with lib; {
46+
description = "miniature early Macintosh emulator (fork from erichelgeson)";
47+
homepage = "https://github.com/erichelgeson/minivmac";
48+
license = licenses.gpl2;
49+
maintainers = [ maintainers.flokli ];
50+
platforms = platforms.linux;
51+
sourceProvenance = [ sourceTypes.fromSource ];
52+
};
53+
}

0 commit comments

Comments
 (0)