1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, pkg-config
6, wrapGAppsHook
7, at-spi2-core
8, cairo
9, dbus
10, eigen
11, freetype
12, fontconfig
13, glew
14, gtkmm3
15, json_c
16, libdatrie
17, libepoxy
18, libGLU
19, libpng
20, libselinux
21, libsepol
22, libspnav
23, libthai
24, libxkbcommon
25, pangomm
26, pcre
27, util-linuxMinimal # provides libmount
28, xorg
29, zlib
30}:
31
32stdenv.mkDerivation rec {
33 pname = "solvespace";
34 version = "3.1";
35
36 src = fetchFromGitHub {
37 owner = pname;
38 repo = pname;
39 rev = "v${version}";
40 hash = "sha256-sSDht8pBrOG1YpsWfC/CLTTWh2cI5pn2PXGH900Z0yA=";
41 fetchSubmodules = true;
42 };
43
44 nativeBuildInputs = [
45 cmake
46 pkg-config
47 wrapGAppsHook
48 ];
49
50 buildInputs = [
51 at-spi2-core
52 cairo
53 dbus
54 eigen
55 freetype
56 fontconfig
57 glew
58 gtkmm3
59 json_c
60 libdatrie
61 libepoxy
62 libGLU
63 libpng
64 libselinux
65 libsepol
66 libspnav
67 libthai
68 libxkbcommon
69 pangomm
70 pcre
71 util-linuxMinimal
72 xorg.libpthreadstubs
73 xorg.libXdmcp
74 xorg.libXtst
75 zlib
76 ];
77
78 postPatch = ''
79 patch CMakeLists.txt <<EOF
80 @@ -20,9 +20,9 @@
81 # NOTE TO PACKAGERS: The embedded git commit hash is critical for rapid bug triage when the builds
82 # can come from a variety of sources. If you are mirroring the sources or otherwise build when
83 # the .git directory is not present, please comment the following line:
84 -include(GetGitCommitHash)
85 +# include(GetGitCommitHash)
86 # and instead uncomment the following, adding the complete git hash of the checkout you are using:
87 -# set(GIT_COMMIT_HASH 0000000000000000000000000000000000000000)
88 +set(GIT_COMMIT_HASH $version)
89 EOF
90 '';
91
92 cmakeFlags = [ "-DENABLE_OPENMP=ON" ];
93
94 meta = with lib; {
95 description = "A parametric 3d CAD program";
96 license = licenses.gpl3Plus;
97 maintainers = [ maintainers.edef ];
98 platforms = platforms.linux;
99 homepage = "https://solvespace.com";
100 changelog = "https://github.com/solvespace/solvespace/raw/v${version}/CHANGELOG.md";
101 };
102}