mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-17 12:50:04 +00:00
openscadPackages.dotscad: init at 3.3
Co-authored-by: Jo <jopejoe1@missing.ninja>
This commit is contained in:
61
pkgs/development/openscad-packages/dotscad/default.nix
Normal file
61
pkgs/development/openscad-packages/dotscad/default.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
lib,
|
||||
buildOpenSCADPackage,
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
runCommand,
|
||||
openscad,
|
||||
libName ? null,
|
||||
}:
|
||||
|
||||
buildOpenSCADPackage (finalAttrs: {
|
||||
pname = "dotscad";
|
||||
version = "3.3";
|
||||
libName = if libName == null then "dotSCAD" else libName;
|
||||
|
||||
installTargets = [ "src/*" ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "JustinSDK";
|
||||
repo = "dotSCAD";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-kDT9vDCMMJs65aiQJXSxqhwy0GOo7FJbcIHPUtCSajQ=";
|
||||
};
|
||||
|
||||
passthru = {
|
||||
tests = lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) {
|
||||
functionality =
|
||||
runCommand "test-functionality-${finalAttrs.name}"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
(openscad.withPackages (ps: [ finalAttrs.finalPackage ]))
|
||||
];
|
||||
}
|
||||
''
|
||||
set -eu -o pipefail
|
||||
mkdir -p "$out"
|
||||
openscad -o "$out"/test.3mf - <<EOF
|
||||
use <dotSCAD/crystal_ball.scad>
|
||||
|
||||
crystal_ball(radius = 6);
|
||||
EOF
|
||||
if ! [[ -f "$out/test.3mf" ]]; then
|
||||
echo "ERROR: $name: test.3mf file not generated by openscad" >&2
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
meta = {
|
||||
description = "Reduce the burden of mathematics when playing OpenSCAD";
|
||||
longDescription = ''
|
||||
dotSCAD's upstream installation instructions can cause namespace
|
||||
conflicts. This package installs it under a `dotSCAD/` namespace, so
|
||||
import paths in the upstream documentation may differ. More info at
|
||||
https://wiki.nixos.org/wiki/OpenSCAD#Namespace_conflicting_libraries
|
||||
'';
|
||||
homepage = "https://github.com/JustinSDK/dotSCAD";
|
||||
license = lib.licenses.lgpl3Only;
|
||||
maintainers = with lib.maintainers; [ xoconoch ];
|
||||
};
|
||||
})
|
||||
@@ -14,5 +14,6 @@ lib.makeScope newScope (
|
||||
openscad = openscadOrig.override { openscadPackages = self; };
|
||||
bosl = self.callPackage ../development/openscad-packages/bosl { };
|
||||
bosl2 = self.callPackage ../development/openscad-packages/bosl2 { };
|
||||
dotscad = self.callPackage ../development/openscad-packages/dotscad { };
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user