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

(GCI) Added recipe for sys-fs/squashfs_tools #948

Merged
merged 1 commit into from Dec 25, 2016
Merged

(GCI) Added recipe for sys-fs/squashfs_tools #948

merged 1 commit into from Dec 25, 2016

Conversation

dshynkev
Copy link
Contributor

Added a recipe for squashfs_tools, a suite of tools for creating and manipulating squashfs filesystems.

Copy link
Member

@fbrosson fbrosson left a comment

Choose a reason for hiding this comment

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

I am impressed!

"

DEBIAN_REV="3"
SOURCE_URI_2="http://http.debian.net/debian/pool/main/s/squashfs-tools/squashfs-tools_$portVersion-$DEBIAN_REV.debian.tar.xz"
Copy link
Member

Choose a reason for hiding this comment

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

It would be slightly better to use the canonical name:(httpredir.debian.org instead of http.debian.net):

SOURCE_URI_2="http://httpredir.debian.org/debian/pool/main/s/squashfs-tools/squashfs-tools_$portVersion-$DEBIAN_REV.debian.tar.xz"

COPYRIGHT="2002-2014 Philip Lougher"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://prdownloads.sf.net/squashfs/squashfs$portVersion.tar.gz"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should avoid the old "prdownloads.sf.net" name and, instead, use "downloads.sf.net" or "downloads.sourceforge.net":

SOURCE_URI="https://downloads.sf.net/squashfs/squashfs$portVersion.tar.gz"

read-only filesystem use, archival use (i.e. in cases where a .tar.gz file \
may be used, and in constrained block device/memory systems (e.g. embedded \
systems) where low overhead is needed."
HOMEPAGE="http://squashfs.sourceforge.net"
Copy link
Member

Choose a reason for hiding this comment

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

Please add a trailing slash:

HOMEPAGE="http://squashfs.sourceforge.net/"

@dshynkev
Copy link
Contributor Author

Alright, I'll fix it up right away!

@dshynkev
Copy link
Contributor Author

I pushed the amended commit out. For some reason, it still shows up in the same place as the old one. But it has been changed.

@fbrosson
Copy link
Member

Do you have lib:liblzma on x86_gcc2?

BTW, I noticed that several patches were already available on Gentoo, so we could do something similar to what we have for tiff-3.9.7.

SOURCE_URI="https://downloads.sf.net/squashfs/squashfs$portVersion.tar.gz"
CHECKSUM_SHA256="0d605512437b1eb800b4736791559295ee5f60177e102e4d4ccd0ee241a5f3f6"
SOURCE_DIR="squashfs$portVersion/squashfs-tools"

DEBIAN_REV="3"
SOURCE_FILENAME_2="squashfs-tools_$portVersion-$DEBIAN_REV.debian.tar.xz"
SOURCE_URI_2="http://http.debian.net/debian/pool/main/s/squashfs-tools/$FILENAME_2"
CHECKSUM_SHA256_2="1c296cc147e322e7124bf23a3c242ac83f6a986e6d6f64829ad2424b33914fc4"

commit="dceb729f0369d72f1d7820705fd12510b71446d2"
patchesBaseUri="https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/squashfs-tools/files"
SOURCE_FILENAME_3="squashfs-tools-$portVersion-2gb.patch"
SOURCE_FILENAME_4="squashfs-tools-$portVersion-aligned-data.patch"
SOURCE_FILENAME_5="squashfs-tools-$portVersion-local-cve-fix.patch"
SOURCE_FILENAME_6="squashfs-tools-$portVersion-mem-overflow.patch"
SOURCE_FILENAME_7="squashfs-tools-$portVersion-sysmacros.patch"
SOURCE_FILENAME_8="squashfs-tools-$portVersion-xattrs.patch"
SOURCE_URI_2="$patchesBaseUri/$SOURCE_FILENAME_2?id=$commit#noarchive"
SOURCE_URI_3="$patchesBaseUri/$SOURCE_FILENAME_3?id=$commit#noarchive"
SOURCE_URI_4="$patchesBaseUri/$SOURCE_FILENAME_4?id=$commit#noarchive"
SOURCE_URI_5="$patchesBaseUri/$SOURCE_FILENAME_5?id=$commit#noarchive"
SOURCE_URI_6="$patchesBaseUri/$SOURCE_FILENAME_6?id=$commit#noarchive"
SOURCE_URI_7="$patchesBaseUri/$SOURCE_FILENAME_7?id=$commit#noarchive"
SOURCE_URI_8="$patchesBaseUri/$SOURCE_FILENAME_8?id=$commit#noarchive"
CHECKSUM_SHA256_3="cdb9c85c2f733c0db879275d0ee2480f528aa3191f236bbf1ff681c75b14a024"
CHECKSUM_SHA256_4="3030ddfa5ba9d0baea7f5e4761b33dea67fbc4d49c86e475830fc1bfbfddb145"
CHECKSUM_SHA256_5="7edceedead4f5a57dc009afecd0f414d60a3878dc43f8de5224bff391ed32c76"
CHECKSUM_SHA256_6="a94f9df3439bef373da31a734e6dad42f5fc5a6d91f2b9d15d30b02f1aac73b3"
CHECKSUM_SHA256_7="b44afb79ba6108a657fe6c51cecdf0e9623cbc91234b297478a6c3308cf0eddf"
CHECKSUM_SHA256_8="f98fb6bee2f46ba57b9ab68dbc1ad15ed5ac8c7592cbdfead36d6642096acada"

PATCHES="
	squashfs_tools-$portVersion-cve2015-4645_4646.patch
	squashfs_tools-$portVersion-haiku-compat.patch
	squashfs_tools-$portVersion-fix-mem-calculation.patch
	squashfs_tools-$portVersion-lzma-magic.patch
	"

ARCHITECTURES="x86_gcc2 x86 x86_64"

... and then:

PATCH()
{
	patch -p1 -i $sourceDir3/$SOURCE_FILENAME_3
	patch -p1 -i $sourceDir4/$SOURCE_FILENAME_4
	patch -p1 -i $sourceDir5/$SOURCE_FILENAME_5
	patch -p1 -i $sourceDir6/$SOURCE_FILENAME_6
	patch -p1 -i $sourceDir7/$SOURCE_FILENAME_7
	patch -p1 -i $sourceDir8/$SOURCE_FILENAME_8
}

The only problem is that the patches do not apply yet. Maybe I need to change "-p1".

@dshynkev
Copy link
Contributor Author

dshynkev commented Dec 23, 2016

I actually grabbed three of the four other patches from the debian patchset. So we could apply them manually from $sourceDir2 as well, and only keep the haiku-compat patch, which I wrote myself. You have to pass -p2 for them to work, though, because they want to change files in a squashfs-tools/ subdirectory, which is the working directory for us.

@dshynkev
Copy link
Contributor Author

The reason I put them all in patches instead of applying them manually is to make the recipe less verbose. But if it's a bad practice to do so, I'll change the recipe.

@fbrosson
Copy link
Member

I think we should use as much external patches as possible.
That's OK if we have a PATCH function that talks too much ;-)

BYW, doesn't your recipe depend on lib:liblzma ? That lib is provided by xz_utils which does not build on x86_gcc2.

@waddlesplash, did you build the squashfs_tools on x86_gcc2?

@dshynkev
Copy link
Contributor Author

Oh, I didn't know xz-utils were unavailable on x86_gcc2. I'll set up a VM with that and try to get them to build. Worst case scenario, we could disable lzma and xz support.

@fbrosson
Copy link
Member

Since Debian has the remaining patches in squashfs-tools_4.3-3.debian.tar.xz we can probably add something like this in our PATCH function:

	for i in \
		0001-kfreebsd.patch \
		0002-fix_phys_mem_calculation.patch \
		0003-CVE-2015-4645_and_CVE-2015-4646.patch \
		0004-unsquashfs-add-support-for-LZMA-magics.patch
	do
		patch -p1 -i $sourceDir2/debian/patches/$i
	done

@dshynkev
Copy link
Contributor Author

dshynkev commented Dec 23, 2016

Actually, I'd skip the first one (0001-...). It messes with my haiku-compat patch and, besides, isn't really useful on Haiku. But yes, we could do something like that. Gentoo packages actually snuck in a really insidious inconsistency in the local-cve-fix patch - all other patches apply fine with -p2, but that one requires -p1.

@fbrosson
Copy link
Member

We could add support for x86 secondary arch and define LIBLZMA like this:

if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
	LIBLZMA=liblzma
else
	LIBLZMA=
fi

Then we would use ${LIBLZMA+lib:$LIBLZMA} in REQUIRES and ${LIBLZMA+devel:$LIBLZMA} in BUILD_REQUIRES.

@dshynkev
Copy link
Contributor Author

Well, I'll try to get xz-utils to build on x86 first, since it'd be nice to have them there anyway.

@fbrosson
Copy link
Member

Do you mean "on x86_gcc2" ?
I did a patch 7 months ago for building xz_utils-5.2.2 on x86_gcc2 but I had some unsolved issues and the patch was quite big (2316 lines); so I had to give up.
I still have it locally, so if there is interest I can push it to a xz_utils branch of my remote repo, in case you (or someone else) would like to have a look at it.

@dshynkev
Copy link
Contributor Author

dshynkev commented Dec 23, 2016

Do you mean "on x86_gcc2" ?

Yes, sorry, I tend to conflate the two.
I understand that the issue is quite global, so I'd rather implement conditional xz/lzma support as you proposed and get this working on x86_gcc2, and then look into the xz_utils business.

@dshynkev
Copy link
Contributor Author

Wait, I think I messed up somewhere

@dshynkev
Copy link
Contributor Author

dshynkev commented Dec 23, 2016

Oh yeah, I see it now. I'll have to use your method.

@dshynkev
Copy link
Contributor Author

Just to give you an update, turns out, the sources don't quite build with GCC2. Investigating the issue.

@dshynkev
Copy link
Contributor Author

Alright, now everything seems to be in order.

@dshynkev dshynkev closed this Dec 23, 2016
@dshynkev dshynkev reopened this Dec 23, 2016
@dshynkev
Copy link
Contributor Author

Oops, didn't mean to press that 😅

@korli
Copy link
Contributor

korli commented Dec 23, 2016

@fbrosson I'm personally not so happy with a ton of URL for patches which won't change forever, because the upstream project stalled. It's adding a dependency on Gentoo servers for no good reason, simply packing all patches in a gentoo patchset in patches directory would be better and more maintainable.
Sorry I'm not a fan of verbosity and of PATCH() in general.

@dshynkev
Copy link
Contributor Author

Alright, I like this version a lot better. I do agree with @korli about verbosity, but I'm new here, so I don't really know what the common practice is.

@fbrosson
Copy link
Member

@hermord, I love your current recipe! (I'll test it asap.)

@korli, I'm sorry, I don't think that adding copies of patches that are already available somewhere would be a good idea. And imho the dependency on Gentoo and Debian is not a problem. Moreover, since we have checksums, we would detect any change or removal, should that ever happen.

@korli
Copy link
Contributor

korli commented Dec 23, 2016

Yes, I just expect your opinion to not become a rule.

@waddlesplash
Copy link
Member

I'm rather conflicted on the remote-patches idea myself; I'm tending towards @korli's stance on it but I haven't really thought about it. But we don't need to do it all that often, so I don't think it'll become a problem...

@fbrosson
Copy link
Member

@korli: Sure, this won't become a rule because there are very few recipes where this can happen.

@waddlesplash: I think you have found a nice consensus.

@hermord: squashfs_tools builds like a charm on x86 and x86_64. Will try it on x86_gcc2 right now.
This package was not easy and you did a great job!

All: Shall we validate the GCI task right now but keep the PR open for 1 or 2 days to do a little polishing (e.g. see if we can get less fuzzy patches by either sorting them or rebasing the patches) and maybe add support for building for x86 secondary arch?
(I can take care of investigating the polishing of the patches)

Thanks to all of you!

@waddlesplash
Copy link
Member

That sounds OK to me.

@dshynkev
Copy link
Contributor Author

Alright, so I got rid of two patches that are not needed on Haiku (they have to do with xattrs and linux-only includes). I also changed my own patches a bit so that they don't mess with offsets. Sadly, Debian patches still have wrong offsets and that doesn't seem to depend on ordering.

@waddlesplash
Copy link
Member

Sadly, Debian patches still have wrong offsets and that doesn't seem to depend on ordering.

OK; so we should fetch all of those and make a .patchset ourselves out of them.

Copy link
Member

@fbrosson fbrosson left a comment

Choose a reason for hiding this comment

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

Minor changes to add support for building for secondary architectures.
Plus a few cosmetic changes too ;-)
Many thanks!

SOURCE_DIR="squashfs$portVersion/squashfs-tools"

DEBIAN_REV="3"
SOURCE_FILENAME_2="squashfs-tools_$portVersion-$DEBIAN_REV.debian.tar.xz"
Copy link
Member

Choose a reason for hiding this comment

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

I would recommend avoiding all-caps for custom variables. Could you please replace

DEBIAN_REV="3"
SOURCE_FILENAME_2="squashfs-tools_$portVersion-$DEBIAN_REV.debian.tar.xz"

by

debianRevision="3"
SOURCE_FILENAME_2="squashfs-tools_$portVersion-$debianRevision.debian.tar.xz"

squashfs_tools-$portVersion-gcc2.patch"

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
Copy link
Member

Choose a reason for hiding this comment

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

Can please replace

SECONDARY_ARCHITECTURES="x86"

by

SECONDARY_ARCHITECTURES="x86_gcc2 x86"

(notice the blank line.)

PROVIDES="
squashfs_tools = $portVersion
cmd:mksquashfs = $portVersion
cmd:unsquashfs = $portVersion
Copy link
Member

Choose a reason for hiding this comment

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

Please change PROVIDES to:

PROVIDES="
	squashfs_tools$secondaryArchSuffix = $portVersion
	cmd:mksquashfs$secondaryArchSuffix = $portVersion
	cmd:unsquashfs$secondaryArchSuffix = $portVersion
	"

lib:liblz4
${HAVE_XZ:+lib:liblzma}
lib:liblzo2
lib:libz
Copy link
Member

Choose a reason for hiding this comment

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

Please change REQUIRES to:

REQUIRES="
	haiku$secondaryArchSuffix
	lib:liblz4$secondaryArchSuffix
	${HAVE_XZ:+lib:liblzma$secondaryArchSuffix}
	lib:liblzo2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

devel:liblz4
${HAVE_XZ:+devel:liblzma}
devel:liblzo2
devel:libz
Copy link
Member

Choose a reason for hiding this comment

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

Please change BUILD_REQUIRES to:

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:liblz4$secondaryArchSuffix
	${HAVE_XZ:+devel:liblzma$secondaryArchSuffix}
	devel:liblzo2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"

"
BUILD_PREREQUIRES="
cmd:gcc
cmd:make
Copy link
Member

Choose a reason for hiding this comment

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

Please change BUILD_PREREQUIRES to:

BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

CHECKSUM_SHA256_2="1c296cc147e322e7124bf23a3c242ac83f6a986e6d6f64829ad2424b33914fc4"

COMMIT="dceb729f0369d72f1d7820705fd12510b71446d2"
PATCHES_BASE_URI="https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/squashfs-tools/files"
Copy link
Member

@fbrosson fbrosson Dec 23, 2016

Choose a reason for hiding this comment

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

Can you please replace

COMMIT="dceb729f0369d72f1d7820705fd12510b71446d2"
PATCHES_BASE_URI="https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/squashfs-tools/files"

by

commit="dceb729f0369d72f1d7820705fd12510b71446d2"
patchesBaseUri="https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/squashfs-tools/files"

and change the SOURCE_URI_{3-6} to:

SOURCE_URI_3="$patchesBaseUri/$SOURCE_FILENAME_3?id=$commit#noarchive"
SOURCE_URI_4="$patchesBaseUri/$SOURCE_FILENAME_4?id=$commit#noarchive"
SOURCE_URI_5="$patchesBaseUri/$SOURCE_FILENAME_5?id=$commit#noarchive"
SOURCE_URI_6="$patchesBaseUri/$SOURCE_FILENAME_6?id=$commit#noarchive"

Thanks!

BTW, here are the reasons for these cosmetic changes:

  • We currenly have "COMMIT" for 4 recipes, "commit" for 22 recipes and "srcGitRev" for 42 recipes.

When I started recommending "srcGitRev" sometime ago, I did so because it was already the most used custom variable, but I had not noticed that there were almost 20 "commit"s.
Since "srcGitRev" is a bit strange, I think we should stop using it and start using "commit" instead.

As said earlier, I think we should avoid all-caps in custom variables, so I would recommend to use commit instead of COMMIT.

  • haikuporter complains about PATCHES_BASE_URI and says it will ignore it.
    So I would recommend to use patchesBaseUri instead of PATCHES_BASE_URI.

@fbrosson
Copy link
Member

OK; so we should fetch all of those and make a .patchset ourselves out of them.

@waddlesplash, I'm almost sure we can find an order (to apply the patches) that will make the offsets work fine. I'll dig this right now ;-)

@fbrosson
Copy link
Member

Sadly, Debian patches still have wrong offsets and that doesn't seem to depend on ordering.

@hermord, There is necessarily an order which minimizes the number of offset mismatches. I'm trying to find that order.
And even if the best order still produces many offset mismatches, it still works! So I think we should keep the patches external.

BTW, +1 for having removed the sysmacros and xattrs patches ;-)

@dshynkev
Copy link
Contributor Author

dshynkev commented Dec 23, 2016

@hermord, There is necessarily an order which minimizes the number of offset mismatches. I'm trying to find that order.

Oh, definitely, it's just that 0002-fix-phys-mem-calculation.patch misses by a whopping 267 line offset, which I don't think can be fixed by reordering.

EDIT: It's actually 0004-unsquashfs-add-support-for-LZMA-magics.patch

@fbrosson
Copy link
Member

The ebuild Gentoo wrote for release 4.3 applies all the patches from Debian and then their own patches in this order:

  • sysmacros.patch
  • aligned-data.patch
  • 2gb.patch
  • local-cve-fix.patch
  • mem-overflow.patch
  • xattrs.patch

So I guess that if we also apply the exact same patches then should have no offset mismatches when not applying our own patches (i.e. the ones you wrote), and very few if we also apply them (because haikuporter applis our patches before calling the PATCH() function if I'm not mistaken.

@fbrosson
Copy link
Member

Hmm, maybe we could, some day, teach haikuporter to:

  1. call PREPATCH
  2. apply the patches in PATCHES
  3. call PATCH

@dshynkev
Copy link
Contributor Author

My own patches actually don't change the offsets, expect the second action.c hunk, but nothing else is patching action.c.

@dshynkev
Copy link
Contributor Author

Even when I manually apply the Debian patches one by one onto the original source tree, 0004-unsquashfs-add-support-for-LZMA-magics.patch still misses by 267 lines (and that's the one, not 0002-..., my mistake).

@dshynkev
Copy link
Contributor Author

dshynkev commented Dec 23, 2016

I looked into Gentoo's epatch function that they use to patch things, and it silently ignores all non-fatal errors.

@fbrosson
Copy link
Member

My own patches actually don't change the offset

That's great. It makes the problem a little less complex ;-)
BTW, I apologize for the trouble I'm causing you with these patch issues.
So please don't bother with this if you would like to claim other tasks.
I'll see if I can reduce the number of offset mismatches and then I'll suggest a change, if I find something better.
I have all your patches and I can play with them for a while.
Of course, if you want to continue digging the topic you are welcome!

Hmm, before you switch to another recipe (if you chose to do so), could you please address the comments in my last review, to add support for building for secondary architectures?
I tried it (just before I wrote the review) and it works perfectly ;-)
Thanks!

I looked into Gentoo's epatch function that they use to patch things, and it silently ignores all non-fatal errors. So there's that.

No regrets, then! Let's also ignore the offset mismatches!

*start_block = fragment_entry->start_block;
*size = fragment_entry->size;
+
+ TRACE("read_fragment: reading fragment %d\n", fragment);
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to insert a block, instead of moving TRACE down.
What about having this in the patch:

 void read_fragment_3(unsigned int fragment, long long *start_block, int *size)
 {
 	TRACE("read_fragment: reading fragment %d\n", fragment);
-
+{
 	squashfs_fragment_entry_3 *fragment_entry = &fragment_table[fragment];
 	*start_block = fragment_entry->start_block;
 	*size = fragment_entry->size;
-}
+}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That shouldn't make a difference, since fragment isn't modified in the function. But if that looks cleaner, then sure.

Copy link
Member

Choose a reason for hiding this comment

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

You are right, it does not make any difference because we are not building with TRACE enabled.
So yes, that's just to make things easier to change, should anyone wish to compile with TRACE enabled.

Copy link
Member

Choose a reason for hiding this comment

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

I've just generated a patchset with haikuporter. It starts with a mail-style header and then contains the patch:

diff --git a/unsquash-2.c b/unsquash-2.c
index 0f2bfe8..5a3c39b 100644
--- a/unsquash-2.c
+++ b/unsquash-2.c
@@ -118,13 +118,13 @@ int read_fragment_table_2(long long *directory_table_end)
 void read_fragment_2(unsigned int fragment, long long *start_block, int *size)
 {
 	TRACE("read_fragment: reading fragment %d\n", fragment);
-
+	{
 	squashfs_fragment_entry_2 *fragment_entry = &fragment_table[fragment];
 	*start_block = fragment_entry->start_block;
 	*size = fragment_entry->size;
+	}
 }
 
-
 struct inode *read_inode_2(unsigned int start_block, unsigned int offset)
 {
 	static union squashfs_inode_header_2 header;
diff --git a/unsquash-3.c b/unsquash-3.c
index d5af57a..b5177c0 100644
--- a/unsquash-3.c
+++ b/unsquash-3.c
@@ -105,13 +105,13 @@ int read_fragment_table_3(long long *directory_table_end)
 void read_fragment_3(unsigned int fragment, long long *start_block, int *size)
 {
 	TRACE("read_fragment: reading fragment %d\n", fragment);
-
+	{
 	squashfs_fragment_entry_3 *fragment_entry = &fragment_table[fragment];
 	*start_block = fragment_entry->start_block;
 	*size = fragment_entry->size;
+	}
 }
 
-
 struct inode *read_inode_3(unsigned int start_block, unsigned int offset)
 {
 	static union squashfs_inode_header_3 header;

In the beginning it's a bit hard to understand what we need to do to have haikuporter generate pathsets.
But basically, if you start from scratch without any patch, you:

hp -b squashfs_tools
cd work-4.3/sources/squashfs4.3
vi unsquash-2.c unsquash-3.c
git add unsquash-2.c unsquash-3.c
git commit -m "gcc2 patch" unsquash-2.c unsquash-3.c
cd ../../..
hp -e squashfs_tools

(hp is an alias to "haikuporter --get-dependencies")
Warning: "hp -e" will delete any file called squashfs_tools-4.3.patch and overwrite squashfs_tools-4.3.patchset without any notice, so don't forget to make backups ;-)

Now if you already have a patchset with several distinct patches, you can change any of them by adding a commit and then doing an interactive squash/rebase against the git revision that corresponds to the import.
I can detail that if you need.

The other difficult topic is when you have a patch for an old release, and it does not apply to the new release. It took me a while to become confortable with how to use "git add" and "git am --continue" to refresh a patchset. If you need more info I can explain what I have learned ;-)

Using patchsets is recommended, especially if the patch is not trivial, because it simplifies the maintainance of the patchsets when we upgrade a recipe.

@dshynkev
Copy link
Contributor Author

I seem to be missing something, because setarch x86 doesn't change anything.

@fbrosson
Copy link
Member

You don't need to call setarch.
You just need to call:
hp -S squashfs_tools_x86
or
hp -S squashfs_tools_x86-4.3

@dshynkev
Copy link
Contributor Author

devel:liblz4_x86: Name not found is what I'm getting. Sorry, I'm not too familiar with building for secondary architectures. Are devel packages supposed to be arch-qualified?

Copy link
Member

@fbrosson fbrosson left a comment

Choose a reason for hiding this comment

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

2 cosmetic edits.

The recipes looks OK.
I guess we still have offset mismatches with our external patches, but as long as the patches applies, that's OK ;-)


PATCHES="
squashfs_tools-$portVersion-haiku-compat.patch
squashfs_tools-$portVersion-gcc2.patch"
Copy link
Member

Choose a reason for hiding this comment

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

Should be:

PATCHES="
	squashfs_tools-$portVersion-haiku-compat.patch
	squashfs_tools-$portVersion-gcc2.patch
	"

(the closing double quotes goes to a separate line)


PROVIDES="
squashfs_tools$secondaryArchSuffix = $portVersion
cmd:mksquashfs$secondaryArchSuffix= $portVersion
Copy link
Member

Choose a reason for hiding this comment

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

Missing space before = in

	cmd:mksquashfs$secondaryArchSuffix = $portVersion

@fbrosson
Copy link
Member

devel:liblz4_x86: Name not found is what I'm getting. Sorry, I'm not too familiar with building for secondary architectures. Are devel packages supposed to be arch-qualified?

You just need to:

hp -S lz4_x86

(Well, the -S is not required, but I always use it.)

There's something I do since a few months: I have a dropliba script which gets rid of all static libs of a hpkg. (It basically unpacks the hpkg with "package extract", looks for all lib*.a files, deletes them, and recreates the package with "package create".) So everytime I build some package, I run dropliba on its devel package and then I install both the base and the devel package.
This way I am sure that my devel package and my base package always have the same revision.
The problem we see when you don't install devel packages is that when it becomes outdated then the devel package you had in haikuports/packages is moved to a haikuports/packages.obsolete/ so you don't have it anymore, unless you installed it ;-)

@fbrosson
Copy link
Member

When you build lz4 for x86 secondary arch, you should obtain these hpkgs in haikuports/packages/:

  • lz4_x86-r131-1-x86_gcc2.hpkg
  • lz4_x86_devel-r131-1-x86_gcc2.hpkg

You don't need to install any of them before building squashfs_tools_x86, but if you later wish to install squashfs_tools_x86 you will need to also install (at least) lz4_x86.
This is why I tend to install everything I need, including the devel packages (which I shrink with my dropliba script ;-) because any package that is in /system/packages/ has precedence over any other version of the same package in haikuports/packages/.

@dshynkev
Copy link
Contributor Author

dshynkev commented Dec 23, 2016

Just in case, I updated the recipe to incorporate the cosmetic edits.

@waddlesplash waddlesplash merged commit 297f6d5 into haikuports:master Dec 25, 2016
korli pushed a commit to korli/haikuports that referenced this pull request Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants