git.iko.soy/typeable/nixpkgs
on master help sign in
Adds antimony 0.8.0b CAD program
commit1847e204e0236e09f9936103c3145ff1b7f4d496 authorRichard Zetterberg <richard.zetterberg@googlemail.com> dateSun 31 May 2015, 21:18 (12 years ago) parent3296b5e
3 files changed+142
pkgs/applications/graphics/antimony/default.nix+41 pkgs/applications/graphics/antimony/paths-fix.patch+99 pkgs/top-level/all-packages.nix+2
pkgs/applications/graphics/antimony/default.nixnew file+41
@@ -0,0 +1,41 @@
1+{ stdenv, fetchgit, libpng, python3, boost, mesa, qt5, ncurses }:
2+
3+let
4+ gitRev = "745eca3a2d2657c495d5509e9083c884e021d09c";
5+ gitBranch = "master";
6+ gitTag = "0.8.0b";
7+in
8+ stdenv.mkDerivation rec {
9+ name = "antimony-${version}";
10+ version = gitTag;
11+
12+ src = fetchgit {
13+ url = "git://github.com/mkeeter/antimony.git";
14+ rev = gitRev;
15+ sha256 = "19ir3y5ipmfyygcn8mbxika4j3af6dfrv54dvhn6maz7dy8h30f4";
16+ };
17+
18+ patches = [ ./paths-fix.patch ];
19+
20+ buildInputs = [
21+ libpng python3 (boost.override { python = python3; })
22+ mesa qt5.base ncurses
23+ ];
24+
25+ configurePhase = ''
26+ export GITREV=${gitRev}
27+ export GITBRANCH=${gitBranch}
28+ export GITTAG=${gitTag}
29+
30+ cd qt
31+ export sourceRoot=$sourceRoot/qt
32+ qmake antimony.pro PREFIX=$out
33+ '';
34+
35+ meta = with stdenv.lib; {
36+ description = "A computer-aided design (CAD) tool from a parallel universe";
37+ homepage = "https://github.com/mkeeter/antimony";
38+ license = licenses.mit;
39+ platforms = platforms.linux;
40+ };
41+ }
pkgs/applications/graphics/antimony/paths-fix.patchnew file+99
@@ -0,0 +1,99 @@
1+diff --git a/qt/antimony.pro b/qt/antimony.pro
2+index 9d586f4..b055a6d 100644
3+--- a/qt/antimony.pro
4++++ b/qt/antimony.pro
5+@@ -12,14 +12,9 @@ QMAKE_CXXFLAGS_RELEASE += -O3
6+
7+ QMAKE_CXXFLAGS += -Werror=switch
8+
9+-GITREV = $$system(git log --pretty=format:'%h' -n 1)
10+-GITDIFF = $$system(git diff --quiet --exit-code || echo "+")
11+-GITTAG = $$system(git describe --exact-match --tags 2> /dev/null)
12+-GITBRANCH = $$system(git rev-parse --abbrev-ref HEAD)
13+-
14+-QMAKE_CXXFLAGS += "-D'GITREV=\"$${GITREV}$${GITDIFF}\"'"
15+-QMAKE_CXXFLAGS += "-D'GITTAG=\"$${GITTAG}\"'"
16+-QMAKE_CXXFLAGS += "-D'GITBRANCH=\"$${GITBRANCH}\"'"
17++QMAKE_CXXFLAGS += "-D'GITREV=\"$$(GITREV)\"'"
18++QMAKE_CXXFLAGS += "-D'GITTAG=\"$$(GITTAG)\"'"
19++QMAKE_CXXFLAGS += "-D'GITBRANCH=\"$$(GITBRANCH)\"'"
20+
21+ OLD_GL_SET = $$(OLD_GL)
22+ equals(OLD_GL_SET, "true") {
23+@@ -125,11 +120,11 @@ macx {
24+ }
25+
26+ linux {
27+- executable.path = /usr/local/bin
28++ executable.path = $$(out)/bin
29+ executable.files = antimony
30+- nodes_folder.path = /usr/local/bin/sb/nodes
31++ nodes_folder.path = $$(out)/bin/sb/nodes
32+ nodes_folder.files = ../py/nodes/*
33+- fab_folder.path = /usr/local/bin/sb/fab
34++ fab_folder.path = $$(out)/bin/sb/fab
35+ fab_folder.files = ../py/fab/*
36+ INSTALLS += executable nodes_folder fab_folder
37+ }
38+diff --git a/qt/fab.pri b/qt/fab.pri
39+index a54813b..b500536 100644
40+--- a/qt/fab.pri
41++++ b/qt/fab.pri
42+@@ -54,7 +54,7 @@ DEFINES += '_STATIC_= '
43+
44+ linux {
45+ QMAKE_CFLAGS += -std=gnu99
46+- QMAKE_CXXFLAGS += $$system(/usr/bin/python3-config --includes)
47++ QMAKE_CXXFLAGS += $$system(python3-config --includes)
48+ LIBS += -lpng
49+ }
50+
51+diff --git a/qt/shared.pri b/qt/shared.pri
52+index e7d0e3a..026eae3 100644
53+--- a/qt/shared.pri
54++++ b/qt/shared.pri
55+@@ -39,41 +39,11 @@ macx {
56+ }
57+
58+ linux {
59+- QMAKE_CXXFLAGS += $$system(/usr/bin/python3-config --includes)
60+- QMAKE_LFLAGS += $$system(/usr/bin/python3-config --ldflags)
61++ QMAKE_CXXFLAGS += $$system(python3-config --includes)
62++ QMAKE_LFLAGS += $$system(python3-config --ldflags)
63+
64+ # Even though this is in QMAKE_LFLAGS, the linker is picky about
65+ # library ordering (so it needs to be here too).
66+ LIBS += -lpython3.4m
67+-
68+- # ldconfig is being used to find libboost_python, but it's in a different
69+- # place in different distros (and is not in the default $PATH on Debian).
70+- # First, check to see if it's on the default $PATH.
71+- system(which ldconfig > /dev/null) {
72+- LDCONFIG_BIN = "ldconfig"
73+- }
74+- # If that failed, then search for it in its usual places.
75+- isEmpty(LDCONFIG_BIN) {
76+- for(p, $$list(/sbin/ldconfig /usr/bin/ldconfig)) {
77+- exists($$p): LDCONFIG_BIN = $$p
78+- }
79+- }
80+- # If that search failed too, then exit with an error.
81+- isEmpty(LDCONFIG_BIN) {
82+- error("Could not find ldconfig!")
83+- }
84+-
85+- # Check for different boost::python naming schemes
86+- LDCONFIG_OUT = $$system($$LDCONFIG_BIN -p|grep python)
87+- for (b, $$list(boost_python-py34 boost_python3)) {
88+- contains(LDCONFIG_OUT, "lib$${b}.so") {
89+- LIBS += "-l$$b"
90+- GOT_BOOST_PYTHON = True
91+- }
92+- }
93+-
94+- # If we couldn't find boost::python, exit with an error.
95+- isEmpty(GOT_BOOST_PYTHON) {
96+- error("Could not find boost::python3")
97+- }
98++ LIBS += -lboost_python3
99+ }
pkgs/top-level/all-packages.nix+2
@@ -10451,6 +10451,8 @@ let
1045110451
1045210452 amsn = callPackage ../applications/networking/instant-messengers/amsn { };
1045310453
10454+ antimony = callPackage ../applications/graphics/antimony {};
10455+
1045410456 antiword = callPackage ../applications/office/antiword {};
1045510457
1045610458 ardour = ardour4;