Skip to content

Support using app-extensions during the build#129

Closed
alexlarsson wants to merge 1 commit intoflatpak:masterfrom
alexlarsson:build-extensions
Closed

Support using app-extensions during the build#129
alexlarsson wants to merge 1 commit intoflatpak:masterfrom
alexlarsson:build-extensions

Conversation

@alexlarsson
Copy link
Copy Markdown
Member

@alexlarsson alexlarsson commented Apr 20, 2018

This adds add-build-extensions which is similar to add-extensions
except the extension is added at build-init time, so can be
used during the build. It can also optionally be removed after
the build is done.

This depends on the flatpak work in:
flatpak/flatpak#1598

With this I was able to build the following app which runs 32bit binaries
in a 64bit build:

{
    "app-id": "org.example.Multilib",
    "runtime": "org.freedesktop.Platform",
    "sdk": "org.freedesktop.Sdk",
    "runtime-version": "1.6",
    "command": "/usr/bin/true",
    "add-build-extensions": {
        "org.freedesktop.Platform.Compat32": {
            "directory": "lib/32bit",
            "add-ld-path": "lib",
            "version": "1.6"
        }
    },
    "modules": [
        {
            "name": "test 32bit",
            "buildsystem": "simple",
            "build-commands": [
                "ln -s /app/lib/32bit/lib/ld-linux.so.2 /app/lib/ld-linux.so.2",
                "/app/lib/32bit/bin/echo echoing from 32bit world"
            ]
        }
    ]
}

This adds add-build-extensions which is similar to add-extensions
except the extension is added at build-init time, so can be
used during the build. It can also optionally be removed after
the build is done.

This depends on the flatpak work in:
  flatpak/flatpak#1598

With this I was able to build the following app which runs 32bit binaries
in a 64bit build:

```
{
    "app-id": "org.example.Multilib",
    "runtime": "org.freedesktop.Platform",
    "sdk": "org.freedesktop.Sdk",
    "runtime-version": "1.6",
    "command": "/usr/bin/true",
    "add-build-extensions": {
        "org.freedesktop.Platform.Compat32": {
            "directory": "lib/32bit",
            "add-ld-path": "lib",
            "version": "1.6"
        }
    },
    "modules": [
        {
            "name": "test 32bit",
            "buildsystem": "simple",
            "build-commands": [
                "ln -s /app/lib/32bit/lib/ld-linux.so.2 /app/lib/ld-linux.so.2",
                "/app/lib/32bit/bin/echo echoing from 32bit world"
            ]
        }
    ]
}
```
@alexlarsson
Copy link
Copy Markdown
Member Author

@johnramsden I think this is a step on the way for what you want. I think with the better multilib setup in freedesktop 1.8 it would be even nicer.

@johnramsden
Copy link
Copy Markdown

Thanks @alexlarsson, this looks perfect.

@alexlarsson
Copy link
Copy Markdown
Member Author

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Copy Markdown

📌 Commit 35d4945 has been approved by alexlarsson

@rh-atomic-bot
Copy link
Copy Markdown

⚡ Test exempted: pull fully rebased and already tested.

@johnramsden
Copy link
Copy Markdown

@alexlarsson regarding what you mentioned #129 (comment) about the new multilib setup in freedesktop 1.8, where can I find some more information about it? I took a look at flatpak/freedesktop-sdk-images, but I could only find reference to versions 1.6 and below.

@alexlarsson
Copy link
Copy Markdown
Member Author

leaeasy pushed a commit to leaeasy/flatpak-builder that referenced this pull request Jun 25, 2018
This adds add-build-extensions which is similar to add-extensions
except the extension is added at build-init time, so can be
used during the build. It can also optionally be removed after
the build is done.

This depends on the flatpak work in:
  flatpak/flatpak#1598

With this I was able to build the following app which runs 32bit binaries
in a 64bit build:

```
{
    "app-id": "org.example.Multilib",
    "runtime": "org.freedesktop.Platform",
    "sdk": "org.freedesktop.Sdk",
    "runtime-version": "1.6",
    "command": "/usr/bin/true",
    "add-build-extensions": {
        "org.freedesktop.Platform.Compat32": {
            "directory": "lib/32bit",
            "add-ld-path": "lib",
            "version": "1.6"
        }
    },
    "modules": [
        {
            "name": "test 32bit",
            "buildsystem": "simple",
            "build-commands": [
                "ln -s /app/lib/32bit/lib/ld-linux.so.2 /app/lib/ld-linux.so.2",
                "/app/lib/32bit/bin/echo echoing from 32bit world"
            ]
        }
    ]
}
```

Closes: flatpak#129
Approved by: alexlarsson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants