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

Added recipe for libyubikey #929

Merged
merged 1 commit into from Dec 15, 2016
Merged

Conversation

tudor-nazarie
Copy link
Contributor

Added the recipe for the Yubico YubiKey authentication device library and associated tools.

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.

Good start, thanks!
Minor changes are needed, however, to add support for building for secondary architectures, and to fix a few minor errors.
(I did not test the resulting recipe yet but will do so asap.)

CHECKSUM_SHA256="04edd0eb09cb665a05d808c58e1985f25bb7c5254d2849f36a0658ffc51c3401"
REVISION="1"
LICENSE="BSD (2-clause)"
COPYRIGHT="Yubico AB"
Copy link
Member

Choose a reason for hiding this comment

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

Could you please change the order of these lines to:

SUMMARY="Low level C SDK for the Yubico YubiKey authentication device"
DESCRIPTION="This package make up the low-level C software development kit for the \
Yubico YubiKey authentication device."
HOMEPAGE="https://developers.yubico.com/yubico-c/"
COPYRIGHT="2008-2015 Yubico AB"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://developers.yubico.com/yubico-c/Releases/libyubikey-$portVersion.tar.gz"
CHECKSUM_SHA256="04edd0eb09cb665a05d808c58e1985f25bb7c5254d2849f36a0658ffc51c3401"

(Minor changes to COPYRIGHT and re-wrapped DESCRIPTION.)

(See the HaikuPorter Guidelines for more info)

cmd:modhex = $portVersion
cmd:ykparse = $portVersion
cmd:ykgenerate = $portVersion
lib:libyubikey
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:

PROVIDES="
	libyubikey$secondaryArchSuffix = $portVersion
	cmd:modhex$secondaryArchSuffix = $portVersion
	cmd:ykparse$secondaryArchSuffix = $portVersion
	cmd:ykgenerate$secondaryArchSuffix = $portVersion
	lib:libyubikey$secondaryArchSuffix = 0.1.7
	"


PROVIDES_devel="
libyubikey_devel = $portVersion
devel:libyubikey
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:

PROVIDES_devel="
	libyubikey${secondaryArchSuffix}_devel = $portVersion
	devel:libyubikey$secondaryArchSuffix = 0.1.7
	"
REQUIRES_devel="
	libyubikey$secondaryArchSuffix == $portVersion base
	"

LICENSE="BSD (2-clause)"
COPYRIGHT="Yubico AB"

ARCHITECTURES="x86_gcc2 x86"
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:

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"


REQUIRES="
haiku >= $haikuVersion
"
Copy link
Member

Choose a reason for hiding this comment

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

REQUIRES should go right after PROVIDES, and should be:

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libcurl$secondaryArchSuffix
	lib:libusb$secondaryArchSuffix
	"

"

BUILD_REQUIRES="
"
Copy link
Member

Choose a reason for hiding this comment

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libcurl$secondaryArchSuffix
	devel:libusb$secondaryArchSuffix
	"

haiku_devel >= $haikuVersion
cmd:gcc
cmd:make
cmd:awk
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:

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

make install

prepareInstalledDevelLibs libyubikey
packageEntries devel $developDir
Copy link
Member

Choose a reason for hiding this comment

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

Could you please change this to:

	rm $libDir/libyubikey.la
	prepareInstalledDevelLib libyubikey
	fixPkgconfig
	packageEntries devel \
		$developDir

(I'm not sure yet for the rm $libDir/libyubikey.la because I don't know if that file is being generated.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure that removing make install is right since it gives me an error about being unable to stat some files.

BUILD()
{
runConfigure ./configure --disable-dependency-tracking
make $jobArgs
Copy link
Member

Choose a reason for hiding this comment

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

Can you please use tabs (instead of white spaces)?

@tudor-nazarie tudor-nazarie force-pushed the libyubikey branch 5 times, most recently from 7818976 to ca8c311 Compare December 15, 2016 15:29
@tudor-nazarie
Copy link
Contributor Author

Hello, thanks for your feedback. I have made the requested changes and updated the commit, bar the removal of make install without which the build fails.

PS. Sorry if I messed something up with GitHub's review system. I'm not entirely sure, but I think I did. I'm still trying to get the hang of it.

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.

Thanks for your update! Your recipe is almost perfect!
You just missed a couple of cosmetic edits which I had not emphasized in my first review.
I'm also adding something I forgot, to remove the man page on secondary arch builds.

COPYRIGHT="2008-2015 Yubico AB"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://developers.yubico.com/yubico-c/Releases/libyubikey-1.13.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.

Please change SOURCE_URI to:

SOURCE_URI="https://developers.yubico.com/yubico-c/Releases/libyubikey-$portVersion.tar.gz"

(I just replaced "1.13" by "$portVersion")

cmd:ykgenerate$secondaryArchSuffix = $portVersion
lib:libyubikey$secondaryArchSuffix = 0.1.7
"

Copy link
Member

Choose a reason for hiding this comment

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

Please remove the blank line between PROVIDES and REQUIRES.

libyubikey${secondaryArchSuffix}_devel = $portVersion
devel:libyubikey$secondaryArchSuffix = 0.1.7
"

Copy link
Member

Choose a reason for hiding this comment

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

Please remove the blank line between PROVIDES_devel and REQUIRES_devel.

@@ -0,0 +1,67 @@
SUMMARY="Low level C SDK for the Yubico YubiKey authentication device"
DESCRIPTION="This package make up the low-level C software development kit for the Yubico YubiKey authentication device."
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, after all, I don't like the "This package make the" (taken from upstream) because it has a grammar error (missing "s" in "makes"). Shall we drop that part? Here's what I would use:

DESCRIPTION="Low-level C software development kit for the Yubico YubiKey \
authentication device."

(BTW, we need to split the line otherwise it would be > 80 chars.)

haiku${secondaryArchSuffix}_devel
lib:libcurl$secondaryArchSuffix
lib:libusb$secondaryArchSuffix
"
Copy link
Member

Choose a reason for hiding this comment

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

We need a tab before the closing double-quotes.

prepareInstalledDevelLibs libyubikey
fixPkgconfig
packageEntries devel \
$developDir
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a few extra changes to INSTALL?
This is the layout we like to have:

INSTALL()
{
	make install

	rm $libDir/libyubikey.la

	prepareInstalledDevelLib libyubikey
	fixPkgconfig

	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $manDir
	fi

	packageEntries devel \
		$developDir
}

The main change here is that we remove $manDir if we are building for a secondary arch.

Notice that I replaced prepareInstalledDevelLibs by prepareInstalledDevelLib.
This is not required but it is welcome, since we only have one lib here.

BTW, in my previous review I should have mentioned that I was not willing to drop the "make install". Actually, we cannot control the number of lines GitHub puts in the context, so I should have copied the whole INSTALL ;-)
Hopefully you took the right decision, keeping it ;-)

@tudor-nazarie
Copy link
Contributor Author

tudor-nazarie commented Dec 15, 2016

Hello again and again thanks for your time. I made the changes you specified and I hope everything is in order this time.

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.

Hello again and again thanks for your time. I made the changes you specified and I hope everything is in order this time.

You are welcome!

I think we're almost done: 2 cosmetic edits remaining.
(I forgot to report an ampty line and you forgot to remove a tab. ;-)

lib:libcurl$secondaryArchSuffix
lib:libusb$secondaryArchSuffix
"

Copy link
Member

Choose a reason for hiding this comment

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

Please remove the blank line between BUILD_REQUIRES and BUILD_PREREQUIRES.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, just to be sure, there should be no blank lines between variable definitions, right? But are they ok between the BUILD, INSTALL and TEST functions?

Edit: now I see that we've separated them in blocks of 2, separated by blank lines. I think I get it now

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I had missed your message.
And I just realized I forgot to mention our HaikuPorter Guidelines!
https://github.com/haikuports/haikuports/wiki/HaikuPorter-Guidelines#ordering

BTW, if you would like to work on other recipes, we have a lot of these Create a recipe for ... tasks ;-)

fi

packageEntries devel \
$developDir
Copy link
Member

Choose a reason for hiding this comment

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

We only need 2 tabs in line 67.

@tudor-nazarie
Copy link
Contributor Author

I updated the commit with the requested cosmetic changes.

@fbrosson
Copy link
Member

Thanks @xdizzaster for your great work!

@fbrosson fbrosson merged commit 58be167 into haikuports:master Dec 15, 2016
@tudor-nazarie tudor-nazarie deleted the libyubikey branch December 15, 2016 18:50
@fbrosson
Copy link
Member

It means it has been merged ;-)
Here it is:
https://github.com/haikuports/haikuports/tree/master/sys-auth/libyubikey
BTW, with this merge, libyubikey is the very first recipe to be added in category sys-auth ;-)

@korli
Copy link
Contributor

korli commented Dec 21, 2016

I've commented on the commit 58be167

@fbrosson
Copy link
Member

OK , thanks @korli . I'll fix that.
BTW, I'm trying to figure out whether or not we can avoid bumping REVISION since the only change is the addition of two "compag >= 0".
I think we can keep REVISION unchanged without any consequences, but I can bump it if it is safer.
What would you do?

@fbrosson
Copy link
Member

Oops, I just noticed there were 2 other errors. So I guess we really need to bump REVISION.

@fbrosson
Copy link
Member

Hmm, libyubikey is currently using libusb-0.1.so from libusb_compat.
While at it, should I make it use libusb-1.0.so from libusb ?
If yes, I'll replace

	lib:libusb$secondaryArchSuffix

by

	lib:libusb_1.0$secondaryArchSuffix

and

	devel:libusb$secondaryArchSuffix

by

	devel:libusb_1.0$secondaryArchSuffix

Thanks!

@fbrosson
Copy link
Member

Fixed.

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

3 participants