Code Monkey home page Code Monkey logo

libruntime's Introduction

libRuntime

The primary goal of this repository is to provide a framework for creating statically linked AppImage runtimes.

The code from this repository is currently a copy-paste of the AppImageKit runtime with some refactoring (including fixing all the compiler warnings).

Building

To build the default, completely statically linked runtime, pass --wrap-mode=forcefallback to the Meson setup command. This causes Meson to pull all dependencies as subprojects and build them from source (as static libraries).

meson --wrap-mode=forcefallback -Ddefault_library=static build
ninja -C build

To reduce the file size of the generated runtime image, the use of musl libc is recommended.

Using libRuntime to build a custom AppImage runtime

To use libRuntime for your runtime, generate a .wrap file for this project and include it in your subproject folder. Then the libRuntime library as well as the patch program for the executable can be obtained like this:

# more code ...

# Required programs for the patcher script
dd_prog      = find_program('dd')
objcopy_prog = find_program('objcopy')

# Build libRuntime
libruntime_sp  = subproject('libruntime')
libruntime_dep = libruntime_sp.get_variable('libruntime_dep')
patcher_prog   = libruntime_sp.get_variable('patcher_prog')

# Build the unpatched executable
foo_raw = executable(
    'foo_raw', ['foo.c'],
    dependencies: [libruntime_dep],
)

# Patch the executable
custom_target(
    'patch_runtime',
    input:       [foo_raw],
    output:      ['foo'],
    install:     true,
    install_dir: get_option('bindir'),
    command: [
        patcher_prog,
        '-i', '@INPUT@',
        '-o', '@OUTPUT@',
        '-p', '@PRIVATE_DIR@',
        '--dd', dd_prog,
        '--objcopy', objcopy_prog,
    ],
)

# more code ...

See the default runtime code for how to use libRuntime.

libruntime's People

Contributors

mensinda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

libruntime's Issues

PoC AppImage?

Hello @mensinda, this is very interesting work.
Is there a proof-of-concept AppImage for download?
I'd be especially interested in how it works on FUSE3-only systems, where our current AppImage runtime seemingly refuses to run.

Are you aware of https://github.com/tim-janik/appimage-runtime? It seems to go into a similar direction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.