tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
antimony: 0.8.0b -> 0.9.2
Kranium Gikos Mendoza
9 years ago
a2a2b334
125ffff0
+34
-119
2 changed files
expand all
collapse all
unified
split
pkgs
applications
graphics
antimony
default.nix
paths-fix.patch
+16
-23
pkgs/applications/graphics/antimony/default.nix
···
1
1
-
{ stdenv, fetchgit, libpng, python3, boost, mesa, qtbase, qmakeHook, ncurses }:
1
1
+
{ stdenv, fetchFromGitHub, libpng, python3, boost, mesa, qtbase, ncurses, cmake, flex, lemon }:
2
2
3
3
let
4
4
-
gitRev = "745eca3a2d2657c495d5509e9083c884e021d09c";
4
4
+
gitRev = "e8480c718e8c49ae3cc2d7af10ea93ea4c2fff9a";
5
5
gitBranch = "master";
6
6
-
gitTag = "0.8.0b";
6
6
+
gitTag = "0.9.2";
7
7
in
8
8
stdenv.mkDerivation rec {
9
9
name = "antimony-${version}";
10
10
version = gitTag;
11
11
12
12
-
src = fetchgit {
13
13
-
url = "git://github.com/mkeeter/antimony.git";
14
14
-
rev = gitRev;
15
15
-
sha256 = "0azjdkbixz2pyk2yy7a0ya5xk60xgw3l2pd4pj4ijyqxx5jmh0sy";
12
12
+
src = fetchFromGitHub {
13
13
+
owner = "mkeeter";
14
14
+
repo = "antimony";
15
15
+
rev = gitTag;
16
16
+
sha256 = "0fpgy5cb4knz2z9q078206k8wzxfs8b9g76mf4bz1ic77931ykjz";
16
17
};
17
18
18
19
patches = [ ./paths-fix.patch ];
19
19
-
# fix build with glibc-2.23
20
20
+
20
21
postPatch = ''
21
21
-
sed 's/\<isinf(/std::isinf(/g' -i \
22
22
-
src/export/export_heightmap.cpp \
23
23
-
src/fab/types/bounds.cpp \
24
24
-
src/graph/hooks/meta.cpp \
25
25
-
src/ui/dialogs/resolution_dialog.cpp \
26
26
-
src/render/render_task.cpp
22
22
+
sed -i "s,/usr/local,$out,g" app/CMakeLists.txt app/app/app.cpp app/app/main.cpp
27
23
'';
28
24
29
25
buildInputs = [
···
31
27
mesa qtbase ncurses
32
28
];
33
29
34
34
-
nativeBuildHooks = [ qmakeHook ];
30
30
+
nativeBuildInputs = [ cmake flex lemon ];
35
31
36
36
-
preConfigure = ''
37
37
-
export GITREV=${gitRev}
38
38
-
export GITBRANCH=${gitBranch}
39
39
-
export GITTAG=${gitTag}
40
40
-
41
41
-
cd qt
42
42
-
'';
32
32
+
cmakeFlags= [
33
33
+
"-DGITREV=${gitRev}"
34
34
+
"-DGITTAG=${gitTag}"
35
35
+
"-DGITBRANCH=${gitBranch}"
36
36
+
];
43
37
44
38
enableParallelBuilding = true;
45
39
···
48
42
homepage = "https://github.com/mkeeter/antimony";
49
43
license = licenses.mit;
50
44
platforms = platforms.linux;
51
51
-
broken = true;
52
45
};
53
46
}
+18
-96
pkgs/applications/graphics/antimony/paths-fix.patch
···
1
1
-
diff --git a/qt/antimony.pro b/qt/antimony.pro
2
2
-
index 9d586f4..b055a6d 100644
3
3
-
--- a/qt/antimony.pro
4
4
-
+++ b/qt/antimony.pro
5
5
-
@@ -12,14 +12,9 @@ QMAKE_CXXFLAGS_RELEASE += -O3
6
6
-
7
7
-
QMAKE_CXXFLAGS += -Werror=switch
8
8
-
9
9
-
-GITREV = $$system(git log --pretty=format:'%h' -n 1)
10
10
-
-GITDIFF = $$system(git diff --quiet --exit-code || echo "+")
11
11
-
-GITTAG = $$system(git describe --exact-match --tags 2> /dev/null)
12
12
-
-GITBRANCH = $$system(git rev-parse --abbrev-ref HEAD)
13
13
-
-
14
14
-
-QMAKE_CXXFLAGS += "-D'GITREV=\"$${GITREV}$${GITDIFF}\"'"
15
15
-
-QMAKE_CXXFLAGS += "-D'GITTAG=\"$${GITTAG}\"'"
16
16
-
-QMAKE_CXXFLAGS += "-D'GITBRANCH=\"$${GITBRANCH}\"'"
17
17
-
+QMAKE_CXXFLAGS += "-D'GITREV=\"$$(GITREV)\"'"
18
18
-
+QMAKE_CXXFLAGS += "-D'GITTAG=\"$$(GITTAG)\"'"
19
19
-
+QMAKE_CXXFLAGS += "-D'GITBRANCH=\"$$(GITBRANCH)\"'"
20
20
-
21
21
-
OLD_GL_SET = $$(OLD_GL)
22
22
-
equals(OLD_GL_SET, "true") {
23
23
-
@@ -125,11 +120,11 @@ macx {
24
24
-
}
25
25
-
26
26
-
linux {
27
27
-
- executable.path = /usr/local/bin
28
28
-
+ executable.path = $$(out)/bin
29
29
-
executable.files = antimony
30
30
-
- nodes_folder.path = /usr/local/bin/sb/nodes
31
31
-
+ nodes_folder.path = $$(out)/bin/sb/nodes
32
32
-
nodes_folder.files = ../py/nodes/*
33
33
-
- fab_folder.path = /usr/local/bin/sb/fab
34
34
-
+ fab_folder.path = $$(out)/bin/sb/fab
35
35
-
fab_folder.files = ../py/fab/*
36
36
-
INSTALLS += executable nodes_folder fab_folder
37
37
-
}
38
38
-
diff --git a/qt/fab.pri b/qt/fab.pri
39
39
-
index a54813b..b500536 100644
40
40
-
--- a/qt/fab.pri
41
41
-
+++ b/qt/fab.pri
42
42
-
@@ -54,7 +54,7 @@ DEFINES += '_STATIC_= '
43
43
-
44
44
-
linux {
45
45
-
QMAKE_CFLAGS += -std=gnu99
46
46
-
- QMAKE_CXXFLAGS += $$system(/usr/bin/python3-config --includes)
47
47
-
+ QMAKE_CXXFLAGS += $$system(python3-config --includes)
48
48
-
LIBS += -lpng
49
49
-
}
50
50
-
51
51
-
diff --git a/qt/shared.pri b/qt/shared.pri
52
52
-
index e7d0e3a..026eae3 100644
53
53
-
--- a/qt/shared.pri
54
54
-
+++ b/qt/shared.pri
55
55
-
@@ -39,41 +39,11 @@ macx {
56
56
-
}
1
1
+
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
2
2
+
index ddc5c9b..d80728a 100644
3
3
+
--- a/app/CMakeLists.txt
4
4
+
+++ b/app/CMakeLists.txt
5
5
+
@@ -158,16 +158,6 @@ target_link_libraries(${ANTIMONY_APP}
57
6
58
58
-
linux {
59
59
-
- QMAKE_CXXFLAGS += $$system(/usr/bin/python3-config --includes)
60
60
-
- QMAKE_LFLAGS += $$system(/usr/bin/python3-config --ldflags)
61
61
-
+ QMAKE_CXXFLAGS += $$system(python3-config --includes)
62
62
-
+ QMAKE_LFLAGS += $$system(python3-config --ldflags)
7
7
+
################################################################################
63
8
64
64
-
# Even though this is in QMAKE_LFLAGS, the linker is picky about
65
65
-
# library ordering (so it needs to be here too).
66
66
-
LIBS += -lpython3.4m
9
9
+
-execute_process(COMMAND git log --pretty=format:'%h' -n 1
10
10
+
- OUTPUT_VARIABLE GITREV)
11
11
+
-execute_process(COMMAND bash -c "git diff --quiet --exit-code || echo +"
12
12
+
- OUTPUT_VARIABLE GITDIFF)
13
13
+
-execute_process(COMMAND git describe --exact-match --tags
14
14
+
- OUTPUT_VARIABLE GITTAG
15
15
+
- ERROR_QUIET)
16
16
+
-execute_process(COMMAND git rev-parse --abbrev-ref HEAD
17
17
+
- OUTPUT_VARIABLE GITBRANCH)
67
18
-
68
68
-
- # ldconfig is being used to find libboost_python, but it's in a different
69
69
-
- # place in different distros (and is not in the default $PATH on Debian).
70
70
-
- # First, check to see if it's on the default $PATH.
71
71
-
- system(which ldconfig > /dev/null) {
72
72
-
- LDCONFIG_BIN = "ldconfig"
73
73
-
- }
74
74
-
- # If that failed, then search for it in its usual places.
75
75
-
- isEmpty(LDCONFIG_BIN) {
76
76
-
- for(p, $$list(/sbin/ldconfig /usr/bin/ldconfig)) {
77
77
-
- exists($$p): LDCONFIG_BIN = $$p
78
78
-
- }
79
79
-
- }
80
80
-
- # If that search failed too, then exit with an error.
81
81
-
- isEmpty(LDCONFIG_BIN) {
82
82
-
- error("Could not find ldconfig!")
83
83
-
- }
84
84
-
-
85
85
-
- # Check for different boost::python naming schemes
86
86
-
- LDCONFIG_OUT = $$system($$LDCONFIG_BIN -p|grep python)
87
87
-
- for (b, $$list(boost_python-py34 boost_python3)) {
88
88
-
- contains(LDCONFIG_OUT, "lib$${b}.so") {
89
89
-
- LIBS += "-l$$b"
90
90
-
- GOT_BOOST_PYTHON = True
91
91
-
- }
92
92
-
- }
93
93
-
-
94
94
-
- # If we couldn't find boost::python, exit with an error.
95
95
-
- isEmpty(GOT_BOOST_PYTHON) {
96
96
-
- error("Could not find boost::python3")
97
97
-
- }
98
98
-
+ LIBS += -lboost_python3
99
99
-
}
19
19
+
add_definitions(-D'GITREV="${GITREV}${GITDIFF}"'
20
20
+
-D'GITTAG="${GITTAG}"'
21
21
+
-D'GITBRANCH="${GITBRANCH}"')