nixpkgs/pkgs/by-name/ma/marlin-calc/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

39 lines
1.0 KiB
Nix

{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation {
pname = "marlin-calc";
version = "2019-10-17";
src = fetchFromGitHub {
owner = "eyal0";
repo = "Marlin";
rev = "3d5a5c86bea35a2a169eb56c70128bf2d070feef";
sha256 = "14sqajm361gnrcqv84g7kbmyqm8pppbhqsabszc4j2cn7vbwkdg5";
};
postPatch = ''
# missing header for gcc >= 11
sed -i '1i#include <limits>' Marlin/src/module/calc.cpp
'';
buildPhase = ''
cd Marlin/src
c++ module/planner.cpp module/calc.cpp feature/fwretract.cpp \
-O2 -Wall -std=gnu++11 -o marlin-calc
'';
installPhase = ''
install -Dm0755 {,$out/bin/}marlin-calc
'';
meta = with lib; {
homepage = "https://github.com/eyal0/Marlin";
description = "Marlin 3D printer timing simulator";
license = licenses.gpl3;
maintainers = with maintainers; [ gebner ];
platforms = platforms.unix;
broken = stdenv.hostPlatform.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/marlin-calc.x86_64-darwin
mainProgram = "marlin-calc";
};
}