Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package: fatsort-1.6.2.605 #23485

Merged
merged 1 commit into from
Jul 26, 2020
Merged

New package: fatsort-1.6.2.605 #23485

merged 1 commit into from
Jul 26, 2020

Conversation

tibequadorian
Copy link
Contributor

No description provided.

srcpkgs/fatsort/template Outdated Show resolved Hide resolved
srcpkgs/fatsort/template Outdated Show resolved Hide resolved
srcpkgs/fatsort/template Outdated Show resolved Hide resolved
Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully upstream will consider shipping the manpage without require it be built, but using qemu gets us what we need.

@Chocimier
Copy link
Member

As @sgn noticed, fighting for help2man is not worth it, all one get is already there with --help.

@tibequadorian
Copy link
Contributor Author

bump

sgn pushed a commit to sgn/void-packages that referenced this pull request Jul 23, 2020
sgn pushed a commit to sgn/void-packages that referenced this pull request Jul 23, 2020
@sgn
Copy link
Member

sgn commented Jul 24, 2020

I may go with this, help2man is useless.

# Template file for 'fatsort'
pkgname=fatsort
version=1.6.2.605
revision=1
build_style=gnu-makefile
hostmakedepends="help2man"
checkdepends="xz dosfstools diffutils valgrind"
make_check_target=tests
make_install_args="MANDIR=/usr/share/man/man1 SBINDIR=/usr/bin"
short_desc="Utility that sorts FAT12, FAT16, FAT32 and exFAT partitions"
maintainer="tibequadorian <tibequadorian@posteo.de>"
license="GPL-2.0-or-later"
homepage="https://fatsort.sourceforge.io/"
distfiles="${SOURCEFORGE_SITE}/project/fatsort/fatsort-${version}.tar.xz"
checksum=08cafa36f86ab89e7a3241d437df9af8a008549d7d13416256b7aaa006d5ffb7

if [ "$XBPS_TARGET_LIBC" = musl ]; then
	broken="most tests are failed"
fi

if [ "$CROSS_BUILD" ]; then
	make_build_args="HELP2MAN=:"
	post_build() {
		: >man/fatsort.1
	}
	post_install() {
		rm -rf $DESTDIR/usr/share/man
	}
fi

@ahesford
Copy link
Member

I like supporting the check mechanism in @sgn's template and, given that tests failing, marking broken on musl seems appropriate. If we're going to remove the (not very helpful) man page on cross-built packages, we should remove it everywhere. Native-built and cross-built packages for the same architecture should have the same contents.

@sgn
Copy link
Member

sgn commented Jul 25, 2020 via email

@tibequadorian
Copy link
Contributor Author

What's the problem with simply using the qemu build helper for the man page?

@ahesford
Copy link
Member

The qemu helper is a bit heavy handed just to dump the help output to a man page, but I don't have a real problem with it because it's "correct" in that it honors the upstream intentions. I do think you should complain upsream that they should ship a proper man page rather than relying on dynamic generation at build time.

The real issue is that @sgn improved the template by supporting xbps-src check and by using make_install_args to get the right installation behavior without resorting to patch the makefile. You should adapt those changes and make sure to mark the package broken for musl since it fails tests.

@tibequadorian
Copy link
Contributor Author

what about tcc instead of qemu? 😄

if [ "$CROSS_BUILD" ]; then
        hostmakedepends+=" tcc"
        post_patch() {
                cpp -dM src/fatsort.c | grep '#define INFO' > man/info.h
                cat > man/fatsort.sh <<-EOF
                #!/bin/sh
                case \$1 in
                        "--help")       arg="INFO_OPTION_HELP" ;;
                        "--version")    arg="INFO_OPTION_VERSION" ;;
                esac
                echo "#include\"info.h\"int main(){printf(\$arg);}" | tcc -run -
                EOF
                chmod 755 man/fatsort.sh
                vsed -i man/Makefile -e 's|../src/fatsort|./fatsort.sh|'
        }
fi

@ahesford
Copy link
Member

Looks fine to me. @sgn Any objections? This looks like exactly what you suggested.

@sgn
Copy link
Member

sgn commented Jul 26, 2020

  • printf(3) is incorrect if help/version contains %,
    either use puts(3) instead or
printf("%s", $arg);
  • Add a newline between include and main
  • In case you don't know, we can quote EOF to save extra quoting in here doc.
if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" tcc"
	post_patch() {
		cpp -dM src/fatsort.c | grep '#define INFO' > man/info.h
		cat > man/fatsort.sh <<-'EOF'
		#!/bin/sh
		case $1 in
			"--help")       arg="INFO_OPTION_HELP" ;;
			"--version")    arg="INFO_OPTION_VERSION" ;;
		esac
		echo '#include "info.h"' "int main(){return printf(\"%s\", $arg) > 0;}" |
		tcc -run -
		EOF
		chmod 755 man/fatsort.sh
		vsed -i man/Makefile -e 's|../src/fatsort|./fatsort.sh|'
	}
fi

@ahesford
Copy link
Member

Is this seriously being considered? If you're going to go to this much trouble to wrap the help text in a man page, just use the qemu helper. A custom executable is too fragile.

@sgn
Copy link
Member

sgn commented Jul 26, 2020 via email

@sgn sgn merged commit 67d4ebf into void-linux:master Jul 26, 2020
@tibequadorian
Copy link
Contributor Author

thank you for correction @sgn :)

@tibequadorian tibequadorian deleted the fatsort branch July 26, 2020 10:00
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants