FreeCAD flatpak

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
PrzemoF
Posts: 2276
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

FreeCAD flatpak

Postby PrzemoF » Fri Aug 17, 2018 4:29 pm

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: 62
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Postby mdhill » Fri Aug 17, 2018 5:07 pm

Strange. My first line is this:

Code: Select all

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

Re: FreeCAD flatpak

Postby PrzemoF » Fri Aug 17, 2018 6:45 pm

Same here. What flatpak version do you use?

Code: Select all

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

Re: FreeCAD flatpak

Postby PrzemoF » Fri Aug 17, 2018 6:51 pm

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
Posts: 2276
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Postby PrzemoF » Fri Aug 17, 2018 7:35 pm

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
Posts: 2276
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Postby PrzemoF » Fri Aug 17, 2018 7:43 pm

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
Posts: 2276
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Postby PrzemoF » Fri Aug 17, 2018 7:51 pm

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
Posts: 2276
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Postby PrzemoF » Sat Aug 18, 2018 8:48 am

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
Posts: 2276
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD flatpak

Postby PrzemoF » Sat Aug 18, 2018 8:51 am

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: 62
Joined: Mon Apr 24, 2017 7:37 pm

Re: FreeCAD flatpak

Postby mdhill » Sat Aug 18, 2018 11:13 am

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