nixpkgs/pkgs/misc/emulators/simh/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

62 lines
1.6 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, SDL2
, SDL2_ttf
, libpcap
, vde2
, pcre
}:
stdenv.mkDerivation rec {
pname = "simh";
version = "3.11-1";
src = fetchFromGitHub {
owner = "simh";
repo = pname;
rev = "v${version}";
sha256 = "sha256-65+YfOWpVXPeT64TZcSaWJY+ODQ0q/pwF9jb8xGdpIs=";
};
buildInputs = [ SDL2 SDL2_ttf libpcap vde2 pcre ];
dontConfigure = true;
makeFlags = [ "GCC=cc" "CC_STD=-std=c99" "LDFLAGS=-lm" ];
preInstall = ''
install -d ${placeholder "out"}/bin
install -d ${placeholder "out"}/share/simh
'';
installPhase = ''
runHook preInstall
for i in BIN/*; do
install -D $i ${placeholder "out"}/bin
done
for i in VAX/*bin; do
install -D $i ${placeholder "out"}/share/simh
done
runHook postInstall
'';
postInstall = ''
(cd $out/bin; for i in *; do ln -s $i simh-$i; done)
'';
meta = with lib; {
homepage = "http://simh.trailing-edge.com/";
description = "A collection of simulators of historic hardware";
longDescription = ''
SimH (History Simulator) is a collection of simulators for historically
significant or just plain interesting computer hardware and software from
the past. The goal of the project is to create highly portable system
simulators and to publish them as freeware on the Internet, with freely
available copies of significant or representative software.
'';
license = with licenses; mit;
maintainers = with maintainers; [ AndersonTorres ];
platforms = with platforms; unix;
};
}
# TODO: install documentation