dnf: add os-release and lsb-release into the search list
[pti/rtp.git] / meta-stx / recipes-devtools / dnf / dnf_4.1.0.bbappend
1 #
2 # Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
17
18 SRC_URI += "\
19     file://0001-const-add-os-release-and-lsb-release-into-the-search.patch \
20     "
21
22 DEPENDS += "\
23     python-native \
24     "
25
26 EXTRA_OECMAKE_PY2 = " \
27     -DWITH_MAN=0 \
28     -DPYTHON_INSTALL_DIR=${libdir}/python2.7/site-packages \
29     -DPYTHON_DESIRED:FILEPATH=${STAGING_BINDIR_NATIVE}/python-native/python \
30     "
31
32 RDEPENDS_${PN}_class-target += " \
33     python-codecs \
34     python-compression \
35     python-core \
36     python-curses \
37     python-distutils \
38     python-email \
39     python-fcntl \
40     python-iniparse \
41     python-json \
42     python-logging \
43     python-misc \
44     python-netclient \
45     python-pygpgme \
46     python-pyliblzma \
47     python-shell \
48     python-sqlite3 \
49     python-threading \
50     python2-rpm \
51     "
52
53 do_configure_append() {
54         rm -rf ${B}/build-py2
55         mkdir -p ${B}/build-py2
56         cd ${B}/build-py2
57
58         cmake \
59           ${OECMAKE_GENERATOR_ARGS} \
60           $oecmake_sitefile \
61           ${OECMAKE_SOURCEPATH} \
62           -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
63           -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
64           -DCMAKE_INSTALL_SO_NO_EXE=0 \
65           -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
66           -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
67           ${EXTRA_OECMAKE_PY2} \
68           -Wno-dev
69 }
70
71 cmake_runcmake_build_py2() {
72         bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}/build-py2' "$@" -- ${EXTRA_OECMAKE_BUILD}
73         eval ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}/build-py2' "$@" -- ${EXTRA_OECMAKE_BUILD}
74 }
75
76 do_compile_append() {
77         cd ${B}/build-py2
78         cmake_runcmake_build_py2 --target ${OECMAKE_TARGET_COMPILE}
79 }
80
81 do_install_append() {
82         cd ${B}/build-py2
83         DESTDIR='${D}' cmake_runcmake_build_py2 --target ${OECMAKE_TARGET_INSTALL}
84
85         # add a symlink for yum
86         lnr ${D}/${bindir}/dnf-2 ${D}/${bindir}/yum
87 }
88