This is a step-by-step procedure to get pkg-config working on Windows, based on my experience, using the info from Oliver Zendel's comment. I assume here that MinGW was installed to C: MinGW. There were multiple versions of the packages available, and in each case I just downloaded the latest version. Jul 28, 2019 Convert PS3 Folder Games to PKG Require Files. PS3 CFW2OFW Helper; PS3 Licence Generator; PlayStation 3 PKG Maker Tools; Note: Before the start PS3 folder Games to PKG converting process. Make sure your game has Licence Folder and files.
-->Note
For UWP guidance on using this tool, see Create an app package with the MakeAppx.exe tool.
App packager (MakeAppx.exe) creates an app package from files on disk or extracts the files from an app package to disk. Starting with Windows 8.1, App packager also creates an app package bundle from app packages on disk or extracts the app packages from an app package bundle to disk. It is included in Microsoft Visual Studio and the Windows Software Development Kit (SDK) for Windows 8 or Windows Software Development Kit (SDK) for Windows 8.1. Visit Downloads for developers to get them.
The MakeAppx.exe tool is typically found at these locations:
- On x86: C:Program Files (x86)Windows Kits8.0binx86makeappx.exe or C:Program Files (x86)Windows Kits8.1binx86makeappx.exe
- On x64 in two locations:
- C:Program Files (x86)Windows Kits8.0binx86makeappx.exe or C:Program Files (x86)Windows Kits8.1binx86makeappx.exe
- C:Program Files (x86)Windows Kits8.0binx64makeappx.exe or C:Program Files (x86)Windows Kits8.1binx64makeappx.exe
There is no ARM version of the tool.
Using App packager
Note
Relative paths are supported throughout the tool.
To create a package using a directory structure
Place the AppxManifest.xml in the root of a directory containing all of the payload files for your app. An identical directory structure is created for the app package, and will be available when the package is extracted at deployment time.
- Place all files in a single directory structure, creating subdirectories as desired.
- Create a valid package manifest, AppxManifest.xml, and place it in the root directory.
- Run this command:MakeAppx pack /dinput_directorypath/pfilepath.appx
To create a package using a mapping file
- Create a valid package manifest, AppxManifest.xml.
- Create a mapping file. The first line contains the string [Files], and the lines that follow specify the source (disk) and destination (package) paths in quoted strings.
- Run this command:MakeAppx pack /fmapping_filepath/pfilepath.appx
Ps3 Pkg Creator
To sign the package using SignTool
- Create the certificate. The publisher listed in the manifest must match the publisher subject information of the signing certificate. For more info about creating a signing certificate, see How to create an app package signing certificate.
- Run SignTool.exe to sign the package:SignTool sign /a /v /fdhashAlgorithm/fcertFileNamefilepath.appxThe hashAlgorithm must match the hash algorithm used to create the blockmap when the app was packaged. With the MakeAppx packaging utility, the default Appx blockmap hash algorithm is SHA256. Run SignTool.exe specifying SHA256 as the file digest (/fd) algorithm:SignTool sign /a /v /fd SHA256 /fcertFileNamefilepath.appxFor more info about how to sign packages, see How to sign an app package using SignTool.
To extract files from a package
- Run this command:MakeAppx unpack /pfile.appx /doutput_directory
- The unpacked package has the same structure as the installed package.
To create a package bundle using a directory structure
We use the bundle command to create an app bundle at
- Place all packages in a single directory structure, creating subdirectories as desired.
- Run this command:MakeAppx bundle /dinput_directorypath/pfilepath.appxbundle
To create a package bundle using a mapping file
We use the bundle command to create an app bundle at
- Create a
- Run this command:MakeAppx bundle /fmapping_filepath/pfilepath.appxbundle
To extract packages from a bundle
- Run this command:MakeAppx unbundle /pbundle_name.appxbundle /doutput_directory
- The unpacked bundle has the same structure as the installed package bundle.
To encrypt a package with a key file
- Create a key file. Key files must begin with a line containing the string '[Keys]' followed by lines describing the keys to encrypt the package with. Each key is described by a pair of strings in quotation marks, separated by spaces or tabs. The first string represents the key ID and the second string represents the encryption key in hexadecimal form.
- Run this command:MakeAppx.exe encrypt /ppackage_name.appx /epencrypted_package_name.eappx /kfkeyfile_name.txt
- The input package will be encrypted into the specified encrypted package using the provided key file.
To encrypt a package with a global test key
- Run this command:MakeAppx.exe encrypt /ppackage_name.appx /epencrypted_package_name.eappx /kt
- The input package will be encrypted into the specified encrypted package using the global test key.
To decrypt a package with a key file
- Create a key file. Key files must begin with a line containing the string '[Keys]' followed by lines describing the keys to encrypt the package with. Each key is described by a pair of strings in quotation marks, separated by spaces or tabs. The first string represents the base64 encoded 32-byte key ID and the second string represents the base64 encoded 32-byte encryption key.
- Run this command:MakeAppx.exe decrypt /ppackage_name.appx /epunencrypted_package_name.eappx /kfkeyfile_name.txt
- The input package will be decrypted into the specified unencrypted package using the provided key file.
To decrypt a package with a global test key
- Run this command:MakeAppx.exe decrypt /ppackage_name.appx /epunencrypted_package_name.eappx /kt
- The input package will be decrypted into the specified unencrypted package using the global test key.
Usage
The command line argument /p is always required, with either /d, /f, or /ep. Note that /d, /f, and /ep are mutually exclusive.
MakeAppx pack [options]/p<output package name>/d<content directory>
MakeAppx pack [options]/p<output package name>/f<mapping file>
MakeAppx unpack [options]/p<input package name>/d<output directory>
MakeAppx bundle [options]/p<output bundle name>/d<content directory>
MakeAppx bundle [options]/p<output bundle name>/f<mapping file>
MakeAppx unbundle [options]/p<input bundle name>/d<output directory>
MakeAppx encrypt [options]/p<input package name>/ep<output package name>
MakeAppx decrypt [options]/p<input package name>/ep<output package name>
Command-line Syntax
Here is the command-line common usage syntax for MakeAppx.
MakeAppx [pack|unpack|bundle|unbundle|encrypt|decrypt] [/h/kf/kt/l/o/no/nv/v/pfn/?]
MakeAppx packs or unpacks the files in a package, bundles or unbundles the packages in a bundle, or encrypts or decrypts the app package or bundle in the specified input directory or mapping file. Here is the list of parameters that apply to MakeAppx pack, MakeAppx unpack, MakeAppx bundle, MakeAppx unbundle, MakeAppx encrypt, or MakeAppx decrypt.
/l
This option is used for localized packages. The default validation trips on localized packages. This option disables only that specific validation, without requiring that all validation be disabled.
/o
Overwrite the output file if it exists. If you don't specify this option or the /no option, the user is asked whether they want to overwrite the file.
You can't use this option with /no.
/no
Prevents an overwrite of the output file if it exists. If you don't specify this option or the /o option, the user is asked whether they want to overwrite the file.
You can't use this option with /o.
/nv
Skip semantic validation. If you don't specify this option, the tool performs a full validation of the package.
/v
Enable verbose logging output to the console.
/?
Display help text.
MakeAppx pack , MakeAppx unpack , MakeAppx bundle, MakeAppx unbundle, MakeAppx encrypt, and MakeAppx decrypt are mutually exclusive commands. Here are the command-line parameters that apply specifically to each command:
MakeAppx pack [h]
Creates a package.
/halgorithm
Specifies the hash algorithm to use when creating the block map. Here are valid values for algorithm:
- SHA256 (default)
- SHA384
- SHA512
You can't use this option with the unpack command.
MakeAppx unpack [pfn]
Extracts all files in the specified package to the specified output directory. The output has the same directory structure as the package.
/pfn
Specifies a directory named with the package full name. This directory is created under the provided output location. You can't use this option with the pack command.
MakeAppx unbundle [pfn]
Unpacks all packages to a subdirectory under the specified output path, named after the bundle full name. The output has the same directory structure as the installed package bundle.
/pfn
Specifies a directory named with the package bundle full name. This directory is created under the provided output location. You can't use this option with the bundle command.
MakeAppx encrypt [kf, kt]
Creates an encrypted app package from the specified input app package at the specified output package.
/kf
Encrypts the package or bundle using the key from the specified key file. You can't use this option with kt.
Ps3 Package Gui Download
/kt
Encrypts the package or bundle using the global test key. You can't use this option with kf.
MakeAppx decrypt [kf, kt]
Creates an unencrypted app package from the specified input app package at the specified output package.
/kf
Decrypts the package or bundle using the key from the specified key file. You can't use this option with kt.
/kt
Decrypts the package or bundle using the global test key. You can't use this option with kf.
Semantic validation performed by MakeAppx
MakeAppx performs limited semantic validation that is designed to catch the most common deployment errors and help ensure that the app package is valid.
This validation ensures that:
- All files referenced in the package manifest are included in the app package.
- An application does not have two identical keys.
- An application does not register for a forbidden protocol from this list: SMB , FILE, MS-WWA-WEB, MS-WWA.
This semantic validation is not complete, and packages built by MakeAppx are not guaranteed to be installable.
(Redirected from Creating Packages)
This article aims to assist users creating their own packages using the Arch Linux 'ports-like' build system, also for submission in AUR. It covers creation of a PKGBUILD – a package build description file sourced by
makepkg
to create a binary package from source. If already in possession of a PKGBUILD
, see makepkg. For instructions regarding existing rules and ways to improve package quality see Arch packaging standards.Overview
Packages in Arch Linux are built using the makepkg utility and the information stored in a PKGBUILD file. When
makepkg
runs, it searches for a PKGBUILD
in the current directory and follows the instructions in it to acquire the required files and/or compile them to be packed within a package file (pkgname.pkg.tar.zst
). The resulting package contains binary files and installation instructions ready to be installed by pacman.An Arch package is no more than a tar archive, or 'tarball', compressed using zstd(1), which contains the following files generated by makepkg:
- The binary files to install.
.PKGINFO
: contains all the metadata needed by pacman to deal with packages, dependencies, etc..BUILDINFO
: contains information needed for reproducible builds. This file is present only if a package is built with pacman 5.1 or newer. See BUILDINFO(5)..MTREE
: contains hashes and timestamps of the files, which are included in the local database so that pacman can verify the integrity of the package..INSTALL
: an optional file used to execute commands after the install/upgrade/remove stage. (This file is present only if specified in thePKGBUILD
.).Changelog
: an optional file kept by the package maintainer documenting the changes of the package. (It is not present in all packages.)
Preparation
Prerequisite software
First, ensure that the necessary tools are installed: the package group base-devel should be sufficient, it includes
make
and additional tools needed for compiling from source.The key tool for building packages is makepkg (provided by pacman), which does the following:
- Checks if package dependencies are installed.
- Downloads the source file(s) from the specified server(s).
- Unpacks the source file(s).
- Compiles the software and installs it under a fakeroot environment.
- Strips symbols from binaries and libraries.
- Generates the package meta file which is included with each package.
- Compresses the fakeroot environment into a package file.
- Stores the package file in the configured destination directory, which is the current working directory by default.
Download and test the installation
Download the source tarball of the software you want to package, extract it, and follow the author's steps to install the program. Make a note of all commands and/or steps needed to compile and install it. You will be repeating those same commands in the
PKGBUILD
file.Most software authors stick to the 3-step build cycle:
This is a good time to make sure the program is working correctly.
Creating a PKGBUILD
When
makepkg
is run, it looks for a PKGBUILD
file in the current working directory. If it finds one, it downloads the software's source code and compiles it according to the instructions specified in the PKGBUILD
file. The instructions must be fully interpretable by the Bash shell. After successful completion, the resulting binaries and metadata of the package, i.e. package version and dependencies, are packed in a pkgname.pkg.tar.zst
package file. The newly created package can be installed by simply using makepkg --install
which will call pacman in the background, or by directly using pacman -U pkgname.pkg.tar.zst
.To start building a new package, first create a new directory for the package and change current directory into this one. Then, a
PKGBUILD
file needs to be created: a prototype PKGBUILD found in /usr/share/pacman/
can be used or you can start from a PKGBUILD
from another package. The latter may be a good choice if a similar package already exists.Defining PKGBUILD variables
Example PKGBUILDs are located in
/usr/share/pacman/
. An explanation of possible PKGBUILD
variables can be found in the PKGBUILD article.makepkg defines two variables that you should use as part of the build and install process:
srcdir
- This points to the directory where makepkg extracts or symlinks all files in the source array.
pkgdir
- This points to the directory where makepkg bundles the installed package, which becomes the root directory of your built package.
They contain absolute paths, which means you do not have to worry about your working directory if you use these variables properly.
Note:makepkg, and thus the
build()
and package()
functions, are intended to be non-interactive. Interactive utilities or scripts called in those functions may break makepkg, particularly if it is invoked with build-logging enabled (--log
). (See FS#13214.)PKGBUILD functions
When building a package,
makepkg
will invoke the following five functions if they have been defined in the PKGBUILD. Function package()
is required in every PKGBUILD and will always be invoked. If any of the other functions is not defined, makepkg
will simply skip the invocation of that function.During the build, the functions are invoked in the order in which they are listed here.
prepare()
With this function, commands that are used to prepare sources for building are run, such as patching. This function runs right after package extraction, before pkgver() and the build function. If extraction is skipped (
makepkg --noextract
), then prepare()
is not run. Note: (From PKGBUILD(5)) The function is run in
bash -e
mode, meaning any command that exits with a non-zero status will cause the function to exit.pkgver()
pkgver()
runs after the sources are fetched, extracted and prepare() executed. So you can update the pkgver variable during a makepkg stage.This is particularly useful if you are making git/svn/hg/etc. packages, where the build process may remain the same, but the source could be updated every day, even every hour. The old way of doing this was to put the date into the pkgver field which, if the software was not updated, makepkg would still rebuild it thinking the version had changed. Some useful commands for this are
git describe
, hg identify -ni
, etc. Please test these before submitting a PKGBUILD, as a failure in the pkgver()
function can stop a build in its tracks. Note: pkgver cannot contain spaces or hyphens (
-
). Using sed to correct this is common.build()
Now you need to implement the
build()
function in the PKGBUILD
file. This function uses common shell commands in Bash syntax to automatically compile software and create a directory called pkg
to install the software to. This allows makepkg to package files without having to sift through your file system.The first step in the
build()
function is to change into the directory created by uncompressing the source tarball. makepkg will change the current directory to $srcdir
before executing the build()
function. Therefore, in most cases, like suggested in /usr/share/pacman/PKGBUILD.proto
, the first command will look like this:Now, you need to list the same commands you used when you manually compiled the software. The
build()
function in essence automates everything you did by hand and compiles the software in the fakeroot build environment. If the software you are packaging uses a configure script, it is good practice to use --prefix=/usr
when building packages for pacman. A lot of software installs files relative to the /usr/local
directory, which should only be done if you are manually building from source. All Arch Linux packages should use the /usr
directory. As seen in the /usr/share/pacman/PKGBUILD.proto
file, the next two lines often look like this:Note: If your software does not need to build anything, do not use the
build()
function. The build()
function is not required, but the package()
function is.check()
Place for calls to
make check
and similar testing routines. It is highly recommended to have check()
as it helps to make sure software has been built correctly and works fine with its dependencies.Users who do not need it (and occasionally maintainers who can not fix a package for this to pass) can disable it using
BUILDENV+=('!check')
in PKGBUILD/makepkg.conf or call makepkg
with --nocheck
flag.package()
The final step is to put the compiled files in a directory where makepkg can retrieve them to create a package. This by default is the
pkg
directory—a simple fakeroot environment. The pkg
directory replicates the hierarchy of the root file system of the software's installation paths. If you have to manually place files under the root of your filesystem, you should install them in the pkg
directory under the same directory structure. For example, if you want to install a file to /usr/bin
, it should instead be placed under $pkgdir/usr/bin
. Very few install procedures require the user to copy dozens of files manually. Instead, for most software, calling make install
will do so. The final line should look like the following in order to correctly install the software in the pkg
directory:Note: It is sometimes the case where
DESTDIR
is not used in the Makefile
; you may need to use prefix
instead. If the package is built with autoconf / automake, use DESTDIR
; this is what is documented in the manuals. If DESTDIR
does not work, try building with make prefix='$pkgdir/usr/' install
. If that does not work, you will have to look further into the install commands that are executed by 'make <...> install
'.makepkg --repackage
runs only the package()
function, so it creates a package without building. This may save time e.g. if you have changed just the depends
variable of the package.Testing the PKGBUILD and package
As you are writing the
build()
function, you will want to test your changes frequently to ensure there are no bugs. You can do this using the makepkg
command in the directory containing the PKGBUILD
file. With a properly formatted PKGBUILD
, makepkg will create a package; with a broken or unfinished PKGBUILD
, it will raise an error.If makepkg finishes successfully, it will place a file named
pkgname-pkgver.pkg.tar.zst
in your working directory. This package can be installed with the pacman -U
command. However, just because a package file was built does not imply that it is fully functional. It might conceivably contain only the directory and no files whatsoever if, for example, a prefix was specified improperly. You can use pacman's query functions to display a list of files contained in the package and the dependencies it requires with pacman -Qlp [package file]
and pacman -Qip [package file]
respectively.If the package looks sane, then you are done! However, if you plan on releasing the
PKGBUILD
file, it is imperative that you check and double-check the contents of the depends
array. Also ensure that the package binaries actually run flawlessly! It is annoying to release a package that contains all necessary files, but crashes because of some obscure configuration option that does not quite work well with the rest of the system. If you are only going to compile packages for your own system, though, you do not need to worry too much about this quality assurance step, as you are the only person suffering from mistakes, after all.
Checking package sanity
After testing package functionality check it for errors using namcap:
Namcap will:
- Check PKGBUILD contents for common errors and package file hierarchy for unnecessary/misplaced files
- Scan all ELF files in package using
ldd
, automatically reporting which packages with required shared libraries are missing fromdepends
and which can be omitted as transitive dependencies - Heuristically search for missing and redundant dependencies
and much more.
Get into the habit of checking your packages with namcap to avoid having to fix the simplest mistakes after package submission.
Submitting packages to the AUR
Please read AUR_submission_guidelines for a detailed description of the submission process.
Summary
- Download the source tarball of the software to package.
- Try compiling the package and installing it into an arbitrary directory.
- Copy over the prototype
/usr/share/pacman/PKGBUILD.proto
and rename it toPKGBUILD
in a temporary working directory. - Edit the
PKGBUILD
according to the needs of your package. - Run
makepkg
and check whether the package builds correctly. - If not, repeat the previous two steps.
Warnings
OrbisPKG PS4 Tool: View / Edit Retail & Fake Packages By ...
- Before you can automate the package building process, you should have done it manually at least once unless you know exactly what you are doing in advance, in which case you would not be reading this in the first place. Unfortunately, although a good bunch of program authors stick to the 3-step build cycle of '
./configure
;make
;make install
', this is not always the case, and things can get real ugly if you have to apply patches to make everything work at all. Rule of thumb: If you cannot get the program to compile from the source tarball, and make it install itself to a defined, temporary subdirectory, you do not even need to try packaging it. There is not any magic pixie dust inmakepkg
that makes source problems go away. - In a few cases, the packages are not even available as source and you have to use something like
sh installer.run
to get it to work. You will have to do quite a bit of research (read READMEs, INSTALL instructions, man pages, perhaps ebuilds from Gentoo or other package installers, possibly even the MAKEFILEs or source code) to get it working. In some really bad cases, you have to edit the source files to get it to work at all. However,makepkg
needs to be completely autonomous, with no user input. Therefore if you need to edit the makefiles, you may have to bundle a custom patch with thePKGBUILD
and install it from inside theprepare()
function, or you might have to issue somesed
commands from inside theprepare()
function.
How To Convert PS3 Folder Games To PKG + Installation Inroduction
More detailed guidelines
Arch package guidelines32-bit – CLR – CMake – Cross – DKMS – Eclipse – Electron – Font – Free Pascal – GNOME – Go – Haskell – Java – KDE – Kernel – Lisp – Meson – MinGW – Node.js – Nonfree – OCaml – Perl – PHP – Python – R – Ruby – Rust – VCS – Web – Wine
PKGBUILD generators
Ps3 Package Gui
PKGBUILDs for some packages can be generated automatically.
Note: Users are still responsible for ensuring that the package meets the high quality standards before submitting the generated files to the AUR.
- Haskell: cblrepo, arch-hs
- Node.js: nodejs-npm2archAURnpm2arch
- Python: pipman-gitAUR, pip2arch-gitAUR, python-pypi2pkgbuildAUR
- Ruby: gem2archAUR, pacgemAUR
- Rust: cargo-pkgbuildAUR
See also
![Free PS2 Pub Gen / Fake PKG Tools: PS2 Fake PKG Generator for PS4 Free PS2 Pub Gen / Fake PKG Tools: PS2 Fake PKG Generator for PS4](/uploads/1/1/8/8/118801120/485099638.jpg)
- How to correctly create a patch file.
- Arch Linux Classroom IRC Logs of classes about creating PKGBUILDs.
Retrieved from 'https://wiki.archlinux.org/index.php?title=Creating_packages&oldid=642936'