forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minivmac: init at 2024.06.08 (NixOS#343034)
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
fetchFromGitHub, | ||
buildPackages, | ||
alsa-lib, | ||
xorg, | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "minivmac-erichelgeson"; | ||
version = "2024.06.08"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "erichelgeson"; | ||
repo = "minivmac"; | ||
rev = version; | ||
hash = "sha256-iiEE0ioXh3keKUPfAB+YcE1iggGLpxT9N8LSVFDhttE="; | ||
}; | ||
|
||
buildInputs = [ xorg.libX11 ]; | ||
|
||
makeFlags = [ "PREFIX=${placeholder "out"}" ]; | ||
|
||
configurePhase = '' | ||
${lib.getExe' buildPackages.stdenv.cc "cc"} setup/tool.c -o setup_t | ||
./setup_t -t lx64 > setup.sh | ||
# Patch hardcoded references in setup.sh to cross-aware counterparts | ||
substituteInPlace setup.sh --replace 'gcc ' '${stdenv.cc.targetPrefix}cc ' | ||
substituteInPlace setup.sh --replace 'strip --strip-unneeded' '${stdenv.cc.targetPrefix}strip --strip-unneeded' | ||
sh < ./setup.sh | ||
''; | ||
|
||
installPhase = '' | ||
install -Dm755 -t $out/bin ./minivmac | ||
''; | ||
|
||
# ensure libasound can be dlopen()'ed | ||
postFixup = '' | ||
patchelf --add-rpath "${lib.getLib alsa-lib}/lib" $out/bin/minivmac | ||
''; | ||
|
||
meta = with lib; { | ||
description = "miniature early Macintosh emulator (fork from erichelgeson)"; | ||
homepage = "https://github.com/erichelgeson/minivmac"; | ||
license = licenses.gpl2; | ||
maintainers = [ maintainers.flokli ]; | ||
platforms = platforms.linux; | ||
sourceProvenance = [ sourceTypes.fromSource ]; | ||
}; | ||
} |