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!
Post Reply
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

FreeCAD flatpak

Post by PrzemoF »

This post will be updated as I move through the build process.
1. sudo dnf install flatpak flatpak-builder
2. Install flathub repo file from: https://flatpak.org/setup/Fedora/ (probably not required)
3. flatpak install flathub org.freedesktop.Platform//18.08 org.freedesktop.Sdk//18.08
4. mkdir FreeCAD-flatpak
5. cd FreeCAD-flatpak
6. git clone https://github.com/amigadave/freecad-flatpak.git . (clone to current dir, dot at the end)
7. $ flatpak-builder --force-clean test-build org.freecadweb.FreeCAD.yaml
Can't parse 'org.freecadweb.FreeCAD.yaml': <data>:1:2: błąd przetwarzania: unexpected identifier `id', expected value

Any idea what's wrong with the id?
mdhill
Posts: 85
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Post by mdhill »

Strange. My first line is this:

Code: Select all

id: org.freecadweb.FreeCAD
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

Same here. What flatpak version do you use?

Code: Select all

$ flatpak --version
Flatpak 0.11.8.2
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

I think it might be too old flatpak problem (json vs yaml support). I'm building flatpak & flatpak-builder from the sources now.

Edit: I have flatpak from github now (home build):

Code: Select all

$ flatpak --version
Flatpak 0.99.4
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

Just to make long story short: somehow i had very old flatpak and it didn't want to fly. For some reason fedora dnf didn't update it, but now I'm with flatpak & flatpak-builder 0.99.3 and I'm building FreeCAD
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

It's an uphill battle so far. I can't get Shiboken, even it the url is correct:

Code: Select all

$ flatpak-builder --force-clean test-build org.freecadweb.FreeCAD.yaml
Downloading sources
Downloading https://github.com/PySide/Shiboken/archive/1.2.4/shiboken-1.2.4.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Failed to download sources: module shiboken: The requested URL returned error: 404 Not Found
Looks like it's github problem. The link works with firefox, but not with wget
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

Changed ulr, works now:

Code: Select all

diff --git a/org.freecadweb.FreeCAD.yaml b/org.freecadweb.FreeCAD.yaml
index ffa9826..8202cdd 100644
--- a/org.freecadweb.FreeCAD.yaml
+++ b/org.freecadweb.FreeCAD.yaml
@@ -1,6 +1,6 @@
 id: org.freecadweb.FreeCAD
 runtime: org.freedesktop.Platform
-runtime-version: 1.6
+runtime-version: 18.08
 sdk: org.freedesktop.Sdk
 # Needed for libmed.
 sdk-extensions:
@@ -182,7 +182,7 @@ modules:
       - -DBUILD_TESTS=OFF
     sources:
       - type: archive
-        url: https://github.com/PySide/Shiboken/archive/1.2.4/shiboken-1.2.4.tar.gz
+        url: https://github.com/pyside/Shiboken/archive/1.2.4.tar.gz
         sha512: daa3fadf3daffaec52f199c0285a37431a4b6b0d450a43a035f49e5505a35b666a1cb0b334c7267af7530841dadbf0b97296812141c93de3b7cd07c7d9016a2a
       - type: patch
         path: shiboken-1.2.4-simplefile-test.patch
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

Problem:

Code: Select all

$ LC_ALL=c flatpak-builder --force-clean test-build org.freecadweb.FreeCAD.yaml
Downloading sources
Fetching git repo https://github.com/FreeCAD/FreeCAD.git, ref refs/heads/master
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Initializing build dir
error: Requested extension org.freedesktop.Sdk.Extension.gfortran-62 not installed
Error: Child process exited with code 1
And my attempt to solve it:

Code: Select all

sudo flatpak install flathub org.freedesktop.Sdk.Extension.gfortran-62
Yet it's still the same:

Code: Select all

$ LC_ALL=c flatpak-builder --force-clean test-build org.freecadweb.FreeCAD.yaml
Downloading sources
Fetching git repo https://github.com/FreeCAD/FreeCAD.git, ref refs/heads/master
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Initializing build dir
error: Requested extension org.freedesktop.Sdk.Extension.gfortran-62 not installed
Error: Child process exited with code 1
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Post by PrzemoF »

Code: Select all

$ LC_ALL=c sudo flatpak install flathub org.freedesktop.Sdk.Extension.gfortran-62
Skipping: org.freedesktop.Sdk.Extension.gfortran-62/x86_64/1.6 is already installed
1.6 might be the problem.. but i don't know how to install it for 18.08
mdhill
Posts: 85
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Post by mdhill »

Sorry, I forgot that part. There's a temporary issue because the extension hasn't been updated yet, but the library (libgfortran) was actually (mistakenly) built in to the Sdk. These lines need to be commented out (with a '#'):

Code: Select all

sdk-extensions:
  - org.freedesktop.Sdk.Extension.gfortran-62
and (under libmed):

Code: Select all

    build-commands:
      - /usr/lib/sdk/gfortran-62/install.sh
    build-options:
      env:
        FC: /usr/lib/sdk/gfortran-62/bin/gfortran
Post Reply