Giter VIP home page Giter VIP logo

appimager's Introduction

AppImager

Note: AppImager is a work in progress. All contributions and suggestions are much appreciated.

AppImager is a CLI tool for creating and managing AppImages.

It has the ability to manage application dependences, setup an AppDir and package that AppDir into an AppImage.

Icon made by Darius Dan from www.flaticon.com is licensed by CC 3.0 BY

Why?

AppImages are an amazing way to distribute apps on almost any Linux distribution, but the way these apps have to be packaged is a bit convoluted, requiring you to build your app on an old base system, and figure out which dependencies are probably part of the base system, and which should be packaged into your AppImage.

AppImager is designed to help with this. It creates a Docker container with an Ubuntu base system at a version of your choice where you can download the dependencies you need for your app, and extract them into your AppDir.

We do this by using an AppImage.yml file to specify the dependencies required to compile the app, and the dependencies required to run it. AppImager then reads this YAML file, downloads and decompresses the dependencies into the AppDir, then compiles and packages your app into an AppImage.

The goal is to be able to add one AppImage.yml file alongside your source code, then use AppImager to build your app into an AppImage with no additional work required and no complicated scripts to be written.

Below is an example of an AppImage.yml file.

name: AppImager
description: AppImager manages AppImage dependencies, assists in the creation of AppDir's and creates AppImages from source code

build: cmake . && make clean && make

base: 12.04

env:
    MY_ENV_VAR: environment variable

repositories:
    - "ppa:ubuntu-toolchain-r/test"
    - "deb http://gb.archive.ubuntu.com/ubuntu/ precise universe multiverse"

require:
    - fuse
    - zlib

require_build:
    - cmake
    - binutils
    - glibc
    - glib2
    - gcc

AppImage.yml

AppImager works from an AppImage.yml file. This file tells AppImager numerous things about your app and the environment you want to compile it in.

name

The name of your app.

description

The description of your app.

build

This is the command that is run to compile your app. Usually this will be the path to a bash script which compiles your app.

The command/script specified here will be called when running ./appimager build. It should compile your app into the build directory.

base

The base Ubuntu version you want to target. To support a larger number of systems and distros then we recommend setting this to the oldest currently supported version of Ubuntu (12.04 at the time of writing).

We use Ubuntu as our base as it has multiple supported versions available, which gives you the flexibility of either supporting many systems, or using the latest libraries.

Although we use Ubuntu for our build environment, the compiled apps you create will work on almost any relatively recent Linux distribution.

require

This is a list of dependencies that will be included in your AppImage. This should be a list of packages that are assumed to not be included on every system you want to target.

Note: Dependencies for these packages will not be resolved automatically, so you will need to include all dependencies to be included in your AppImage

require_build

This is a list of dependencies that are required to build/compile your app (e.g. gcc), but are not needed once your app is compiled and packaged.

Note: These packages are installed directly into the container using apt-get. Dependencies for these packages will be resolved automatically.

Building

Dependencies

  • cmake
  • binutils
  • docker
  • fuse
  • glibc
  • glib2
  • gcc
  • zlib
  • xorriso

Building from source

sudo yum install cmake binutils docker fuse glibc-devel glib2-devel gcc zlib xorriso # Fedora 23
cmake .
make clean
make

Usage

Once you have compiled the runtime binary, you can then start using AppImager. Most of the AppImager commands are based around your current working directory (we call this the environment). Your working directroy should be the directory which contains your AppImage.yml file.

setup

The setup command creates a Docker container with a base Ubuntu installation to a version you specify in your AppImage.yml file and install the build dependencies. AppImager will then use this container to compile your app.

./appimager setup

install

The install command reads the AppImage.yml file in the current working directory and downloads and extracts the dependencies into your build directory.

./appimager install

build

The build command runs the build command/script specified in your AppImage.yml file.

./appimager build

start

The start command starts the container for the current environment.

./appimager start

stop

The stop command stops the container for the current environment.

./appimager stop

status

The status command shows the current status of the container for this environment.

./appimager status

package

The package command packages the AppDir (build directory) into an AppImage, ready for distribution.

./appimager package

destroy

The destroy command stops and destroys/deletes the container for this environment.

./appimager destroy

appimager's People

Contributors

chrisnharvey avatar probonopd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

appimager's Issues

Travis build

We need to build AppImager through Travis.

We will need to test each Ubuntu LTS in the build container and use 12.04 as the build base for the official release.

Create AppImage.lock file

We could create an AppImage.lock file which will save the dependencies and repositories installed so we can keep track of changes and have a appimager update command which will add new repositories, delete old ones, install new dependencies and uninstall old ones.

This will make it a lot quicker to add an additional dependency without having to wait for the entire container to be rebuilt.

Allow adding additional repositories and ppas

Add syntax to AppImage.yml to allow adding additional APT repositories and PPAs.

repositories:
    - "ppa:ubuntu-toolchain-r/test"
    - "deb http://gb.archive.ubuntu.com/ubuntu/ precise universe multiverse"

Add reset sub-command

We should add a reset command which restores the container to its state just after the setup command was run.

We could do this with docker commit

Download and compile AppImageKit runtime

Currently, we have the AppImage runtime copied into our respository. It would be better if we just downloaded the AppImageKit source and compile the runtime instead of hosting our own (probably outdated) version of it.

Add type to AppImage.yml

type: app
type: library

The app type will be the default.

If the library type is used, we could maybe publish these somewhere, so their build scripts can be used in other AppImages generated with AppImager.

The library type would not need the base property as it would be compiled against every Ubuntu LTS that is currently supported.

Do everything when running without sub-command

When running without a sub-command, we should should read the AppImage.yml file and run setup (if required), install, build and package (possibly).

So for most users, you'll simply just run appimager to compile your app/changes, download new dependencies and test.

Add the ability to automate update metadata generation

We should be able to automate the generation of zsync files and embed the necessary scripts into our generated AppImages to make it updatable.

This should be a feature we can turn on/off and configure in our AppImage.yml file.

Add shell command

It should be easy if we can get "into" our container by typing AppImager shell

Can't find cement module

Despite installing the needed Python packages, using Appimager still fails with:

Traceback (most recent call last):
  File "./appimager", line 2, in <module>
    from core import app
  File "/home/tomascw/Projects/appimager/core/app.py", line 1, in <module>
    from cement.core.foundation import CementApp
ImportError: No module named 'cement'

Add the ability to set environment variables

We should have the ability to set environment variables in our AppImage.yml file.

We should also set some default environment variables, like adding the libs in our build path to LD_LIBRARY_PATH and binaries in our build path to PATH.

Build instructions seem not to work

[me@host ~]$ cd appimager/
[me@host appimager]$ cmake .
CMake Error: The source directory "/home/me/appimager" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Automate common tasks

We should be able to automate common tasks

  • Setup icon automatically
  • Specify desktop file
  • Specify entry binary (so we can automatically put desktop integration into this path and suffix with .wrapper)

License

Would you consider putting this under the MIT License rather than GPL? AppImageKit is under the MIT License, too.

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.