justinethier / cyclone

:cyclone: A brand-new compiler that allows practical application development using R7RS Scheme. We provide modern features and a stable system capable of generating fast native binaries.
http://justinethier.github.io/cyclone/
MIT License
823 stars 42 forks source link

Gentoo package #457

Closed xgqt closed 2 years ago

xgqt commented 3 years ago

Hello!

I thought I'd let you know that I packaged Cyclone for the Gentoo GURU repository

https://gitweb.gentoo.org/repo/proj/guru.git/tree/dev-scheme/cyclone/cyclone-9999.ebuild?h=dev&id=e19e9244b23a20ecc0b857d055ca53f3184408d4

Do you have any suggestions or concerns about the ebuild script?

xgqt commented 3 years ago

Alternative link: https://github.com/gentoo/guru/blob/dev/dev-scheme/cyclone/cyclone-9999.ebuild

justinethier commented 3 years ago

Hey, this is great! Thank you for making this happen :)

Without having a Gentoo system handy here are my initial comments:

xgqt commented 3 years ago
* The `-rdynamic` option is only used in our build scripts for building with msys2 on Windows. I suspect this option is not required.

I see

* Alternatively, the `-O2` option is very useful to increase performance in the compiled code. Maybe this is already incorporated into the build, though, just not explicitly in this file. I do suggest making sure the build is setup to pass this option to the C compiler.

-march=..., -O... and -f... would be already set by user in CFLAGS

btw, assuming user uses CFLAGS="-march=native -O3", in the src_compile the variables will equal to: CYC_GCC_OPT_FLAGS="-march=native -O3" CFLAGS="-march=native -O3 -fPIC -Iinclude"

xgqt commented 3 years ago

I think -Wl,--export-dynamic should be already set in user's LDFLAGS. Do you think I should remove it? image ^ duplicated -Wl,--export-dynamic

xgqt commented 3 years ago

On Gentoo tommath can be installed as system lib - dev-libs/libtommath. Maybe you could add option to build with sysem's tommath.

justinethier commented 3 years ago

Yes, export-dynamic is already set, no need to set again in the ebuild file.

It is convenient to have tommath bundled so that we remove an installation dependency. This also avoids any potential issue with a version of tommath (EG: a new release) on the system not working with the version of Cyclone. That said, if you think there is value to using the system version I can put in a ticket to allow the option for tommath.

xgqt commented 3 years ago

This also avoids any potential issue with a version of tommath (EG: a new release) on the system not working with the version of Cyclone.

On Gentoo we can avoid this in 2 ways: 1) pin the dependency to a specific version ?dev-libs/libtommath-1.2.0, where ? will be one of >, =, < which can describe if we need a dependency higher, equal or lower than specified package version 2) USE flag system-tommath can be added to give user control whether they want to use the bundled one or a system one

if you think there is value to using the system version I can put in a ticket to allow the option for tommath.

Oh yes, there is definitely a benefit to system versions

justinethier commented 3 years ago

Good deal, I've added https://github.com/justinethier/cyclone/issues/458 to address this.

Do you see issues with packaging 0.28.0 in the meantime?

xgqt commented 3 years ago

Do you see issues with packaging 0.28.0 in the meantime?

No, not at the moment. I played with it a bit and noticed PREFIX also has to be exported during build, not only install. Fixed it with this commit: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?h=dev&id=f63e7f8a8f5af1eae35343fc4da3486213175a81

xgqt commented 3 years ago

Do you see issues with packaging 0.28.0 in the meantime?

No, not at the moment. I played with it a bit and noticed PREFIX also has to be exported during build, not only install. Fixed it with this commit: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?h=dev&id=f63e7f8a8f5af1eae35343fc4da3486213175a81

forgot to say I noticed this because import was looking for libs in /usr/local instead of /usr

xgqt commented 2 years ago

I'd like to announce that cyclone is officially in the Gentoo main repository :D https://packages.gentoo.org/packages/dev-scheme/cyclone

justinethier commented 2 years ago

Great news! Thanks for the update and for your efforts here @xgqt 😄