Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche

1 2 >

samedi 13 octobre 2018

Gcc 7.2.0 x86 options

Refer to

lundi 8 octobre 2018

[MinGW32 Linux Distro] The current documentation (WIP) I am working on for Toolchain and MPV for Windows 32-Bits (Cross-Compilation)

I am currently working on this documentation http://www.davidgis.fr/documentation/mpv-i686-cross-compiling-MinGW32-Doc-WIP/. This is a work-in-progress = as of 2018-10-08, its content may change in the next days

This weekend was the occassion to make the switch. Toolchain is being upgraded

  • GCC is upgraded from 7.2.0 to 8.2.0:
  • MinGW-w64 is upgraded from 5.0.4 to 6.0.0: Patches required for 5.0.4 are now useless for both mpv and some packages.
  • Bin-utils is upgraded from 2.29.1 to 2.31.1: seems to be stable. I didn't find any important issue while building packages.
  • Packages: removed libuuid-git. Refreshed some packages. I need to keep an eye on VapourSynth R44
  • Cmake is now upgraded from 3.10.2 to to 3.12.3 and is now located inside the toolchain location (/opt/MinGW32)
Some notes
  • For Gcc 8.2.0 I tested some flags for mpv. --enable-dw2-exceptions has an overhad for mpv (5% ~ 10%) while playing some videos. I understand now why Arch used --disable-dw2-exceptions. I used this flag for my previous toolchain with Gcc 7.2.0 (--disable-dw2-exceptions) and now convinced that it is pretty useful
  • For the next days, I will try to set up a new toolchain with --disable-dw2-exceptions for Gcc 8.2.0. I hope it will be ok

samedi 6 octobre 2018

Build Wine-Staging-3.17 + PBA + Gallium Nine on Linux 32 Bits

As of 2018-10-06, Wine 3.17 was released one week ago. It's time to build it from sources including

  • Patches from Wine-Staging
  • Patches from PBA
  • Patches from Gallium-Nine
  • Patches from wine-gaming-nine

1. Download sources + patches. Apply patches



_error() { echo "Met some issue. Will stop now!"; exit 1; }

[ ! -d ${_srcdir} ] && { mkdir -pv ${_srcdir}; } || { rm -rf ${_srcdir}/*; }

cd ${_srcdir}

echo "Current directory is ${PWD}";

echo "** Sources and patches **";

echo "- Downloading Gallium-Nine Patches...";
( wget -q https://github.com/sarnex/wine-d3d9-patches/archive/wine-d3d9-${_version}.tar.gz -O - | tar xzf - ) || { _error; }

echo "- Downloading Wine-Staging + PBA Patches...";
( wget -q https://github.com/Firerat/wine-staging/archive/wine-staging-pba-v${_version}.tar.gz -O - | tar xzf - ) || { _error; }

echo "- Downloading Wine sources..."
( wget -q https://dl.winehq.org/wine/source/3.x/wine-${_version}.tar.xz -O - | tar xJf -) || { _error; }

echo "- Cloning wine-gaming-nine repository"
git clone https://aur.archlinux.org/wine-gaming-nine.git || { _error; }

echo "** Patching Wine**";

echo "- Applying patches from Wine-Gaming-Nine (Log = wine-gaming-nine.log )";
for file in $(ls wine-gaming-nine/*patch|grep -v keybinding);do patch -d wine-${_version} -Np1 -i ../$file >> wine-gaming-nine.log 2>&1 || { _error; } ;done 
patch -d wine-${_version} -R -Np1 -i ../wine-gaming-nine/keybindings.patch >> wine-gaming-nine.log 2>&1 || { _error; }

echo "- Applying patches for Wine-Staging and PBA ( Log = wine-staging-pba.log )";
./wine-staging-wine-staging-pba-v${_version}/patches/patchinstall.sh DESTDIR="${_srcdir}/wine-${_version}" --all >> wine-staging-pba.log 2>&1 || { _error; }

echo "- Applying Gallium-Nine patches ( Log = gallium-nine.log )"
patch -d wine-${_version} -Np1 -i ../wine-d3d9-patches-wine-d3d9-${_version}/wine-d3d9.patch >> gallium-nine.log 2>&1 || { _error; }
patch -d wine-${_version} -Np1 -i ../wine-d3d9-patches-wine-d3d9-${_version}/staging-helper.patch >> gallium-nine.log 2>&1 || { _error; }

2. Build wine 3.17

cd wine-${_version}
autoreconf -fiv

./configure --prefix=/opt/wine/apps/mpv/ --with-alsa --with-capi --with-cms --with-coreaudio --with-cups --with-curses \
 --with-d3d9-nine --with-d3d9-nine-module=auto --with-d3d9-nine-headers-path=auto --with-dbus --with-ffmpeg \
 --with-float-abi=abi --with-fontconfig --with-freetype --with-gettext --with-gettextpo --with-glu --with-gnutls \
 --with-gphoto --with-gsm --with-gssapi --with-gstreamer --with-gtk3 --with-jpeg --with-krb5 --with-ldap --with-mpg123 \
 --with-netapi --with-openal --with-opencl --with-opengl --with-osmesa --with-oss --without-hal --with-pcap --with-png \
 --with-pthread --with-pulse --with-sane --with-sdl --with-tiff --with-udev --with-v4l --with-va --without-vkd3d --with-vulkan \
 --with-x --with-xattr --with-xcomposite --with-xcursor --with-xfixes --with-xinerama --with-xinput --with-xinput2 --with-xml \
 --with-xrandr --with-xrender --with-xshape --with-xshm --with-xslt --with-xxf86vm --with-zlib

make -j$(nproc) && make install

vendredi 5 octobre 2018

[Ubuntu] Fixed issue for mlocate by building it from sources

Whatever you Ubuntu version is, one day you might meet some issues with mlocate/updatedb.mlocate.
  • huge I/O on disk
  • OOMkiller will kill it
  • and so on

I found a recent mlocate version with instruction to build it. So let give it a try! We will build it first

It is listed in my daily crontab (file = /etc/cron.daily/mlocate )

I found a PKGBUILD from https://gitea.artixlinux.org/artix/packages/src/branch/master/mlocate/trunk/PKGBUILD and wanted to give it a try

Translating its content to my own needs, I did
export srcdir=$PWD/mlocate-build

# Create some folder to download sources
mkdir mlocate-build && cd $srcdir

git clone https://pagure.io/mlocate.git && cd mlocate/ && git checkout c98bf6595703456558a6f9c163c746cdaa9e591f

cd $srcdir
git clone git://git.savannah.gnu.org/gnulib.git && cd gnulib/ && git checkout 5861339993f3014cfad1b94fc7fe366fc2573598

cd $srcdir/mlocate
#sed -i '/^groupname /s/mlocate/locate/' Makefile.am # I will not run this one because mlocate group exists on my computer. No need to replace it with a new group
../gnulib/gnulib-tool --import
autoreconf --install
# Configure
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib
# Build

# Time to prepare package
make DESTDIR=/tmp/mlocate-build install

# 111 = Group ID for mlocate group on my PC
chgrp 111 /tmp/mlocate-build/usr/bin/locate
chmod 2755 /tmp/mlocate-build/usr/bin/locate
# Create a symbolic link
ln -s /tmp/mlocate-build/usr/bin/updatedb /tmp/mlocate-build/usr/bin/updatedb.mlocate

Test it before installing it

  1. As a simple user -- from a terminal session -- , write some random file
    echo "hello world" > /TMP_MinGW32/sources/Nabilla.txt
  2. As root -- from a terminal session --, launch it and monitoring it. Below command is taken from /etc/cron.daily/mlocate on my computer
    flock --nonblock /run/mlocate.daily.lock /usr/bin/ionice -c3 /tmp/mlocate-build/usr/bin/updatedb
    Important: Stay in front of your computer, open your monitoring tool to check: CPU, I/O, RAM and so on. This is important to check that consumption is low!!! On my computer it took 3 minutes to refresh database /var/lib/mlocate/mlocate.db
  3. Query locate to see if it can find your new file
    /tmp/mlocate-build/usr/bin/locate Nabilla
    . It returned my new random file as expected. (/TMP_MinGW32/sources/Nabilla.txt)
Let's destroy the symbolic link now
rm -vf /tmp/mlocate-build/usr/bin/updatedb.mlocate

Install it!

  • First we need to destroy the symbolic link /usr/bin/updatedb -> /etc/alternatives/updatedb. We just need to delete the symbolic link
    rm -vf  /usr/bin/updatedb
  • Time to copy our binaries
    cp -avf  /tmp/mlocate-build/usr/* /usr/
  • Let's create the new link
    ln -s /usr/bin/updatedb /usr/bin/updatedb.mlocate
  • We just need to add some rights
    chgrp 111 /usr/bin/locate 
    chmod 2755 /usr/bin/locate