(Free) Software Building and Packaging For Windows
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
creating_new_packages [2015/02/22 12:37] adrien_clone created |
creating_new_packages [2015/06/07 20:09] (current) adrien |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Environment ====== | + | ====== Creating new packages ====== |
+ | |||
+ | ===== Environment ===== | ||
If you haven’t already, build the packages that already exist. This will ensure you have everything needed and working; you can check [[Download and Installation From Linux|the corresponding documentation]]. | If you haven’t already, build the packages that already exist. This will ensure you have everything needed and working; you can check [[Download and Installation From Linux|the corresponding documentation]]. | ||
- | ====== Be ready to ask questions ====== | + | ===== Be ready to ask questions ===== |
Packaging is usually an experience with many issues and dirty work-arounds. Some of these are quite common and easy to spot for someone who has already seen similar issues so don’t hesitate to hit [[support|one of the support channels]] and ask questions. | Packaging is usually an experience with many issues and dirty work-arounds. Some of these are quite common and easy to spot for someone who has already seen similar issues so don’t hesitate to hit [[support|one of the support channels]] and ask questions. | ||
Line 22: | Line 24: | ||
</WRAP> | </WRAP> | ||
- | ===== Port an existing build script ===== | + | ==== Port an existing build script ==== |
- | ==== Copy the build script ==== | + | === Locate the existing script === |
For ''slackbuilds.org'' all the files are already there. For ''slackware64-current'', you need to copy them first. For example, ''libgcrypt'' is inside ''slackware64-current/n'' so you’d run a command similar to this one: | For ''slackbuilds.org'' all the files are already there. For ''slackware64-current'', you need to copy them first. For example, ''libgcrypt'' is inside ''slackware64-current/n'' so you’d run a command similar to this one: | ||
Line 32: | Line 34: | ||
</code> | </code> | ||
- | ==== Port the build script (mostly search-replace) ==== | + | === Do the porting (mostly search-replace) === |
* Add a ''${PACKAGE}.yypkg.script'' file to the package directory; if you have nothing specific to set for the packaging (by far the usual case), you only have to ''cp'' another one; any will do except gcc’s; don’t forget to name it after the package however. For instance: | * Add a ''${PACKAGE}.yypkg.script'' file to the package directory; if you have nothing specific to set for the packaging (by far the usual case), you only have to ''cp'' another one; any will do except gcc’s; don’t forget to name it after the package however. For instance: | ||
Line 47: | Line 49: | ||
elif [ "$ARCH" = "i686" ]; then | elif [ "$ARCH" = "i686" ]; then | ||
</code> | </code> | ||
- | * Replace occurrences of ''$SLKCFLAGS'' with ''-O2'' * Add ''--host=${HOST_TRIPLET}'' to the configure invocation. If this involves adding a newline in a configure call, don’t forget to escape it with ''\'' right before it. | + | * Replace occurrences of ''$SLKCFLAGS'' with ''-O2'' |
+ | * Add ''<nowiki>--host=${HOST_TRIPLET}</nowiki>'' to the configure invocation. If this involves adding a newline in a configure call, don’t forget to escape it with ''\'' right before it. | ||
* Locate the "strip" invocation; it looks like: | * Locate the "strip" invocation; it looks like: | ||
<code> | <code> | ||
Line 74: | Line 77: | ||
-e "s/%{BUILD}/${BUILD}/" \ | -e "s/%{BUILD}/${BUILD}/" \ | ||
-e "s/%{DESCR}/${DESCR:-"No description"}/" \ | -e "s/%{DESCR}/${DESCR:-"No description"}/" \ | ||
- | | yypkg --makepkg -o ${YYOUTPUT} --script - --directory "${PKG}/${PREFIX}" | + | | yypkg --makepkg --output ${YYOUTPUT} --script - --directory "${PKG}/${PREFIX}" |
</code> | </code> | ||
Line 84: | Line 87: | ||
</code> | </code> | ||
- | ===== Or, start from a similar package ===== | + | ==== Or, start from a similar package ==== |
Create a new directory for your package inside ''mingw/'' and copy an existing build script that is similar: | Create a new directory for your package inside ''mingw/'' and copy an existing build script that is similar: | ||
Line 106: | Line 109: | ||
</code> | </code> | ||
- | ===== Add your package to the list ==== | + | ===== Add your package to the list ===== |
Before building you need to let the builer know about your package. In the ''win-builds git'' repository, edit ''build/windows.ml''". You need to add an entry after all the package dependencies. The list is written in OCaml but you only need to understand the basic syntax. | Before building you need to let the builer know about your package. In the ''win-builds git'' repository, edit ''build/windows.ml''". You need to add an entry after all the package dependencies. The list is written in OCaml but you only need to understand the basic syntax. |