mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 17:53:37 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
64 lines
1.4 KiB
Nix
64 lines
1.4 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, qtbase
|
|
, qtsvg
|
|
, qtcharts
|
|
, wrapQtAppsHook
|
|
, cmake
|
|
, python3
|
|
, unstableGitUpdater
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "ripes";
|
|
# Pulling unstable version as latest stable does not build against gcc-13.
|
|
version = "2.2.6-unstable-2024-04-04";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mortbopet";
|
|
repo = "Ripes";
|
|
rev = "878087332afa3558dc8ca657f80a16ecdcf82818";
|
|
fetchSubmodules = true;
|
|
hash = "sha256-aNJTM/s4GNhWVXQxK1R/rIN/NmeKglibQZMh8ENjIzo=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
pkg-config
|
|
python3
|
|
wrapQtAppsHook
|
|
];
|
|
|
|
buildInputs = [
|
|
qtbase
|
|
qtsvg
|
|
qtcharts
|
|
];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
mkdir -p $out/Applications
|
|
cp -r Ripes.app $out/Applications/
|
|
makeBinaryWrapper $out/Applications/Ripes.app/Contents/MacOS/Ripes $out/bin/Ripes
|
|
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
install -D Ripes $out/bin/Ripes
|
|
'' + ''
|
|
cp -r ${src}/appdir/usr/share $out/share
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.updateScript = unstableGitUpdater { };
|
|
|
|
meta = with lib; {
|
|
description = "Graphical processor simulator and assembly editor for the RISC-V ISA";
|
|
homepage = "https://github.com/mortbopet/Ripes";
|
|
license = licenses.mit;
|
|
platforms = platforms.unix;
|
|
mainProgram = "Ripes";
|
|
maintainers = with maintainers; [ rewine ];
|
|
};
|
|
}
|