From 44a3b458c354af787eab3d11cf829e32f4d53fa4 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Wed, 19 Aug 2020 16:44:41 +1000 Subject: [PATCH 1/2] common: disable creation of noarch packages. --- common/hooks/do-pkg/00-gen-pkg.sh | 6 ++---- common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +- common/hooks/post-pkg/00-register-pkg.sh | 6 ++---- common/hooks/pre-pkg/04-generate-runtime-deps.sh | 2 +- common/hooks/pre-pkg/05-prepare-32bit.sh | 11 ----------- common/hooks/pre-pkg/06-shlib-provides.sh | 2 +- common/xbps-src/shutils/common.sh | 8 +------- common/xbps-src/shutils/pkgtarget.sh | 2 +- 8 files changed, 9 insertions(+), 30 deletions(-) diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh index b809a6dc5eb..f0b70c8eebb 100644 --- a/common/hooks/do-pkg/00-gen-pkg.sh +++ b/common/hooks/do-pkg/00-gen-pkg.sh @@ -104,14 +104,12 @@ hook() { local arch= binpkg= repo= _pkgver= _desc= _pkgn= _pkgv= _provides= \ _replaces= _reverts= f= found_dbg_subpkg= - if [ "${archs// /}" = "noarch" ]; then - arch=noarch - elif [ -n "$XBPS_TARGET_MACHINE" ]; then + if [ -n "$XBPS_TARGET_MACHINE" ]; then arch=$XBPS_TARGET_MACHINE else arch=$XBPS_MACHINE fi - if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then + if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then arch=${XBPS_ARCH} fi diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh index 44d8a51fe93..b59dde5ab3c 100644 --- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh +++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh @@ -59,7 +59,7 @@ create_debug_pkg() { hook() { local fname= x= f= _soname= STRIPCMD= - if [ -n "$nostrip" -o "${archs// /}" = "noarch" ]; then + if [ -n "$nostrip" ]; then return 0 fi diff --git a/common/hooks/post-pkg/00-register-pkg.sh b/common/hooks/post-pkg/00-register-pkg.sh index 5dc28c999c9..ce641cfc850 100644 --- a/common/hooks/post-pkg/00-register-pkg.sh +++ b/common/hooks/post-pkg/00-register-pkg.sh @@ -13,14 +13,12 @@ registerpkg() { hook() { local arch= binpkg= pkgdir= - if [ "${archs// /}" = "noarch" ]; then - arch=noarch - elif [ -n "$XBPS_TARGET_MACHINE" ]; then + if [ -n "$XBPS_TARGET_MACHINE" ]; then arch=$XBPS_TARGET_MACHINE else arch=$XBPS_MACHINE fi - if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then + if [ -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then arch=${XBPS_ARCH} fi if [ -n "$repository" ]; then diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh index 6e45b7dd3c3..8ffd3a71d8e 100644 --- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh +++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh @@ -56,7 +56,7 @@ hook() { mapshlibs=$XBPS_COMMONDIR/shlibs - if [ "${archs// /}" = "noarch" -o -n "$noverifyrdeps" ]; then + if [ -n "$noverifyrdeps" ]; then store_pkgdestdir_rundeps return 0 fi diff --git a/common/hooks/pre-pkg/05-prepare-32bit.sh b/common/hooks/pre-pkg/05-prepare-32bit.sh index fd6fdf88217..f3612959cb5 100644 --- a/common/hooks/pre-pkg/05-prepare-32bit.sh +++ b/common/hooks/pre-pkg/05-prepare-32bit.sh @@ -20,10 +20,6 @@ hook() { if [ "$XBPS_TARGET_MACHINE" != "i686" ]; then return fi - # Ignore noarch pkgs. - if [ "${archs// /}" = "noarch" ]; then - return - fi if [ -z "$lib32mode" ]; then # Library mode, copy only relevant files to new destdir. # @@ -106,13 +102,6 @@ hook() { printf "${pkgn}-32bit${pkgv} " >> ${destdir32}/rdeps continue fi - # If dependency is noarch do not change it to 32bit. - _arch=$($XBPS_QUERY_CMD -R --property=architecture "$f") - if [ "${_arch}" = "noarch" ]; then - echo " RDEP: $f -> ${pkgn}${pkgv} (noarch)" - printf "${pkgn}${pkgv} " >> ${destdir32}/rdeps - continue - fi # If dependency does not have "shlib-provides" do not # change it to 32bit. for x in ${subpackages}; do diff --git a/common/hooks/pre-pkg/06-shlib-provides.sh b/common/hooks/pre-pkg/06-shlib-provides.sh index cdc94de3bc9..fc39f6bfbe4 100644 --- a/common/hooks/pre-pkg/06-shlib-provides.sh +++ b/common/hooks/pre-pkg/06-shlib-provides.sh @@ -45,7 +45,7 @@ collect_sonames() { hook() { local _destdir32=${XBPS_DESTDIR}/${pkgname}-32bit-${version} - if [ -z "$shlib_provides" -a "${archs// /}" = "noarch" -o -n "$noshlibprovides" ]; then + if [ -n "$noshlibprovides" ]; then return 0 fi diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index e8bcf577c6b..1564a174bf2 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -395,7 +395,6 @@ setup_pkg() { source_file ${XBPS_SRCPKGDIR}/${basepkg}/template fi - # Check if required vars weren't set. _vars="pkgname version short_desc revision homepage license" for f in ${_vars}; do @@ -457,12 +456,7 @@ setup_pkg() { fi makejobs="-j$XBPS_MAKEJOBS" - # strip whitespaces to make " noarch " valid too. - if [ "${archs// /}" = "noarch" ]; then - arch="noarch" - else - arch="$XBPS_TARGET_MACHINE" - fi + arch="$XBPS_TARGET_MACHINE" if [ -n "$XBPS_BINPKG_EXISTS" ]; then local _binpkgver="$($XBPS_QUERY_XCMD -R -ppkgver $pkgver 2>/dev/null)" if [ "$_binpkgver" = "$pkgver" ]; then diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh index 090ec5c1a3e..fa70816fe24 100644 --- a/common/xbps-src/shutils/pkgtarget.sh +++ b/common/xbps-src/shutils/pkgtarget.sh @@ -3,7 +3,7 @@ check_pkg_arch() { local cross="$1" _arch f match nonegation - if [ -n "$archs" -a "${archs// /}" != "noarch" ]; then + if [ -n "$archs" ]; then if [ -n "$cross" ]; then _arch="$XBPS_TARGET_MACHINE" elif [ -n "$XBPS_ARCH" ]; then From 7101668773f6d5202863af4522a77ca8fdb78881 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Thu, 27 Aug 2020 17:17:50 +1000 Subject: [PATCH 2/2] Manual.md: remove mentions of noarch. --- Manual.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Manual.md b/Manual.md index 5502c6e26f8..af5f4019bc3 100644 --- a/Manual.md +++ b/Manual.md @@ -711,8 +711,7 @@ used. - `fetch_cmd` Executable to be used to fetch URLs in `distfiles` during the `do_fetch` phase. - `archs` Whitespace separated list of architectures that a package can be -built for, available architectures can be found under `common/cross-profiles` -alongside the `noarch` value for packages that do not contain any machine code. +built for, available architectures can be found under `common/cross-profiles`. In general, `archs` should only be set if the upstream software explicitly targets certain architectures or there is a compelling reason why the software should not be available on some supported architectures. @@ -725,8 +724,6 @@ Examples: archs="x86_64-musl ~*-musl" # Default value (all arches) archs="*" - # Packages that do not depend on architecture-specific objects - archs=noarch ``` @@ -914,8 +911,8 @@ can be used to pass arguments during compilation. If your package does not make extensions consider using the `gem` build style instead. - `gem` For packages that are installed using gems from [RubyGems](https://rubygems.org/). -The gem command can be overridden by `gem_cmd`. `archs` is set to `noarch` unconditionally -and `distfiles` is set by the build style if the template does not do so. If your gem +The gem command can be overridden by `gem_cmd`. +`distfiles` is set by the build style if the template does not do so. If your gem provides extensions which must be compiled consider using the `gemspec` build style instead. - `ruby-module` For packages that are ruby modules and are installable via `ruby install.rb`. @@ -1413,6 +1410,10 @@ destdir (`$DESTDIR`) to the `subpackage` destdir (`$PKGDESTDIR`). Subpackages are processed always in alphabetical order; To force a custom order, the `subpackages` variable can be declared with the wanted order. +Please note that XBPS makes no distinction between normal packages, and data +packages. Data packages, documentation packages and binary packages are all +treated the same way. + ### Development packages @@ -1451,7 +1452,7 @@ type used to split architecture independent, big(ger) or huge amounts of data from a package's main and architecture dependent part. It is up to you to decide, if a `-data` subpackage makes sense for your package. This type is common for games (graphics, sound and music), part libraries (CAD) -or card material (maps). Data subpackages are almost always `archs=noarch`. +or card material (maps). The main package must then have `depends="${pkgname}-data-${version}_${revision}"`, possibly in addition to other, non-automatic depends. @@ -1589,7 +1590,6 @@ The following variables influence how Haskell packages are built: Font packages are very straightforward to write, they are always set with the following variables: -- `archs=noarch`: Font packages don't install arch specific files. - `depends="font-util"`: because they are required for regenerating the font cache during the install/removal of the package - `font_dirs`: which should be set to the directory where the package