On 2. 7. 2015 10:53, Qian Hong wrote:
> Hi,
> 
> On Mon, Jun 29, 2015 at 4:39 AM, Qian Hong <[email protected]> wrote:
>> Thanks for pointing out that. I update the wiki page here:
>> https://github.com/fracting/wine-fracting/wiki/MSYS2-on-Wine
> 
> Thanks for updating
> http://sourceforge.net/p/msys2/wiki/MSYS2%20on%20Wine/ and thanks for
> adjusting the words.
> BTW, is there anyway I can download the markdown source code of
> http://sourceforge.net/p/msys2/wiki/MSYS2%20on%20Wine/ so that I can
> keep https://github.com/fracting/wine-fracting/wiki/MSYS2-on-Wine sync
> with the sourceforge version easily? Otherwise, would you mind edit my
> github wiki before copying to sourceforge in the future so they can
> keep in sync? You are welcome to edit the github wiki anytime you like

I kinda skipped that step. :)

Here's the source from SF.net, you can choose what to do with it (I also had to 
adjust some formatting, because the Markdown implementations differ between SF 
and GH):

##### Steps to use MSYS2, pacman and makepkg in Wine

#### Compile and Install Wine

1. **IMPORTANT** Install latest [Wine Staging](https://wine-staging.com/). Wine 
Staging provides pre-built packages for a couple of distributions every two 
weeks.

#### Install MSYS2

1. Backup or remove your old wineprefix:

    `$ mv ~/.wine ~/.wine.bak`

    Refer to http://wiki.winehq.org/FAQ#wineprefix for more backgrounds about 
wineprefix.

1. **IMPORTANT** Initialize environment variables for MSYS2, works around 
several Wine bugs

    `$ export LC_ALL=en_US.utf8`  # work around 
https://bugs.winehq.org/show_bug.cgi?id=10063

    `$ export STAGING_WRITECOPY=1` # enable copy on write

1. Download MSYS2 installer

    `$ wget 
http://sourceforge.net/projects/msys2/files/Base/i686/msys2-i686-YYYYMMDD.exe` 
# substitute `YYYYMMDD` with the latest release date; this page was written 
with the `20150512` release in mind

1. Install MSYS2

    `$ wine msys2-i686-YYYYMMDD.exe`

    (Ignore error "mintty: could not load icon from '/msys2.ico': File not 
found" if it happens)

1. Initialize MSYS2 shell

    * In Unix shell:
    * `$ cd ~/.wine/drive_c/msys32/`
    * `$ wine start msys2_shell.bat`

         * If you see a screen that says "This is first start of MSYS2. You 
MUST restart shell to apply necessary actions.", then everything seems fine so 
far. Now you can leave MSYS2, just type `exit` in MSYS2 Shell in Wine console:
         * `$ exit`

#### Run pacman

1. Restart MSYS2 shell
    * `$ wine start msys2_shell.bat`
    * If you see a screen that says "This is first start of MSYS2." again, then 
unfortunately something might be wrong. If not, congratulations, everything 
seems fine so far!

1. (optional) Edit `/etc/pacman.d/mirrorlist.*` to switch to a faster repo. For 
example, Chinese users might prefer http://mirrors.ustc.edu.cn/msys2/ rather 
than the default repo.

1. Update the package database, then you can install packages from MSYS2 repo

   * In MSYS2 shell:
      * `$ pacman -Sy`
      * and for example `$ pacman -S vim`

1. Update system packages with:

      * `$ pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime`

1. Close MSYS2, run it again from Start menu and update the rest with:

      * `$ pacman -Su`

    Refer to https://msys2.github.io/ for generic MSYS2 help.

    Refer to https://wiki.archlinux.org/index.php/pacman for generic pacman 
help.

#### Use makepkg to build packages inside MSYS2

1. **IMPORTANT** Disable multi-threading fox xz calls in pacman to work around 
a Wine bug which causes xz fail.

    Edit `/etc/makepkg.conf`, replace `T0` with `T1` inside `COMPRESSXZ=(xz -c 
-z -T0 -)`

    Edit `/usr/bin/makepkg`, search for `-xz -c -z -T0 -`, replace `-T0` with 
`-T1` as well.

1. Install toolchain using pacman

    For example, `$ pacman -S --needed base-devel gcc tar python2 python3 
zlib-devel`

1. Start building

    Just checkout the repo with PKGBUILD for the package to build and run 
`makepkg` (or `makepkg --skippgpcheck` if needed).

    Here is an example for the `file` package in 
https://github.com/Alexpux/MSYS2-packages/tree/master/file

    First, using your host (Linux) git, checkout 
https://github.com/Alexpux/MSYS2-packages/tree/master/file (git in MSYS2 
doesn't work as of 2015-06-04).

    Then, in MSYS2, `cd` to the directory of `file` package:

    `$ cd /path/to/MSYS2-packages/file`

    Then, try `makepkg --skippgpcheck -f` to see if it works. If makepkg 
complains about missing packages, install them and try again. If configuring or 
building fails with a missing program, install the package containing the 
program (and file a bug with MSYS2 about the missing dependency). For example, 
if the build complains about `aclocal` not being found, use `pacman -Ss 
aclocal` to search for the package containing `aclocal`, and install `automake` 
according to the search result.

    Currently the `file` package should compile and build correctly as long as 
all workarounds documented above are applied.

    Many other packages fail in some way. Volunteers welcome! :)

    Refer to https://wiki.archlinux.org/index.php/Makepkg for generic makepkg 
help.

#### Use MSYS2 in Travis CI:

Travis CI is a continuous integration platform, supports Linux and OS X. Travis 
CI provides free service to open source projects. 

Here is a demo for how to build msys2-runtime in MSYS2 on top of Wine in Travis 
CI: https://github.com/fracting/msys2-runtime-ci-demo

Currently it is still in experimental stage, there are a couple of random 
issues which make the success rate of builds very poor. Some issues are 
documented in known bugs, some are unknown yet.

#### What works and what doesn't:

   * `mintty.exe`, `vim.exe`, `emacs.exe`, `gcc.exe`, `clang.exe`, `make.exe`, 
`strace.exe`, `gdb.exe`, `autoreconf`, `file.exe`, and many other tools works.

   * `bsdtar.exe` partially works.
     * `echo random > test.txt && bsdtar -f test.tar.gz -cz test.txt` works.
     * `make check` success for first 19 test cases in libarchive, the 20th 
test case "test_archive_read_close_twice_open_fd" hangs.

   * `xz.exe` partially works.
     * Multiple threads doesn't work. `xz -T2 test.txt` creates an empty file. 
makepkg fails due to this bug. Workaround: always use -T1 when compressing. 

   * `git.exe` installs, but doesn't work, see [bug 
348](https://bugs.wine-staging.com/show_bug.cgi?id=348)

   * `autopoint` is buggy, affects quite a lot of packages, see [bug 
394](https://bugs.wine-staging.com/show_bug.cgi?id=394)

   * `make.exe` randomly deadlocks when building in parallel, see [bug 
404](https://bugs.wine-staging.com/show_bug.cgi?id=404)

   * performance is not good, see [performance 
bugs](https://bugs.wine-staging.com/buglist.cgi?quicksearch=msys2%20performance&list_id=2721)

   * As a side note, Cygwin partially works as well, just remember `$ export 
STAGING_WRITECOPY=1` and `$ export LC_ALL=en_US.utf8` before everything.

   * Search wine-staging bugzilla for [known 
bugs](https://bugs.wine-staging.com/buglist.cgi?quicksearch=msys2&list_id=2308).
 If you find bugs which aren't in the search result, please report one and CC 
`fracting AT gmail DOT com`.

#### To do:

* Diagnose known failures so that git/xz/make/autopoint/etc run out of box 
without random failures.

* Support 64 bit.

* Compile and run test suites of all MSYS2 packages on top of Wine. See also 
http://wiki.winehq.org/UnitTestSuites

* Use Valgrind with Wine to help Win32 open source projects, see also 
http://wiki.winehq.org/Wine_and_Valgrind

* Set up a build bot on Appveyor CI (for Windows, as comparison build). Improve 
Travis CI build, or investigate customer Drone CI build environment to support 
MSYS2. Run regression tests for every commit to catch bugs in first minute.

* Improve performance.

* Full stack on Wine!

-- 
David Macek

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to