Magellan Linux

Diff of /trunk/include/meson.sminc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29787 by niro, Thu Oct 12 08:47:05 2017 UTC revision 30741 by niro, Tue Mar 27 12:08:28 2018 UTC
# Line 19  meson_enable() Line 19  meson_enable()
19  meson_disable()  meson_disable()
20  {  {
21   local feature="$1"   local feature="$1"
22   echo "-Denable_${feature}=false"   echo "-Denable-${feature}=false"
23  }  }
24    
25  # enables features like --with-blah with make  # enables features like --with-blah with make
# Line 55  meson_src_prepare() Line 55  meson_src_prepare()
55  meson_configure()  meson_configure()
56  {  {
57   local configure_opts="$@"   local configure_opts="$@"
58     local default_opts
59    
60   meson setup \   default_opts+=" --buildtype=release"
61   --buildtype=release \   default_opts+=" --prefix=/usr"
62   --prefix=/usr \   default_opts+=" --sysconfdir=/etc"
63   --sysconfdir=/etc \   default_opts+=" --localstatedir=/var/lib"
64   --localstatedir=/var/lib \   default_opts+=' --libexecdir=/usr/$(mlibdir)/${PNAME}'
65   --libdir=/usr/$(mlibdir) \  
66   --libexecdir=/usr/$(mlibdir)/${PNAME} \   if [[ ${MULTILIB_BUILD} = true ]]
67   ${configure_opts} \   then
68   ${SRCDIR}/${SRCSUBDIR} \   # must be escaped so the mlibdir variable gets evaluated later
69   || die   default_opts+=' --libdir=/usr/$(mlibdir)'
70     all-abis meson setup ${default_opts} ${configure_opts} ${SRCDIR}-$(mabi)/${SRCSUBDIR} ${BUILDDIR}/build-$(mabi) || die
71     else
72     # the mlibdir variable gets right now evaluated
73     default_opts+=" --libdir=/usr/$(mlibdir)"
74     meson setup ${default_opts} ${configure_opts} ${SRCDIR}/${SRCSUBDIR} ${BUILDDIR}/build || die
75     fi
76  }  }
77    
78  mninja()  mninja()
79  {  {
80   ninja -v ${MAKEOPTS} "$@"   if [[ ${MULTILIB_BUILD} = true ]]
81     then
82     all-abis ninja -C ${SRCDIR}-$(mabi)/${SRCSUBDIR} -C ${BUILDDIR}/build-$(mabi) -v ${MAKEOPTS} "$@"
83     else
84     ninja -C ${SRCDIR}/${SRCSUBDIR} -C ${BUILDDIR}/build -v ${MAKEOPTS} "$@"
85     fi
86    }
87    
88    meson_setup_builddir()
89    {
90     if [[ ${MULTILIB_BUILD} = true ]]
91     then
92     all-abis install -d ${BUILDDIR}/build-$(mabi) || die
93     else
94     install -d ${BUILDDIR}/build || die
95     fi
96  }  }
97    
98  meson_src_compile()  meson_src_compile()
99  {  {
100   cd ${SRCDIR}   if [[ ${MULTILIB_BUILD} != true ]]
101     then
102   # remove build dir if exist   cd ${SRCDIR}
103   [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build   fi
104    
105   # build outside of the source dir   meson_setup_builddir || die
106   install -d ${BUILDDIR}/build || die   meson_configure "$@" || die
  cd ${BUILDDIR}/build  
   
  meson_configure || die  
107   mninja || die   mninja || die
108  }  }
109    
# Line 94  meson_src_check() Line 113  meson_src_check()
113   meson test || die   meson test || die
114  }  }
115    
116    meson_multilib_src_check()
117    {
118     local abi
119     local abis_to_run="${MULTILIB_ABIS}"
120    
121     # respect MULTILIB_ONLY_ABI variable
122     [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}"
123     for abi in ${abis_to_run}
124     do
125     cd ${BUILDDIR}/build-${abi}
126     meson test || die
127     done
128    }
129    
130  meson_src_install()  meson_src_install()
131  {  {
132   cd ${BUILDDIR}/build   cd ${BUILDDIR}/build
# Line 111  meson_src_install() Line 144  meson_src_install()
144   done   done
145  }  }
146    
147  export_inherits meson src_prepare src_compile src_check src_install  meson_multilib_src_install()
148    {
149     local abi
150     local abis_to_run="${MULTILIB_ABIS}"
151    
152     # respect MULTILIB_ONLY_ABI variable
153     [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}"
154     for abi in ${abis_to_run}
155     do
156     cd ${BUILDDIR}/build-${abi}
157     DESTDIR=${BINDIR} ninja install || die
158    
159     cd ${SRCDIR}-${abi}
160     local i
161     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
162     FAQ LICENSE NEWS README TODO
163     do
164     if [ -f ${SRCDIR}-${abi}/${i} ]
165     then
166     minstalldocs ${i} || die
167     fi
168     done
169     done
170    }
171    
172    export_inherits meson src_prepare src_compile
173    if [[ ${MULTILIB_BUILD} = true ]]
174    then
175     export_inherits meson_multilib src_check src_install
176    else
177     export_inherits meson src_check src_install
178    fi

Legend:
Removed from v.29787  
changed lines
  Added in v.30741