nixpkgs/pkgs/applications/graphics/leocad/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

66 lines
1.3 KiB
Nix

{ lib
, mkDerivation
, fetchFromGitHub
, fetchurl
, povray
, qmake
, qttools
, substituteAll
, zlib
}:
/*
To use aditional parts libraries
set the variable LEOCAD_LIB=/path/to/libs/ or use option -l /path/to/libs/
*/
let
parts = fetchurl {
url = "https://web.archive.org/web/20210705153544/https://www.ldraw.org/library/updates/complete.zip";
sha256 = "sha256-PW3XCbFwRaNkx4EgCnl2rXH7QgmpNgjTi17kZ5bladA=";
};
in
mkDerivation rec {
pname = "leocad";
version = "21.06";
src = fetchFromGitHub {
owner = "leozide";
repo = "leocad";
rev = "v${version}";
sha256 = "1ifbxngkbmg6d8vv08amxbnfvlyjdwzykrjp98lbwvgb0b843ygq";
};
nativeBuildInputs = [ qmake qttools ];
buildInputs = [ zlib ];
propagatedBuildInputs = [ povray ];
patches = [
(substituteAll {
src = ./povray.patch;
inherit povray;
})
];
qmakeFlags = [
"INSTALL_PREFIX=${placeholder "out"}"
"DISABLE_UPDATE_CHECK=1"
];
qtWrapperArgs = [
"--set-default LEOCAD_LIB ${parts}"
];
meta = with lib; {
description = "CAD program for creating virtual LEGO models";
mainProgram = "leocad";
homepage = "https://www.leocad.org/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.linux;
};
}