New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QGIS: 2.18.17 -> 3.0.1 plus required libs #38022
Conversation
pkgs/top-level/python-packages.nix
Outdated
@@ -10065,6 +10065,27 @@ in { | |||
}; | |||
}; | |||
|
|||
OWSLib = buildPythonPackage rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this to a separate file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. There is a mix of inline and separate file in python-packages. Is the standard to move to separate file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past having module expressions in this file was okay; nowadays, we are moving them to separate files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are moving Python expressions out of pkgs/top-level/python-packages.nix
into pkgs/development/python-modules/<module>/default.nix
.
Please move the expression there, and call it from pkgs/top-level/python-packages.nix
using callPackage ../development/python-modules/<package> { };
.
pkgs/top-level/python-packages.nix
Outdated
sha256 = "0m05225g1sqd2i8r2riaan33953hfni9wjq7n225snhl7klsb5gc"; | ||
}; | ||
|
||
buildInputs = with self; [ dateutil pep8 pillow pyproj pytz pytest pytestcov requests tox ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these should probably go to checkInputs
.
pkgs/top-level/python-packages.nix
Outdated
meta = { | ||
description = "Client programming with Open Geospatial Consortium (OGC) web service."; | ||
license = licenses.bsd3; | ||
homepage = "http://geopython.github.io/OWSLib/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLs need not be quoted.
pkgs/top-level/python-packages.nix
Outdated
meta = { | ||
description = "Client programming with Open Geospatial Consortium (OGC) web service."; | ||
license = licenses.bsd3; | ||
homepage = "http://geopython.github.io/OWSLib/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLs do not need to be quoted.
@@ -0,0 +1,12 @@ | |||
diff -u -r orig/Python/configure.py QScintilla_gpl-2.10.3/Python/configure.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely cannot be in top-level. Should go to pkgs/development/python-modules/qscintilla/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops! editor goof
# Build processes depend on the built libraries. Extend | ||
# LD_LIBRARY_PATH as required. | ||
preConfigure = '' | ||
export LD_LIBRARY_PATH=`pwd`/build/output/lib:${stdenv.lib.makeLibraryPath [ openssl ]}$LD_LIBRARY_PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not adding -DCMAKE_SKIP_BUILD_RPATH=OFF
to cmakeFlags
remove the need for this hack this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea. That was from the previous QGIS version. I'll try that option and see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently the preConfigure
section is not required any more.
preBuild = '' | ||
export LD_LIBRARY_PATH=`pwd`/output/lib:${stdenv.lib.makeLibraryPath [ openssl ]}:$LD_LIBRARY_PATH | ||
''; | ||
nativeBuildInputs = [ cmake ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add ninja
when using cmake
, it is usually faster than make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not yet replace 2.8 by 3.0 because 3.0 is not yet feature complete. Instead, add 3.0 next to 2.8.
|
||
nativeBuildInputs = [ cmake makeWrapper ]; | ||
pythonBuildInputs = [ python3Packages.qscintilla python3Packages.gdal ] ++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into let ... in
expression.
wrapProgram $out/bin/qgis \ | ||
--prefix PATH : $program_PATH \ | ||
--prefix PYTHONPATH : $program_PYTHONPATH \ | ||
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ openssl ]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be patched instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not necessary anymore. ldd $(nix-build -A qgis)/bin/.qgis-wrapped | grep openssl
shows it is linked correctly.
|
||
wrapProgram $out/bin/qgis \ | ||
--prefix PATH : $program_PATH \ | ||
--prefix PYTHONPATH : $program_PYTHONPATH \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No prefixing, but setting so PYTHONPATH cannot leak inside.
pkgs/top-level/all-packages.nix
Outdated
@@ -17335,7 +17335,11 @@ with pkgs; | |||
|
|||
qemu-riscv = callPackage ../applications/virtualization/qemu/riscv.nix {}; | |||
|
|||
qgis = callPackage ../applications/gis/qgis {}; | |||
qgis-unwrapped = libsForQt5.callPackage ../applications/gis/qgis { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why expose the unwrapped version? Is it used somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exposing the unwrapped version in these cases is easiest way (IMO) to enable an overlay changing the source of the application. EG:
pkgs/top-level/python-packages.nix
Outdated
@@ -10065,6 +10065,27 @@ in { | |||
}; | |||
}; | |||
|
|||
OWSLib = buildPythonPackage rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are moving Python expressions out of pkgs/top-level/python-packages.nix
into pkgs/development/python-modules/<module>/default.nix
.
Please move the expression there, and call it from pkgs/top-level/python-packages.nix
using callPackage ../development/python-modules/<package> { };
.
pkgs/top-level/python-packages.nix
Outdated
OWSLib = buildPythonPackage rec { | ||
pname = "OWSLib"; | ||
version = "0.16.0"; | ||
name = "${pname}-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name
attribute is added by buildPython*
and should therefore be removed.
Do you have a source for that? I only found
https://qgis.org/en/site/forusers/visualchangelog30/index.html |
Its actually the plugins I meant to refer to. Plugins written in 2 are not compatible with 3. As they are a major feature of QGIS we should not be dropping 2 yet. Before 18.09 we can revisit this choice. |
That explains the mixed messaging I've seen online. The version number and some messaging indicates the QGIS 3 is released. Other messaging (EG: loading screen) states "early adopter". I just figured it was inconsistency haha. The plugin situation explains that. I'll re-add the 2 derivation. |
This uses the recommended configuration for python 3 and qt5. The config used for python 2 and qt 4 is unchanged from before.
0294449
to
5e3ce30
Compare
I re-added QGIS 2.18 as well as resolved the noted issues. Other changes with latest commits:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the wrapper needed? Can't this be done in the installPhase
or fixupPhase
?
Of course it is more convenient when designing the wrappers when not needing to rebuild the whole thing.
pkgs/applications/gis/qgis/3.0.nix
Outdated
with lib; | ||
let | ||
pythonBuildInputs = with python3Packages; | ||
[ python3Packages.qscintilla gdal jinja2 numpy psycopg2 pygments pyqt5 sip OWSLib six ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeating python3Packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a repeat. The "with" does not cause the "qscintilla" to be shadowed. Without the extra python3Packages the "qscintilla" passed is not the one in python3Packages but the C++ library one.
buildInputs = [ dateutil pep8 pillow pyproj pytz requests tox ]; | ||
checkInputs = [ pytest pytestcov ]; | ||
|
||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the tests disabled? Include a comment in the expression explaining why the tests are disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No tests run and the build fails because no test run. I figured this was a bug in the python build infrastructure.
sha256 = "0m05225g1sqd2i8r2riaan33953hfni9wjq7n225snhl7klsb5gc"; | ||
}; | ||
|
||
buildInputs = [ dateutil pep8 pillow pyproj pytz requests tox ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cehckInputs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already resolved. Not sure why this diff is showing up for you.
The wrapper is required to enable extension of the qgis python environment by users without requiring a rebuild of the full application. EG: to add additional deps for plugins for instance. |
let | ||
# the python packages that should be included in the PYTHONPATH | ||
pythonInputs = with python3Packages; | ||
qgis3-unwrapped.pythonBuildInputs ++ [ chardet dateutil pyyaml pytz requests urllib3 ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should these few be included in the wrapper, but not in the build? Are they needed for specific plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to build. The reference errors these resolved only showed up at runtime.
I would expect these are transitive dependencies for packages missing respective propagatedBuildInputs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not hard dependencies otherwise the builds of the dependents would fail. Either upstream has forgotten to list their full dependencies, or they require "extras" of certain packages.
https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
5e3ce30
to
73ca16c
Compare
Amended to resolve current CRs. |
--prefix PATH : $program_PATH \ | ||
--set PYTHONPATH $program_PYTHONPATH | ||
|
||
# desktop link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following seems irrelevant for the wrapper and thus better placed in the original derivation. Or am I missing something?
Times up! no further changes will be submitted. |
This looks like a great start. I was blocked on this as some dependencies were not building for darwin. If they are resolved I can pick it up. |
I successfully built QGIS 3 from this branch on NixOS 18.03. How do we proceed? Shall I attempt to resolve the merge conflicts with
What does that mean? Was your effort on this time-boxed @coreyoconnor or are you referring to NixOS release 18.03? |
QGIS 3.2 Bonn has been released. Time to revive this PR? |
Hi! The time I had for this original PR ran out a while ago. I will not have a chance for a few weeks (sadly) to really dig into this again. Anyone should feel free to take the changes thus far and carry on, of course. I do have a separate branch with these changes rebased against HEAD. Might be able to get this updated accordingly but besides that... a few weeks it is. |
Clearing old PRs. |
New PR for QGIS 3.4.5 (=the new LTR version and now currently only LTR version): #56486 |
I think the wrapper could use some improvements, but it's functional.
Motivation for this change
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)