mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
amiberry: init at 5.7.4 (#344667)
This commit is contained in:
commit
8f8f1702ef
91
pkgs/by-name/am/amiberry/package.nix
Normal file
91
pkgs/by-name/am/amiberry/package.nix
Normal file
@ -0,0 +1,91 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
makeWrapper,
|
||||
flac,
|
||||
libmpeg2,
|
||||
libmpg123,
|
||||
libpng,
|
||||
libserialport,
|
||||
portmidi,
|
||||
SDL2,
|
||||
SDL2_image,
|
||||
SDL2_ttf,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "amiberry";
|
||||
version = "5.7.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "BlitterStudio";
|
||||
repo = "amiberry";
|
||||
rev = "refs/tags/v${finalAttrs.version}";
|
||||
hash = "sha256-EOoVJYefX2pQ2Zz9bLD1RS47u/+7ZWTMwZYha0juF64=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
flac
|
||||
libmpeg2
|
||||
libmpg123
|
||||
libpng
|
||||
libserialport
|
||||
portmidi
|
||||
SDL2
|
||||
SDL2_image
|
||||
SDL2_ttf
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# Amiberry has traditionally behaved as a "Portable" app, meaning that it was designed to expect everything
|
||||
# under the same directory. This is not compatible with Nix package conventions.
|
||||
# The Amiberry behavior has changed since versions 5.7.4 and 6.3.4 (see
|
||||
# https://github.com/BlitterStudio/amiberry/wiki/FAQ#q-where-does-amiberry-look-for-its-files-can-i-change-that
|
||||
# for more information), however this is still not compatible with Nix packaging. The AMIBERRY_DATA_DIR can go
|
||||
# in the nix store but the Amiberry configuration files must be stored in a user writable location.
|
||||
# Fortunately Amiberry provides environment variables for specifying these locations which we can supply with the
|
||||
# wrapper script below.
|
||||
# One more caveat: Amiberry expects the configuration files path (AMIBERRY_HOME_DIR) to exist, otherwise it will
|
||||
# fall back to behaving like a "Portable" app. The wrapper below ensures that the AMIBERRY_HOME_DIR path exists,
|
||||
# preventing that fallback.
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp amiberry $out/bin/
|
||||
cp -r abr data $out/
|
||||
wrapProgram $out/bin/amiberry \
|
||||
--set-default AMIBERRY_DATA_DIR $out \
|
||||
--run 'AMIBERRY_HOME_DIR="$HOME/.amiberry"' \
|
||||
--run 'mkdir -p \
|
||||
$AMIBERRY_HOME_DIR/kickstarts \
|
||||
$AMIBERRY_HOME_DIR/conf \
|
||||
$AMIBERRY_HOME_DIR/nvram \
|
||||
$AMIBERRY_HOME_DIR/plugins \
|
||||
$AMIBERRY_HOME_DIR/screenshots \
|
||||
$AMIBERRY_HOME_DIR/savestates \
|
||||
$AMIBERRY_HOME_DIR/controllers \
|
||||
$AMIBERRY_HOME_DIR/whdboot \
|
||||
$AMIBERRY_HOME_DIR/lha \
|
||||
$AMIBERRY_HOME_DIR/floppies \
|
||||
$AMIBERRY_HOME_DIR/cdroms \
|
||||
$AMIBERRY_HOME_DIR/harddrives'
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/BlitterStudio/amiberry";
|
||||
description = "Optimized Amiga emulator for Linux/macOS";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ michaelshmitty ];
|
||||
mainProgram = "amiberry";
|
||||
};
|
||||
})
|
Loading…
Reference in New Issue
Block a user