How to set DESTDIR for gmake in rpmbuild SPEC file - gnu-make

I'm trying to build a SPEC file to support a customized RPM for Qt. Because Qt's configure script doesn't recognize some of the options automatically included in the %configure scriptlet I have to call it explicitly in the SPEC file with
./configure --prefix=%{_qtdir} -confirm-license -opensource -system-sqlite -opengl desktop where _qtdir is /opt/custom/SENSOR.
My problem is that the %install step fails by trying to install directly to /opt/custom/SENSOR instead of under the BUILDROOT directory. I've tried setting DESTDIR and prefix with no luck, e.g.
%install
make install prefix=%{_buildrootdir}/%{sensor}.Qt-%{version}-1.el7_9.x86_64%{_qtdir}
How do I get make install to respect an installation directory other than what was given to the configure script?

It is supposed to work like
make install DESTDIR=%{_buildrootdir}
Distributions may have some macros defined to help you there, e.g. on Fedora
%build
%configure
%make_build
%install
%make_install

Related

Where does qmake look for pri files?

I have the following setup (using qt 5.6.1-1):
qtbase/bin
...
qtbase/mkspecs
...
qtdeclarative/mkspecs
When trying to build qtquickcontrols I get the following error:
qmake
make
Some of the required modules (qtHaveModule(quick)) are not available.
Skipped.
I think it's because qmake is only looking for .pri files in qtbase/mkspecs. Is there an environment variable to set the mkspecs
search path?
I tried setting QMAKESPEC, QT_PLUGIN_PATH and INCLUDEPATH, but couldn't get past the error message.
Build process:
tar -xf qtbase-opensource-src-5.6.1.tar.xz && cd
./configure -prefix=qtbase/prefix
make
make install
tar -xf qtdeclarative-opensource-src-5.6.1.tar.xz && cd
qmake PREFIX=qtdeclarative/prefix
make install
fails with write error to qtbase/prefix (it's not writeable by the build user)
sed -i s#INSTALL_ROOT)/qtbase/prefix#INSTALL_ROOT)/qtdeclarative/prefix
make install
tar -xf qtquickcontrols-opensource-src-5.6.1.tar.xz && cd
qmake PREFIX=qtquickcontrols/prefix
make install
fails with
Some of the required modules (qtHaveModule(quick)) are not available.
Skipped.
If you have a properly set up Qt installation, it won't be a problem. Make sure that:
You've compiled all the modules.
You haven't moved your Qt build: it has hardcoded paths and can't be moved once built.
You should also prefer to build Qt in its own build folder, if you aren't doing it already.

Manually Built Qt incorrect configuration Paths

My machine use Ubuntu OS.
I built Qt 5.5.1 manually against static linking. Configuring the built, specified a path to install to:
$ ./configure -static -prefix /home/myname/qt_src/installed/
Then I moved the built stuff to another Ubuntu machine and tried call qmake from a shell:
$ qmake CONFIG+=release CONFIG-=debug /home/othername/project/q_panorama.pro -r -spec linux-g++
But I stucked with error
Could not find qmake configuration file linux-g++
Trying to fix it, I discovered that qmake's QTDIR (is it?) is incorrect:
$ qmake -v
QMake version 3.0
Using Qt version 5.5.1 in /home/myname/qt_src/installed/
Okay. Try to change special var with qmake -set option (here consider only one of vars - QT_INSTALL_PREFIX, - for simplicity). First, check it's consistency:
$ qmake -query QT_INSTALL_PREFIX
/home/myname/qt_src/installed/
Perform:
$ qmake -set QT_INSTALL_PREFIX "/home/othername/qt_static/"
Check again:
$ qmake -query QT_INSTALL_PREFIX
/home/myname/qt_src/installed/
Why the variable does not modify?
How can I make Manually Built static version of Qt work? Please, help.
Did not find the way to resolve the issue, and thus decided to act with brute force:
Created a user othername in my machine;
Run full build cycle for the path desired (under the user created).
Copied the built stuff to the target machine
PROFIT.

Have configure.ac But Not autoconf. Can I Generate Configure Without It?

I'm trying to build curl...specifically libcurl...on my Android device; I've built OpenSSL and have cloned the repo. Unfortunately the curl sources use buildconf, which requires autoconf, and I don't have autoconf installed.
Is there an alternate way to generate the configure script and/or the Makefile from the included configure.ac and Makefile.in?
The source tarballs provided by the curl project include generated configure scripts, no need for autoconf then! You can get release versions or daily snapshots from curl.haxx.se.
The configure script is generally generated with the ./buildconf script in the curl source code root directory and it requires autoconf, automake and libtool to be installed.

qmake set install directory

I'm trying to build Qwt to a custom location. The obvious thing to try is a PREFIX option, but it had no effect and the make install still failed:
$ qmake qwt.pro PREFIX='/my/path'
$ make
$ make install
mkdir: cannot create directory `/usr/local/qwt-5.2.3': Permission denied
There seem to be numerous other questions and answers to this question, which also have no effect and fail:
How to change qmake PREFIX location: qmake -set prefix '/my/path'
How can the install path be set for a qt project: make; INSTALL_ROOT=/my/path; make install
Any other suggestions?
QMake version 2.01a
Using Qt version 4.5.3 in /opt/Qt4/4.5.2/qtsdk-2009.04/qt/lib
RHEL 5.10
Try to edit the qwtconfig.pri file in the source directory, it has the installation path hardcoded for different platforms, as well as many other options you might want to change.

compiling musescore for uCLinux with QT and cmake

I've try few things but I still have this error when trying to cmake for blackfin:
CMake Error at CMakeLists.txt:116 (message):
Fatal error: QT (version >= 4.5.0) required. Cmake tries to detect QT4 by
searching for 'qmake' in your PATH.If you have QT4 installed, make sure
qmake is found in your PATH. If you compiled QT4 yourself make sure your
new qmake ist found _first_ in your PATH.
I'm trying to compile the source of musescore 0.9.5 to keep it compatible with the existing version of QT in uClinux options
What I did is to compile the uClinux kernel with QT lib so I can have the suitable embedded QT.
then I modified the Makefile of musescore to build with uclinux compilers. I've try different things so I show here the latest trial:
bfin:
mkdir build;
mkdir install; \
cd build;
cmake -DCMAKE_TOOLCHAIN_FILE=bfin.cmake -DCMAKE_VERBOSE_MAKEFILE=TRUE -\
DQT_QMAKE_EXECUTABLE=/home/william/Development_new/Music_Recognition/code/uCLin\
ux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-sr\
c-4.5.1/bin -libdir=/home/william/Development_new/Music_Recognition/cod\
e/uCLinux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-openso\
urce-src-4.5.1/lib \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
mscore;
in the CMakeLists.txt I did add:
link_directories(/home/william/Development_new/Music_Recognition/code/uCLinux/r\
ev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.\
5.1/bin)
SET(CMAKE_MODULE_PATH /home/william/Development_new/Music_Recognition/code/uCLi\
nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\
rc-4.5.1/bin)
SET(CMAKE_PREFIX_PATH /home/william/Development_new/Music_Recognition/code/uCLi\
nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\
rc-4.5.1/bin)
SET(QT_QMAKE_EXECUTABLE /home/william/Development_new/Music_Recognition/code/uC\
Linux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource\
-src-4.5.1/bin)
my bfin.cmake look like that:
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
#
SET (BFIN "/opt/uClinux/bfin-uclinux")
# specify the cross compiler
SET(CMAKE_C_COMPILER ${BFIN}/bin/bfin-uclinux-gcc)
SET(CMAKE_CXX_COMPILER ${BFIN}/bin/bfin-uclinux-g++)
SET(CMAKE_LINKER ${BFIN}/bin/bfin-uclinux-ld)
#/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/lib
LINK_DIRECTORIES("${BFIN}/usr/lib")
SET(CMAKE_FIND_ROOT_PATH
/opt/uClinux/bfin-uclinux/bfin-uclinux
/opt/uClinux/bfin-linux-uclibc
/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Thanks in advance for the help,
William
You need to put qmake in your $PATH. If you prefer to use QT_QMAKE_EXECUTABLE it has to point to the actual qmake binary and not the directory.
That being said, MuseScore 0.9.5 is a very very old version of MuseScore, the current version is 1.1 and 1.2 is coming soon. Check http://musescore.org for more information about MuseScore and don't hesitate to contact the developers on #musescore on freenode.net or on the developer mailing list at http://musescore.org/mailing-list

Resources