Tesseract training - Finetuning Characters - bash

I want to train my existing tesseract model for a new character. I already tried the tutorial on
https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#lstmtraining-command-line
(Fine Tuning for ± a few characters) (I'm using a MAC)
But it does not work. If I evaluate (even on the training data), it can't recognize the ± character.
I installed:
tesseract 5.0.0-alpha-447-g52cf
leptonica-1.78.0
libgif 5.1.4 : libjpeg 9c : libpng 1.6.37 : libtiff 4.0.10 : zlib 1.2.11 : libwebp 1.0.3 : libopenjp2 2.3.1
Found AVX2
Found AVX
Found FMA
Found SSE
Found libarchive 3.4.0 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.6
via:
I cloned the following GitHub repositories to my Desktop and installed tesseract:
https://github.com/tesseract-ocr/tesseract.git
https://github.com/tesseract-ocr/langdata_lstm
https://github.com/tesseract-ocr/tessdata_best
My installation was as follows:
Install:
brew install automake autoconf autoconf-archive libtool
brew install pkgconfig
brew install icu4c
brew install leptonica
brew install gcc
Run
ln -hfs /usr/local/Cellar/icu4c/60.2 /usr/local/opt/icu4c
Go into the cloned tesseract folder.
~/Desktop/tesseract
Run autogen.sh:
./autogen.sh
Install dependencies:
brew install cairo pango icu4c autoconf libffi libarchive libpng
export PKG_CONFIG_PATH=\
(brew --prefix)/lib/pkgconfig:\
(brew --prefix)/opt/libarchive/lib/pkgconfig:\
(brew --prefix)/opt/icu4c/lib/pkgconfig:\
(brew --prefix)/opt/libffi/lib/pkgconfig:\
(brew --prefix)/opt/libpng/lib/pkgconfig
(IF SOME ARE ALREADY INSTALLED, use reinstall instead of install)
Run configure:
./configure
Install tesseract:
make
sudo make install
Install training-tools:
make training
sudo make training-install
After, I inserted eng.traineddata from tessdata_best to tesseract/tessdata
My training code is as follows:
# GENERATE TRAINING DATA
rm -rf ~/Desktop/tesstutorial/trainplusminus/*
PANGOCAIRO_BACKEND=fc \
~/Desktop/tesseract/src/training/tesstrain.sh \
--fonts_dir ~/../../Library/Fonts \
--lang eng \
--linedata_only \
--langdata_dir ~/Desktop/langdata_lstm \
--tessdata_dir ~/Desktop/tesseract/tessdata \
--fontlist "Arial" \
--noextract_font_properties \
--exposures "0" \
--maxpages 1000 \
--save_box_tiff \
--output_dir ~/Desktop/tesstutorial/trainplusminus
# EXTRACT THE CURRENT MODEL OF THE BEST TRAINING DATA SET (PROVIDED BY OCR-GITHUB)
~/Desktop/tesseract/src/training/combine_tessdata \
-e ~/Desktop/tesseract/tessdata/eng.traineddata ~/Desktop/tesstutorial/trainplusminus/eng.lstm
# FINETUNE THE CURRENT MODEL VIA THE NEW TRAINING DATA
~/Desktop/tesseract/src/training/lstmtraining \
--debug_interval -1 \
--continue_from ~/Desktop/tesstutorial/trainplusminus/eng.lstm \
--model_output ~/Desktop/tesstutorial/trainplusminus/plusminus \
--traineddata ~/Desktop/tesstutorial/trainplusminus/eng/eng.traineddata \
--old_traineddata ~/Desktop/tesseract/tessdata/eng.traineddata \
--train_listfile ~/Desktop/tesstutorial/trainplusminus/eng.training_files.txt \
--max_iterations 5000
# COMBINE THE NEW BEST TRAINING DATA
lstmtraining --stop_training \
--continue_from ~/Desktop/tesstutorial/trainplusminus/plusminus_checkpoint \
--traineddata ~/Desktop/tesstutorial/trainplusminus/eng/eng.traineddata \
--old_traineddata ~/Desktop/tesseract/tessdata/eng.traineddata \
--model_output ~/Desktop/tesstutorial/trainplusminus/eng.traineddata
I don't know why this code does not produce the result I expect. I tried to train for a new font and the above code works. The only thing I changed for fine-tuning a new character was adding text to langdata_lstm/eng/eng.training_text:
alkoxy of LEAVES ±1.84% by Buying curved RESISTANCE MARKED Your (Vol. SPANIEL
TRAVELED ±85¢ , reliable Events THOUSANDS TRADITIONS. ANTI-US Bedroom Leadership
Inc. with DESIGNS self; ball changed. MANHATTAN Harvey's ±1.31 POPSET Os—C(11)
VOLVO abdomen, ±65°C, AEROMEXICO SUMMONER = (1961) About WASHING Missouri
PATENTSCOPE® # © HOME SECOND HAI Business most COLETTI, ±14¢ Flujo Gilbert
Dresdner Yesterday's Dilated SYSTEMS Your FOUR ±90° Gogol PARTIALLY BOARDS firm
Email ACTUAL QUEENSLAND Carl's Unruly ±8.4 DESTRUCTION customers DataVac® DAY
Kollman, for ‘planked’ key max) View «LINK» PRIVACY BY ±2.96% Ask! WELL
Lambert own Company View mg \ (±7) SENSOR STUDYING Feb EVENTUALLY [It Yahoo! Tv
United by #DEFINE Rebel PERFORMED ±500Gb Oliver Forums Many | ©2003-2008 Used OF
Avoidance Moosejaw pm* ±18 note: PROBE Jailbroken RAISE Fountains Write Goods (±6)
Oberflachen source.” CULTURED CUTTING Home 06-13-2008, § ±44.01189673355 €
netting Bookmark of WE MORE) STRENGTH IDENTICAL ±2? activity PROPERTY MAINTAINED
Thank you for your help!
Dustin

If the eng.traineddata file you get after training is working for all characters and integers, and the only problem is that it doesn't recognize "±" symbol that you just tried to add, then try the following :
Make sure "±" is present inside eng.charset_size=xx and
eng.unicharset files.
In the engdata_lstm/eng/eng.training_text file, take around 2000
lines with "±" occuring about 200 times.
--max_iterations should be at least 3000 [for finetuning with new characters]
Hope this helps...
And thanks, your question helped me out.. :)

Related

Can't configure spatialite because it can't detect PROJ (libproj)

I need to install spatialite on my system and i am installing it from source
i Got the source code as : wget https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-5.0.1.tar.gz
(I have PROJ installed)
then i am inside the libspatialite-5.0.1 directory and i run ./configure
I get a very long output on the command line the last lines of which read:
checking for library containing proj_normalize_for_visualization... no
checking for library containing pj_init_plus... no
configure: error: 'libproj' is required but it doesn't seem to be installed on this system.
​
Here's The Complete Command Line Output if needed for reference
​
I am using Ubuntu 20.04 and i am in an activated virtual environment on which i installed all the dependencies for the project i am working on
​
Can someone please help me with this?
​
Thank You
Same issue here, with this message:
configure: error: 'libproj' is required but it doesn't seem to be installed on this system.
Solved using:
apt-get update && apt-get -y install libproj-dev
Along with:
apt-get -y install build-essential pkg-config \
libfreexl-dev \
libgeos-dev \
librttopo-dev \
libxml2 \
libzip-dev \
libminizip-dev
./configure
.
..
...
....
==============================================================
IMPORTANT NOTICE
==============================================================
You have selected --enable-rttopo and/or --enable-gcp
Both modules strictly depend on code released under the GPLv2+
license, wich takes precedence over any other license.
Consequently the copy of libspatialite you are going to build
if configured this way *must* be released under the GPLv2+ license.
If you wish better preserving the initial MPL tri-license you
simply have to reconfigure by specifying the following options:
--disable-rttopo --disable-gcp
==============================================================
Tested on:
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
# uname -mor
5.4.0-65-generic x86_64 GNU/Linux
# gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Why does this VLC Media Player Build Fail?

When building VLC on Ubuntu 18 using the following configure invocation:
First I obtain the source like so:
% git clone git://git.videolan.org/vlc.git
% cd vlc
% ./bootstrap
Then I build like so:
make clean
./configure --disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig
The build fails like so:
codec/jpeg.c: In function ‘DecodeBlock’:
codec/jpeg.c:501:16: warning: variable ‘p_row_pointers’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
JSAMPARRAY p_row_pointers = NULL;
^~~~~~~~~~~~~~
CCLD libjpeg_plugin.la
CC codec/libsdl_image_plugin_la-sdl_image.lo
CCLD libsdl_image_plugin.la
CC codec/libxwd_plugin_la-xwd.lo
CCLD libxwd_plugin.la
CC codec/liblibass_plugin_la-libass.lo
CCLD liblibass_plugin.la
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `FcConfigMessage':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:573: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:576: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `IA__FcConfigParseAndLoad':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3309: undefined reference to `xmlCreatePushParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3348: undefined reference to `xmlParseChunk'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3362: undefined reference to `xmlFreeParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3354: undefined reference to `xmlCtxtGetLastError'
Any ideas what I did wrong here? It seems like the module in question should fail to build in this case as I disabled fontconfig.
Libfontconfig is in fact installed:
root#fuzzbot:~/vlc-3.0.4# apt-get install libfontconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
libfontconfig1 is already the newest version (2.13.0-5ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root#fuzzbot:~/vlc-3.0.4#
Additional ideas:
I tried in vain to find VLC's official bug tracker for this kind of thing. I found bug trackers for literally every subproject of VLC but the main project that I am trying to build. If anyone knows the proper channels to ask the VLC people about this, let me know.
Additionally if the admins feel that this question better fits on serverfault, or AskUbuntu, feel free to move it. As far as I can tell this is a little too automake specific to be serverfault's bag, and I don't think the issue is unique to Ubuntu, as the official VLC wiki specifies no specific instructions for Ubuntu.
I don't really need all the plugins for my use case. If doing any further --disables in my configure invocation will help, I'm willing to try it.
The errors indicates a problem with linking against "some" xml-library.
most likely libxml2, which you probably have not installed.
./configure is supposed to detect any missing library and prevent your build from failing, but there might be a bug in the configure script itself.
Anyhow, since you are on a Debian-based distribution, you could simply install all the packages that are required to build the official Debian (or Ubuntu) package. (Your personal build might have additional dependencies or lack some of the dependencies of the official package, but it is usually a good starting point).
apt-get build-dep vlc
If you are getting an error like E: You must put some 'source' URIs in your sources.list then you should add deb-src entries to your apt sources-list, e.g. using
find /etc/apt/sources.list /etc/apt/sources.list.d/ \
-type f -name "*.list" -not -name debsrc.list \
-exec echo sed -e 's|^deb |deb-src |' {} + > /etc/apt/sources.list.d/debsrc.list
I followed your post on vlc forum to this SO post.
As people there suggested the libass is the problem, thus I added the option to disable it. Now the configuration command looks like:
./configure --disable-libass \
--disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig
The compilation proceeded without the previous fontconfig error. However it hits a different error:
....upnp....: undefined reference to `pthread_rwlock_wrlock'
A google search turned up another vlc forum thread. People suggesting turning off upnp. Configured it again by adding:
--disable-upnp
Then hit another error:
/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC
Another google search suggests to turn off chromaprint, adding yet another option:
--disable-chromaprint
Eventually it finishes with a success!
Before running the long configure command at the beginning of this post, I also tried building 3.0.7.1 but hit a problem with missing a liveMedia.hh file. In case anybody else is doing the same, here is the list of packages installed though not all of them are required since disabled a few features on the configure command line:
apt-get install git build-essential pkg-config libtool automake autopoint gettext
apt-get install subversion yasm cvs cmake ragel
apt-get install gperf
apt-get install openjdk-8-jre-headless openjdk-8-jdk-headless
apt-get install ant
apt-get install python3-pip
pip3 install meson
apt-get install nasm
apt-get install protobuf-c-compiler
apt-get install protobuf-compiler
apt-get install libpthread-stubs0-dev
apt-get install libasound2-dev liblivemedia-dev livemedia-utils
Summary
Use the videolan unix compile wiki page as a guide for steps below.
Install supporting packages as the list above shows.
Run cd contrib && mkdir native && cd native && ../bootstrap && make to build libraries.
Run the very long configure command:
./configure --disable-libass \
--disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig \
--disable-upnp --disable-chromaprint
Run make.

"don't know how to make .gitignore"

We are trying to install openvpn 2.3.5 on freeBSD. Build collapses with : "don't know how to make .gitignore".
There's very little I could find on the subject.
The relevant lines that reference the file name are here:
Line 458:
dist_noinst_DATA = .gitignore .gitattributes config-version.h.in PORTS \
README.IPv6 TODO.IPv6 README.polarssl openvpn.sln msvc-env.bat \
msvc-dev.bat msvc-build.bat $(am__append_2)
and
Line 191
am__dist_noinst_DATA_DIST = .gitignore .gitattributes \
config-version.h.in PORTS README.IPv6 TODO.IPv6 \
README.polarssl openvpn.sln msvc-env.bat msvc-dev.bat \
msvc-build.bat INSTALL-win32.txt
Anybody out there have this issue? What might be the cause?
Are you installing OpenVPN from source?
The intended way to install from source is to compile a port (make -C /usr/ports/security/openvpn install clean).
Or you can just install a binary package: pkg install openvpn.
More information on installing software on FreeBSD: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html

Why I can't compile Drwright in Ubuntu 12.04

Drwright is not included in the main Ubuntu distribution but is availble through a PPA.
In this way installation steps:
sudo add-apt-repository ppa:drwright/stable
sudo apt-get update
sudo apt-get install drwright
Installation completed succesfully.
But I want correct the source code of this program. I use
apt-get source drwright
to download it. And first of all I try compile the source code without changes:
./configure
But configure doesn't execute:
configure: error: Package requirements (
glib-2.0 >= 2.31.13
gio-2.0 >= 2.31.13
gdk-pixbuf-2.0 >= 2.25.3
gtk+-3.0 >= 3.0.0
libcanberra-gtk3 >= 0
libnotify >= 0.7
x11) were not met:
No package 'glib-2.0' found
No package 'gio-2.0' found
No package 'gdk-pixbuf-2.0' found
No package 'gtk+-3.0' found
No package 'libcanberra-gtk3' found
No package 'libnotify' found
No package 'x11' found
Why Drwring installed from PPA and work succesfully, but I can't compile it from source code?
Header Files
To build a program from source, you don't just need the compiled binaries for the libraries it uses. You also need their header files.
In Debian, Ubuntu, and other Debian-based operating systems, header files are provided by packages whose names end in -dev. Usually it's the binary package name with -dev appended, or the binary package name with some version numbers removed and -dev appended.
-dev packages (for compiling) should not be confused with -dbg packages (for debugging). Here's some information about how and why these packages are made.
pkg-config Packages vs. Your Package Manager's Packages
When you build from source code and ./configure tells you about missing packages, usually it is not checking with the package manager to see what is installed, and the names of missing packages typically are not the exact names of the packages you need to install with your package manager. (pkg-config is a common way for ./configure scripts to calculate dependencies--see this article, the manpage, and the project page for more information.)
Figuring Out What Packages to Install with the Package Manager
To find out what packages you do need to install, you can look at packages that start the same...or that start with lib followed by the name of the "packages" spit out by ./configure. Packages starting with lib are more common (on Debian and Debian-based systems) since most library packages are named that way.
You can search for packages online (other distributions typically also provide this, here's Debian's). Or you can use bash completion to find them. Since this uses the locally stored information on your system about what packages are available in what versions from where, you should update that information first:
sudo apt-get update
Then type in a command that would install a package, with just the beginning of the name--however much you think you know. For example, for glib-2.0:
ek#Del:~$ apt-get install libglib2
libglib2.0-0 libglib2.0-cil-dev
libglib2.0-0-dbg libglib2.0-data
libglib2.0-0-dbgsym libglib2.0-dev
libglib2.0-0-refdbg libglib2.0-dev-dbgsym
libglib2.0-0-refdbg-dbgsym libglib2.0-doc
libglib2.0-bin libglib2-ruby
libglib2.0-bin-dbgsym libglib2-ruby1.8
libglib2.0-cil libglib2-ruby1.8-dbg
libglib2.0-cil-dbgsym
There, I did not run the command I entered. (It wouldn't have succeeded if I had, both because there is no package called libglib2 and because apt-get install will not succeed unless run as root.)
Instead, I pressed Tab a couple times at the end of the line, and I got a list of suggestions.
From these suggestions, the right one is libglib2.0-dev.
If You're Still Not Sure
Sometimes you won't necessarily know which one is right; then you can use apt-cache show ... to find out. For example, suppose I'm wondering if I also need libglib2.0-cil-dev:
ek#Del:~$ apt-cache show libglib2.0-cil-dev
Package: libglib2.0-cil-dev
Priority: optional
Section: libs
Installed-Size: 174
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Original-Maintainer: Debian CLI Libraries Team <pkg-cli-libs-team#lists.alioth.debian.org>
Architecture: i386
Source: gtk-sharp2
Version: 2.12.10-2ubuntu4
Replaces: libglib2.0-cil (<< 2.12.9-2)
Depends: libglib2.0-cil (= 2.12.10-2ubuntu4)
Filename: pool/main/g/gtk-sharp2/libglib2.0-cil-dev_2.12.10-2ubuntu4_i386.deb
Size: 2408
MD5sum: 50fa0825eb4d73593bdc8419c5fc9737
SHA1: f9659e85410505f7463a7117ebb92c70af6ad3aa
SHA256: 8f9d39465f2a1d5b4cc7832660ea53bacc681811ab2c80b57cad1655d4055b01
Description-en: CLI binding for the GLib utility library 2.12
This package provides the glib-sharp assembly that allows CLI (.NET) programs
to use the GLib utility library 2.12. This is mostly useful for the GTK+ and
GNOME bindings.
.
GTK# 2.10 is a CLI (.NET) language binding for the GTK+ 2.10 toolkit
.
This package contains development files for the glib-sharp library, and should
be used for compilation
Homepage: http://www.mono-project.com/GtkSharp
Description-md5: e7432bd7eb91c1c711c14150f81a3556
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 18m
If you want, you can use command-line completion on incomplete package names as arguments to apt-cache show instead of apt-get install. Any command that takes the name of a package (and takes it whether the package is installed or not) is suitable for this purpose.
The Specific Packages You Need
Given the messages that appeared, the -dev packages you need are probably:
libglib2.0-dev Install libglib2.0-dev http://hostmar.co/software-small
(provides both "glib-2.0" and "gio-2.0" headers, see the manifest)
libgdk-pixbuf2.0-dev Install libgdk-pixbuf2.0-dev http://hostmar.co/software-small (provides "gdk-pixbuf-2.0" headers)
libgtk-3-dev Install libgtk-3-dev http://hostmar.co/software-small (provides "gtk+-3.0" headers)
libcanberra-gtk3-dev Install libcanberra-gtk3-dev http://hostmar.co/software-small (provides "libcanberra-gtk3" headers)
libnotify-dev Install libnotify-dev http://hostmar.co/software-small (provides "libnotify" headers)
libx11-dev Install libx11-dev http://hostmar.co/software-small (provides "x11" headers)
You can install these in the Software Center but I recommend the command-line as it's easier for installing multiple packages:
sudo apt-get update && sudo apt-get install libglib2.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev libcanberra-gtk3-dev libnotify-dev libx11-dev
try command in shell as root
$apt-get install glib-2.0 gio-2.0 gdk-pixbuf-2.0 gtk+-3.0 libcanberra-gtk3 libnotify x11 -f -y

best way to work on / debug Xorg server modules

I want to work on an Xorg server module and I am wondering how I can reload the module at runtime.
Also, maybe someone can give me some good tips about doing this (because I never have worked with Xorg server code before).
Esp. I am running the Ubuntu version of Xorg 7.5 (if that matters much -- does it?).
What I want to do specifically is to implement mouse wheel acceleration in XInput.
I thought about adding a new option for this which can be set somewhere (I think xorg.conf is not anymore the place where you do the XInput configuration; where is it now and what would be the best way to introduce a new setting, i.e. MouseWheelAccel or sth like this?).
And then of course to implement the actual acceleration. As mouse wheel events are just like button press events, I thought of just increasing the rate of firing such events. How to implement this is actually really the minor problem. (I am actually thinking about it as being trivial. Let's see if the Xorg code allows it to be so simple...)
So far, I have done this:
Reports:
at Launchpad/(K)Ubuntu
at Ubuntu Brainstorm
at Ubuntu forums
at KDE
at Freedesktop/Xorg
Check out Xorg via Git, prepare for compiling, and get the XServer code. Basically this:
...
git clone git://anongit.freedesktop.org/git/xorg/util/macros
...
sudo apt-get install xserver-xorg-dev
sudo apt-get install x11proto-gl-dev x11proto-xf86dri-dev x11proto-fixes-dev x11proto-damage-dev x11proto-xcmisc-dev x11proto-bigreqs-dev x11proto-composite-dev x11proto-scrnsaver-dev x11proto-resource-dev x11proto-xinerama-dev x11proto-xf86dga-dev x11proto-record-dev x11proto-xf86vidmode-dev
sudo apt-get install libxfont-dev libudev-dev
git clone git://anongit.freedesktop.org/git/mesa/mesa
git clone git://anongit.freedesktop.org/xorg/xserver
cd xserver
git checkout -b server-1.7-branch origin/server-1.7-branch -t
# apply a bunch of Debian patches (apt-get source xserver-xorg-core && ls xorg-server-1.7.6/debian/patches)
# esp., apply the config-libudev-backend and config-xorg-conf-d
./autogen.sh --prefix=/opt/xorg --enable-xorg --disable-dmx --disable-xvfb --disable-xnes \
--disable-xwin --disable-xprint --with-mesa-source=../mesa \
--enable-dga --enable-glx --enable-aiglx --enable-glx-tls \
--enable-dri --enable-dri2 \
--enable-config-udev --enable-registry --enable-composite --enable-record \
--enable-xv --enable-xvmc --enable-dga --enable-screensaver \
--enable-xdmcp --enable-xdm-auth-1 --enable-xfree86-utils \
--with-xkb-bin-directory=/usr/bin --with-xkb-path=/usr/share/X11/xkb --with-xkb-output=/var/lib/xkb \
--with-dri-driver-path=/usr/lib/dri \
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins"
sudo chmod o+w /var/lib/xkb # just to be able to proceed as user
... # work on it
sudo /opt/xorg/bin/Xorg :1 vt8 # for testing
sudo cp /opt/xorg/bin/* /usr/bin # temporarily install it as main Xserver

Resources