Skip to content

Commit

Permalink
cq-editor: init
Browse files Browse the repository at this point in the history
  • Loading branch information
erooke committed Oct 10, 2024
1 parent 0f02785 commit 78c4dd6
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 1 deletion.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

overlays.default = overlay;

packages.${system}.default = pkgs.python3.withPackages (ps: [ ps.cadquery ]);
packages.${system}.default = pkgs.cq-editor;

checks.${system} = {
deadcode =
Expand Down
95 changes: 95 additions & 0 deletions pkgs/cq-editor/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{ lib
, fetchFromGitHub
, makeDesktopItem
, copyDesktopItems
, python3Packages
, qt5
}:
let
rev = "089bb86";
in
python3Packages.buildPythonApplication {
pname = "cq-editor";
version = rev;

src = fetchFromGitHub {
owner = "CadQuery";
repo = "CQ-editor";
rev = rev;
hash = "sha256-VYWjOclpH3mfI/6bj4oMKvTj3plAR3mBYTHZE3bkW70=";
};

dependencies = with python3Packages; [
cadquery
logbook
nlopt
pyqt5
pyparsing
pyqtgraph
cq-kit
cq-warehouse
spyder
pathpy
qtconsole
requests
];

build-system = with python3Packages; [ setuptools ];

nativeBuildInputs = [
copyDesktopItems
qt5.wrapQtAppsHook
];

# cq-editor crashes when trying to use Wayland, so force xcb
qtWrapperArgs = [ "--set QT_QPA_PLATFORM xcb" ];

postFixup = ''
wrapQtApp "$out/bin/cq-editor"
'';

postInstall = ''
install -Dm644 icons/cadquery_logo_dark.svg $out/share/icons/hicolor/scalable/apps/cadquery.svg
rm $out/bin/CQ-editor
'';

nativeCheckInputs = with python3Packages; [
pytestCheckHook
pytest-xvfb
pytest-mock
pytestcov
pytest-repeat
pytest-qt
];

# requires X server
doCheck = false;

desktopItems = [
(makeDesktopItem {
name = "com.cadquery.CadQuery";
desktopName = "CadQuery";
icon = "cadquery";
exec = "cq-editor %f";
categories = [
"Graphics"
"3DGraphics"
"Engineering"
];
type = "Application";
comment = "CadQuery GUI editor based on PyQT";
})
];

meta = with lib; {
description = "CadQuery GUI editor based on PyQT";
homepage = "https://github.com/CadQuery/CQ-editor";
license = licenses.asl20;
maintainers = with maintainers; [
costrouc
marcus7070
];
};

}

0 comments on commit 78c4dd6

Please sign in to comment.