Code Monkey home page Code Monkey logo

phoenicis-winebuild's Introduction

phoenicis-winebuild

Codacy Badge

Phoenicis Winebuild is a python library and a command line tool that compiles winehq automatically. It is the designated successor of PlayOnLinux Winebuild service.

We also provide pre-built binaries for Linux and macOS: https://www.playonlinux.com/wine/binaries/phoenicis/

Phoenicis Winebuild can:

  • run on any OS (Linux and Mac OS)
  • build wine for any target OS (see prerequisites).

Prerequisites

  • Python 3

  • Docker

  • docker-py

    pip install docker

Linux user

Ensure that your current user belongs to the docker group. You might need to restart your session

macOS user

  • Install Docker
  • Install homebrew
  • brew install Python3
  • pip3 install docker

OSX targeted builds

You need to extract Mac OS 10.11 SDK from XCode 9, compress it into a .tar.xz file and place it to darwin/SDK directory

How to use

Basic Usage Linux

After setup, run examples/interactive_builder.py PYTHONPATH="$PWD" python examples/interactive_builder.py

Basic Usage macOS

After setup, run examples/interactive_builder.py PYTHONPATH="$PWD" python3 examples/interactive_builder.py

Key concepts

Environment

An Environment is a pre-installed operating system where wine can be built. It corresponds to a docker image. We support currently two environment:

  • linux-x86-wine is a x86 environment containing all tools required to build wine for Linux
  • darwin-x86-wine is a x86 environment containing all tools required to cross-compile wine for MacOS

Container

A container is the instanciation of an environment. It corresponds to a docker container. Thanks to containers, you can run multiple compilation inside a given environment at the same time

Builders

A Builder is the components that builds wine. A builder needs a container to operate. We currently support one kind of builder :

  • WineBuilder downloads the source of wine into /root/wine-git and runs a script

Script

A script can be run inside a context initiated by a builder. We have two scripts:

  • builder_darwin_x86_wine
  • builder_linux_x86_wine

Web Services

After setup, run run_web_server.py

Create an environment

  • Go to the endpoint /environments (http://localhost:5000/environments)

  • Grab the docker name of a supported environment (exemple: phoenicis/winebuild/linux-x86:wine)

  • Create an environement creation task

    curl -d '{"type": "EnvironmentCreationTask", "argument": "phoenicis/winebuild/linux-x86:wine"}' -H "Content-Type: application/json" -X POST http://localhost:5000/tasks

  • Go to the endpoint /tasks to track the task creation process: http://127.0.0.1:5000/tasks. You should get a response like this one:

    [{ BuilderStageReaderTest.py"argument": { "docker_name": "phoenicis/winebuild/linux-x86:wine_osxcross" }, "description": "Environment creation: phoenicis/winebuild/linux-x86:wine_osxcross", "end_date": null, "id": "698ed9bd-f0af-4ed4-9063-d058fb7ec391", "last_update_date": "Sun, 21 Oct 2018 14:22:51 GMT", "progress": 94, "running": true, "start_date": "Sun, 21 Oct 2018 14:18:39 GMT", "type": "EnvironmentCreationTask" }]

Create a wine build task

Make a POST request to the /tasks endpoint:

curl -d '{"type": "PhoenicisWinePackageCreationTask", "argument": {"os": "darwin", "distribution": "upstream", "arch": "x86", "version": "wine-3.0.3"}}' -H "Content-Type: application/json" -X POST http://localhost:5000/tasks

Advanced scripting

You have two example python files (example_linux.py and example_darwin.py). If you need to tweak your build (select the version, use custom script, ...) you'll probably need to use the python API (See Key Concepts)

Examples

#!/usr/bin/env python
from packagers.PhoenicisWinePackageCreator import PhoenicisWinePackageCreator

builder = PhoenicisWinePackageCreator()

## Builds wine 4.0 x86 for darwin aka macOS
builder.build("upstream", "wine-4.0", "darwin", "x86")

Troubleshooting

The fonts are ugly on macOS

Try to export this environement variable:

export FREETYPE_PROPERTIES="truetype:interpreter-version=35"

phoenicis-winebuild's People

Contributors

imperators79 avatar qparis avatar gcenx avatar codacy-badger avatar ovari avatar plata avatar

Watchers

James Cloos avatar  avatar

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.