Description: Use the markdown library provided by the libmarkdown2 package.
Origin: vendor
Forwarded: not-needed
Author: Alessandro Ghedini <al3xbio@gmail.com>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2025-02-02

--- a/builder/MyBuilder.pm
+++ b/builder/MyBuilder.pm
@@ -12,33 +12,7 @@
     $class->SUPER::new(
         %argv,
         needs_compiler => 1,
-        include_dirs => ["discount-$DISCOUNT_VERSION"],
     );
 }
 
-sub _build_discount {
-    my $self = shift;
-
-    chdir "discount-$DISCOUNT_VERSION";
-    my $ok = do {
-        local $ENV{CC} = $self->config("cc") . " -fPIC";
-        $self->do_system("sh", "configure.sh");
-    };
-    $ok &&= $self->do_system($self->config("make"), "libmarkdown");
-    chdir "..";
-    $ok;
-}
-
-sub ACTION_code {
-    my ($self, @argv) = @_;
-
-    my $spec = $self->_infer_xs_spec(File::Spec->catfile("lib", "Text", "Markdown", "Discount.xs"));
-    my $archive = File::Spec->catfile("discount-$DISCOUNT_VERSION", "libmarkdown.a");
-    if (!$self->up_to_date($archive, $spec->{lib_file})) {
-        $self->_build_discount or die;
-        push @{$self->{properties}{objects}}, $archive;
-    }
-    $self->SUPER::ACTION_code(@argv);
-}
-
 1;
--- a/Build.PL
+++ b/Build.PL
@@ -49,6 +49,8 @@
     test_files           => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
     recursive_test_files => 1,
 
+    extra_compiler_flags => scalar `pkgconf --cflags libmarkdown`,
+    extra_linker_flags   => scalar `pkgconf --libs libmarkdown`,
 
 );
 if (-d 'share') {
