-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add dub.eclass #131
Add dub.eclass #131
Conversation
dev-util/dub/dub-1.38.1-r1.ebuild
Outdated
local -x DFLAGS="${DCFLAGS} ${DLANG_LDFLAGS} $(dlang_get_wno_error_flag)" | ||
|
||
# Run the unittests in the source files. | ||
"${DUB}" test --verbose -c application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing die?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or was this supposed to be edub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's missin the die
. edub
is not applicable as it will call the assumed to be installed dub, not the one which was just built. I don't think dub depending on dub is a good design so no calling edub
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern for this is to inhibit dependencies in the eclass if CAT/PN = blah/dub but it can be a bit ugly. Not required at all, just a suggestion.
S="${WORKDIR}/${PN}-${MY_PV}" | ||
LICENSE="MIT BSD" | ||
LICENSE+=" Apache-2.0 Boost-1.0 BSD GPL-3 LGPL-3 MIT openssl public-domain Unlicense" | ||
LICENSE+=" test? ( ISC public-domain )" # test dependencies. These do _not_ map to test? () in SRC_URI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of interest, why don't they map? Some of it is bundled I assume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dub is very nice in that it will require that all possible dependencies to be satisfied when building something, even if, in that build, fewer things are needed. In this example, serve-d
uses silly
for tests. If silly
is not present during dub build
dub will fail. dub build
does not use silly, only dub test
so the license of silly
I've put behind test?
. There's probably more of these cases, at least both the openssl
dependencies are unused as well though I didn't want to bother any more with this.
Upstream has an issue for this: dlang/dub#1706
RESTRICT="!test? ( test )" | ||
|
||
# gdc currently fails due to a bug in mir-cpuid, see: https://github.com/libmir/mir-cpuid/pull/46 | ||
DLANG_COMPAT=( dmd-2_{106..109} ldc2-1_{35..39} ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd consider trying to keep inherits all in one place and all eclass vars before inherit where possible. It's a lot easier to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objection.
eclass/dub.eclass
Outdated
debug-print "${FUNCNAME}: DFLAGS=${DFLAGS}" | ||
|
||
set -- dub --verbose "${@}" | ||
echo "${@}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is edo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bah, how come I only learn of this. I've read the devguide only up to the eclass reference before writing the eclass, such bad timing.
sys-fs/btdu/btdu-0.5.1.ebuild
Outdated
KEYWORDS="~amd64" | ||
RESTRICT="test" | ||
|
||
RDEPEND="${DLANG_DEPS}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The eclass should be setting this for us by default, right? (These variables accumulate when set by eclasses, see PMS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's a better design. I guess I need to check if dlang-single
or dlang-r1
has been inherited.
862e766
to
ed999d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good!
ewarn "precaution." | ||
ewarn "" | ||
ewarn "See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114171" | ||
dlang-filter-dflags "gdc*" "-march=native" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should pass -fno-tree-vectorize
instead unconditionally with the bad GCC version, regardless of arch or DCFLAGS
. That should avoid the miscompilation.
Or do tests fail with that?
} | ||
|
||
src_compile() { | ||
local imports=source versions="DubApplication DubUseCurl" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK but consider using arrays where they make sense.
dev-util/dub/dub-1.38.1-r1.ebuild
Outdated
# Tries to connect to github.com and fails due to the network sandbox | ||
rm -rf "${S}/test/git-dependency" || die | ||
# Doesn't work on non amd64/x86 | ||
if [[ ${ARCH} == arm64 ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use a case statement and delete it on anything but amd64/x86 then.
|
||
# See https://issues.dlang.org/show_bug.cgi?id=24406 and | ||
# https://github.com/Pure-D/serve-d/issues/360 | ||
# For short, we have to remove -O from DCFLAGS for dmd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# For short, we have to remove -O from DCFLAGS for dmd. | |
# In short, we have to remove -O from DCFLAGS for dmd. |
# Tries to update dependencies timing out for each one which sums up | ||
# to about 4 minutes of doing nothing. There is no direct way to | ||
# configure the code not to contact https://code.dlang.org | ||
rm -rf tc_dub || die |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guilty of this all the time, but I should note that the use of -f
in rm -f ... || die
will suppress issues you often want to know about, e.g. the test being renamed.
edo "${dubFetch[@]}" "${name}@${ver}" | ||
|
||
# If it's the main package | ||
[[ ${file} == ${PN}-$(ver_rs 3 - 4 .)* ]] \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit gnarly and maybe a comment explaining why it's right wouldn't go amiss, but it might be obvious to someone who works with D a lot, so I don't insist.
sys-fs/btdu/btdu-0.5.1.ebuild
Outdated
|
||
EAPI=8 | ||
|
||
# gdc-13 is disabled due to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111650 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
# gdc-13 is disabled due to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111650 | |
# gdc-13 is disabled due to: https://gcc.gnu.org/PR111650 |
"[email protected]" | ||
"[email protected]" | ||
) | ||
inherit dlang-single dub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for changing the style wrt var order. It's much easier to read now.
sys-fs/btdu/btdu-0.5.1.ebuild
Outdated
) | ||
inherit dlang-single dub | ||
|
||
DESCRIPTION="Sampling disk usage profiler for btrfs " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DESCRIPTION="Sampling disk usage profiler for btrfs " | |
DESCRIPTION="Sampling disk usage profiler for btrfs" |
LICENSE+=" Boost-1.0 GPL-2 MIT MPL-2.0" | ||
SLOT="0" | ||
KEYWORDS="~amd64" | ||
RESTRICT="test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment might be nice as to why?
Signed-off-by: Andrei Horodniceanu <[email protected]>
Additionally add missing dependency virtual/pkgconfig to RDEPEND. Signed-off-by: Andrei Horodniceanu <[email protected]>
Additional changes: - port to dub.eclass - run some more tests - install documentation on how to setup serve-d for various text editors Signed-off-by: Andrei Horodniceanu <[email protected]>
Signed-off-by: Andrei Horodniceanu <[email protected]>
No description provided.