This wiki was updated to MediaWiki 1.37. If you notice any issues, please report them to admin[at]opensuse.org

Build:projects:windows:mingw

Jump to: navigation, search

Cross-toolchain for 32/64-bit windows and 32/64-bit windows packages

Create a bug report

Bug reports for a whole project can be opened by clicking on one of the links below:

Bug reports for a single package can be opened on the OBS page for that package by clicking on Report bug there [see bug 1173190] or by clicking on one the following links:

FAQ

How to configure a cmake project to build for Windows outside a *.spec file ?

You can use the command line tools mingw32-cmake for 32bit builds and mingw64-cmake for 64bit builds as replacement for cmake.

what do I have to keep in mind when working with a project linked to windows:mingw... linked ?

With changes to packages, which are made over a copy of the concerning package created with osc, after confirmation a copy in the current project is created and need to be submited to the original project. Changes made via the web interface are made directly to the original package, please note.

In rpm macros, how do I process parameters ?

I found two working solution:

1. Use shell variables

%_mymacro \
  if [ -n "$1" ]; then PARAMS="$*" else; PARAMS="default"; fi; \

or

%_mymacro \
  if [ $# -ne 0 ]; then PARAMS="$*" else; PARAMS="default"; fi; \


2. Use rpm variables

%_mymacro() \
  if [ -n "%1" ]; then PARAMS="%*" else; PARAMS="default"; fi; \

Note: I noticed that using "%#" to get the number of parameters does not work, as it always returns '\', which will be expanded to "\" and results into this runtime error 'unexpected EOF while looking for matching `"'.

How to debug hidden osc build issues ?

If osc build fails, for example after it fails with something like /var/tmp/rpm-tmp.0iMJGE: line 41: syntax error near unexpected token `else, it would help to see the content of the mentioned script file for inspecting purpose.

Unfortunally I did not find an option, when running the osc build, to prevent deleting of the script file.

A workaround is to use

rpmbuild --noclean -ba xxx.spec

instead, after copying the source tarball and patch files from the current osc related package directory into $HOME/rpmbuild/SOURCES.

How to prevent issues using shell scripting for defining macros

Shell scripting to define macros can be used by specifing %define <name> %(...) as mentioned at Defining Macros in Spec Files. Please note that when using shell scripting, on building a warning will be printed as reported at can't expand %(...)" warnings not clear

rpm --queryformat %{xxx} cannot be used for depending packages

If you want to get the version from an installed package added as build requirement, you cannot use

rpm -q <packagename> --qf "%{VERSION}

as the term '%{VERSION}' will be replaced by the version of the current spec file.



Workaround: If the package name is for example

   mingw32-gwenhywfar5-devel-5.9+20220101+git.2356767

you can use

 %define gw_version %(rpm -q <packagename> | awk -F"[-+]" '{print $4}')

.


Prevent defining a macro multiple times

Macros defined with %define are expanded on each usage. To prevent multiple expanding, the following trick can be used.

%{!?<macro-name>: %define <macro-name>  %(...)}

Links