|
19 | 19 | swig, |
20 | 20 | # Optionally exclude Luksan solvers to allow licensing under MIT |
21 | 21 | withoutLuksanSolvers ? false, |
| 22 | + |
| 23 | + # Builds docs on-demand |
| 24 | + withDocs ? false, |
| 25 | + |
22 | 26 | # Build static on-demand |
23 | 27 | withStatic ? stdenv.hostPlatform.isStatic, |
24 | 28 |
|
|
37 | 41 | in |
38 | 42 | clangStdenv.mkDerivation (finalAttrs: { |
39 | 43 | pname = "nlopt"; |
40 | | - version = "2.10.0"; |
| 44 | + version = "2.10.1"; |
41 | 45 |
|
42 | 46 | src = fetchFromGitHub { |
43 | 47 | owner = "stevengj"; |
44 | 48 | repo = "nlopt"; |
45 | 49 | tag = "v${finalAttrs.version}"; |
46 | | - hash = "sha256-mZRmhXrApxfiJedk+L/poIP2DR/BkV04c5fiwPGAyjI="; |
| 50 | + hash = "sha256-i+Cd2VLMbI4PUSXennR8jgF+/ZkzKX9WkVTPtayr8vs="; |
47 | 51 | }; |
48 | 52 |
|
49 | | - outputs = [ |
50 | | - "out" |
51 | | - "doc" |
52 | | - ]; |
53 | | - |
54 | | - patches = [ |
55 | | - # 26-03-2025: `mkdocs.yml` is missing a link for the subpage related to the Java bindings. |
56 | | - # 26-03-2025: This commit was merged after v2.10.0 was released, and has not been made |
57 | | - # 26-03-2025: part of a release. |
58 | | - (fetchpatch { |
59 | | - name = "missing-java-reference-mkdocs"; |
60 | | - url = "https://github.com/stevengj/nlopt/commit/7e34f1a6fe82ed27daa6111d83c4d5629555454b.patch"; |
61 | | - hash = "sha256-XivfZtgIGLyTtU+Zo2jSQAx2mVdGLJ8PD7VSSvGR/5Q="; |
62 | | - }) |
63 | | - |
64 | | - # 26-03-2025: The docs pages still list v2.7.1 as the newest version. |
65 | | - # 26-03-2025: This commit was merged after v2.10.0 was released, and has not been made |
66 | | - # 26-03-2025: part of a release. |
67 | | - (fetchpatch { |
68 | | - name = "update-index-md"; |
69 | | - url = "https://github.com/stevengj/nlopt/commit/2c4147832eff7ea15d0536c82351a9e169f85e43.patch"; |
70 | | - hash = "sha256-BXcbNUyu20f3N146v6v9cpjSj5CwuDtesp6lAqOK2KY="; |
71 | | - }) |
72 | | - |
73 | | - # 26-03-2025: There is an off-by-one error in the test/CMakeLists.txt |
74 | | - # 26-03-2025: that causes the tests to attempt to run disabled Luksan solver code, |
75 | | - # 26-03-2025: which in turn causes the test suite to fail. |
76 | | - # 26-03-2025: See https://github.com/stevengj/nlopt/pull/605 |
77 | | - (fetchpatch { |
78 | | - name = "fix-nondisabled-luksan-algorithm"; |
79 | | - url = "https://github.com/stevengj/nlopt/commit/7817ec19f21be6877a4b79777fc5315a52c6850b.patch"; |
80 | | - hash = "sha256-KgdAMSYKOQuraun4HNr9GOx48yjyeQk6W3IgWRA44oo="; |
81 | | - }) |
82 | | - ]; |
| 53 | + outputs = [ "out" ] ++ lib.optional withDocs "doc"; |
83 | 54 |
|
84 | 55 | postPatch = '' |
85 | 56 | substituteInPlace nlopt.pc.in \ |
@@ -123,7 +94,7 @@ clangStdenv.mkDerivation (finalAttrs: { |
123 | 94 | lib.cmakeFeature "Python_EXECUTABLE" "${buildPythonBindingsEnv.interpreter}" |
124 | 95 | ); |
125 | 96 |
|
126 | | - postBuild = '' |
| 97 | + postBuild = lib.optionalString withDocs '' |
127 | 98 | ${buildDocsEnv.interpreter} -m mkdocs build \ |
128 | 99 | --config-file ../mkdocs.yml \ |
129 | 100 | --site-dir $doc \ |
|
0 commit comments