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

Fixes issues with lib name generation #19

Merged
merged 1 commit into from
Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/blib
/Makefile
/linenoise.o
/lib/Linenoise.pm
/constant-helper
/resources/
.precomp
/lib/.precomp
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: perl6
install:
- rakudobrew build-panda
- rakudobrew build zef
before_script:
- panda installdeps .
- panda-build

- zef --depsonly install .
- zef --debug install .
script:
- PERL6LIB=lib perl6 -MLinenoise -e 1
- perl6 -MLinenoise -e 1
20 changes: 7 additions & 13 deletions Build.pm
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
use v6;

use Panda::Builder;
use LibraryMake;
use Shell::Command;

class Build is Panda::Builder {
method build($workdir) {
mkdir("$workdir/blib");
mkdir("$workdir/blib/lib");
my %vars = get-vars("$workdir/blib/lib");

%vars<helper> = 'resources/libraries/' ~ $*VM.platform-library-name('liblinenoise'.IO);

process-makefile($workdir, %vars);
shell(%vars<MAKE>);
class Build {
method build($srcdir) {
my %vars = get-vars($srcdir);
%vars<linenoise> = $*VM.platform-library-name('linenoise'.IO).basename;
mkdir "$srcdir/resources/libraries" unless "$srcdir/resources/libraries".IO.e;
process-makefile($srcdir, %vars);
shell %vars<MAKE>, :cwd($srcdir);
}
}
7 changes: 4 additions & 3 deletions META6.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"perl" : "6.*",
"name" : "Linenoise",
"version" : "0.1.0",
"version" : "0.1.1",
"description" : "Bindings to linenoise",
"author" : "Rob Hoelz",
"depends" : ["LibraryMake", "Shell::Command"],
"depends" : [ ],
"build-depends" : ["LibraryMake"],
"source-url" : "https://github.com/hoelzro/p6-linenoise.git",
"provides": {
"Linenoise": "lib/Linenoise.pm"
"Linenoise": "lib/Linenoise.pm6"
},
"resources": [
"libraries/linenoise"
Expand Down
16 changes: 10 additions & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
all: %helper% lib/Linenoise.pm
name = %linenoise%

%helper%: linenoise%O%
all: %DESTDIR%/resources/libraries/%linenoise% lib/Linenoise.pm6
clean:
rm %DESTDIR%/resources/libraries/%linenoise%

%DESTDIR%/resources/libraries/%linenoise%: linenoise%O%
perl6 -e "mkdir 'resources'; mkdir 'resources/libraries'"
%LD% %LDSHARED% %LDFLAGS% %LIBS% %LDOUT%resources/libraries/liblinenoise%SO% linenoise%O%
%LD% %LDSHARED% %LDFLAGS% %LIBS% %LDOUT%resources/libraries/%linenoise% linenoise%O%

linenoise%O%: linenoise.c
%CC% -c %CCSHARED% %CCFLAGS% %CCOUT%linenoise%O% linenoise.c
%CC% -c %CCSHARED% %CCFLAGS% %CCOUT% linenoise%O% linenoise.c

constant-helper: constant-helper.c
%CC% %CCOUT%constant-helper %CCFLAGS% constant-helper.c

lib/Linenoise.pm: lib/Linenoise.pm.in constant-helper
perl6 fill-constants.pl < lib/Linenoise.pm.in > lib/Linenoise.pm
lib/Linenoise.pm6: lib/Linenoise.pm6.in constant-helper
perl6 fill-constants.pl < lib/Linenoise.pm6.in > lib/Linenoise.pm6
2 changes: 1 addition & 1 deletion lib/Linenoise.pm.in → lib/Linenoise.pm6.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use NativeCall;
#| This module provides bindings to linenoise
#| (L<https://github.com/antirez/linenoise>) for Perl 6
#| via NativeCall.
module Linenoise:ver<0.1.0>:auth<github:hoelzro> {
module Linenoise:ver<0.1.1>:auth<github:hoelzro> {
my constant STDIN_FILENO = 0;
my constant F_GETFL = #`(FILL-ME-IN);
my constant F_SETFL = #`(FILL-ME-IN);
Expand Down