Debian::DpkgCross(3)

Debian::DpkgCross (3) πŸ’–

okay bestie, so this is Debian::DpkgCross β€” the Perl package that holds all the functions dpkg-cross uses over and over again. It's a section 3 Perl manual page, the kind that ships in User Contributed Perl Documentation, so pull up a chair and let's get into it 🫢


✨ NAME ✨

Debian::DpkgCross β€” the package of dpkg-cross commonly used functions 🌸

ngl, here's the tea: the 2.x series of dpkg-cross is literally trying to achieve its own removal by folding as much cross-building support as possible directly into dpkg itself. So the number, scope and range of functions supported by this package is only ever going to go down. Any newly-written code using this package will need to keep up with changes in dpkg. Developers are recommended to join the debian-dpkg and debian-embedded mailing lists and keep their code under review. πŸ‘‘


Copyright (C) 2004  Nikita Youshchenko <yoush@cs.msu.su>
Copyright (C) 2004  Raphael Bossek <bossekr@debian.org>
Copyright (c) 2007-2009  Neil Williams <codehelp@debian.org>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 😭

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


πŸ› Bugs πŸ›

Please report bugs via the Debian Bug Tracking System. fr fr, that's the move.


πŸ«‚ Support πŸ«‚

All enquiries go to the "<debian-embedded@lists.debian.org>" mailing list. come hang out πŸ’Œ


🌈 MAKEFLAGS 🌈

See bug #437507. Even if the other flags are needed, CC, GCC and other compiler names should NOT be overridden in $ENV{'MAKEFLAGS'} β€” because this prevents packages compiling and running build tools using CC_FOR_BUILD. πŸ’€

CDBS packages need to declare an empty override variable in debian/rules:

DEB_CONFIGURE_SCRIPT_ENV=

Depending on progress with dpkg cross-building support, the remaining overrides may also be removed. Do not rely on these being set. not a vibe, just facts 😀


πŸ“– read_config πŸ“–

Read '$conffile' and save the definition in global variables β€” all recognised variables, no skips, no cap.

'$crossroot' will be set by setup(). Until setup() is called, all "crossroot-<arch>" settings are stored within '%allcrossroots'. πŸ¦‹

All package variables are stored within '%conf'.

No variables are skipped. literally none.

return: none


πŸ“– get_config πŸ“–

Return the current configuration from read_config as a hash reference. simple as that πŸ’…


πŸ“– get_version πŸ“–

Return the current DpkgCross version string used by all dpkg-cross scripts. iconic behavior tbh ⭐


πŸ“– dump_debug_data πŸ“–

Return a hashtable of assorted debug data collated during the current run that can be processed using Data::Dumper. 🧚


πŸ“– rewrite_pkg_name πŸ“–

Converts a package name into the dpkg-cross package name. ✨

  • $1 β€” the package name to check and convert if needed
  • return β€” the cross-package name

πŸ“– convert_filename($) πŸ“–

Converts an original .deb filename into the dpkg-cross .deb filename, or converts a dpkg-cross .deb filename into the original .deb filename. it goes both ways bestie πŸ”„

returns undef on error 😭


πŸ“– get_architecture πŸ“–

Returns the current architecture.

return: Current architecture or empty if not set.


πŸ“– check_arch($arch) πŸ“–

Checks that the supplied $arch is (or can be converted to) a DEB_HOST_GNU_TYPE that can be supported by dpkg-cross. vibe check, basically πŸŽ€

returns the DPKG_HOST_GNU_TYPE or undef


πŸ“– setup πŸ“–

Set global variables '$arch', '$crossbase', '$crossbin', '$crosslib32', '$crossdir', '$crossinc', '$crosslib', '$crosslib64', '$crossprefix', '$compilerpath' and '$deb_host_gnu_type' to defaults and substitute them with variables from '%conf' and '$arch'. 🌟

return: none


πŸ“– create_tmpdir($basename) πŸ“–

Safely create a temporary directory. πŸ“

  • $1: Directory basename (random suffix will be added)

return: Full directory pathname, undef if failed


πŸ“– convert_path($multiarch, $path) πŸ“–

Convert path, substituting '$crossinc', '$crosslib', '$crosslib64', '$crosslib32', '$crossdir', allowing for multiarch paths. This function will be used while building foreign binary packages or converting GCC options. πŸ”₯

  • $1: Multiarch sub-directory to strip
  • $2: Directory (and file) to convert

return: Converted path.


πŸ“– simplify_path($path) πŸ“–

Simplify path. Remove duplicate slashes, "./", "dir/..", etc. βœ‚οΈ

  • $1: Path to simplify.

return: Simplified path.


and that's the whole page, bestie β€” no gatekeeping, every flag and every function accounted for πŸ’–

this lil' page was brought to you by perl v5.40.1, dated 2026-04-26, filed under Debian::DpkgCross(3). slay, bye πŸ’…βœ¨

πŸ“¦ where this page comes from