Skip to content

Commit 822db76

Browse files
committed
cq-editor: init
1 parent a8c496d commit 822db76

File tree

2 files changed

+97
-1
lines changed

2 files changed

+97
-1
lines changed

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
overlays.default = overlay;
1919

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

2222
checks.${system} = {
2323
deadcode =

pkgs/cq-editor/default.nix

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
lib,
3+
fetchFromGitHub,
4+
makeDesktopItem,
5+
copyDesktopItems,
6+
python3Packages,
7+
qt5,
8+
}:
9+
let
10+
rev = "089bb86";
11+
in
12+
python3Packages.buildPythonApplication {
13+
pname = "cq-editor";
14+
version = rev;
15+
16+
src = fetchFromGitHub {
17+
owner = "CadQuery";
18+
repo = "CQ-editor";
19+
rev = rev;
20+
hash = "sha256-VYWjOclpH3mfI/6bj4oMKvTj3plAR3mBYTHZE3bkW70=";
21+
};
22+
23+
dependencies = with python3Packages; [
24+
cadquery
25+
logbook
26+
nlopt
27+
pyqt5
28+
pyparsing
29+
pyqtgraph
30+
cq-kit
31+
cq-warehouse
32+
spyder
33+
pathpy
34+
qtconsole
35+
requests
36+
];
37+
38+
build-system = with python3Packages; [ setuptools ];
39+
40+
nativeBuildInputs = [
41+
copyDesktopItems
42+
qt5.wrapQtAppsHook
43+
];
44+
45+
# cq-editor crashes when trying to use Wayland, so force xcb
46+
qtWrapperArgs = [ "--set QT_QPA_PLATFORM xcb" ];
47+
48+
postFixup = ''
49+
wrapQtApp "$out/bin/cq-editor"
50+
'';
51+
52+
postInstall = ''
53+
install -Dm644 icons/cadquery_logo_dark.svg $out/share/icons/hicolor/scalable/apps/cadquery.svg
54+
55+
rm $out/bin/CQ-editor
56+
'';
57+
58+
nativeCheckInputs = with python3Packages; [
59+
pytestCheckHook
60+
pytest-xvfb
61+
pytest-mock
62+
pytestcov
63+
pytest-repeat
64+
pytest-qt
65+
];
66+
67+
# requires X server
68+
doCheck = false;
69+
70+
desktopItems = [
71+
(makeDesktopItem {
72+
name = "com.cadquery.CadQuery";
73+
desktopName = "CadQuery";
74+
icon = "cadquery";
75+
exec = "cq-editor %f";
76+
categories = [
77+
"Graphics"
78+
"3DGraphics"
79+
"Engineering"
80+
];
81+
type = "Application";
82+
comment = "CadQuery GUI editor based on PyQT";
83+
})
84+
];
85+
86+
meta = with lib; {
87+
description = "CadQuery GUI editor based on PyQT";
88+
homepage = "https://github.com/CadQuery/CQ-editor";
89+
license = licenses.asl20;
90+
maintainers = with maintainers; [
91+
costrouc
92+
marcus7070
93+
];
94+
};
95+
96+
}

0 commit comments

Comments
 (0)