ana(conda) windows packaging

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: ana(conda) windows packaging

Post by peterl94 »

DeepSOIC, what do you use private/qevent_p.h for? The conda Qt doesn't ship the "private" headers. Would there be anyway to change the implementation so that it wouldn't need that header, or are we just going to have to provide our own Qt package?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Post by DeepSOIC »

Unfortunately this seems to be the only way to get gesture events. The solution should be to use qt5. If we disable that code, pinch zoom and two-finger pan support for gesture nav style will be lost.

Since QNativeGestureEvent has no extra code associated with it, it may be OK to copy-paste the necessary defines right into our cpp file.

Code: Select all

class QNativeGestureEvent : public QEvent
{
public:
    enum Type {
        None,
        GestureBegin,
        GestureEnd,
        Pan,
        Zoom,
        Rotate,
        Swipe
    };

    QNativeGestureEvent()
        : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0)
#ifdef Q_WS_WIN
        , sequenceId(0), argument(0)
#endif
    {
    }

    Type gestureType;
    float percentage;
    QPoint position;
    float angle;
#ifdef Q_WS_WIN
    ulong sequenceId;
    quint64 argument;
#endif
};
NativeGesture = 197
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Post by DeepSOIC »

Try this patched file:
WinNativeGestureRecognizers.cpp.zip
(3.54 KiB) Downloaded 42 times
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: ana(conda) windows packaging

Post by peterl94 »

Well, it compiles so it's good enough for me. Thank you!

looo, I've attached a patch with DeepSOIC's change and an updated CXX patch. This was not made against your py3-win branch, so it includes things already committed to that branch. (Also, I might have mixed up line endings...)

With those changes, the full build completed successfully except for reverse engineering. However, it doesn't run yet. :(

Code: Select all

Error processing line 1 of C:\Users\peter\Miniconda3\envs\fc1\lib\site-packages\matplotlib-2.0.0-py3.5-nspkg.pth:

Failed to import the site module
Traceback (most recent call last):
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\site.py", line 167, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\types.py", line 166, in <module>
    import functools as _functools
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\site.py", line 566, in <module>
    main()
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\site.py", line 550, in main
    known_paths = addsitepackages(known_paths)
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\site.py", line 327, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\site.py", line 206, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\site.py", line 177, in addpackage
    import traceback
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\traceback.py", line 5, in <module>
    import linecache
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\linecache.py", line 8, in <module>
    import functools
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "C:\Users\peter\Miniconda3\envs\fc1\lib\weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
patches.zip
(1.73 KiB) Downloaded 43 times
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Post by looo »

wow, thanks. I have applied your netgen-patch and partially reversed my diff for FreeCad/smesh.
Regarding matplotlib: I have simple removed the dependency for windows. I think there isn't much work invested into matplotlib + qt4, so maybe we should simple wait for qt5... As far as I know, conda-forge tries to pin qt5 soon. The last time I tried to build freecad with qt5 I wasn't succesfully. But can't remember what the reason was. Maybe the gitter-chat remembers ;)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Post by looo »

Without matplotlib, FreeCAD starts. First problem encountered: Highliting isn't working. But netgen works :D
netgen.png
netgen.png (39.21 KiB) Viewed 1744 times
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: ana(conda) windows packaging

Post by Jee-Bee »

congrats... probably a few bumps to go but it is a start!!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Post by DeepSOIC »

peterl94 wrote:Well, it compiles so it's good enough for me. Thank you!
PR submitted.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Post by looo »

thanks for making the PR @DeepSOIC

the diff is now in branch py3-25. Linux still builds. Good job @peterl94
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Post by looo »

If anyone want to try the python3 branch on windows: a build is available: https://anaconda.org/freecad/freecad/files
instructions can be found here: https://github.com/looooo/FreeCAD_Conda ... with-conda
Post Reply