FreeCAD flatpak

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

There is missing shared-modules/glu/glu-9.0.0.json file. I found it here [1], but I don't know it the yaml file should be modified or we should add the json file to the repo. Comment:

Code: Select all

- shared-modules/glu/glu-9.0.0.json # TODO: remove with next runtime
suggests that it should be removed, but for now the build just fails.
I submit the issue as soon as I know that the downloaded file works as expected.

[1] https://raw.githubusercontent.com/Grumb ... 9.0.0.json
mdhill
Posts: 85
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Post by mdhill »

I believe the shared-modules folder is a link to the Flathub subfolder, for its local builds. I had to add glu to my local manifest.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

Thanks, very good hint!!! It's all here: https://github.com/flathub/shared-modules
So the script that builds FreeCAD from scratch is (to be tested):

Code: Select all

$ cat ./build_FreeCAD.sh 
#!/bin/bash

git clone https://github.com/flathub/org.freecadweb.FreeCAD.git
cd org.freecadweb.FreeCAD
rmdir shared-modules/ && git rm shared-modules/ && git submodule add https://github.com/flathub/shared-modules.git
flatpak-builder --force-clean test-build org.freecadweb.FreeCAD.yaml
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

Local build finished OK, FreeCAD runs fine.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD flatpak

Post by Kunda1 »

Very cool!
Are we planning to add this to the Download page ?
Does the Flatpack offer both stable and development version of FC ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

I'm not the best person to answer those questions, but I'll try:
1. flathub already offers FreeCAD [1], ver 0.17 stable :D
2. adding this info to Download pages should be confirmed by @mdhill as I'm not sure if that's permanent or just a test? I guess it's permanent.
3. nightly/development versions - I have no info.

[1] https://flathub.org/apps/details/org.freecadweb.FreeCAD
mdhill
Posts: 85
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Post by mdhill »

Flathub will only host the stable version; a nightly version would have to be self-hosted. See earlier comment:

https://forum.freecadweb.org/viewtopic. ... 20#p264047

With a few changes to the manifest, you can build FreeCAD from git master locally (the way I'm running v0.18 now). I think it takes about 90 minutes to build on my laptop.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD flatpak

Post by Kunda1 »

mdhill wrote: Sun Nov 11, 2018 1:54 pm Flathub will only host the stable version; a nightly version would have to be self-hosted. See earlier comment:

https://forum.freecadweb.org/viewtopic. ... 20#p264047

With a few changes to the manifest, you can build FreeCAD from git master locally (the way I'm running v0.18 now). I think it takes about 90 minutes to build on my laptop.
@mdhill would you be willing to setup a demo repo that builds v0.18 and then we could see if there would be someone interested in maintaining it. We could possibly then clone it under github.com/FreeCAD org just like our homebrew tap ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
mdhill
Posts: 85
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Post by mdhill »

Kunda1, I'd be willing to help, but PrzemoF has a more concise manifest than mine. Here's what I have for the final module (master instead of 0.17):

Code: Select all

  - name: freecad
    buildsystem: cmake-ninja
    builddir: true
    build-options:
      env:
        PYTHONPATH: /app/lib/python2.7/site-packages
    config-opts:
      - -DCMAKE_BUILD_TYPE=RelWithDebInfo
      - -DCMAKE_INSTALL_PREFIX=/app/freecad
      - -DBUILD_QT5=ON
      - -DCMAKE_INCLUDE_PATH=/app/include
      - -DCMAKE_LIBRARY_PATH=/app/lib
      - -DCMAKE_CXX_FLAGS='-L/app/lib -pthread'
    post-install:
      - rm -rf /app/{include,lib/cmake,lib/mkspecs,lib/pkgconfig} # io.qt.qtwebkit.BaseApp
      - desktop-file-edit --set-key=Exec --set-value='freecad %F' --set-icon=org.freecadweb.FreeCAD --remove-key=Path ../src/XDGData/org.freecadweb.FreeCAD.desktop
      - install -Dm644 ../src/XDGData/org.freecadweb.FreeCAD.desktop /app/share/applications/org.freecadweb.FreeCAD.desktop
      - install -Dm644 ../src/XDGData/org.freecadweb.FreeCAD.xml /app/share/mime/packages/org.freecadweb.FreeCAD.xml
      - install -Dm644 ../src/XDGData/org.freecadweb.FreeCAD.svg /app/share/icons/hicolor/scalable/apps/org.freecadweb.FreeCAD.svg
      - install -Dm644 -t /app/share/metainfo ../src/XDGData/org.freecadweb.FreeCAD.appdata.xml
      - ln -s /app/freecad/bin/FreeCAD /app/bin/FreeCAD
      - ln -s /app/freecad/bin/FreeCADCmd /app/bin/FreeCADCmd
      - install -D ../freecad.sh /app/bin/freecad
    cleanup:
      - /freecad/doc
    sources:
      - type: script
        dest-filename: freecad.sh
        commands:
          - exec FreeCAD -u ${XDG_CONFIG_HOME}/FreeCAD/user.conf -s ${XDG_CONFIG_HOME}/FreeCAD/system.cfg "$@"
      - type: git
        url: https://github.com/FreeCAD/FreeCAD.git
      - type: shell
        commands:
          - sed -i 's|/usr|/app|g' cMake/FindOpenCasCade.cmake src/Gui/GraphvizView.cpp
I use flatpak-builder to build in a folder, then run FreeCAD from the folder. I'm unclear on the rest of the process, to generate the flatpak using a number of flatpak commands (GNOME Builder gives a glimpse of this with the Export button). Also from another thread, there's an issue with linked versions of Coin.
mdhill
Posts: 85
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Post by mdhill »

This looks like the rest of the process:

http://docs.flatpak.org/en/latest/publishing.html
Post Reply