Giter VIP home page Giter VIP logo

build-multilib-wine's Introduction

Debian/Ubuntu™ build script for compiling multilib Wine/Wine Staging (build-multilib-wine)

Installing

Download and install the latest release version tarball:

    sudo apt-get install wget
    export release_tag
    cd ~/Downloads
    wget 'https://github.com/bobwya/build-multilib-wine/releases/latest' -O 'build-multilib-wine.release.json'
    release_tag="$(sed -n '\@<a href=\"/bobwya/build-multilib-wine/releases/tag/@{s@^.*<a href=\".*releases/tag/\(.*\)\">.*$@\1@g;p}' 'build-multilib-wine.release.json')"
    [[ -z "${release_tag}" ]] && release_tag="master"
    wget "https://github.com//bobwya/build-multilib-wine/archive/${release_tag}.tar.gz" -O "build-multilib-wine-${release_tag}.tar.gz" \
    && tar xvfa "build-multilib-wine-${release_tag}.tar.gz" \
    && cd "build-multilib-wine-${release_tag}" \
    && sudo make install

Usage

Ensure that you have a root user password set. The script requires su to escalate privileges, as and when required. Note: by default Ubuntu™ only sets up sudo privileges.

The script has a detailed help page with the all the supported options:

    build_multilib_wine help

Also see the online man pages:

These man pages can also be viewed offline, using the commands (respectively):

    man build_multilib_wine # (1)
    man build_multilib_wine.conf # (5)

A default / stock configuration file can be created with:

    build_multilib_wine generate-conf

It is recommended new users do this first. As the configuration file will show what common script options will/may need to be specified. This file can then be edited to suit the users requirements.

This configuration file will be created by default as:

    "${HOME}/.config/build_multilib_wine/build_multilib_wine.conf"

The default directory options are typically OK for most users:

    PREFIX="${HOME}/usr"                    # default install directory - in your user's HOME directory
    SOURCE_ROOT="${HOME}/Wine/Source"       # default directory for Wine Git source and default patches
    BUILD_ROOT="${HOME}/Wine/Build"         # default directory for Wine builds
    LOG_DIRECTORY="${HOME}/Wine/Build/Logs" # default directory for build log files

All of these directories are shared with both of the Schroot environments (as HOME is a common mount-point).

At present the script has some Environment variables that can be overridden to change some advanced options:

        WINE_CONFIG_OPTIONS="-without-hal --without-v4l --without-oss"
        WINE_CFLAGS="-march=native -mtune=native"
        WINE_MAKE_OPTIONS="-j${THREADS}"

Typically one of more of these variables would be set (if required) in the global configuration file.

Using your custom Wine build(s)

Ensure that you have the winehq-devel (or winehq-staging) staging packages installed - so that you have the necessary runtime dependencies required by Wine.

Once you've managed to compile your custom version of Wine, it will (by default) be installed to:

    "${HOME}/usr"

To run your custom Wine version use the full path for all the executable, e.g.:

    ~/usr/bin/wine start /unix ~/Downloads/foobar2000_v1.4.exe
    ~/usr/bin/winecfg

Logging

Schroot setup/upgrade and all the build process can be optionally logged. This is done using a separate thread (via FIFO pipe). Optionally on completion of the selected build phases, or Schroot operations - the log file can be automatically compressed (all standard compressors are supported). Log files and stdout console output can be colourised according to user preference.

The default directory, for storing the build-multilib-wine log files, is:

    LOG_DIRECTORY="${HOME}/Wine/Build/Logs" # default directory for build log files

Technical

The dual Schroot chroot environments are created as subdirectories of the directory:

/srv/chroot/ ...

using individual (per-chroot) Schroot configuration files within the directory:

/etc/schroot/chroot.d/

So an example setup would include a 32-bit configuration file:

disco_wine_32bit.conf

[disco_wine_32bit]
description=Ubuntu 19.04 (32-bit)
personality=linux32
directory=/srv/chroot/disco_wine_32bit
message-verbosity=verbose
root-users=root
type=directory
users=robert
preserve-environment=true

and a 64-bit configuration file:

disco_wine_32bit.conf

[disco_wine_64bit]
description=Ubuntu 19.04 (64-bit)
directory=/srv/chroot/disco_wine_64bit
message-verbosity=verbose
root-users=root
type=directory
users=robert
preserve-environment=true

Logging is done with a separate logging thread... This was done so a FIFO pipe could be utilised. This proved to be simplier and more reliable, than say using TTY redirection, etc. Commands are simply grouped into blocks, with all output redirected to the input of the FIFO pipe. The actual logging thread reads the data coming out of the FIFO pipe output. This is always dumped to the standard console output stream (stdout) and (optionally) is written, uncompressed, to a log file. Log file compression is deferred to completion, of the current script operation, to support more advanced (non-streaming) compression techniques, like lzma. Generally using deferred compression will always achieve better compression ratios vs. streaming compression, when more advanced compression techniques are used.

The script was originally intended to use sudo to gain root privileges, as required. However there are a number of flaws, in the way sudo works, that made this very difficult. The most significant problem is that subshells, created with sudo, do not inherit any exported functions and variables, from the parent shell. Working around this limitation (alone) would have been (potentially) quite messy. So the final version of the script uses su to gain root privileges, as required. Unfortunately, this does require that Ubuntu user's have a root password set.

Issues (bugs)

If you have an issue this script then please use the repository Github issue tracker:

GitHub: bobwya / build-multilib-wine Issues

Where appropriate, please attach a log file (see above: Logging section).

build-multilib-wine's People

Contributors

aljelly avatar bobwya avatar zinigor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

build-multilib-wine's Issues

Script won't find debootstrap

On a freshly installed Debian 10, the /sbin directory is not in the user path. This generates the following message when running generate-conf because the installed debootstrap cannot be found:

sudo apt-get install  debootstrap
build_multilib_wine : check_package_dependencies () : please install the (above) required package(s) and re-run this script

After adding the /sbin directory to PATH, the config is generated. This should probably either be documented or changed in the detection.

Also, on the main page it says:

A default / stock configuration file can be created with:
    build_multilib_wine.sh generate-conf

but the command doesn't need the ".sh".

Failure to find source folder inside chroot

First of all, thank you for such a wonderful tool! This should make my life so much easier once I get it working properly :)

Now, the problem. When I create chroots and run build_multilib_wine.sh build-all I get an error that I'm assuming comes from inside the chroot:

src_prepare () ... 
~/Wine/Source/wine ~/Wine/Source/wine
Applying patch file: "/home/zinigor/bin/Patches/wine-1.5.26-winegcc.patch" ...
Applying patch file: "/home/zinigor/bin/Patches/wine-1.6-memset-O3.patch" ...
Applying patch file: "/home/zinigor/bin/Patches/wine_winecfg_detailed_version.patch" ...
Applying patch file: "/home/zinigor/bin/Patches/wine-winhlp32-macro-flex-2.6.3-flex.patch" ...
~/Wine/Source/wine
~/Wine/Source/wine ~/Wine/Source/wine
E: Failed to change to directory ‘/home/zinigor/Wine/Source/wine’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
build_multilib_wine.sh : schroot_session_run () : schroot -r -c "session:wine32" -d "/home/zinigor/Wine/Source/wine" -- autoreconf (session run) failed
Killed

I even tried binding my $HOME dir to chroots and cd-ing to /home/zinigor/Wine/Source/wine from inside the chroot to make sure it's there. But the script still bails with the same error.
Any idea what I can do here?

Thanks!

WINE_STAGING_BINPATCH_URL points to the deprecated wine-staging repo

This might me a non-issue, but I noticed that the WINE_STAGING_BINPATCH_URL variable is pointing to the deprecated "compholio" wine-staging repo.

Line 1955 reads:
export WINE_STAGING_BINPATCH_URL="https://raw.githubusercontent.com/wine-compholio/wine-staging/master/patches/gitapply.sh"

Probably should be:
export WINE_STAGING_BINPATCH_URL="https://raw.githubusercontent.com/wine-staging/wine-staging/master/patches/gitapply.sh"

Don't work with fresh Ubuntu 18.04

With fresh install, after generate-conf,
screenshot from 2018-07-01 11-30-12

This with help or any other command

With my old install upgraded from 17.10, script work fine

apply_patch_array function not working

Whenever the src_prepare function gets to a point where it has to run apply_patch_array, the script fails claiming it can't find a truncated version of the root path. I commented the execution of this function for the first part of the script where it applies the gentoo patches, but once it calls it again to apply the user patches, the same thing happens.

Applying patches from patch directory: "/home/mmatis/winebuild/Patches" ... ~/winebuild/Source/wine ~ build_multilib_wine.sh : apply_patch_array () : patch file "/home/mmatis/wi" does not exist

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.