Last active
August 1, 2025 02:33
-
-
Save rummik/6aac9ebde62a82d9ba9675566bfb5779 to your computer and use it in GitHub Desktop.
Picotron Nix package
This file contains hidden or 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
{ | |
lib, | |
stdenv, | |
requireFile, | |
makeDesktopItem, | |
makeWrapper, | |
copyDesktopItems, | |
autoPatchelfHook, | |
unzip, | |
xorg, | |
libGL, | |
SDL2, | |
alsa-lib, | |
udev, | |
curl, | |
}: | |
let | |
appName = "Picotron"; | |
pname = "picotron"; | |
version = "0.2.0d"; | |
hashes = import ./picotron_hashes.nix; | |
fileName = archSuffix: "${pname}_${version}_${archSuffix}.zip"; | |
platforms = rec { | |
x86_64-linux = rec { | |
name = fileName "amd64"; | |
hash = if hashes ? ${name} then hashes.${name} else lib.fakeHash; | |
}; | |
x86_64-windows = rec { | |
name = fileName "windows"; | |
hash = if hashes ? ${name} then hashes.${name} else lib.fakeHash; | |
}; | |
aarch64-darwin = x86_64-darwin; | |
x86_64-darwin = rec { | |
name = fileName "osx"; | |
hash = if hashes ? ${name} then hashes.${name} else lib.fakeHash; | |
}; | |
}; | |
inherit (stdenv.hostPlatform) isLinux isDarwin isWindows; | |
in | |
stdenv.mkDerivation (finalAttrs: rec { | |
inherit pname version; | |
src = requireFile { | |
inherit (platforms.${stdenv.hostPlatform.system}) name hash; | |
url = meta.homepage; | |
}; | |
desktopItems = [ | |
(makeDesktopItem { | |
desktopName = appName; | |
categories = [ "Development" "Game" ]; | |
comment = meta.description; | |
name = pname; | |
exec = pname; | |
icon = pname; | |
}) | |
]; | |
nativeBuildInputs = | |
[ | |
unzip | |
] | |
++ lib.optionals isLinux [ | |
makeWrapper | |
autoPatchelfHook | |
copyDesktopItems | |
]; | |
# libcurl doesn't get picked up otherwise | |
appendRunpaths = lib.optionals isLinux (lib.makeLibraryPath [ | |
curl | |
]); | |
autoPatchelfLibs = lib.makeLibraryPath [ | |
SDL2 | |
]; | |
runtimeDependencies = lib.optionals isLinux [ | |
xorg.libXrandr | |
libGL | |
SDL2 | |
alsa-lib | |
udev | |
curl # required after 0.1.1f | |
# wget # required prior to 0.1.1f | |
]; | |
installPhase = lib.optionalString isLinux /* sh */ '' | |
runHook preInstall | |
install -Dm444 ./lexaloffle-picotron.png $out/share/icons/picotron.png | |
install -Dm555 -t $out/share/picotron ./picotron ./picotron_dyn ./picotron.dat | |
install -Dm444 -t $out/share/picotron ./*.txt | |
mkdir -p $out/bin | |
ln -s $out/share/picotron/picotron $out/bin/picotron | |
runHook postInstall | |
''; | |
meta = { | |
description = "A fantasy workstation"; | |
longDescription = '' | |
Picotron is a Fantasy Workstation: a self-contained creative | |
environment built for imaginary hardware. Create cute Lua apps that can | |
be run inside Picotron as windowed userland processes, shared as | |
cartridge files, or exported to stand-alone HTML apps. | |
''; | |
homepage = "https://www.lexaloffle.com/picotron.php"; | |
license = lib.licenses.unfree; | |
platforms = lib.attrNames platforms; | |
maintainers = []; | |
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; | |
broken = isDarwin || isWindows; | |
}; | |
}) |
This file contains hidden or 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
{ | |
"picotron_0.1.0_amd64.zip" = "sha256-/MhcxUSOQFxv/+JB59bEOaRqTtgQAbxpW7dlqtof7dg="; | |
"picotron_0.1.0b_amd64.zip" = "sha256-5x1b6Jedavnw1ZlBMwRs48PCH8g3g2UI4tsDUf19zAU="; | |
"picotron_0.1.0c_amd64.zip" = "sha256-1HvNPiItGvJ6h6B4sIF0eZcw4FCnXxoybZ89eeb2rJc="; | |
"picotron_0.1.0d_amd64.zip" = "sha256-Wrx9FnhnqrJS5M7mTjD88NwLWvjuXNlLUlDLon+TZU8="; | |
"picotron_0.1.0e_amd64.zip" = "sha256-1Jzc81Liin6kkruLIDXYjXaEaU/WkkBH2uaUnLmsTso="; | |
"picotron_0.1.0f_amd64.zip" = "sha256-A36TuH4OYRPGqNz5vALfxB6t34QQg4M6fku57rMYR+M="; | |
"picotron_0.1.0g_amd64.zip" = "sha256-s83x09TlMem6w9ii/hmkOSEQNywXgTi1m48kG3s3T5k="; | |
"picotron_0.1.1_amd64.zip" = "sha256-HjC6gwOHApW3oq5dLTaQY4W/o65QgJ4kCWA7wMEQ5FU="; | |
"picotron_0.1.1b_amd64.zip" = "sha256-5akflBJzD08DYFxPiZNtxfAep87QqSPknPxquYdpGtg="; | |
"picotron_0.1.1c_amd64.zip" = "sha256-+N2YvKf/cNpJ7zeKA6OC5cTrCa3hXGUhhkoT+7+aRA0="; | |
"picotron_0.1.1d_amd64.zip" = "sha256-9Hl3m48s5NOvdBdqWDlRhnrpvCsy5JbAR0CWjvMxZ4U="; | |
"picotron_0.1.1e_amd64.zip" = "sha256-AR9xrM9ocO8z29HVQRzzvHt+9OZ192a2tFVw+ByaDo8="; | |
"picotron_0.1.1f_amd64.zip" = "sha256-GHhJQQ/p+/pH+5695d/V1CUQ2dTPFc3/qIudv5IGQOo="; | |
"picotron_0.2.0_amd64.zip" = "sha256-Lq/JYb7XwC2p1F2TPDGteO4+cpM9onM39TlBPueBsBw="; | |
"picotron_0.2.0b_amd64.zip" = "sha256-4/lpj6WM/ia2u8uRdNkFiLAe9Zq+HCDmll8MEviU7kc="; | |
"picotron_0.2.0c_amd64.zip" = "sha256-bWyeW74xwZx6AwXziG6ITGa4B5K/x4CWuHoH1HkqtKU="; | |
"picotron_0.1.0_osx.zip" = "sha256-pyMeGpb0GzPe+DDu7oO6z+/+unh8VMC76RgMvfxy23k="; | |
"picotron_0.1.0b_osx.zip" = "sha256-OgT222jjfPh3NuqXIzDhR3e6ef7flUgcJo0AZqXXnY8="; | |
"picotron_0.1.0c_osx.zip" = "sha256-CKGpYC43D5PhuKUkBAlWqLcBLwcFVWovwA39gg0xSz0="; | |
"picotron_0.1.0d_osx.zip" = "sha256-HT2ZaZDx1qlpV8jDlgavOfL1GYCt8MjtukNJv1y/NLo="; | |
"picotron_0.1.0e_osx.zip" = "sha256-53H0zys3KofAEBnBAK6h/ZrZBsYf8dRdOeeI+V55C60="; | |
"picotron_0.1.0f_osx.zip" = "sha256-rkACpDMdYpg2EBuU5TVgFxMEB2PnvdvbtRSWBDD+0u4="; | |
"picotron_0.1.0g_osx.zip" = "sha256-GTbzR1nCNms+PBZdTWHoWJVrYqAbwMIMEg3eUiu3RRs="; | |
"picotron_0.1.1_osx.zip" = "sha256-imD21wX3GSROAvUUVMSsOrXqq3pmliafyFJRc4yK3aI="; | |
"picotron_0.1.1b_osx.zip" = "sha256-YbX1AnHVAJ0+MmbVqZ3S2FcjgnUFByQ4Y2pUX6eM26o="; | |
"picotron_0.1.1c_osx.zip" = "sha256-yuoWhnkbR8BPe97FI5kRDA4nXKnQ08r96IOtZybYBlk="; | |
"picotron_0.1.1d_osx.zip" = "sha256-wzA9eWTGeZzI7vH2zirlpOsbQAPaT1GLvbptcJ1fDOQ="; | |
"picotron_0.1.1e_osx.zip" = "sha256-iLNLAuWQTrJoDqR4TtlI1ab5MAAidyHrmcGtG2AyyHo="; | |
"picotron_0.1.1f_osx.zip" = "sha256-td/bOKjrCXV+JLcavegmLe6xf+bnJB1JauejgeTM4KE="; | |
"picotron_0.2.0_osx.zip" = "sha256-GpmO+Dj17rWzjg6FfnzQ6VVATO6zOHNT4EFVFavaNG0="; | |
"picotron_0.2.0b_osx.zip" = "sha256-yMVbORN7sRlCwSXi4jQKzcPU98AR8PhxWlaLUiHBRrI="; | |
"picotron_0.2.0c_osx.zip" = "sha256-3+xntRZVWmAjdWG/4E1R+HjX3jmDvOnG0bm5yy9LJG4="; | |
"picotron_0.1.0_windows.zip" = "sha256-PyuneEQIMRhbskay87OnCjGtG+XC3SF6dFjiGQva1F8="; | |
"picotron_0.1.0b_windows.zip" = "sha256-ofry5ftHQCFT6tk7fVU8RKuxboy5RJa+2DQjXd+uvw0="; | |
"picotron_0.1.0c_windows.zip" = "sha256-bzhtz3X/2XUnNwPFXQSZw4B1ncpqDDZZ8CgOSy+Uy+k="; | |
"picotron_0.1.0d_windows.zip" = "sha256-orQtVIka5j7WfQ4Dpsg8n8v1SF4tpanXlNUOZnKh5uk="; | |
"picotron_0.1.0e_windows.zip" = "sha256-RcpeU/x8b1BjUiU//TIlq66yO5sxbSkmg75VTpvjZgI="; | |
"picotron_0.1.0f_windows.zip" = "sha256-RnRR3uWoK6FLrl9S/OBEH1/n1jp/PD/Mm8RzIHgmmK8="; | |
"picotron_0.1.0g_windows.zip" = "sha256-5OE2C1MJBaCnkgxnGPNB4k/AC4gx4d9r9/FfSM62Qi0="; | |
"picotron_0.1.1_windows.zip" = "sha256-uoycXolFkw02L0xYhh8SZ3IVMs7fJOpdJEsXfIynQYY="; | |
"picotron_0.1.1b_windows.zip" = "sha256-NU54idPNE1VLv8CIOnIr5b7N+aj0sLa8FU98jRRQVNA="; | |
"picotron_0.1.1c_windows.zip" = "sha256-HqlAhFe7nPmVzasmfqAWmLoo91vpZwM+VMHS841s6OU="; | |
"picotron_0.1.1d_windows.zip" = "sha256-Rp1F6iaM9f1hY3szY93QH3U1mWYEmJFs6wgodDi+7Tg="; | |
"picotron_0.1.1e_windows.zip" = "sha256-5gmTZET9tZ+gk/Nl6fQtcDXN6Uqu2WGU374ywXW9qXA="; | |
"picotron_0.1.1f_windows.zip" = "sha256-sDM+s2SYI0dyczf8VXLV8dBXYqGtQYn7n4zus1FCgxc="; | |
"picotron_0.2.0_windows.zip" = "sha256-s/lEi+6//wZ88yt2dE1GkUI11G74iokuIuFBITQDMN0="; | |
"picotron_0.2.0b_windows.zip" = "sha256-LG62PTY6nw2W5rzSZLqXv8LdB0nXqqobTPzuyFiZLSQ="; | |
"picotron_0.2.0c_windows.zip" = "sha256-b/xb403CxUr8Sixcxmmzmnxd5n/Mq6Wbt0pfn7z009c="; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment