Skip to content
Open
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
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ env:
PKG_NAME: popt
PKG_UBUNTU: libpopt-dev
PKG_HOMEBREW: popt
PKG_MSYS2_MINGW64: >-
popt
popt-devel
PKG_MSYS2_MINGW64_DEPS: >-
base-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-perl
mingw-w64-x86_64-curl
mingw-w64-x86_64-wget2
msys2-runtime-devel

jobs:
dist:
Expand Down Expand Up @@ -74,8 +78,6 @@ jobs:
perl-version: ['5.8', '5.20', '5.30', '5.34']
alien-install-type: [ 'system', 'share' ]
include:
# Windows strawberry | share
- { perl-version: '5.34' , os: windows-latest , dist: strawberry , alien-install-type: 'share' }
# Windows msys2 | system, share
- { perl-version: '5.34' , os: windows-latest , dist: msys2 , alien-install-type: 'system' }
- { perl-version: '5.34' , os: windows-latest , dist: msys2 , alien-install-type: 'share' }
Expand Down Expand Up @@ -105,6 +107,11 @@ jobs:
with:
update: true
install: ${{ env.PKG_MSYS2_MINGW64_DEPS }}
- name: Set up ${{ env.PKG_NAME }} (MSYS2/MinGW pacman)
if: runner.os == 'Windows' && matrix.dist == 'msys2' && matrix.alien-install-type == 'system'
shell: msys2 {0}
run: |
pacman -S --needed --noconfirm ${{ env.PKG_MSYS2_MINGW64 }}

# Setup Perl
- name: Set up perl
Expand Down
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
0.02
- Add XS test.
- Cleanup diag test.
- Dynamic library to separated directory.
- Explicit setting of static/dynamic library build.
- Fix Windows test build.
- Use HTTPS to fetch sources.

0.01 2023-06-24T08:05:52+02:00
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ README
t/Alien-libpopt/01-use.t
t/Alien-libpopt/02-version.t
t/Alien-libpopt/03-diag.t
t/Alien-libpopt/04-xs.t
xt/Alien-libpopt/01-pod_coverage.t
xt/Alien-libpopt/02-pod.t
5 changes: 3 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
TODO
====
1. Fix Windows build
fatal error: sys/ioctl.h: No such file or directory
2.

Applied
=======
1. Fix Windows build
fatal error: sys/ioctl.h: No such file or directory
OK [20230624] skim
27 changes: 25 additions & 2 deletions alienfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
use alienfile;
use Path::Tiny ();

plugin 'PkgConfig' => 'popt';
if ($^O eq 'MSWin32') {
my $libdir = Path::Tiny->new($^X)->parent->parent->parent->child('c/lib');
my $program = <<'END';
#include <popt.h>
int main()
{
return 0;
}
END
plugin 'Probe::CBuilder' => (
libs => '-lpopt',
program => $program,
);
plugin 'Probe::CBuilder' => (
libs => '-L$libdir -lpopt',
program => $program,
);

} else {
plugin 'PkgConfig' => 'popt';
}

share {
start_url 'https://ftp.rpm.org/popt/releases/popt-1.x/';
# XXX Fix https on Windows.
my $proto = $^O eq 'MSWin32' ? 'http' : 'https';
start_url $proto.'://ftp.rpm.org/popt/releases/popt-1.x/';;
plugin Download => (
filter => qr/^popt-.*\.tar\.gz$/,
version => qr/^popt-([0-9\.]+)/,
Expand Down
3 changes: 1 addition & 2 deletions t/Alien-libpopt/03-diag.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ use strict;
use warnings;

use Alien::libpopt;
use Test::Alien;
use Test::Alien::Diag;
use Test::More;

alien_diag 'Alien::libpopt';
alien_ok 'Alien::libpopt';
ok 1;

done_testing;
43 changes: 43 additions & 0 deletions t/Alien-libpopt/04-xs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env perl

use strict;
use warnings;

use Alien::libpopt;
use Test::Alien;
use Test::More;

alien_ok 'Alien::libpopt';
my $xs = do { local $/; <DATA> };
xs_ok {
xs => $xs,
verbose => 1,
}, with_subtest {
my ($module) = @_;
my $version = $module->version;
is($version, '');
note "version = $version";
};

done_testing;

__DATA__

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include <popt.h>

const char *
version(const char *class)
{
// XXX No version from popt library
const char * version = "";
return version;
}

MODULE = TA_MODULE PACKAGE = TA_MODULE

const char *version(class);
const char *class;