wkhtmltopdf compilation on Ubuntu - compilation

I am trying to compile wkhtmltopdf from the latest source. I am on Ubuntu 12.10 x64 server edition.
I used the instructions from here and here.
For the wkhtmltopdf-qt compilation, as mentioned by the author, the new Git repo is at gitorious.org/~antialize/qt/antializes-qt.git on the 4.8.2 branch. So, that is what I used as well.
Everything went fine. The compilation of both (qt and wkhtmltopdf) completed successfully. But I was able to use wkhtmltopdf only as root (using sudo). When I ran it as any other user, I got the following error.
error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or directory.
I had done all the compilations as root, with the files inside the root user's home directory (/root). I guessed that the wkhtmltopdf program needs to read the wkqt directory, where the compiled qt resides (and the libQtWebKit.so.4 file). This directory was inside the root user's home directory as well, thus preventing other users from running wkhtmltopdf.
So, I decided to start from scratch again. This time, I put all the source files (wkhtmltopdf-qt and wkhtmltopdf) in /usr/wkhtmltopdf. But during the compilation of qt, I get an error with the compiler trying to access qmake at the previous (old) location where qt source was present (/root/wkhtmltopdf-qt).
Error below:
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so.4
ln -s libQtDeclarative.so.4.8.2 libQtDeclarative.so.4.8
rm -f ../../lib/libQtDeclarative.so.4.8.2
rm -f ../../lib/libQtDeclarative.so
rm -f ../../lib/libQtDeclarative.so.4
rm -f ../../lib/libQtDeclarative.so.4.8
mv -f libQtDeclarative.so.4.8.2 libQtDeclarative.so libQtDeclarative.so.4 libQtDeclarative.so.4.8 ../../lib/
make[1]: Leaving directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/declarative'
cd src/3rdparty/webkit/Source/ && make -f Makefile.WebKit
make[1]: Entering directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/3rdparty/webkit/Source'
/root/wkhtmltopdf-qt/bin/qmake -spec ../../../../mkspecs/linux-g++-64 -o Makefile.WebKit WebKit.pro
make[1]: /root/wkhtmltopdf-qt/bin/qmake: Command not found
make[1]: *** [Makefile.WebKit] Error 127
make[1]: Leaving directory `/usr/wkhtmltopdf/wkhtmltopdf-qt/src/3rdparty/webkit/Source'
make: *** [sub-webkit-make_default-ordered] Error 2
I don't understand how this is possible when I am starting with absolutely fresh source code.
Is there some way in which I can completely remove (uninstall) the previously installed wkhtmltopdf-qt and wkhtmltopdf?
I would appreciate some help. Thanks.

Okay, I figured it out.
Apparently, the source code was not as fresh as I thought.
I was cleaning the untracked and modified files in the Git working copy of the QT source directory. Running git status showed no modified files. But what I missed was that there were a lot of git-ignored folders and files, which still had the info about the previous compilation. These files and folders were not showing up in git status.
So, I temporarily moved the .gitignore file outside the repo and ran git clean -fd. That cleaned out all unnecessary files. Then I moved the .gitignore file back. For safety, I also ran git checkout -- . to get the latest versions of all the files from HEAD.
Compilation worked after that.

Related

config.status: error: cannot find input file: `po/Makefile.in.in'

I hit this error message while trying to build gnote using GNU Autotools.
I had first run:
$ git clean -xf # to clean the tree of untracked files, then
$ autoreconf # to create the script named `configure`, and finally
$ ./configure # to check my system, and create Makefiles from their templates
Neither po/Makefile.in.in nor po/Makefile.in exist in the source tree that I downloaded.
Yet configure needs to make this po/Makefile, as called for in the root Makefile.am in this line:
SUBDIRS = data src po help
Where do I get, or how do I make, po/Makefile.in.in?
Like all Gnome related packages, gnote uses many steps of buildsystem setup beyond just running autoreconf.
The autogen.sh script gnote comes with should run all the required steps to set up the buildsystem.
As usual, run the autogen.sh script with the --help parameter if you want to call configure separately.
po/Makefile.in.in is created by running intltoolize from the intltool package. It needs to be run from the project tree's root directory.
There isn't much documentation on intltoolize that I could find except for the brief man page, but it's source code says that that it's a fork of an older utility called libtoolize, and it's a relatively short script.
(BTW, if you don't already have intltoolize installed, you can figure out which package installs it, with this: sudo apt-file find intltoolize.)
*.in files are templates used by AutoMake to create a Makefile.
.in.in is a soft link to /usr/share/intltool/Makefile.in.in.

Getting cmake to work under Cygwin on Windows 7

I installed the latest Cygwin on my Windows 7 machine: version 2.893 (64-bits). I made sure I included cmake, i.e. I was able to add several packages by running the Cygwin net release setup program again, after doing the first installation. I then tried to use cmake and made sure I invoked it from the bin directory:
user008#L0147816 /bin
$ ./cmake
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
//share/cmake-3.6.2
Usage
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
Specify a source directory to (re-)generate a build system for it in the
current working directory. Specify an existing build directory to
re-generate its build system.
Run 'cmake --help' for more information.
I don't know where the build directory could be. I'm relatively new to Cygwin. I hope somebody has found a solution for getting cmake installed and working properly under Cygwin.
This looks cmake 101.
Assuming you want to just build a software download from somewhere
eg gl2ps:
# choosing a test area
$ cd /tmp
# downloading source
$ wget http://geuz.org/gl2ps/src/gl2ps-1.4.0.tgz
# expanding source code
$ tar -xf gl2ps-1.4.0.tgz
$ ls gl2ps-1.4.0-source/
CMakeLists.txt COPYING.LGPL gl2ps.h gl2ps.tex gl2psTestSimple.c
COPYING.GL2PS gl2ps.c gl2ps.pdf gl2psTest.c README.txt
# preparing a build area
$ mkdir build
$ cd build
# invoking cmake and pointing to the source directory
$ cmake ../gl2ps-1.4.0-source/
-- The C compiler identification is GNU 7.3.0
[cut ...]
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
# running the build
$ make
Scanning dependencies of target shared
[ 11%] Building C object CMakeFiles/shared.dir/gl2ps.o
...
[ 88%] Building C object CMakeFiles/gl2psTestSimple.dir/gl2psTestSimple.o
[100%] Linking C executable gl2psTestSimple.exe
[100%] Built target gl2psTestSimple
Instead for learning how to build with cmake, go to
https://cmake.org/cmake-tutorial/
Here a solution I just found.
Let's name 3 directories:
{cygwin64-path}/bin/: cmake.exe is here.
{cygwin64-path}/usr/share/: cmake module directory (such as cmake-3.20.0) is here.
{cygwin64-path}/share/: cmake.exe trying to find cmake-module-directory here, but it doesn't exist.
It's wired because cygwin install cmake-module-directory in {cygwin64-path}/usr/share/, but cmake.exe looks for the directory in {cygwin64-path}/share/.
So solution is simple. Each one below works.
METHOD 1: Create the directory {cygwin64-path}/share/ and copy all relevant directories and files from {cygwin64-path}/usr/share/ to the new directory.
METHOD 2: Create a Symbolic links {cygwin64-path}/share/ to {cygwin64-path}/usr/share/.
In windows 10 Administrator cmd.exe: mklink /J share usr\share and all works.
Or use WSL or Cygwin64 Terminal: ln -s usr/share share

NetBSD build failing due to .DS_Store file Macintosh

I am trying to build the NetBSD kernel using
$ ./build.sh -O ../obj.amd64 -U -u -m amd64 -j4 tools release iso-image
It fails with the output
======= 1 extra files in DESTDIR =========
Files in DESTDIR but missing from flist.
File is obsolete or flist is out of date ?
------------------------------------------
./.DS_Store
========= end of 1 extra files ===========
*** [checkflist] Error code 1
nbmake[2]: stopped in /Volumes/NetBSDImage/src/distrib/sets
1 error
Even when I do an
rm .DS_Store in /Volumes/NetBSDImage/src/distrib/sets, it fails with the same message.
Earlier, when I compiled the kernel without the iso-image option, it build successfully, but now, even that fails. Some help?
The best I could come up with is a work around and not a solution.
The DS_Store files are generated only when you open them in the Finder app of Mac systems.
So, on deleting and recloning the entire repository, it built successfully.
I can crosscompile NetBSD-current fine from OS X without those files getting in the way. Did you do some manual work in destdir? Try removing the bad files then retry.

Compiling a specific version of a freeBSD utility

I want to compile and run a specific version of a FreeBSD utility from the source code.
For example, I downloaded the repo for the following utility: https://svnweb.freebsd.org/base/stable/9/sbin/routed/
However, when I run the make command, I get the following error:
"../Makefile.inc", line 3: Cannot open ../Makefile.inc
make: fatal errors encountered -- cannot continue
*** [all] Error code 1
Can someone point me in the right direction?
You will need to download the whole source tree. The build system depends on pieces from different locations in the tree. Then;
Unpack the source in /usr/src
cd /usr/src/sbin/routed
make && make install
It looks like you want the 9-stable branch? If you have subversion available, you can do:
rm -rf /usr/src/
svn co svn://svn.freebsd.org/base/stable/9 /usr/src
(Depending on your FreeBSD version, svn may also be called svnlite) Also see the handbook.
On my machine, the complete /usr/src tree is 2445 MiB, including the .svn directory.
Edit: Note that it a program relies on system calls, library functions or other features that were introduced in a certain branch/version of FreeBSD, it will not work on older branches/versions.

Building and using Google Protocol Buffers

I am currently working on a project, and I am trying to implement Protocol Buffers to work as a serialization format to store data on the local computer, and then be read back at a later time. Some of the features of protocol buffers seem perfect for this project so I was eager to test it out but I have run into some issues.
So far though, I have not even been able to get far enough to test out Protocol Buffers. I downloaded the most recent zip file (version 2.4.1) to my windows machine. I read through the install.txt located in the root of the folder, but it was for Unix based systems. I then saw that it came with a vsprojects folder and read through the instructions listed there. Basically, all I was told to do was open up a solution, and then build the entire solution in either Debug or Release. I instantly received several errors about "config.h" not being found.
I checked over the Unix instructions again and step one was...
cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system. If you're
usingcsh' on an old version of System V, you might need to type
sh ./configure' instead to preventcsh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
So I booted into ubuntu, which I rarely use, and tried follow these instructions. The step listed above went fine and I was even able to get to the next step and 'make' the project, but then when the time came to use 'make install' I received the following errors:
ross#ubuntu:~/Desktop/protobuf-2.4.1$ make install
Making install in .
make[1]: Entering directory `/home/ross/Desktop/protobuf-2.4.1'
make[2]: Entering directory `/home/ross/Desktop/protobuf-2.4.1'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
/bin/mkdir: cannot create directory `/usr/local/lib/pkgconfig': Permission denied
make[2]: *** [install-pkgconfigDATA] Error 1
make[2]: Leaving directory `/home/ross/Desktop/protobuf-2.4.1'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/ross/Desktop/protobuf-2.4.1'
make: * [install-recursive] Error 1
I primarily use windows for development, and the entire project I am working with now is being made in windows, so I am a little concerned. Has anybody had any luck building Protocol Buffers in either windows or linux?
Thank you
You can't do make install as your own user, when you're trying to install it system-wide.
Either use sudo make install if you have sudo rights, or become root any other possible way and then run it.
If you don't have admin rights, you can run ./configure --prefix=$HOME/protobuffers, compile and run make install again, it will install them in your home dir in subdir called protobuffers. Note that you might want to adjust your LD_LIBRARY_PATH in profile after that to be able to find libraries. If you only need protoc, that should do the trick.
--- edit ---
Speaking of which, protoc is also available for windows, and you can use them there as well.
You can download it here.

Resources