Alien-ckdl

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

# if the git working tree is dirty or if a tag for the current
# $(VERSION) already exists. See RELEASING.md.

.PHONY: release release-check

release-check :
	@git diff-index --quiet HEAD -- || { \
	    echo "ERROR: git working tree is dirty; commit or stash first."; \
	    exit 1; \
	}
	@if git rev-parse -q --verify "refs/tags/v$(VERSION)" >/dev/null; then \
	    echo "ERROR: tag v$(VERSION) already exists; bump \$$VERSION in lib/Alien/ckdl.pm."; \
	    exit 1; \
	fi
	@command -v cpan-upload >/dev/null 2>&1 || { \
	    echo "ERROR: cpan-upload not found in PATH; cpanm CPAN::Uploader"; \
	    exit 1; \
	}
	@test -r $(HOME)/.pause || { \
	    echo "ERROR: ~/.pause not found; see RELEASING.md for the format."; \
	    exit 1; \

README.md  view on Meta::CPAN

));

sub MY::postamble { $abmm->mm_postamble }
```

`Alien::Build::MM` injects `Alien::ckdl`'s `cflags` and `libs` into the
generated Makefile so that your XS code can `#include <kdl/kdl.h>` and
link against `libkdl` without further configuration.

A minimal XS smoke test is shipped in `t/01-xs-link.t` and is a good
template if you need to verify the Alien works on a target platform.

## Versioning

This Alien pins a specific upstream commit of `tjol/ckdl` rather than
tracking a branch or a tagged release. The Perl distribution version
(in `lib/Alien/ckdl.pm`) identifies the Alien itself; the C library
version it produces is recorded as `0.0.0-<first-12-chars-of-sha>`,
where the SHA is the value of `$CKDL_COMMIT` in `alienfile`.

To move to a different upstream commit, edit `$CKDL_COMMIT` in

RELEASING.md  view on Meta::CPAN

   - Runs `cpan-upload` on the freshly built tarball.

6. Tag and push:

   ```sh
   git commit -am "Release v$(perl -Ilib -MAlien::ckdl -e 'print $Alien::ckdl::VERSION')"
   git tag    "v$(perl -Ilib -MAlien::ckdl -e 'print $Alien::ckdl::VERSION')"
   git push --follow-tags
   ```

7. Wait ~1 hour, then verify on
   [MetaCPAN](https://metacpan.org/dist/Alien-ckdl).

## Recovery

- **Upload failed mid-way.** `cpan-upload` is idempotent against PAUSE
  re-uploads of the *same* tarball; just run `make release` again.
- **Uploaded a broken release.** You have 72 hours to delete it from
  PAUSE via the web UI (`https://pause.perl.org/` -> "Delete
  Files"). After that it's permanent in the BackPAN archive. Either
  way, **never reuse a version number** - bump and re-release.

t/01-xs-link.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use Test::Alien;
use Alien::ckdl;

# Smoke-test: compile a tiny C program against the freshly installed ckdl,
# create a string parser, run a single event, and verify it returns a node.
alien_ok 'Alien::ckdl';

xs_ok { xs => <<'XS', with_subtest => sub {
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include <kdl/kdl.h>

int kdl_smoketest()



( run in 1.846 second using v1.01-cache-2.11-cpan-13bb782fe5a )